From c2c78301270fb56b405f31b215c4acbb44669f10 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 20 Apr 2010 08:42:04 +0200 Subject: CWS gnumake2: move all delivered sot headers to inc/sot --- sot/source/base/formats.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sot/source/base/formats.cxx') diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index baddde6e716f..58b08fb53f18 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -34,8 +34,8 @@ #include #include -#include "filelist.hxx" -#include "clsids.hxx" +#include "sot/filelist.hxx" +#include "sot/clsids.hxx" #include #include -- cgit v1.2.3 From d210c6ccc30466e98240c1409df0550514668d68 Mon Sep 17 00:00:00 2001 From: Xiaofei Zhang Date: Thu, 29 Jul 2010 10:56:19 +0800 Subject: #i112600#: clean up l10ntools, rsc, sot, svl, tools and unotools --- l10ntools/inc/cfgmerge.hxx | 14 +- l10ntools/inc/export.hxx | 128 ++--- l10ntools/inc/gsicheck.hxx | 52 +- l10ntools/inc/l10ntools/vosapp.hxx | 10 +- l10ntools/inc/lngmerge.hxx | 12 +- l10ntools/inc/srciter.hxx | 2 +- l10ntools/inc/tagtest.hxx | 110 ++-- l10ntools/inc/wtranode.hxx | 4 +- l10ntools/inc/wtratree.hxx | 4 +- l10ntools/inc/xmlparse.hxx | 34 +- l10ntools/inc/xrmmerge.hxx | 8 +- l10ntools/layout/layoutparse.cxx | 6 +- l10ntools/layout/layoutparse.hxx | 2 +- l10ntools/layout/tralay.cxx | 8 +- l10ntools/source/cfgmerge.cxx | 80 +-- l10ntools/source/directory.cxx | 6 +- l10ntools/source/export.cxx | 386 ++++++------- l10ntools/source/export2.cxx | 30 +- l10ntools/source/gsicheck.cxx | 252 ++++---- l10ntools/source/gsiconv.cxx | 26 +- l10ntools/source/helpex.cxx | 48 +- l10ntools/source/helpmerge.cxx | 6 +- l10ntools/source/lngex.cxx | 48 +- l10ntools/source/lngmerge.cxx | 38 +- l10ntools/source/localize.cxx | 96 ++-- l10ntools/source/merge.cxx | 30 +- l10ntools/source/srciter.cxx | 16 +- l10ntools/source/tagtest.cxx | 242 ++++---- l10ntools/source/wtranode.cxx | 4 +- l10ntools/source/wtratree.cxx | 12 +- l10ntools/source/xgfconv.cxx | 6 +- l10ntools/source/xmlparse.cxx | 106 ++-- l10ntools/source/xrmmerge.cxx | 50 +- rsc/inc/rscall.h | 2 +- rsc/inc/rscarray.hxx | 14 +- rsc/inc/rscclass.hxx | 34 +- rsc/inc/rscclobj.hxx | 16 +- rsc/inc/rscconst.hxx | 26 +- rsc/inc/rsccont.hxx | 36 +- rsc/inc/rscdb.hxx | 44 +- rsc/inc/rscdef.hxx | 140 ++--- rsc/inc/rscerror.h | 6 +- rsc/inc/rscflag.hxx | 28 +- rsc/inc/rscinst.hxx | 60 +- rsc/inc/rsckey.hxx | 8 +- rsc/inc/rsclst.hxx | 8 +- rsc/inc/rscmgr.hxx | 16 +- rsc/inc/rscpar.hxx | 24 +- rsc/inc/rscrange.hxx | 90 +-- rsc/inc/rscrsc.hxx | 4 +- rsc/inc/rscstr.hxx | 12 +- rsc/inc/rsctools.hxx | 12 +- rsc/inc/rsctop.hxx | 30 +- rsc/inc/rsctree.hxx | 6 +- rsc/inc/vclrsc.hxx | 4 +- rsc/source/misc/rscdbl.cxx | 6 +- rsc/source/misc/rsclst.cxx | 4 +- rsc/source/parser/rscdb.cxx | 76 +-- rsc/source/parser/rscibas.cxx | 28 +- rsc/source/parser/rscicpx.cxx | 48 +- rsc/source/parser/rscinit.cxx | 104 ++-- rsc/source/parser/rsckey.cxx | 10 +- rsc/source/parser/rsclex.cxx | 32 +- rsc/source/parser/rsclex.hxx | 2 +- rsc/source/parser/rscpar.cxx | 12 +- rsc/source/parser/rscyacc.cxx | 18 +- rsc/source/parser/rscyacc.y | 42 +- rsc/source/prj/start.cxx | 44 +- rsc/source/res/rscall.cxx | 4 +- rsc/source/res/rscarray.cxx | 40 +- rsc/source/res/rscclass.cxx | 146 ++--- rsc/source/res/rscclobj.cxx | 24 +- rsc/source/res/rscconst.cxx | 38 +- rsc/source/res/rsccont.cxx | 66 +-- rsc/source/res/rscflag.cxx | 58 +- rsc/source/res/rscmgr.cxx | 32 +- rsc/source/res/rscrange.cxx | 106 ++-- rsc/source/res/rscstr.cxx | 28 +- rsc/source/res/rsctop.cxx | 38 +- rsc/source/rsc/rsc.cxx | 24 +- rsc/source/rscpp/cpp.h | 20 +- rsc/source/rscpp/cpp1.c | 46 +- rsc/source/rscpp/cpp2.c | 50 +- rsc/source/rscpp/cpp3.c | 32 +- rsc/source/rscpp/cpp4.c | 34 +- rsc/source/rscpp/cpp5.c | 10 +- rsc/source/rscpp/cpp6.c | 72 +-- rsc/source/rscpp/cppdef.h | 50 +- rsc/source/tools/rscchar.cxx | 10 +- rsc/source/tools/rscdef.cxx | 184 +++--- rsc/source/tools/rsctools.cxx | 14 +- rsc/source/tools/rsctree.cxx | 28 +- sot/inc/absdev.hxx | 2 +- sot/inc/agg.hxx | 16 +- sot/inc/filelist.hxx | 6 +- sot/inc/sot/exchange.hxx | 180 +++--- sot/inc/sot/factory.hxx | 10 +- sot/inc/sot/formats.hxx | 276 ++++----- sot/inc/sot/object.hxx | 66 +-- sot/inc/sot/sotdata.hxx | 2 +- sot/inc/sot/storage.hxx | 90 +-- sot/inc/stg.hxx | 280 ++++----- sot/inc/storinfo.hxx | 16 +- sot/source/base/exchange.cxx | 34 +- sot/source/base/factory.cxx | 24 +- sot/source/base/filelist.cxx | 14 +- sot/source/base/formats.cxx | 56 +- sot/source/base/object.cxx | 74 +-- sot/source/sdstor/stg.cxx | 296 +++++----- sot/source/sdstor/stgavl.cxx | 36 +- sot/source/sdstor/stgavl.hxx | 8 +- sot/source/sdstor/stgcache.cxx | 108 ++-- sot/source/sdstor/stgcache.hxx | 66 +-- sot/source/sdstor/stgdir.cxx | 272 ++++----- sot/source/sdstor/stgdir.hxx | 78 +-- sot/source/sdstor/stgelem.cxx | 106 ++-- sot/source/sdstor/stgelem.hxx | 122 ++-- sot/source/sdstor/stgio.cxx | 110 ++-- sot/source/sdstor/stgio.hxx | 12 +- sot/source/sdstor/stgole.cxx | 88 +-- sot/source/sdstor/stgole.hxx | 24 +- sot/source/sdstor/stgstrms.cxx | 334 +++++------ sot/source/sdstor/stgstrms.hxx | 106 ++-- sot/source/sdstor/storage.cxx | 214 +++---- sot/source/sdstor/storinfo.cxx | 20 +- sot/source/sdstor/ucbstorage.cxx | 598 +++++++++---------- sot/source/sdstor/unostorageholder.cxx | 2 +- svl/inc/broadcast.hxx | 2 +- svl/inc/cntnrsrt.hxx | 38 +- svl/inc/converter.hxx | 4 +- svl/inc/instrm.hxx | 16 +- svl/inc/listener.hxx | 8 +- svl/inc/lngmisc.hxx | 14 +- svl/inc/outstrm.hxx | 10 +- svl/inc/poolcach.hxx | 2 +- svl/inc/strmadpt.hxx | 16 +- svl/inc/svl/aeitem.hxx | 30 +- svl/inc/svl/brdcst.hxx | 8 +- svl/inc/svl/cancel.hxx | 16 +- svl/inc/svl/cenumitm.hxx | 64 +-- svl/inc/svl/cintitem.hxx | 112 ++-- svl/inc/svl/cnclhint.hxx | 6 +- svl/inc/svl/cntwall.hxx | 24 +- svl/inc/svl/ctypeitm.hxx | 18 +- svl/inc/svl/custritm.hxx | 12 +- svl/inc/svl/dateitem.hxx | 20 +- svl/inc/svl/eitem.hxx | 10 +- svl/inc/svl/filerec.hxx | 314 +++++----- svl/inc/svl/flagitem.hxx | 24 +- svl/inc/svl/globalnameitem.hxx | 10 +- svl/inc/svl/hint.hxx | 10 +- svl/inc/svl/httpcook.hxx | 10 +- svl/inc/svl/ilstitem.hxx | 6 +- svl/inc/svl/imageitm.hxx | 12 +- svl/inc/svl/inethist.hxx | 12 +- svl/inc/svl/intitem.hxx | 52 +- svl/inc/svl/itemiter.hxx | 12 +- svl/inc/svl/itempool.hxx | 128 ++--- svl/inc/svl/itemprop.hxx | 16 +- svl/inc/svl/itemset.hxx | 72 +-- svl/inc/svl/lckbitem.hxx | 16 +- svl/inc/svl/lstner.hxx | 12 +- svl/inc/svl/macitem.hxx | 36 +- svl/inc/svl/mailenum.hxx | 8 +- svl/inc/svl/metitem.hxx | 4 +- svl/inc/svl/nranges.hxx | 14 +- svl/inc/svl/ownlist.hxx | 4 +- svl/inc/svl/poolitem.hxx | 66 +-- svl/inc/svl/ptitem.hxx | 16 +- svl/inc/svl/rectitem.hxx | 16 +- svl/inc/svl/restrictedpaths.hxx | 6 +- svl/inc/svl/rngitem.hxx | 22 +- svl/inc/svl/sfontitm.hxx | 8 +- svl/inc/svl/slstitm.hxx | 18 +- svl/inc/svl/smplhint.hxx | 10 +- svl/inc/svl/srchitem.hxx | 10 +- svl/inc/svl/stritem.hxx | 8 +- svl/inc/svl/style.hxx | 120 ++-- svl/inc/svl/svarray.hxx | 310 +++++----- svl/inc/svl/svdde.hxx | 64 +-- svl/inc/svl/svldata.hxx | 2 +- svl/inc/svl/svstdarr.hxx | 38 +- svl/inc/svl/szitem.hxx | 16 +- svl/inc/svl/undo.hxx | 70 +-- svl/inc/svl/visitem.hxx | 24 +- svl/inc/svl/zforlist.hxx | 194 +++---- svl/inc/svl/zformat.hxx | 226 ++++---- svl/inc/whiter.hxx | 16 +- svl/source/config/languageoptions.cxx | 2 +- svl/source/filerec/filerec.cxx | 212 +++---- svl/source/inc/passwordcontainer.hxx | 6 +- svl/source/inc/poolio.hxx | 100 ++-- svl/source/items/aeitem.cxx | 50 +- svl/source/items/cenumitm.cxx | 52 +- svl/source/items/cintitem.cxx | 88 +-- svl/source/items/cntwall.cxx | 32 +- svl/source/items/ctypeitm.cxx | 24 +- svl/source/items/custritm.cxx | 6 +- svl/source/items/dateitem.cxx | 26 +- svl/source/items/flagitem.cxx | 22 +- svl/source/items/globalnameitem.cxx | 12 +- svl/source/items/ilstitem.cxx | 16 +- svl/source/items/imageitm.cxx | 24 +- svl/source/items/intitem.cxx | 28 +- svl/source/items/itempool.cxx | 150 ++--- svl/source/items/itemprop.cxx | 22 +- svl/source/items/itemset.cxx | 542 +++++++++--------- svl/source/items/lckbitem.cxx | 30 +- svl/source/items/macitem.cxx | 26 +- svl/source/items/nranges.cxx | 32 +- svl/source/items/poolcach.cxx | 6 +- svl/source/items/poolio.cxx | 388 ++++++------- svl/source/items/poolitem.cxx | 40 +- svl/source/items/ptitem.cxx | 24 +- svl/source/items/rectitem.cxx | 24 +- svl/source/items/rngitem.cxx | 2 +- svl/source/items/rngitem_inc.cxx | 20 +- svl/source/items/sfontitm.cxx | 12 +- svl/source/items/sitem.cxx | 10 +- svl/source/items/slstitm.cxx | 48 +- svl/source/items/srchitem.cxx | 12 +- svl/source/items/stritem.cxx | 6 +- svl/source/items/style.cxx | 238 ++++---- svl/source/items/stylepool.cxx | 4 +- svl/source/items/szitem.cxx | 22 +- svl/source/items/visitem.cxx | 24 +- svl/source/items/whiter.cxx | 18 +- svl/source/memtools/svarray.cxx | 112 ++-- svl/source/misc/adrparse.cxx | 2 +- svl/source/misc/folderrestriction.cxx | 2 +- svl/source/misc/fstathelper.cxx | 6 +- svl/source/misc/inethist.cxx | 98 ++-- svl/source/misc/inettype.cxx | 22 +- svl/source/misc/lngmisc.cxx | 44 +- svl/source/misc/ownlist.cxx | 40 +- svl/source/misc/restrictedpaths.cxx | 2 +- svl/source/misc/strmadpt.cxx | 60 +- svl/source/notify/brdcst.cxx | 28 +- svl/source/notify/broadcast.cxx | 8 +- svl/source/notify/cancel.cxx | 16 +- svl/source/notify/listener.cxx | 14 +- svl/source/notify/lstner.cxx | 20 +- svl/source/notify/smplhint.cxx | 2 +- svl/source/numbers/nbdll.cxx | 2 +- svl/source/numbers/numfmuno.cxx | 56 +- svl/source/numbers/numfmuno.hxx | 4 +- svl/source/numbers/numhead.cxx | 38 +- svl/source/numbers/numhead.hxx | 22 +- svl/source/numbers/zforfind.cxx | 448 +++++++-------- svl/source/numbers/zforfind.hxx | 132 ++--- svl/source/numbers/zforlist.cxx | 492 ++++++++-------- svl/source/numbers/zformat.cxx | 632 ++++++++++----------- svl/source/numbers/zforscan.cxx | 164 +++--- svl/source/numbers/zforscan.hxx | 84 +-- svl/source/svdde/ddecli.cxx | 28 +- svl/source/svdde/ddedata.cxx | 12 +- svl/source/svdde/ddedll.cxx | 2 +- svl/source/svdde/ddeimp.hxx | 26 +- svl/source/svdde/ddeml1.cxx | 432 +++++++------- svl/source/svdde/ddeml2.cxx | 270 ++++----- svl/source/svdde/ddemldeb.cxx | 38 +- svl/source/svdde/ddemlimp.hxx | 190 +++---- svl/source/svdde/ddemlos2.h | 78 +-- svl/source/svdde/ddesvr.cxx | 102 ++-- svl/source/svsql/converter.cxx | 4 +- svl/source/undo/undo.cxx | 106 ++-- svl/unx/source/svdde/ddedummy.cxx | 52 +- tools/bootstrp/addexes/replace.cxx | 2 +- tools/bootstrp/addexes2/mkfilt.cxx | 32 +- tools/bootstrp/command.cxx | 26 +- tools/bootstrp/cppdep.cxx | 32 +- tools/bootstrp/cppdep.hxx | 6 +- tools/bootstrp/inimgr.cxx | 10 +- tools/bootstrp/iserver.cxx | 24 +- tools/bootstrp/mkcreate.cxx | 148 ++--- tools/bootstrp/prj.cxx | 246 ++++---- tools/bootstrp/rscdep.cxx | 10 +- tools/bootstrp/sstring.cxx | 66 +-- tools/inc/bootstrp/command.hxx | 14 +- tools/inc/bootstrp/inimgr.hxx | 2 +- tools/inc/bootstrp/listmacr.hxx | 4 +- tools/inc/bootstrp/mkcreate.hxx | 54 +- tools/inc/bootstrp/prj.hxx | 72 +-- tools/inc/bootstrp/sstring.hxx | 12 +- tools/inc/impcont.hxx | 32 +- tools/inc/poly.h | 34 +- tools/inc/tools/bigint.hxx | 8 +- tools/inc/tools/cachestr.hxx | 22 +- tools/inc/tools/color.hxx | 110 ++-- tools/inc/tools/config.hxx | 30 +- tools/inc/tools/contnr.hxx | 56 +- tools/inc/tools/date.hxx | 42 +- tools/inc/tools/datetime.hxx | 20 +- tools/inc/tools/errcode.hxx | 6 +- tools/inc/tools/errinf.hxx | 64 +-- tools/inc/tools/fontenum.hxx | 2 +- tools/inc/tools/fract.hxx | 34 +- tools/inc/tools/fsys.hxx | 124 ++-- tools/inc/tools/gen.hxx | 52 +- tools/inc/tools/geninfo.hxx | 80 +-- tools/inc/tools/globname.hxx | 30 +- tools/inc/tools/inetmime.hxx | 6 +- tools/inc/tools/inetmsg.hxx | 82 +-- tools/inc/tools/inetstrm.hxx | 44 +- tools/inc/tools/iparser.hxx | 28 +- tools/inc/tools/line.hxx | 6 +- tools/inc/tools/link.hxx | 24 +- tools/inc/tools/list.hxx | 36 +- tools/inc/tools/mempool.hxx | 6 +- tools/inc/tools/multisel.hxx | 40 +- tools/inc/tools/ownlist.hxx | 18 +- tools/inc/tools/poly.hxx | 102 ++-- tools/inc/tools/postwin.h | 6 +- tools/inc/tools/presys.h | 3 - tools/inc/tools/prewin.h | 9 - tools/inc/tools/prex.h | 4 - tools/inc/tools/pstm.hxx | 68 +-- tools/inc/tools/rc.hxx | 4 +- tools/inc/tools/ref.hxx | 78 +-- tools/inc/tools/resid.hxx | 6 +- tools/inc/tools/resmgr.hxx | 22 +- tools/inc/tools/rtti.hxx | 26 +- tools/inc/tools/shl.hxx | 2 +- tools/inc/tools/solar.h | 137 ++--- tools/inc/tools/stack.hxx | 22 +- tools/inc/tools/stream.hxx | 24 +- tools/inc/tools/string.hxx | 108 ++-- tools/inc/tools/svborder.hxx | 6 +- tools/inc/tools/table.hxx | 60 +- tools/inc/tools/tenccvt.hxx | 4 +- tools/inc/tools/time.hxx | 56 +- tools/inc/tools/unqid.hxx | 24 +- tools/inc/tools/unqidx.hxx | 64 +-- tools/inc/tools/vcompat.hxx | 22 +- tools/inc/tools/vector2d.hxx | 12 +- tools/inc/tools/wldcrd.hxx | 8 +- tools/inc/tools/zcodec.hxx | 50 +- tools/source/communi/geninfo.cxx | 70 +-- tools/source/communi/parser.cxx | 56 +- tools/source/datetime/datetime.cxx | 54 +- tools/source/datetime/tdate.cxx | 158 +++--- tools/source/datetime/ttime.cxx | 48 +- tools/source/debug/debug.cxx | 88 +-- tools/source/debug/stcktree.cxx | 62 +- tools/source/fsys/comdep.hxx | 12 +- tools/source/fsys/dirent.cxx | 146 ++--- tools/source/fsys/filecopy.cxx | 8 +- tools/source/fsys/fstat.cxx | 36 +- tools/source/fsys/tdir.cxx | 74 +-- tools/source/fsys/wldcrd.cxx | 12 +- tools/source/fsys/wntmsc.cxx | 98 ++-- tools/source/fsys/wntmsc.hxx | 4 +- tools/source/generic/bigint.cxx | 4 +- tools/source/generic/color.cxx | 112 ++-- tools/source/generic/config.cxx | 156 ++--- tools/source/generic/fract.cxx | 12 +- tools/source/generic/gen.cxx | 54 +- tools/source/generic/line.cxx | 34 +- tools/source/generic/link.cxx | 10 +- tools/source/generic/poly.cxx | 304 +++++----- tools/source/generic/poly2.cxx | 102 ++-- tools/source/generic/svborder.cxx | 2 +- tools/source/inet/inetmime.cxx | 2 +- tools/source/inet/inetmsg.cxx | 134 ++--- tools/source/inet/inetstrm.cxx | 124 ++-- tools/source/memtools/contnr.cxx | 116 ++-- tools/source/memtools/mempool.cxx | 2 +- tools/source/memtools/multisel.cxx | 130 ++--- tools/source/memtools/table.cxx | 82 +-- tools/source/memtools/unqidx.cxx | 60 +- tools/source/rc/rc.cxx | 18 +- tools/source/rc/resmgr.cxx | 120 ++-- tools/source/ref/errinf.cxx | 84 +-- tools/source/ref/globname.cxx | 136 ++--- tools/source/ref/pstm.cxx | 218 +++---- tools/source/stream/cachestr.cxx | 32 +- tools/source/stream/stream.cxx | 124 ++-- tools/source/stream/strmos2.cxx | 108 ++-- tools/source/stream/strmunx.cxx | 6 +- tools/source/stream/strmwnt.cxx | 78 +-- tools/source/stream/vcompat.cxx | 6 +- tools/source/string/strascii.cxx | 14 +- tools/source/string/strcvt.cxx | 12 +- tools/source/string/strimp.cxx | 32 +- tools/source/string/tenccvt.cxx | 4 +- tools/source/string/tstring.cxx | 30 +- tools/source/testtoolloader/testtoolloader.cxx | 4 +- tools/source/zcodec/zcodec.cxx | 82 +-- unotools/inc/unotools/accelcfg.hxx | 2 +- .../inc/unotools/accessiblerelationsethelper.hxx | 4 +- unotools/inc/unotools/accessiblestatesethelper.hxx | 12 +- unotools/inc/unotools/componentresmodule.hxx | 4 +- unotools/inc/unotools/configitem.hxx | 2 +- unotools/inc/unotools/configpathes.hxx | 10 +- unotools/inc/unotools/configvaluecontainer.hxx | 12 +- unotools/inc/unotools/defaultoptions.hxx | 2 +- unotools/inc/unotools/fontcfg.hxx | 66 +-- unotools/inc/unotools/fontcvt.hxx | 8 +- unotools/inc/unotools/fontdefs.hxx | 56 +- unotools/inc/unotools/intlwrapper.hxx | 6 +- unotools/inc/unotools/lingucfg.hxx | 118 ++-- unotools/inc/unotools/localedatawrapper.hxx | 64 +-- unotools/inc/unotools/misccfg.hxx | 12 +- unotools/inc/unotools/pathoptions.hxx | 2 +- unotools/inc/unotools/regoptions.hxx | 2 +- unotools/inc/unotools/searchopt.hxx | 110 ++-- unotools/inc/unotools/securityoptions.hxx | 2 +- unotools/inc/unotools/syslocaleoptions.hxx | 20 +- unotools/inc/unotools/textsearch.hxx | 10 +- unotools/inc/unotools/ucbhelper.hxx | 6 +- unotools/inc/unotools/ucblockbytes.hxx | 10 +- unotools/inc/unotools/useroptions.hxx | 38 +- .../accessibility/accessiblerelationsethelper.cxx | 4 +- .../accessibility/accessiblestatesethelper.cxx | 12 +- unotools/source/config/accelcfg.cxx | 2 +- unotools/source/config/defaultoptions.cxx | 8 +- unotools/source/config/fltrcfg.cxx | 90 +-- unotools/source/config/fontcfg.cxx | 10 +- unotools/source/config/lingucfg.cxx | 180 +++--- unotools/source/config/menuoptions.cxx | 12 +- unotools/source/config/misccfg.cxx | 42 +- unotools/source/config/moduleoptions.cxx | 2 +- unotools/source/config/pathoptions.cxx | 16 +- unotools/source/config/regoptions.cxx | 6 +- unotools/source/config/saveopt.cxx | 60 +- unotools/source/config/searchopt.cxx | 170 +++--- unotools/source/config/syslocaleoptions.cxx | 6 +- unotools/source/config/useroptions.cxx | 12 +- unotools/source/i18n/intlwrapper.cxx | 2 +- unotools/source/i18n/localedatawrapper.cxx | 144 ++--- unotools/source/i18n/textsearch.cxx | 20 +- unotools/source/misc/fontcvt.cxx | 4 +- unotools/source/misc/fontdefs.cxx | 2 +- unotools/source/streaming/streamwrap.cxx | 4 +- unotools/source/ucbhelper/localfilehelper.cxx | 4 +- unotools/source/ucbhelper/ucbhelper.cxx | 32 +- unotools/source/ucbhelper/ucblockbytes.cxx | 20 +- 437 files changed, 12077 insertions(+), 12136 deletions(-) mode change 100644 => 100755 svl/source/items/rngitem_inc.cxx mode change 100644 => 100755 unotools/inc/unotools/syslocaleoptions.hxx mode change 100644 => 100755 unotools/source/config/syslocaleoptions.cxx (limited to 'sot/source/base/formats.cxx') diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx index ae0708f5ff05..e0c2c0cf61f2 100644 --- a/l10ntools/inc/cfgmerge.hxx +++ b/l10ntools/inc/cfgmerge.hxx @@ -76,13 +76,13 @@ public: CfgStack() : CfgStackList( 10, 10 ) {} ~CfgStack(); - ULONG Push( CfgStackData *pStackData ); + sal_uIntPtr Push( CfgStackData *pStackData ); CfgStackData *Push( const ByteString &rTag, const ByteString &rId ); CfgStackData *Pop() { return Remove( Count() - 1 ); } - CfgStackData *GetStackData( ULONG nPos = LIST_APPEND ); + CfgStackData *GetStackData( sal_uIntPtr nPos = LIST_APPEND ); - ByteString GetAccessPath( ULONG nPos = LIST_APPEND ); + ByteString GetAccessPath( sal_uIntPtr nPos = LIST_APPEND ); }; // @@ -101,7 +101,7 @@ protected: CfgStack aStack; CfgStackData *pStackData; - BOOL bLocalize; + sal_Bool bLocalize; virtual void WorkOnText( ByteString &rText, @@ -121,7 +121,7 @@ private: const ByteString &rIsoLang, const ByteString &rResTyp ); -BOOL IsTokenClosed( const ByteString &rToken ); +sal_Bool IsTokenClosed( const ByteString &rToken ); public: CfgParser(); @@ -181,9 +181,9 @@ private: std::vector aLanguages; ResData *pResData; - BOOL bGerman; + sal_Bool bGerman; ByteString sFilename; - BOOL bEnglish; + sal_Bool bEnglish; protected: void WorkOnText( diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index d1474503882f..8828594c54fd 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -61,7 +61,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; } }; @@ -114,11 +114,11 @@ DECLARE_LIST( ExportListBase, ExportListEntry * ) class ExportList : public ExportListBase { private: - ULONG nSourceLanguageListEntryCount; + sal_uIntPtr nSourceLanguageListEntryCount; public: ExportList() : ExportListBase() { nSourceLanguageListEntryCount = 0; } - ULONG GetSourceLanguageListEntryCount() { return nSourceLanguageListEntryCount; } + sal_uIntPtr GetSourceLanguageListEntryCount() { return nSourceLanguageListEntryCount; } void NewSourceLanguageListEntry() { nSourceLanguageListEntryCount++; } }; @@ -144,21 +144,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; @@ -167,16 +167,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; @@ -201,14 +201,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 ), @@ -229,14 +229,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 ), @@ -300,23 +300,23 @@ private: ByteString sActPForm; // hold cur. system - BOOL bDefine; // cur. res. in a define? - BOOL bNextMustBeDefineEOL; // define but no \ at lineend - ULONG 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_uIntPtr nLevel; // res. recursiv? how deep? + sal_uInt16 nList; // cur. res. is String- or FilterList ByteString nListLang; - ULONG nListIndex; - ULONG nListLevel; + sal_uIntPtr nListIndex; + sal_uIntPtr 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; @@ -339,7 +339,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 ); @@ -364,7 +364,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(); @@ -375,11 +375,11 @@ private: static std::vector aLanguages; static std::vector 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 ); @@ -396,10 +396,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 ); @@ -408,17 +408,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; } }; @@ -460,8 +460,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 ); }; @@ -495,7 +495,7 @@ public: PFormEntrys* GetPFObject( const ByteString& rPFO ); ByteString Dump(); - BOOL operator==( ResData *pData ); + sal_Bool operator==( ResData *pData ); }; // @@ -509,7 +509,7 @@ public: class MergeDataFile { private: - BOOL bErrorLog; + sal_Bool bErrorLog; ByteString sErrorLog; SvFileStream aErrLog; ByteStringSet aLanguageSet; @@ -520,7 +520,7 @@ private: public: - MergeDataFile( const ByteString &rFileName, const ByteString& rFile , BOOL bErrLog, CharSet aCharSet, bool bCaseSensitive = false ); + MergeDataFile( const ByteString &rFileName, const ByteString& rFile , sal_Bool bErrLog, CharSet aCharSet, bool bCaseSensitive = false ); ~MergeDataFile(); @@ -536,7 +536,7 @@ public: const ByteString &rQHTEXT, const ByteString &rTITLE , const ByteString &sFilename , bool bCaseSensitive ); - static USHORT GetLangIndex( USHORT nId ); + static sal_uInt16 GetLangIndex( sal_uInt16 nId ); static ByteString CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive = false ); ByteString Dump(); diff --git a/l10ntools/inc/gsicheck.hxx b/l10ntools/inc/gsicheck.hxx index fb1eecd38c82..49a1f861eed0 100644 --- a/l10ntools/inc/gsicheck.hxx +++ b/l10ntools/inc/gsicheck.hxx @@ -41,7 +41,7 @@ private: ParserMessageList aMessages; LineFormat aFormat; - ULONG nLineNumber; + sal_uIntPtr nLineNumber; ByteString aUniqId; ByteString aLineType; @@ -50,15 +50,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_uIntPtr nLine ); LineFormat GetLineFormat() const { return aFormat; } - ULONG GetLineNumber() const { return nLineNumber; } + sal_uIntPtr GetLineNumber() const { return nLineNumber; } ByteString const GetUniqId() const { return aUniqId; } ByteString const GetLineType() const { return aLineType; } @@ -74,13 +74,13 @@ public: void SetTitle( ByteString &aNew ) { aTitle = aNew; ReassembleLine(); } ParserMessageList* GetMessageList() { return &aMessages; }; - BOOL HasMessages(){ return ( aMessages.Count() > 0 ); }; + sal_Bool HasMessages(){ return ( aMessages.Count() > 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; }; }; // @@ -97,31 +97,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_uIntPtr nLine, ByteString aUniqueId = ByteString() ); + void PrintError( ByteString aMsg, ByteString aPrefix, ByteString aContext, sal_uIntPtr 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_uIntPtr 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 49e10e15e3d4..ccfe07006f76 100644 --- a/l10ntools/inc/l10ntools/vosapp.hxx +++ b/l10ntools/inc/l10ntools/vosapp.hxx @@ -10,19 +10,19 @@ 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() { vos::OStartupInfo aStartInfo; - return (USHORT)aStartInfo.getCommandArgCount(); + return (sal_uInt16)aStartInfo.getCommandArgCount(); } -XubString Application::GetCommandLineParam( USHORT nParam ) +XubString Application::GetCommandLineParam( sal_uInt16 nParam ) { vos::OStartupInfo aStartInfo; rtl::OUString aParam; diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx index 923da89988b6..ba8577c0fc04 100644 --- a/l10ntools/inc/lngmerge.hxx +++ b/l10ntools/inc/lngmerge.hxx @@ -43,11 +43,11 @@ DECLARE_LIST( LngLineList, ByteString * ) 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 aLanguages; @@ -58,9 +58,9 @@ private: const ByteString &rPrj , const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID ); public: - LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat, bool bQuiet_in ); + LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFFormat, bool bQuiet_in ); ~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 ); }; diff --git a/l10ntools/inc/srciter.hxx b/l10ntools/inc/srciter.hxx index 36061346fe16..91e2c20a768a 100644 --- a/l10ntools/inc/srciter.hxx +++ b/l10ntools/inc/srciter.hxx @@ -49,7 +49,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 3e9b03916f4f..90b19037e6e9 100644 --- a/l10ntools/inc/tagtest.hxx +++ b/l10ntools/inc/tagtest.hxx @@ -34,9 +34,9 @@ class GSILine; -typedef USHORT TokenId; +typedef sal_uInt16 TokenId; -#define TOK_INVALIDPOS USHORT( 0xFFFF ) +#define TOK_INVALIDPOS sal_uInt16( 0xFFFF ) class ParserMessage; @@ -74,24 +74,24 @@ private: String aTagName; StringHashMap aProperties; - BOOL bClosed; // tag is closed - BOOL bCloseTag; // tag is close Tag + sal_Bool bClosed; // tag is closed + sal_Bool bCloseTag; // tag is close Tag - 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; @@ -100,35 +100,35 @@ 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; } }; class ParserMessageList : public Impl_ParserMessageList { public: - 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(); }; @@ -235,13 +235,13 @@ public: void Clear() { - for ( ULONG i = 0 ; i < Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < Count() ; i++ ) delete TokenListImpl::GetObject( i ); TokenListImpl::Clear(); } - void Insert( TokenInfo p, ULONG nIndex = LIST_APPEND ) + void Insert( TokenInfo p, sal_uIntPtr nIndex = LIST_APPEND ) { TokenListImpl::Insert( new TokenInfo(p), nIndex ); } -/* TokenInfo Remove( ULONG nIndex ) +/* TokenInfo Remove( sal_uIntPtr nIndex ) { TokenInfo aT = GetObject( nIndex ); delete TokenListImpl::GetObject( nIndex ); @@ -250,16 +250,16 @@ public: }*/ // TokenInfo Remove( TokenInfo p ){ return Remove( GetPos( p ) ); } // TokenInfo GetCurObject() const { return *TokenListImpl::GetCurObject(); } - TokenInfo& GetObject( ULONG nIndex ) const + TokenInfo& GetObject( sal_uIntPtr nIndex ) const { // if ( TokenListImpl::GetObject(nIndex) ) return *TokenListImpl::GetObject(nIndex); // else // return TokenInfo(); } -/* ULONG GetPos( const TokenInfo p ) const +/* sal_uIntPtr GetPos( const TokenInfo p ) const { - for ( ULONG i = 0 ; i < Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < Count() ; i++ ) if ( p == GetObject( i ) ) return i; return LIST_ENTRY_NOTFOUND; @@ -267,7 +267,7 @@ public: TokenList( const TokenList& rList ); /* { - for ( ULONG i = 0 ; i < rList.Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < rList.Count() ; i++ ) { Insert( rList.GetObject( i ), LIST_APPEND ); } @@ -276,54 +276,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
- String GetNextTokenString( ParserMessageList &rErrorList, USHORT &rTokeStartPos ); + String GetNextTokenString( ParserMessageList &rErrorList, sal_uInt16 &rTokeStartPos ); public: SimpleParser(); @@ -335,9 +335,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(); @@ -353,7 +353,7 @@ class TokenParser TokenId nPfCaseOptions; TokenId nAppCaseOptions; - BOOL bPfCaseActive ,bAppCaseActive; + sal_Bool bPfCaseActive ,bAppCaseActive; TokenId nActiveRefTypes; @@ -363,7 +363,7 @@ public: TokenParser(); void Parse( const String &aCode, ParserMessageList* pList ); // ParserMessageList& GetErrors(){ return aErrorList; } -// BOOL HasErrors(){ return ( aErrorList.Count() > 0 ); } +// sal_Bool HasErrors(){ return ( aErrorList.Count() > 0 ); } TokenList& GetTokenList(){ return aParser.GetTokenList(); } }; @@ -373,21 +373,21 @@ 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& GetReferenceErrors(){ return aReferenceParser.GetErrors(); } -// BOOL HasReferenceErrors(){ return aReferenceParser.HasErrors(); } +// sal_Bool HasReferenceErrors(){ return aReferenceParser.HasErrors(); } // ParserMessageList& GetTesteeErrors(){ return aTesteeParser.GetErrors(); } -// BOOL HasTesteeErrors(){ return aTesteeParser.HasErrors(); } +// sal_Bool HasTesteeErrors(){ return aTesteeParser.HasErrors(); } ParserMessageList& GetCompareWarnings(){ return aCompareWarningList; } - BOOL HasCompareWarnings(){ return ( aCompareWarningList.Count() > 0 ); } + sal_Bool HasCompareWarnings(){ return ( aCompareWarningList.Count() > 0 ); } String GetFixedTestee(){ return aFixedTestee; } }; diff --git a/l10ntools/inc/wtranode.hxx b/l10ntools/inc/wtranode.hxx index af01a4b29d5c..99afe462a9ab 100644 --- a/l10ntools/inc/wtranode.hxx +++ b/l10ntools/inc/wtranode.hxx @@ -80,7 +80,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: @@ -102,7 +102,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 6fd33a7cb413..5ed45d350348 100644 --- a/l10ntools/inc/wtratree.hxx +++ b/l10ntools/inc/wtratree.hxx @@ -81,7 +81,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 @@ -132,7 +132,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 69e74a83ec47..cb72ca532afe 100644 --- a/l10ntools/inc/xmlparse.hxx +++ b/l10ntools/inc/xmlparse.hxx @@ -87,7 +87,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 ) { @@ -107,7 +107,7 @@ protected: XMLNode() {} public: - virtual USHORT GetNodeType() = 0; + virtual sal_uInt16 GetNodeType() = 0; virtual ~XMLNode() {} }; @@ -126,7 +126,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; } @@ -162,7 +162,7 @@ protected: public: - virtual USHORT GetNodeType() = 0; + virtual sal_uInt16 GetNodeType() = 0; /// returns child list of this node XMLChildNodeList *GetChildList() { return pChildList; } @@ -201,7 +201,7 @@ typedef std::hash_map HashMap; /// Mapping XML tag names <-> have localizable strings -typedef std::hash_map TagMap; /** Holds information of a XML file, is root node of tree @@ -219,7 +219,7 @@ public: ~XMLFile(); ByteString* GetGroupID(std::deque &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(); @@ -227,14 +227,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; } @@ -275,10 +275,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(); @@ -344,7 +344,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; } @@ -414,7 +414,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; } @@ -446,7 +446,7 @@ public: ) : XMLChildNode( Parent ), sComment( rComment ) {} - virtual USHORT GetNodeType(); + virtual sal_uInt16 GetNodeType(); XMLComment( const XMLComment& obj ); @@ -478,7 +478,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; } @@ -490,8 +490,8 @@ public: */ struct XMLError { XML_Error eCode; // the error code - ULONG nLine; // error line number - ULONG nColumn; // error column number + sal_uIntPtr nLine; // error line number + sal_uIntPtr nColumn; // error column number String sMessage; // readable error message }; diff --git a/l10ntools/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx index e8c3d322c92b..91981aa41619 100644 --- a/l10ntools/inc/xrmmerge.hxx +++ b/l10ntools/inc/xrmmerge.hxx @@ -38,8 +38,8 @@ private: ByteString sGID; ByteString sLID; - BOOL bError; - BOOL bText; + sal_Bool bError; + sal_Bool bText; bool sLocalized; @@ -74,8 +74,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 6bb839a9409e..692571b1166d 100644 --- a/l10ntools/layout/layoutparse.cxx +++ b/l10ntools/layout/layoutparse.cxx @@ -44,7 +44,7 @@ LayoutXMLFile::SearchL10NElements( XMLParentNode* pCur, int ) /* Recurse int children, SearchL10NElements does not do that for us. */ if ( XMLChildNodeList* lst = pCur->GetChildList() ) - for ( ULONG i = 0; i < lst->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < lst->Count(); i++ ) if ( lst->GetObject( i )->GetNodeType() == XML_NODE_TYPE_ELEMENT ) HandleElement( ( XMLElement* )lst->GetObject( i ) ); else if ( lst->GetObject( i )->GetNodeType() == XML_NODE_TYPE_COMMENT ) @@ -56,7 +56,7 @@ interestingAttributes( XMLAttributeList* lst ) { std::vector interesting; if ( lst ) - for ( ULONG i = 0; i < lst->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < lst->Count(); i++ ) if ( lst->GetObject( i )->Equals( STRING( "id" ) ) ) interesting.insert( interesting.begin(), lst->GetObject( i ) ); else if ( ! BSTRING( *lst->GetObject( i ) ).CompareTo( "_", 1 ) ) @@ -116,7 +116,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 cd24f091d318..2cf560b96893 100644 --- a/l10ntools/layout/layoutparse.hxx +++ b/l10ntools/layout/layoutparse.hxx @@ -38,7 +38,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 72fd1a1d8c5e..906173998b1c 100644 --- a/l10ntools/layout/tralay.cxx +++ b/l10ntools/layout/tralay.cxx @@ -111,7 +111,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 ) @@ -163,7 +163,7 @@ void TranslateLayout::ParseCommandLine() static XMLAttribute* findAttribute( XMLAttributeList* lst, String const& name ) { - for ( ULONG i = 0; i < lst->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < lst->Count(); i++ ) if ( lst->GetObject( i )->Equals( name ) ) return lst->GetObject( i ); return 0; @@ -243,7 +243,7 @@ static void insertMarker( XMLParentNode *p, ByteString const& file ) if ( XMLChildNodeList* lst = p->GetChildList() ) if ( lst->Count() ) { - ULONG i = 1; + sal_uIntPtr i = 1; // Skip newline, if possible. if ( lst->Count() > 1 && lst->GetObject( 2 )->GetNodeType() == XML_NODE_TYPE_DEFAULT ) @@ -260,7 +260,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/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 170c2922d9ce..3f27fe60a493 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -54,11 +54,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; bool bQuiet; ByteString sPrj; ByteString sPrjRoot; @@ -78,19 +78,19 @@ 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; bQuiet = false; 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++ ) { @@ -114,19 +114,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 == "-QQ" ) { bQuiet = true; @@ -144,7 +144,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: { @@ -162,7 +162,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: { @@ -175,7 +175,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; @@ -320,19 +320,19 @@ CfgStackData* CfgStack::Push( const ByteString &rTag, const ByteString &rId ) CfgStack::~CfgStack() /*****************************************************************************/ { - for ( ULONG i = 0; i < Count(); i++ ) + for ( sal_uIntPtr i = 0; i < Count(); i++ ) delete GetObject( i ); } /*****************************************************************************/ -ByteString CfgStack::GetAccessPath( ULONG nPos ) +ByteString CfgStack::GetAccessPath( sal_uIntPtr nPos ) /*****************************************************************************/ { if ( nPos == LIST_APPEND ) nPos = Count() - 1; ByteString sReturn; - for ( ULONG i = 0; i <= nPos; i++ ) { + for ( sal_uIntPtr i = 0; i <= nPos; i++ ) { if ( i ) sReturn += "."; sReturn += GetStackData( i )->GetIdentifier(); @@ -342,7 +342,7 @@ ByteString CfgStack::GetAccessPath( ULONG nPos ) } /*****************************************************************************/ -CfgStackData *CfgStack::GetStackData( ULONG nPos ) +CfgStackData *CfgStack::GetStackData( sal_uIntPtr nPos ) /*****************************************************************************/ { if ( nPos == LIST_APPEND ) @@ -359,7 +359,7 @@ CfgStackData *CfgStack::GetStackData( ULONG nPos ) CfgParser::CfgParser() /*****************************************************************************/ : pStackData( NULL ), - bLocalize( FALSE ) + bLocalize( sal_False ) { } @@ -371,7 +371,7 @@ CfgParser::~CfgParser() /*****************************************************************************/ -BOOL CfgParser::IsTokenClosed( const ByteString &rToken ) +sal_Bool CfgParser::IsTokenClosed( const ByteString &rToken ) /*****************************************************************************/ { return rToken.GetChar( rToken.Len() - 2 ) == '/'; @@ -385,7 +385,7 @@ void CfgParser::AddText( ) /*****************************************************************************/ { - USHORT nTextLen = 0; + sal_uInt16 nTextLen = 0; while ( rText.Len() != nTextLen ) { nTextLen = rText.Len(); rText.SearchAndReplaceAll( "\n", " " ); @@ -418,7 +418,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: @@ -450,7 +450,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="; @@ -470,7 +470,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; @@ -488,7 +488,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" ) { @@ -525,11 +525,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; } @@ -734,9 +734,9 @@ CfgMerge::CfgMerge( : CfgOutputParser( rOutputFile ), pMergeDataFile( NULL ), pResData( NULL ), - bGerman( FALSE ), + bGerman( sal_False ), sFilename( rFilename ), - bEnglish( FALSE ) + bEnglish( sal_False ) { if ( rMergeSource.Len()){ pMergeDataFile = new MergeDataFile( @@ -786,9 +786,9 @@ void CfgMerge::WorkOnText( } //if ( nLangIndex.EqualsIgnoreCaseAscii("de") ) - // bGerman = TRUE; + // bGerman = sal_True; if (( nLangIndex.EqualsIgnoreCaseAscii("en-US") )) - bEnglish = TRUE; + bEnglish = sal_True; PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData ); if ( pEntrys ) { @@ -816,7 +816,7 @@ void CfgMerge::Output( const ByteString& rOutput ) pOutputStream->Write( rOutput.GetBuffer(), rOutput.Len()); } -ULONG CfgStack::Push( CfgStackData *pStackData ) +sal_uIntPtr CfgStack::Push( CfgStackData *pStackData ) { Insert( pStackData, LIST_APPEND ); return Count() - 1; @@ -836,7 +836,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("de") ) && ( !sCur.EqualsIgnoreCaseAscii("en-US") ) && @@ -878,6 +878,6 @@ void CfgMerge::WorkOnRessourceEnd() } delete pResData; pResData = NULL; - bGerman = FALSE; - bEnglish = FALSE; + bGerman = sal_False; + bEnglish = sal_False; } diff --git a/l10ntools/source/directory.cxx b/l10ntools/source/directory.cxx index a36f8bd2361f..f7330a9b5ed9 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 59f29525eda4..36ec7985a26a 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -56,12 +56,12 @@ Export *pExport = 0L; // set of global variables DECLARE_LIST( FileList, ByteString * ) 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; bool bQuiet; ByteString sPrj; ByteString sPrjRoot; @@ -85,12 +85,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[]) sTempFile = ""; pTempFile = NULL; bQuiet = false; - 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++ ) { @@ -127,24 +127,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; @@ -156,7 +156,7 @@ extern char *GetOutputFile( int argc, char* argv[]) } case STATE_INPUT: { aInputFileList.Insert( new ByteString( argv[ i ]), LIST_APPEND ); - bInput = TRUE; // min. one source file found + bInput = sal_True; // min. one source file found } break; case STATE_OUTPUT: { @@ -173,7 +173,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: { @@ -186,7 +186,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; @@ -249,8 +249,8 @@ extern FILE *GetNextFile() ByteString sOrigFile( sFileName ); sFileName = Export::GetNativeFile( sFileName ); - delete aInputFileList.GetObject(( ULONG ) 0 ); - aInputFileList.Remove(( ULONG ) 0 ); + delete aInputFileList.GetObject(( sal_uIntPtr ) 0 ); + aInputFileList.Remove(( sal_uIntPtr ) 0 ); if ( sFileName == "" ) { fprintf( stderr, "ERROR: Could not precompile File %s\n", @@ -336,7 +336,7 @@ int GetError() // get error at global instance of class Export if ( pExport->GetError()) return 1; - return FALSE; + return sal_False; } } @@ -384,7 +384,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 ) @@ -408,10 +408,10 @@ BOOL ResData::SetId( const ByteString &rId, USHORT nLevel ) sId.EraseTrailingChars( '\t' ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // @@ -419,14 +419,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 ), @@ -436,9 +436,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 ); @@ -463,15 +463,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 ), @@ -480,11 +480,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; @@ -509,15 +509,15 @@ 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 ); nListIndex = 0; while ( aResStack.Count()) { - delete aResStack.GetObject(( ULONG ) 0 ); - aResStack.Remove(( ULONG ) 0 ); + delete aResStack.GetObject(( sal_uIntPtr ) 0 ); + aResStack.Remove(( sal_uIntPtr ) 0 ); } } @@ -531,8 +531,8 @@ Export::~Export() if ( bEnableExport ) aOutput.Close(); while ( aResStack.Count()) { - delete aResStack.GetObject(( ULONG ) 0 ); - aResStack.Remove(( ULONG ) 0 ); + delete aResStack.GetObject(( sal_uIntPtr ) 0 ); + aResStack.Remove(( sal_uIntPtr ) 0 ); } if ( bMergeMode && !bUnmerge ) { @@ -555,16 +555,16 @@ int Export::Execute( int nToken, const char * pToken ) printf("sToken = %s\n",sToken.GetBuffer()); printf("nToken = %d\n",nToken); printf("+---------------\n"); */ - 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" )))) { @@ -608,21 +608,21 @@ 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 ) { /*if ( bDontWriteOutput && bUnmerge ) { - bDontWriteOutput = FALSE; - bNextMustBeDefineEOL = FALSE; - bDefine = TRUE; + bDontWriteOutput = sal_False; + bNextMustBeDefineEOL = sal_False; + bDefine = sal_True; }*/ 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; @@ -635,20 +635,20 @@ int Export::Execute( int nToken, const char * pToken ) #if 0 // impossible, unsigned is never negative if( sTmpLine.Len() < 0 ){ - if ( sTmpLine.GetChar(( USHORT )( sTmpLine.Len() - 1 )) != '\\' ) - bNextMustBeDefineEOL = TRUE; + if ( sTmpLine.GetChar(( sal_uInt16 )( sTmpLine.Len() - 1 )) != '\\' ) + bNextMustBeDefineEOL = sal_True; } #endif } } } - 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; @@ -656,7 +656,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; @@ -665,7 +665,7 @@ int Export::Execute( int nToken, const char * pToken ) } if ( nOpen < nClose ) - bExecuteDown = TRUE; + bExecuteDown = sal_True; } switch ( nToken ) { @@ -685,17 +685,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.GetObject( nLevel - 2 )->bChild = TRUE; + aResStack.GetObject( nLevel - 2 )->bChild = sal_True; } // create new instance for this res. and fill mandatory fields @@ -732,12 +732,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.GetObject( nLevel - 2 )->bChild = TRUE; + aResStack.GetObject( nLevel - 2 )->bChild = sal_True; } // create new instance for this res. and fill mandatory fields @@ -760,13 +760,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.GetObject( nLevel - 2 )->bChild = TRUE; + aResStack.GetObject( nLevel - 2 )->bChild = sal_True; } ResData *pNewData = new ResData( sActPForm, FullId() , sFilename ); @@ -777,11 +777,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 ); delete aResStack.GetObject( nLevel - 1 ); @@ -791,7 +791,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 ); @@ -803,7 +803,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( ' ' ); @@ -822,7 +822,7 @@ int Export::Execute( int nToken, const char * pToken ) // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); //} - pResData->bList = TRUE; + pResData->bList = sal_True; nList = LIST_STRING; //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); nListLang = SOURCE_LANGUAGE; @@ -833,7 +833,7 @@ int Export::Execute( int nToken, const char * pToken ) //if ( bUnmerge ){ // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); //} - pResData->bList = TRUE; + pResData->bList = sal_True; nList = LIST_FILTER; //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); nListLang = SOURCE_LANGUAGE; @@ -843,7 +843,7 @@ int Export::Execute( int nToken, const char * pToken ) else if ( sKey == "UIENTRIES" ) { //if ( bUnmerge ){ // ( sOrig.SearchAndReplace( "=", "[ de ] =" ));} - pResData->bList = TRUE; + pResData->bList = sal_True; nList = LIST_UIENTRIES; //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); nListLang = SOURCE_LANGUAGE; @@ -857,15 +857,15 @@ int Export::Execute( int nToken, const char * pToken ) Parse( LEVELUP, "" ); } //if ( bUnmerge && ( nListLang.EqualsIgnoreCaseAscii("de") || nListLang.EqualsIgnoreCaseAscii("en-US") ) && ListExists( pResData, nList )) - // bDontWriteOutput = TRUE; + // bDontWriteOutput = sal_True; } 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("[de]="); nPos = sTmpToken.ToLowerAscii().Search("[en-us]="); if( nPos != STRING_NOTFOUND ) { @@ -878,7 +878,7 @@ 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; //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); nListLang = SOURCE_LANGUAGE; @@ -886,7 +886,7 @@ int Export::Execute( int nToken, const char * pToken ) nListLevel = 0; } else if ( sKey == "FILTERLIST" ) { - pResData->bList = TRUE; + pResData->bList = sal_True; nList = LIST_FILTER; //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); nListLang = SOURCE_LANGUAGE; @@ -895,7 +895,7 @@ int Export::Execute( int nToken, const char * pToken ) } // PairedList else if ( sKey == "PAIREDLIST" ) { - pResData->bList = TRUE; + pResData->bList = sal_True; nList = LIST_PAIRED; //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); nListLang = SOURCE_LANGUAGE; @@ -904,7 +904,7 @@ int Export::Execute( int nToken, const char * pToken ) } else if ( sKey == "ITEMLIST" ) { - pResData->bList = TRUE; + pResData->bList = sal_True; nList = LIST_ITEM; //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); nListLang = SOURCE_LANGUAGE; @@ -912,7 +912,7 @@ int Export::Execute( int nToken, const char * pToken ) nListLevel = 0; } else if ( sKey == "UIENTRIES" ) { - pResData->bList = TRUE; + pResData->bList = sal_True; nList = LIST_UIENTRIES; //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); nListLang = SOURCE_LANGUAGE; @@ -922,7 +922,7 @@ int Export::Execute( int nToken, const char * pToken ) /*if ( bUnmerge && ( nListLang.EqualsIgnoreCaseAscii( "de" ) || nListLang.EqualsIgnoreCaseAscii("en-US" ) ) && ListExists( pResData, nList )) - bDontWriteOutput = TRUE;*/ + bDontWriteOutput = sal_True;*/ } else { // new res. is a String- or FilterList @@ -944,11 +944,11 @@ int Export::Execute( int nToken, const char * pToken ) CleanValue( sLang ); nListLang = sLang; /*if (( bUnmerge ) && ( !nListLang.EqualsIgnoreCaseAscii("de")) && ( !nListLang.EqualsIgnoreCaseAscii("en-US"))) - bDontWriteOutput = TRUE;*/ + bDontWriteOutput = sal_True;*/ nListIndex = 0; nListLevel = 0; /*if ( bUnmerge && nListLang.EqualsIgnoreCaseAscii("de") && ListExists( pResData, nList ) ) - bDontWriteOutput = TRUE;*/ + bDontWriteOutput = sal_True;*/ } } } @@ -975,7 +975,7 @@ int Export::Execute( int nToken, const char * pToken ) break; case LONGTEXTLINE: case TEXTLINE: - bDontWriteOutput = FALSE; + bDontWriteOutput = sal_False; if ( nLevel ) { CutComment( sToken ); @@ -1008,7 +1008,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 ); @@ -1029,7 +1029,7 @@ int Export::Execute( int nToken, const char * pToken ) // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); // } SetChildWithText(); - pResData->bHelpText = TRUE; + pResData->bHelpText = sal_True; if ( bBreakWhenHelpText ) { ByteString sError( "\"HelpText\" found in source\n" ); YYWarning( sError.GetBufferAccess()); @@ -1054,7 +1054,7 @@ int Export::Execute( int nToken, const char * pToken ) // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); // } SetChildWithText(); - pResData->bQuickHelpText = TRUE; + pResData->bQuickHelpText = sal_True; if ( bMergeMode ) PrepareTextToMerge( sOrig, STRING_TYP_QUICKHELPTEXT, nLangIndex, pResData ); //if ( bUnmerge ) @@ -1073,7 +1073,7 @@ int Export::Execute( int nToken, const char * pToken ) // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); // } SetChildWithText(); - pResData->bTitle = TRUE; + pResData->bTitle = sal_True; if ( bMergeMode ) PrepareTextToMerge( sOrig, STRING_TYP_TITLE, nLangIndex, pResData ); //if ( bUnmerge ) @@ -1097,7 +1097,7 @@ int Export::Execute( int nToken, const char * pToken ) } break; case NEWTEXTINRES: { - bDontWriteOutput = TRUE; + bDontWriteOutput = sal_True; // this means something like // ### Achtung : Neuer Text ... /*ByteString sLang( "GERMAN" ); ByteString sText = sToken.GetToken( 2, ':' ).GetToken( 0, '*' ); @@ -1107,7 +1107,7 @@ int Export::Execute( int nToken, const char * pToken ) } 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, '=' ); @@ -1119,18 +1119,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 ) {}; @@ -1159,16 +1159,16 @@ 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, "" ); //WorkOnTokenSet( LEVELDOWN, pTkn ); @@ -1176,7 +1176,7 @@ int Export::Execute( int nToken, const char * pToken ) } break; case PRAGMA : { - bDontWriteOutput = FALSE; + bDontWriteOutput = sal_False; while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {}; sToken.EraseLeadingChars( ' ' ); @@ -1199,11 +1199,11 @@ int Export::Execute( int nToken, const char * pToken ) } break; case TEXTREFID : { - bDontWriteOutput = TRUE; + bDontWriteOutput = sal_True; /*ByteString sK = sToken.GetToken( 0, '=' ); ByteString sKey = sK.EraseAllChars( '\t' ).EraseAllChars( ' ' ); ByteString sT = sToken.GetToken( 1, '=' ).GetToken( 0, ';' ); - USHORT nRefId = ( USHORT ) sT.EraseAllChars( '\t' ).EraseAllChars( ' ' ).ToInt32(); + sal_uInt16 nRefId = ( sal_uInt16 ) sT.EraseAllChars( '\t' ).EraseAllChars( ' ' ).ToInt32(); if (( sKey.ToUpperAscii() == "TEXT" ) || ( sKey == "MESSAGE" ) || ( sKey == "CUSTOMUNITTEXT" ) || @@ -1222,7 +1222,7 @@ int Export::Execute( int nToken, const char * pToken ) // 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++ ); } @@ -1246,8 +1246,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 ) == '\"' ) @@ -1266,8 +1266,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; @@ -1277,7 +1277,7 @@ void Export::UnmergeUTF8( ByteString& sOrig ){ } /*****************************************************************************/ -BOOL Export::ListExists( ResData *pResData, USHORT nLst ) +sal_Bool Export::ListExists( ResData *pResData, sal_uInt16 nLst ) /*****************************************************************************/ { switch ( nLst ) { @@ -1287,20 +1287,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; /* ByteStringHashMap::iterator pos3 = pResData->sText.begin(); ByteStringHashMap::iterator end3 = pResData->sText.end(); @@ -1461,7 +1461,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 ; > ; @@ -1489,8 +1489,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; @@ -1504,7 +1504,7 @@ BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList, ByteString sTimeStamp( Export::GetTimeStamp()); ByteString sCur; - for ( ULONG i = 0; pExportList != NULL && i < pExportList->Count(); i++ ) { + for ( sal_uIntPtr i = 0; pExportList != NULL && i < pExportList->Count(); i++ ) { ExportListEntry *pEntry = pExportList->GetObject( i ); // mandatory for export: german and eng. and/or enus //ByteString a("Export::WriteExportList::pEntry"); @@ -1567,7 +1567,7 @@ BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList, if ( bCreateNew ) delete pExportList; - return TRUE; + return sal_True; } /*****************************************************************************/ @@ -1577,7 +1577,7 @@ ByteString Export::FullId() ByteString sFull; if ( nLevel > 1 ) { sFull = aResStack.GetObject( 0 )->sId; - for ( USHORT i = 1; i < nLevel - 1; i++ ) { + for ( sal_uInt16 i = 1; i < nLevel - 1; i++ ) { ByteString sToAdd = aResStack.GetObject( i )->sId; if ( sToAdd.Len()) { sFull += "."; @@ -1707,7 +1707,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 ) == '\\' ) || @@ -1745,14 +1745,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 ) { @@ -1812,7 +1812,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++ ); @@ -1820,7 +1820,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++ ); } @@ -1828,7 +1828,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; @@ -1836,13 +1836,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 ); @@ -1859,11 +1859,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()) { @@ -1912,13 +1912,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; @@ -1933,7 +1933,7 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp, case LIST_ITEM : { if ( bUnmerge ) - return TRUE; + return sal_True; ExportList *pList = NULL; switch ( nTyp ) { @@ -1980,17 +1980,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 --; @@ -2022,22 +2022,22 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp, if (( nLangIndex != ByteString("de") ) && ( nLangIndex != ByteString("en-US") )) { - bDontWriteOutput = TRUE; + bDontWriteOutput = sal_True; } - return TRUE; + return sal_True; }*/ 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 ++; } @@ -2045,19 +2045,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 --; @@ -2092,7 +2092,7 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp, if ( !pEntrys ) { rText = sOrigText; - return FALSE; // no data found + return sal_False; // no data found } ByteString sContent; @@ -2100,12 +2100,12 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp, //if ( !sContent.Len() && ( ! nLangIndex.EqualsIgnoreCaseAscii("en-US") )) { if ( !sContent.Len() && ( ! Export::isSourceLanguage( nLangIndex ) )) { rText = sOrigText; - return FALSE; // no data found + return sal_False; // no data found } //if ( nLangIndex.EqualsIgnoreCaseAscii("en-US") ) { if ( Export::isSourceLanguage( nLangIndex ) ) { - return FALSE; + return sal_False; } ByteString sPostFix( rText.Copy( ++nEnd )); @@ -2121,11 +2121,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 ( bUnmerge ) { return;} @@ -2149,8 +2149,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; @@ -2158,7 +2158,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) { @@ -2167,7 +2167,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode ) else sOutput += ";\t\\\n"; } - bFirst=FALSE; + bFirst=sal_False; sOutput += "\t"; sOutput += pResData->sTextTyp; //if ( !sCur.EqualsIgnoreCaseAscii("en-US")) { @@ -2188,8 +2188,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 ); } @@ -2203,15 +2203,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) { @@ -2220,7 +2220,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode ) else sOutput += ";\t\\\n"; } - bFirst=FALSE; + bFirst=sal_False; sOutput += "\t"; sOutput += "QuickHelpText"; //if ( !sCur.EqualsIgnoreCaseAscii("en-US") ) { @@ -2237,8 +2237,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 ); } @@ -2250,15 +2250,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) { @@ -2267,7 +2267,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode ) else sOutput += ";\t\\\n"; } - bFirst=FALSE; + bFirst=sal_False; sOutput += "\t"; sOutput += "Title"; //if ( !sCur.EqualsIgnoreCaseAscii("en-US") ) { @@ -2284,8 +2284,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 ); } @@ -2309,9 +2309,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; @@ -2323,7 +2323,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 ) ){ @@ -2334,18 +2334,18 @@ void Export::MergeRest( ResData *pResData, USHORT nMode ) pResData->sId = ByteString("1"); PFormEntrys *pEntrys; - ULONG nLIndex = 0; - ULONG nMaxIndex = 0; + sal_uIntPtr nLIndex = 0; + sal_uIntPtr nMaxIndex = 0; if ( pList ) nMaxIndex = pList->GetSourceLanguageListEntryCount(); pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); while( pEntrys && ( nLIndex < nMaxIndex )) { //printf("Lang %s, List Index %d\n",sCur.GetBuffer(),(int)nLIndex); 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 && pResData->sResTyp.Equals( "pairedlist" ) ){ @@ -2408,7 +2408,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode ) } } - USHORT nStart, nEnd; + sal_uInt16 nStart, nEnd; nStart = sLine.Search( "\"" ); ByteString sPostFix; @@ -2492,7 +2492,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode ) } nListIndex++; - ULONG nMaxIndex = 0; + sal_uIntPtr nMaxIndex = 0; if ( pList ) nMaxIndex = pList->GetSourceLanguageListEntryCount(); ByteString sLine; @@ -2517,7 +2517,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++; @@ -2547,15 +2547,15 @@ void Export::SetChildWithText() /*****************************************************************************/ { if ( aResStack.Count() > 1 ) { - for ( ULONG i = 0; i < aResStack.Count() - 1; i++ ) { - aResStack.GetObject( i )->bChildWithText = TRUE; + for ( sal_uIntPtr i = 0; i < aResStack.Count() - 1; i++ ) { + aResStack.GetObject( i )->bChildWithText = sal_True; } } } void ParserQueue::Push( const QueueEntry& aEntry ){ // printf("nTyp = %d ",aEntry.nTyp); - 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 8a384b415b6f..b6c42d27303c 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -52,7 +52,7 @@ ResData::~ResData() { if ( pStringList ) { // delete existing res. of type StringList - for ( ULONG i = 0; i < pStringList->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pStringList->Count(); i++ ) { ExportListEntry* test = pStringList->GetObject( i ); if( test != NULL ) delete test; } @@ -60,7 +60,7 @@ ResData::~ResData() } if ( pFilterList ) { // delete existing res. of type FilterList - for ( ULONG i = 0; i < pFilterList->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pFilterList->Count(); i++ ) { ExportListEntry* test = pFilterList->GetObject( i ); delete test; } @@ -68,7 +68,7 @@ ResData::~ResData() } if ( pItemList ) { // delete existing res. of type ItemList - for ( ULONG i = 0; i < pItemList->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pItemList->Count(); i++ ) { ExportListEntry* test = pItemList->GetObject( i ); delete test; } @@ -76,7 +76,7 @@ ResData::~ResData() } if ( pUIEntries ) { // delete existing res. of type UIEntries - for ( ULONG i = 0; i < pUIEntries->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pUIEntries->Count(); i++ ) { ExportListEntry* test = pUIEntries->GetObject( i ); delete test; } @@ -145,8 +145,8 @@ void Export::QuotHTMLXRM( ByteString &rString ) /*****************************************************************************/ { ByteString sReturn; - //BOOL bBreak = FALSE; - for ( USHORT i = 0; i < rString.Len(); i++ ) { + //sal_Bool bBreak = sal_False; + for ( sal_uInt16 i = 0; i < rString.Len(); i++ ) { ByteString sTemp = rString.Copy( i ); if ( sTemp.Search( " 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 ); @@ -214,7 +214,7 @@ GSILine::GSILine( const ByteString &rLine, ULONG nLine ) void GSILine::NotOK() /*****************************************************************************/ { - bOK = FALSE; + bOK = sal_False; } /*****************************************************************************/ @@ -224,7 +224,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' ) ); @@ -246,8 +246,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 @@ -274,17 +274,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 ) @@ -294,7 +294,7 @@ GSIBlock::GSIBlock( BOOL PbPrintContext, BOOL bSource, BOOL bTrans, BOOL bRef, B , bReference( bRef ) , bAllowKeyIDs( bAllowKID ) , bAllowSuspicious( bAllowSusp ) - , bHasBlockError( FALSE ) + , bHasBlockError( sal_False ) { } @@ -305,7 +305,7 @@ GSIBlock::~GSIBlock() delete pSourceLine; delete pReferenceLine; - for ( ULONG i = 0; i < Count(); i++ ) + for ( sal_uIntPtr i = 0; i < Count(); i++ ) delete ( GetObject( i )); } @@ -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(); } @@ -328,7 +328,7 @@ void GSIBlock::InsertLine( GSILine* pLine, ByteString aSourceLang) return; } } - ULONG nPos = 0; + sal_uIntPtr nPos = 0; if ( aSourceLang.Len() ) // only check blockstructure if source lang is given { @@ -337,7 +337,7 @@ void GSIBlock::InsertLine( GSILine* pLine, ByteString aSourceLang) if ( GetObject( nPos )->GetLanguageId().Equals( pLine->GetLanguageId() ) ) { PrintError( "Translation Language entry double. Checking both.", "File format", "", pLine->GetLineNumber(), pLine->GetUniqId() ); - bHasBlockError = TRUE; + bHasBlockError = sal_True; GetObject( nPos )->NotOK(); pLine->NotOK(); } @@ -356,7 +356,7 @@ void GSIBlock::SetReferenceLine( GSILine* pLine ) /*****************************************************************************/ void GSIBlock::PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, - ByteString aContext, ULONG nLine, ByteString aUniqueId ) + ByteString aContext, sal_uIntPtr nLine, ByteString aUniqueId ) /*****************************************************************************/ { ::PrintMessage( aType, aMsg, aPrefix, aContext, bPrintContext, nLine, aUniqueId ); @@ -364,7 +364,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_uIntPtr nLine, ByteString aUniqueId ) /*****************************************************************************/ { PrintMessage( "Error:", aMsg, aPrefix, aContext, nLine, aUniqueId ); @@ -375,7 +375,7 @@ void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix, GSILine *pLine ) /*****************************************************************************/ { - ULONG i; + sal_uIntPtr i; for ( i = 0 ; i < pList->Count() ; i++ ) { ParserMessage *pMsg = pList->GetObject( i ); @@ -395,7 +395,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 ); @@ -404,7 +404,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" @@ -412,25 +412,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 ) @@ -445,7 +445,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; @@ -453,7 +453,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; @@ -461,7 +461,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(); @@ -475,12 +475,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; } } } @@ -490,7 +490,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 ) @@ -499,32 +499,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 ); @@ -535,7 +535,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 ); @@ -546,7 +546,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 ); @@ -560,38 +560,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_uIntPtr 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 @@ -601,7 +601,7 @@ BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags { PrintList( pSourceLine->GetMessageList(), "ReferenceString", pSourceLine ); pSourceLine->NotOK(); - bHasError = TRUE; + bHasError = sal_True; } } if ( bReference ) @@ -617,7 +617,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 { @@ -628,7 +628,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; } } } @@ -636,7 +636,7 @@ BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags if ( pSourceLine ) bHasError |= !TestUTF8( pSourceLine, bFixTags ); - ULONG i; + sal_uIntPtr i; for ( i = 0; i < Count(); i++ ) { aTester.CheckTestee( GetObject( i ), pSourceLine != NULL, bFixTags ); @@ -644,7 +644,7 @@ BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags { if ( GetObject( i )->HasMessages() || aTester.GetCompareWarnings().HasErrors() ) GetObject( i )->NotOK(); - bHasError = TRUE; + bHasError = sal_True; PrintList( GetObject( i )->GetMessageList(), "Translation", GetObject( i ) ); PrintList( &(aTester.GetCompareWarnings()), "Translation Tag Missmatch", GetObject( i ) ); } @@ -656,19 +656,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; - ULONG i; + sal_Bool bHasError = sal_False; + sal_Bool bCopyAll = ( !pSourceLine && bRequireSourceLine ) || ( pSourceLine && !pSourceLine->IsOK() && !bCheckTranslationLang ) || bHasBlockError; + sal_uIntPtr i; for ( i = 0; i < Count(); i++ ) { if ( !GetObject( i )->IsOK() || bCopyAll ) { - bHasError = TRUE; + bHasError = sal_True; aErrOut.LazyOpen(); aErrOut.WriteLine( *GetObject( i ) ); } @@ -681,18 +681,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; - ULONG i; + sal_Bool bHasOK = sal_False; + sal_uIntPtr i; for ( i = 0; i < Count(); i++ ) { if ( ( GetObject( i )->IsOK() || bCheckSourceLang ) && !bHasBlockError ) { - bHasOK = TRUE; + bHasOK = sal_True; aOkOut.LazyOpen(); aOkOut.WriteLine( *GetObject( i ) ); } @@ -705,18 +705,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; - ULONG i; + sal_Bool bHasFixes = sal_False; + sal_uIntPtr i; for ( i = 0; i < Count(); i++ ) { if ( GetObject( i )->IsFixed() ) { - bHasFixes = TRUE; + bHasFixes = sal_True; aFixOut.LazyOpen(); aFixOut.WriteLine( *GetObject( i ) ); } @@ -785,31 +785,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': { @@ -819,61 +819,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': { @@ -887,7 +887,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; @@ -896,34 +896,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 @@ -933,7 +933,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; } } } @@ -1033,20 +1033,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_uIntPtr 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_uIntPtr 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() ) @@ -1057,7 +1057,7 @@ int _cdecl main( int argc, char *argv[] ) pGSILine->NotOK(); if ( bWriteError ) { - bFileHasError = TRUE; + bFileHasError = sal_True; aErrOut.LazyOpen(); aErrOut.WriteLine( *pGSILine ); } @@ -1096,7 +1096,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 ) @@ -1116,7 +1116,7 @@ int _cdecl main( int argc, char *argv[] ) { // if ( pGSILine->GetLanguageId() == aSourceLang ) // PrintError( "No reference line found. Entry is new in source file", "File format", "", bPrintContext, pGSILine->GetLineNumber(), aId ); - bContinueSearching = FALSE; + bContinueSearching = sal_False; } else { @@ -1138,7 +1138,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 b2e470f604ea..64ec6e38af5b 100644 --- a/l10ntools/source/gsiconv.cxx +++ b/l10ntools/source/gsiconv.cxx @@ -39,12 +39,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_uIntPtr nPos( rStream.Tell()); rStream.Seek( STREAM_SEEK_TO_BEGIN ); ByteString sLine; @@ -64,7 +64,7 @@ USHORT GetGSIFileType( SvStream &rStream ) } /*****************************************************************************/ -ByteString GetGSILineId( const ByteString &rLine, USHORT nFileType ) +ByteString GetGSILineId( const ByteString &rLine, sal_uInt16 nFileType ) /*****************************************************************************/ { ByteString sId; @@ -89,7 +89,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; @@ -108,8 +108,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 ) { @@ -122,7 +122,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 ) @@ -231,9 +231,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_uIntPtr nMaxLines = (sal_uIntPtr) ByteString( argv[ 2 ] ).ToInt64(); if ( !nMaxLines ) { fprintf( stderr, "\nERROR: Linecount must be at least 1!\n\n" ); exit ( 3 ); @@ -241,8 +241,8 @@ int _cdecl main( int argc, char *argv[] ) ByteString sGSILine; ByteString sOldId; - ULONG nLine = 0; - ULONG nOutputFile = 1; + sal_uIntPtr nLine = 0; + sal_uIntPtr nOutputFile = 1; String sOutput( sBase ); sOutput += String( "_", RTL_TEXTENCODING_ASCII_US ); @@ -345,7 +345,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/helpex.cxx b/l10ntools/source/helpex.cxx index 49a59266a85d..e185b77cad54 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -51,10 +51,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,21 +64,21 @@ ByteString sSDFFile; bool bQuiet; /*****************************************************************************/ -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 = ""; bQuiet = false; 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++ ) { @@ -109,18 +109,18 @@ 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() == "-QQ" ) { bQuiet = true; } 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; @@ -128,12 +128,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: { @@ -159,7 +159,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: { @@ -175,12 +175,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; } @@ -233,8 +233,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 ); @@ -266,8 +266,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 aLanguages; diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 0ab7e6eb5c2e..8fb40c329e59 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -271,7 +271,7 @@ bool HelpParser::CreateSDF( DirEntry aTempFile( sUsedTempFile ); aTempFile.Kill(); } - return TRUE; + return sal_True; } ByteString HelpParser::makeAbsolutePath( const ByteString& sHelpFile , const ByteString& rRoot_in ) @@ -585,9 +585,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 c593b85d4932..4b9a3683ff47 100644 --- a/l10ntools/source/lngex.cxx +++ b/l10ntools/source/lngex.cxx @@ -48,11 +48,11 @@ // 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 bool bQuiet; ByteString sPrj; ByteString sPrjRoot; @@ -60,21 +60,21 @@ 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; bQuiet = 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++ ) { @@ -100,19 +100,19 @@ 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 == "-NOUTF8" ) { nState = STATE_UTF8; - bUTF8 = FALSE; + bUTF8 = sal_False; }*/ /* else if ( sSwitch == "-ULF" ) { nState = STATE_ULF; - bULF = TRUE; + bULF = sal_True; }*/ else if ( sSwitch == "-L" ) { nState = STATE_LANGUAGES; @@ -120,12 +120,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: { @@ -143,7 +143,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: { @@ -156,13 +156,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 5f40a4346f53..36d0eace00d0 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -38,7 +38,7 @@ using namespace std; // class LngParser // /*****************************************************************************/ -LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat , bool bQuiet_in ) +LngParser::LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFFormat , bool bQuiet_in ) /*****************************************************************************/ : nError( LNG_OK ), @@ -77,7 +77,7 @@ LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat , LngParser::~LngParser() /*****************************************************************************/ { - for ( ULONG i = 0; i < pLines->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < pLines->Count(); i++ ) delete pLines->GetObject( i ); delete pLines; } @@ -100,7 +100,7 @@ void LngParser::FillInFallbacks( ByteStringHashMap Text ) } /*****************************************************************************/ -BOOL LngParser::CreateSDF( +sal_Bool LngParser::CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot ) /*****************************************************************************/ @@ -125,8 +125,8 @@ BOOL LngParser::CreateSDF( sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); sActFileName.SearchAndReplaceAll( "/", "\\" ); - ULONG nPos = 0; - BOOL bStart = true; + sal_uIntPtr nPos = 0; + 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; @@ -205,7 +205,7 @@ BOOL LngParser::CreateSDF( } /*****************************************************************************/ -BOOL LngParser::Merge( +sal_Bool LngParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString& rPrj ) /*****************************************************************************/ { @@ -218,16 +218,16 @@ BOOL LngParser::Merge( nError = LNG_COULD_NOT_OPEN; } nError = LNG_OK; -// MergeDataFile( const ByteString &rFileName, const ByteString& rFile , BOOL bErrLog, CharSet aCharSet, BOOL bUTF8 ); +// MergeDataFile( const ByteString &rFileName, const ByteString& rFile , sal_Bool bErrLog, CharSet aCharSet, sal_Bool bUTF8 ); - 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(); - ULONG nPos = 0; - BOOL bGroup = FALSE; + sal_uIntPtr nPos = 0; + sal_Bool bGroup = sal_False; ByteString sGroup; // seek to next group @@ -241,7 +241,7 @@ BOOL LngParser::Merge( sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' ); sGroup.EraseLeadingChars( ' ' ); sGroup.EraseTrailingChars( ' ' ); - bGroup = TRUE; + bGroup = sal_True; } nPos ++; } @@ -249,13 +249,13 @@ BOOL LngParser::Merge( while ( nPos < pLines->Count()) { ByteStringHashMap Text; ByteString sID( sGroup ); - ULONG nLastLangPos = 0; + sal_uIntPtr 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; @@ -269,7 +269,7 @@ BOOL LngParser::Merge( sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' ); sGroup.EraseLeadingChars( ' ' ); sGroup.EraseTrailingChars( ' ' ); - bGroup = TRUE; + bGroup = sal_True; nPos ++; sLanguagesDone = ""; } @@ -291,7 +291,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->GetObject( nPos ); @@ -327,7 +327,7 @@ BOOL LngParser::Merge( !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 == "-" ))) { @@ -349,9 +349,9 @@ BOOL LngParser::Merge( delete pResData; } - for ( ULONG i = 0; i < pLines->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < pLines->Count(); i++ ) aDestination.WriteLine( *pLines->GetObject( i )); aDestination.Close(); - return TRUE; + return sal_True; } diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 1d1428ff2dc0..82c888889460 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -131,7 +131,7 @@ class SourceTreeLocalizer : public SourceTreeIterator { private: SvFileStream aSDF; - USHORT nMode; + sal_uInt16 nMode; ByteString sLanguageRestriction; @@ -140,12 +140,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, @@ -161,8 +161,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 @@ -177,8 +177,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 ); }; @@ -202,10 +202,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(); @@ -233,7 +233,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 ); @@ -246,10 +246,10 @@ const ByteString SourceTreeLocalizer::GetProjectRootRel() sCur.SearchAndReplaceAll( sDelimiter, "/" ); sCur.EraseLeadingChars( '/' ); - ULONG nCount = sCur.GetTokenCount( '/' ); + sal_uIntPtr nCount = sCur.GetTokenCount( '/' ); ByteString sProjectRootRel; - for ( ULONG i = 0; i < nCount; i++ ) { + for ( sal_uIntPtr i = 0; i < nCount; i++ ) { if ( sProjectRootRel.Len()) sProjectRootRel += sDelimiter; sProjectRootRel += ".."; @@ -365,11 +365,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_uIntPtr nIndex = 0; + sal_Bool bReturn = sal_True; ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); @@ -384,7 +384,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 ]; @@ -394,11 +394,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_uIntPtr nIndex = 0; + sal_Bool bReturn = sal_False; ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); @@ -413,7 +413,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 ]; @@ -438,11 +438,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 ); @@ -459,7 +459,7 @@ void SourceTreeLocalizer::WorkOnDirectory( const ByteString &rDirectory ) /*****************************************************************************/ { //printf("Working on Directory %s\n",rDirectory.GetBuffer()); - ULONG nIndex = 0; + sal_uIntPtr nIndex = 0; ByteString sExtension( ExeTable[ nIndex ][ 0 ] ); ByteString sExecutable( ExeTable[ nIndex ][ 1 ] ); ByteString sParameter( ExeTable[ nIndex ][ 2 ] ); @@ -494,7 +494,7 @@ void SourceTreeLocalizer::OnExecuteDirectory( const rtl::OUString &aDirectory ) } /*****************************************************************************/ -BOOL SourceTreeLocalizer::Extract( const ByteString &rDestinationFile ) +sal_Bool SourceTreeLocalizer::Extract( const ByteString &rDestinationFile ) /*****************************************************************************/ { nMode = LOCALIZE_EXTRACT; @@ -502,7 +502,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(); @@ -517,7 +517,7 @@ BOOL SourceTreeLocalizer::Extract( const ByteString &rDestinationFile ) } /*****************************************************************************/ -BOOL SourceTreeLocalizer::MergeSingleFile( +sal_Bool SourceTreeLocalizer::MergeSingleFile( const ByteString &rPrj, const ByteString &rFile, const ByteString &rSDFFile @@ -526,7 +526,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 )); @@ -545,7 +545,7 @@ BOOL SourceTreeLocalizer::MergeSingleFile( ByteString sBCur( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); if( !bQuiet2 ) fprintf( stdout, "##### %s #####\n", sBCur.GetBuffer()); - ULONG nIndex = 0; + sal_uIntPtr nIndex = 0; ByteString sExtension( aEntry.GetExtension(), RTL_TEXTENCODING_ASCII_US ); ByteString sCandidate( ExeTable[ nIndex ][ 0 ] ); @@ -557,18 +557,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; } @@ -611,7 +611,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); @@ -656,14 +656,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; @@ -725,18 +725,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; } } } @@ -755,7 +755,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; @@ -763,7 +763,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(); // aSDF.Close(); @@ -821,7 +821,7 @@ int Error() } /*****************************************************************************/ -BOOL CheckLanguages( ByteString &rLanguages ) +sal_Bool CheckLanguages( ByteString &rLanguages ) /*****************************************************************************/ { ByteString sTmp( rLanguages ); @@ -838,10 +838,10 @@ 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 bQuiet = false; bool bQuiet2 = false; bool bSkipLinks = false; @@ -851,7 +851,7 @@ int _cdecl main( int argc, char *argv[] ) ByteString sOutput; bQuiet2 = true; - bExport = TRUE; + bExport = sal_True; for( int i = 1; i < argc; i++ ) { ByteString sSwitch( argv[ i ] ); @@ -861,7 +861,7 @@ int _cdecl main( int argc, char *argv[] ) nState = STATE_EXPORT; if ( bMerge ) return Error(); - bExport = TRUE; + bExport = sal_True; } else if( sSwitch.Equals( "-Q" )) { bQuiet = true; diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index e15a5c8a28fa..e9ff3233c274 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -50,12 +50,12 @@ ByteString PFormEntrys::Dump(){ 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 ) == '\\' ) { @@ -67,8 +67,8 @@ 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 ) /*****************************************************************************/ { @@ -84,14 +84,14 @@ BOOL PFormEntrys::GetText( ByteString &rReturn, // 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; @@ -101,14 +101,14 @@ 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()); @@ -180,7 +180,7 @@ PFormEntrys *MergeData::InsertEntry( const ByteString &rPForm ) } /*****************************************************************************/ -BOOL MergeData::operator==( ResData *pData ) +sal_Bool MergeData::operator==( ResData *pData ) /*****************************************************************************/ { ByteString sResTyp_upper( pData->sResTyp ); @@ -203,8 +203,8 @@ BOOL MergeData::operator==( ResData *pData ) #define FFORMAT_OLD 0x0002 /*****************************************************************************/ -MergeDataFile::MergeDataFile( const ByteString &rFileName, const ByteString& sFile ,BOOL bErrLog, -// CharSet aCharSet, BOOL bUTF8 , bool bCaseSensitive ) +MergeDataFile::MergeDataFile( const ByteString &rFileName, const ByteString& sFile ,sal_Bool bErrLog, +// CharSet aCharSet, sal_Bool bUTF8 , bool bCaseSensitive ) CharSet aCharSet, bool bCaseSensitive ) /*****************************************************************************/ @@ -400,7 +400,7 @@ void MergeDataFile::InsertEntry( /*****************************************************************************/ { MergeData *pData; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; // uniquify the filename to save memory. ByteStringHashMap::const_iterator fit = aFilenames.find (rInFilename); @@ -423,7 +423,7 @@ void MergeDataFile::InsertEntry( aMap.insert( MergeDataHashMap::value_type( sKey, pData ) ); } - bFound = FALSE; + bFound = sal_False; PFormEntrys *pFEntrys = 0; // search for PFormEntrys diff --git a/l10ntools/source/srciter.cxx b/l10ntools/source/srciter.cxx index e928a244efe6..4e87fda3e079 100644 --- a/l10ntools/source/srciter.cxx +++ b/l10ntools/source/srciter.cxx @@ -40,7 +40,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 ; @@ -103,31 +103,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_uIntPtr 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 c382aaa7272d..13d474e2d59c 100644 --- a/l10ntools/source/tagtest.cxx +++ b/l10ntools/source/tagtest.cxx @@ -42,12 +42,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) @@ -90,14 +90,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; @@ -126,7 +126,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList ) switch ( cDelim ) { case ' ': aState = TC_HAS_TAG_NAME; - bCheckName = TRUE; + bCheckName = sal_True; break; case '/': { @@ -137,12 +137,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; } @@ -156,16 +156,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; } @@ -176,7 +176,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; } @@ -188,10 +188,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; @@ -203,7 +203,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; @@ -224,14 +224,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; @@ -251,13 +251,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; } @@ -269,11 +269,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; } @@ -284,7 +284,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList ) switch ( cDelim ) { case '>': aState = TC_FINISHED; - bCheckEmpty = TRUE; + bCheckEmpty = sal_True; break; default: aState = TC_ERROR; } @@ -293,16 +293,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; } @@ -313,7 +313,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList ) switch ( cDelim ) { case '>': aState = TC_FINISHED; - bCheckEmpty = TRUE; + bCheckEmpty = sal_True; break; default: aState = TC_ERROR; } @@ -321,7 +321,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList ) default: rErrorList.AddError( 99, "Internal error Parsing Tag ", *this ); - bIsBroken = TRUE; + bIsBroken = sal_True; } @@ -330,14 +330,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++ ) { @@ -353,11 +353,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 ) @@ -365,9 +365,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; } @@ -383,23 +383,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" ) ) @@ -415,26 +415,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" )) @@ -443,25 +443,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 ) @@ -485,7 +485,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; } } } @@ -496,7 +496,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; } } } @@ -508,7 +508,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; } } } @@ -516,7 +516,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 @@ -548,23 +548,23 @@ 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 ) { Insert( new ParserError( nErrorNr, aErrorText, rTag ), LIST_APPEND ); } -void ParserMessageList::AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag ) +void ParserMessageList::AddWarning( sal_uInt16 nErrorNr, ByteString aErrorText, const TokenInfo &rTag ) { Insert( new ParserWarning( nErrorNr, aErrorText, rTag ), LIST_APPEND ); } -BOOL ParserMessageList::HasErrors() +sal_Bool ParserMessageList::HasErrors() { - USHORT i; + sal_uInt16 i; for ( i=0 ; i < Count() ; i++ ) if ( GetObject( i )->IsError() ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } struct Tag @@ -669,7 +669,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; @@ -686,9 +686,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 ) @@ -707,7 +707,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++; @@ -725,7 +725,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++; @@ -739,12 +739,12 @@ TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList ) return aResult; } -String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT &rTagStartPos ) +String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, sal_uInt16 &rTagStartPos ) { -// USHORT nStyle1StartPos = aSource.SearchAscii( "<#", nPos ); - 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 nStyle1StartPos = aSource.SearchAscii( "<#", nPos ); + 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; @@ -764,7 +764,7 @@ String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT & /* if ( nStyle1StartPos < nStyle2StartPos && nStyle1StartPos <= nStyle3StartPos ) // <= to make sure our spechial tags are recognized before all others { // test for <# ... > style tokens - USHORT nEndPos = aSource.SearchAscii( ">", nStyle1StartPos ); + sal_uInt16 nEndPos = aSource.SearchAscii( ">", nStyle1StartPos ); if ( nEndPos == STRING_NOTFOUND ) { // Token is incomplete. Skip start and search for better ones nPos = nStyle1StartPos +2; @@ -776,7 +776,7 @@ String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT & } else*/ 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; @@ -788,8 +788,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); @@ -816,7 +816,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++; @@ -841,8 +841,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; @@ -977,11 +977,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(); } } @@ -999,11 +999,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(); } } @@ -1311,12 +1311,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 ) @@ -1326,7 +1326,7 @@ BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rExpec || aCurrentToken.nId != TAG_COMMONEND ) { aTag = aParser.GetNextToken( *pErrorList ); - return TRUE; + return sal_True; } } @@ -1347,10 +1347,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); @@ -1359,7 +1359,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 ) @@ -1379,15 +1379,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 ); @@ -1404,7 +1404,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 ) @@ -1416,12 +1416,12 @@ 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 ) { - ULONG i=0,j=0; + sal_uIntPtr i=0,j=0; // Clean old Warnings while ( aCompareWarningList.Count() ) { @@ -1458,39 +1458,39 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTa if ( aReference.GetObject( i ).IsDone() ) continue; - BOOL bTagFound = FALSE; + sal_Bool bTagFound = sal_False; for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ ) { if ( aTestee.GetObject( j ).IsDone() ) continue; - if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), FALSE, aCompareWarningList ) ) + if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), sal_False, aCompareWarningList ) ) { aReference.GetObject( i ).SetDone(); aTestee.GetObject( 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.Count() ; i++ ) if ( !aReference.GetObject( i ).IsDone() ) nTagCount++; if ( nTagCount > 1 ) - bCanFix = FALSE; + bCanFix = sal_False; nTagCount = 0; for ( i=0 ; i < aTestee.Count() ; i++ ) if ( !aTestee.GetObject( i ).IsDone() ) nTagCount++; if ( nTagCount > 1 ) - bCanFix = FALSE; + bCanFix = sal_False; } // generate errors for tags that have differing attributes @@ -1499,17 +1499,17 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTa if ( aReference.GetObject( i ).IsDone() ) continue; - BOOL bTagFound = FALSE; + sal_Bool bTagFound = sal_False; for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ ) { if ( aTestee.GetObject( j ).IsDone() ) continue; - if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), TRUE, aCompareWarningList, bCanFix && bFixTags ) ) + if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), sal_True, aCompareWarningList, bCanFix && bFixTags ) ) { aReference.GetObject( i ).SetDone(); aTestee.GetObject( j ).SetDone(); - bTagFound = TRUE; + bTagFound = sal_True; } } } @@ -1531,10 +1531,10 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTa } for ( i=0 ; i < aReference.Count() ; i++ ) - aReference.GetObject( i ).SetDone( FALSE ); + aReference.GetObject( i ).SetDone( sal_False ); for ( i=0 ; i < aTestee.Count() ; i++ ) - aTestee.GetObject( i ).SetDone( FALSE ); + aTestee.GetObject( i ).SetDone( sal_False ); } void LingTest::CheckReference( GSILine *aReference ) @@ -1542,7 +1542,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() ); @@ -1553,14 +1553,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.Count()-1 ; i>=0 ; i-- ) { if ( aTesteeTokens.GetObject( i ).HasBeenFixed() ) { - bFixesDone = TRUE; + bFixesDone = sal_True; aFixedTestee.Replace( aTesteeTokens.GetObject( i ).nPos, aTesteeTokens.GetObject( i ).aTokenString.Len(), aTesteeTokens.GetObject( i ).MakeTag() ); } } diff --git a/l10ntools/source/wtranode.cxx b/l10ntools/source/wtranode.cxx index 47fadc5d17f7..1f51fea49d02 100644 --- a/l10ntools/source/wtranode.cxx +++ b/l10ntools/source/wtranode.cxx @@ -79,11 +79,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 28adf7c7142b..efd60ad48442 100644 --- a/l10ntools/source/wtratree.cxx +++ b/l10ntools/source/wtratree.cxx @@ -255,10 +255,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. @@ -330,11 +330,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) @@ -365,7 +365,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 54b92fb3c1c2..0f406ca20b25 100644 --- a/l10ntools/source/xgfconv.cxx +++ b/l10ntools/source/xgfconv.cxx @@ -36,14 +36,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 ); @@ -55,7 +55,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 14b5944488a9..a92eed15c9fa 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -96,7 +96,7 @@ XMLParentNode::XMLParentNode( const XMLParentNode& obj) if( obj.pChildList ){ pChildList=new XMLChildNodeList(); XMLChildNode* pNode = NULL; - for ( ULONG i = 0; i < obj.pChildList->Count(); i++ ){ + for ( sal_uIntPtr i = 0; i < obj.pChildList->Count(); i++ ){ pNode = obj.pChildList->GetObject( i ); if( pNode != NULL){ switch(pNode->GetNodeType()){ @@ -126,7 +126,7 @@ XMLParentNode& XMLParentNode::operator=(const XMLParentNode& obj){ } if( obj.pChildList ){ pChildList=new XMLChildNodeList(); - for ( ULONG i = 0; i < obj.pChildList->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < obj.pChildList->Count(); i++ ) AddChild( obj.pChildList->GetObject( i ) ); }else pChildList = NULL; @@ -160,7 +160,7 @@ int XMLParentNode::GetPosition( ByteString id ){ static const ByteString sDeStr = ByteString(String::CreateFromAscii(GERMAN_ISO2).ToLowerAscii() , RTL_TEXTENCODING_ASCII_US ).ToLowerAscii(); if ( pChildList ){ - for ( ULONG i = 0; i < pChildList->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pChildList->Count(); i++ ) { XMLChildNode *pChild = pChildList->GetObject( i ); if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ a = static_cast(pChild); @@ -188,7 +188,7 @@ int XMLParentNode::RemoveChild( XMLElement *pRefElement ) { XMLElement* a; if ( pChildList ){ - for ( ULONG i = 0; i < pChildList->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pChildList->Count(); i++ ) { XMLChildNode *pChild = pChildList->GetObject( i ); if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ a = static_cast(pChild); @@ -218,7 +218,7 @@ int XMLParentNode::RemoveChild( XMLElement *pRefElement ) void XMLParentNode::RemoveAndDeleteAllChilds(){ /*****************************************************************************/ if ( pChildList ) { - for ( ULONG i = 0; i < pChildList->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < pChildList->Count(); i++ ) delete pChildList->GetObject( i ); pChildList->Clear(); } @@ -228,7 +228,7 @@ void XMLParentNode::RemoveAndDeleteAllChilds(){ XMLElement *XMLParentNode::GetChildElement( XMLElement *pRefElement ) /*****************************************************************************/ { - for ( ULONG i = 0; i < pChildList->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pChildList->Count(); i++ ) { XMLChildNode *pChild = pChildList->GetObject( i ); if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ) if ((( XMLElement * ) pChild )->GetName() == @@ -238,14 +238,14 @@ XMLElement *XMLParentNode::GetChildElement( XMLElement *pRefElement ) if ( !pList ) return ( XMLElement * ) pChild; - BOOL bMatch = FALSE; - for ( ULONG j = 0; j < pList->Count() && bMatch; j++ ) { + sal_Bool bMatch = sal_False; + for ( sal_uIntPtr j = 0; j < pList->Count() && bMatch; j++ ) { XMLAttribute *pAttribute = pList->GetObject( j ); XMLAttribute *pCandidate = (( XMLElement * ) pChild )->GetAttribute( *pAttribute ); if ( !pCandidate || !pAttribute->IsEqual( *pCandidate )) - bMatch = FALSE; + bMatch = sal_False; } if ( bMatch ) return ( XMLElement * ) pChild; @@ -259,14 +259,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 ) /*****************************************************************************/ { @@ -323,7 +323,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; @@ -334,7 +334,7 @@ BOOL XMLFile::Write( ofstream &rStream , XMLNode *pCur ) switch( pCur->GetNodeType()) { case XML_NODE_TYPE_FILE: { if( GetChildList()) - for ( ULONG i = 0; i < GetChildList()->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < GetChildList()->Count(); i++ ) Write( rStream, GetChildList()->GetObject( i )); } break; @@ -343,7 +343,7 @@ BOOL XMLFile::Write( ofstream &rStream , XMLNode *pCur ) rStream << "<"; WriteString( rStream, pElement->GetName()); if ( pElement->GetAttributeList()) - for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ) { + for ( sal_uIntPtr j = 0; j < pElement->GetAttributeList()->Count(); j++ ) { rStream << " "; String sData(*pElement->GetAttributeList()->GetObject( j )); xmlutil.QuotHTML( sData ); @@ -358,7 +358,7 @@ BOOL XMLFile::Write( ofstream &rStream , XMLNode *pCur ) rStream << "/>"; else { rStream << ">"; - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) + for ( sal_uIntPtr k = 0; k < pElement->GetChildList()->Count(); k++ ) Write( rStream, pElement->GetChildList()->GetObject( k )); rStream << "GetName()); @@ -387,11 +387,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 ) @@ -400,7 +400,7 @@ void XMLFile::Print( XMLNode *pCur, USHORT nLevel ) switch( pCur->GetNodeType()) { case XML_NODE_TYPE_FILE: { if( GetChildList()) - for ( ULONG i = 0; i < GetChildList()->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < GetChildList()->Count(); i++ ) Print( GetChildList()->GetObject( i )); } break; @@ -409,7 +409,7 @@ void XMLFile::Print( XMLNode *pCur, USHORT nLevel ) fprintf( stdout, "<%s", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); if ( pElement->GetAttributeList()) - for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ + for ( sal_uIntPtr j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ ByteString aAttrName( *pElement->GetAttributeList()->GetObject( j ), RTL_TEXTENCODING_UTF8 ); if( !aAttrName.EqualsIgnoreCaseAscii( XML_LANG ) ) { fprintf( stdout, " %s=\"%s\"", @@ -422,7 +422,7 @@ void XMLFile::Print( XMLNode *pCur, USHORT nLevel ) fprintf( stdout, "/>" ); else { fprintf( stdout, ">" ); - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) + for ( sal_uIntPtr k = 0; k < pElement->GetChildList()->Count(); k++ ) Print( pElement->GetChildList()->GetObject( k ), nLevel + 1 ); fprintf( stdout, "", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); } @@ -469,14 +469,14 @@ XMLFile::XMLFile( const String &rFileName ) // the file name, empty if created f XMLStrings ( NULL ) { -// nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("bookmark_value"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); - 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_value"),RTL_TEXTENCODING_ASCII_US) , sal_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 ) @@ -517,7 +517,7 @@ void XMLFile::InsertL10NElement( XMLElement* pElement ){ LangHashMap* elem; if( pElement->GetAttributeList() != NULL ){ - for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ + for ( sal_uIntPtr j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ tmpStr=ByteString( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); if( tmpStr.CompareTo(ID)==COMPARE_EQUAL ){ // Get the "id" Attribute id = ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); @@ -633,7 +633,7 @@ void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) case XML_NODE_TYPE_FILE: { XMLParentNode* pElement; if( GetChildList()){ - for ( ULONG i = 0; i < GetChildList()->Count(); i++ ){ + for ( sal_uIntPtr i = 0; i < GetChildList()->Count(); i++ ){ pElement = (XMLParentNode*) GetChildList()->GetObject( i ); if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) SearchL10NElements( pElement , i); } @@ -645,7 +645,7 @@ void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) ByteString sName(pElement->GetName(),RTL_TEXTENCODING_ASCII_US); ByteString language,tmpStrVal,oldref; if ( pElement->GetAttributeList()){ - for ( ULONG j = 0 , cnt = pElement->GetAttributeList()->Count(); j < cnt && bInsert; j++ ){ + for ( sal_uIntPtr j = 0 , cnt = pElement->GetAttributeList()->Count(); j < cnt && bInsert; j++ ){ const ByteString tmpStr( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); if( tmpStr.CompareTo(THEID)==COMPARE_EQUAL ){ // Get the "id" Attribute tmpStrVal=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); @@ -670,7 +670,7 @@ void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) if ( bInsert && ( nodes_localize.find( sName.ToLowerAscii() ) != nodes_localize.end() ) ) InsertL10NElement(pElement); else if ( bInsert && pElement->GetChildList() ){ - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) + for ( sal_uIntPtr k = 0; k < pElement->GetChildList()->Count(); k++ ) SearchL10NElements( (XMLParentNode*) pElement->GetChildList()->GetObject( k ) , k); } } @@ -707,7 +707,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) case XML_NODE_TYPE_FILE: { XMLParentNode* pElement; if( GetChildList()){ - for ( ULONG i = 0; i < GetChildList()->Count(); i++ ){ + for ( sal_uIntPtr i = 0; i < GetChildList()->Count(); i++ ){ pElement = (XMLParentNode*) GetChildList()->GetObject( i ); if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) CheckExportStatus( pElement );//, i); } @@ -719,7 +719,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) ByteString sName(pElement->GetName(),RTL_TEXTENCODING_ASCII_US); if( sName.EqualsIgnoreCaseAscii( TOPIC ) ){ if ( pElement->GetAttributeList()){ - for ( ULONG j = 0 , cnt = pElement->GetAttributeList()->Count(); j < cnt && bInsert; j++ ){ + for ( sal_uIntPtr j = 0 , cnt = pElement->GetAttributeList()->Count(); j < cnt && bInsert; j++ ){ const ByteString tmpStr( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); if( tmpStr.EqualsIgnoreCaseAscii( STATUS ) ){ ByteString tmpStrVal=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); @@ -733,7 +733,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) } } else if ( pElement->GetChildList() ){ - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) + for ( sal_uIntPtr k = 0; k < pElement->GetChildList()->Count(); k++ ) CheckExportStatus( (XMLParentNode*) pElement->GetChildList()->GetObject( k ) );//, k); } } @@ -744,7 +744,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) } /*****************************************************************************/ -USHORT XMLElement::GetNodeType() +sal_uInt16 XMLElement::GetNodeType() /*****************************************************************************/ { return XML_NODE_TYPE_ELEMENT; @@ -768,7 +768,7 @@ XMLElement::XMLElement(const XMLElement& obj) { if ( obj.pAttributes ){ pAttributes = new XMLAttributeList(); - for ( ULONG i = 0; i < obj.pAttributes->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < obj.pAttributes->Count(); i++ ) AddAttribute( *obj.pAttributes->GetObject( i ) , obj.pAttributes->GetObject( i )->GetValue() ); } } @@ -788,13 +788,13 @@ XMLElement& XMLElement::operator=(const XMLElement& obj){ nPos =obj.nPos; if ( pAttributes ){ - for ( ULONG i = 0; i < pAttributes->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < pAttributes->Count(); i++ ) delete pAttributes->GetObject( i ); delete pAttributes; } if ( obj.pAttributes ){ pAttributes =new XMLAttributeList(); - for ( ULONG i = 0; i < obj.pAttributes->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < obj.pAttributes->Count(); i++ ) AddAttribute( *obj.pAttributes->GetObject( i ) , obj.pAttributes->GetObject( i )->GetValue() ); } } @@ -816,7 +816,7 @@ void XMLElement::ChangeLanguageTag( const String &rValue ){ static const String rName = String::CreateFromAscii("xml-lang"); SetLanguageId( ByteString(rValue,RTL_TEXTENCODING_UTF8) ); if ( pAttributes ){ - for ( ULONG i = 0; i < pAttributes->Count(); i++ ){ + for ( sal_uIntPtr i = 0; i < pAttributes->Count(); i++ ){ if ( *pAttributes->GetObject( i ) == rName ){ pAttributes->GetObject( i )->setValue(rValue); } @@ -827,7 +827,7 @@ void XMLElement::ChangeLanguageTag( const String &rValue ){ XMLChildNodeList* pCList = GetChildList(); if( pCList != NULL ){ - for ( ULONG i = 0; i < pCList->Count(); i++ ){ + for ( sal_uIntPtr i = 0; i < pCList->Count(); i++ ){ pNode = pCList->GetObject( i ); if( pNode != NULL && pNode->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ pElem = static_cast< XMLElement* >(pNode); @@ -845,7 +845,7 @@ XMLAttribute *XMLElement::GetAttribute( const String &rName ) /*****************************************************************************/ { if ( pAttributes ) - for ( ULONG i = 0; i < pAttributes->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < pAttributes->Count(); i++ ) if ( *pAttributes->GetObject( i ) == rName ) return pAttributes->GetObject( i ); @@ -857,7 +857,7 @@ XMLElement::~XMLElement() /*****************************************************************************/ { if ( pAttributes ) { - for ( ULONG i = 0; i < pAttributes->Count(); i++ ) + for ( sal_uIntPtr i = 0; i < pAttributes->Count(); i++ ) delete pAttributes->GetObject( i ); delete pAttributes; @@ -906,7 +906,7 @@ void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement if ( pElement->GetAttributeList()){ if ( pElement->GetChildList()){ XMLChildNode* tmp=NULL; - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ){ + for ( sal_uIntPtr k = 0; k < pElement->GetChildList()->Count(); k++ ){ tmp=pElement->GetChildList()->GetObject( k ); Print( tmp, buffer , false); } @@ -923,7 +923,7 @@ void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement buffer.append( OUString::createFromAscii("\\<") ); buffer.append( pElement->GetName() ); if ( pElement->GetAttributeList()){ - for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ + for ( sal_uIntPtr j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ OUString aAttrName( *pElement->GetAttributeList()->GetObject( j ) ); if( !aAttrName.equalsIgnoreAsciiCase( XML_LANG ) ) { @@ -941,7 +941,7 @@ void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement else { buffer.append( OUString::createFromAscii("\\>") ); XMLChildNode* tmp=NULL; - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ){ + for ( sal_uIntPtr k = 0; k < pElement->GetChildList()->Count(); k++ ){ tmp=pElement->GetChildList()->GetObject( k ); Print( tmp, buffer , false); } @@ -1006,7 +1006,7 @@ void XMLData::AddData( const String &rData) { } /*****************************************************************************/ -USHORT XMLData::GetNodeType() +sal_uInt16 XMLData::GetNodeType() /*****************************************************************************/ { return XML_NODE_TYPE_DATA; @@ -1017,7 +1017,7 @@ USHORT XMLData::GetNodeType() // /*****************************************************************************/ -USHORT XMLComment::GetNodeType() +sal_uInt16 XMLComment::GetNodeType() /*****************************************************************************/ { return XML_NODE_TYPE_COMMENT; @@ -1043,7 +1043,7 @@ XMLComment& XMLComment::operator=(const XMLComment& obj){ // /*****************************************************************************/ -USHORT XMLDefault::GetNodeType() +sal_uInt16 XMLDefault::GetNodeType() /*****************************************************************************/ { return XML_NODE_TYPE_DEFAULT; @@ -1241,7 +1241,7 @@ XMLFile *SimpleXMLParser::Execute( SvMemoryStream *pStream ) pCurNode = pXMLFile; pCurData = NULL; - ULONG nPos = pStream->Tell(); + sal_uIntPtr nPos = pStream->Tell(); pStream->Seek( STREAM_SEEK_TO_END ); aErrorInformation.eCode = XML_ERROR_NONE; @@ -1256,7 +1256,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 ); @@ -1326,7 +1326,7 @@ void XMLUtil::QuotHTML( String &rString ) static const String QAMP(String::CreateFromAscii("&")); 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 149fd560fe3b..24d4fbe5985a 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -57,10 +57,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; bool bQuiet; ByteString sPrj; ByteString sPrjRoot; @@ -78,18 +78,18 @@ 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 = ""; bQuiet = false; - 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,15 +113,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; @@ -136,7 +136,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: { @@ -153,7 +153,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: { @@ -166,7 +166,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; @@ -300,8 +300,8 @@ int GetError() /*****************************************************************************/ XRMResParser::XRMResParser() /*****************************************************************************/ - : bError( FALSE ), - bText( FALSE ) + : bError( sal_False ), + bText( sal_False ) { aLanguages = Export::GetLanguages(); } @@ -359,7 +359,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, '.' ); @@ -377,7 +377,7 @@ int XRMResParser::Execute( int nToken, char * pToken ) EndOfText( sCurrentOpenTag, sCurrentCloseTag ); sLID = sNewLID; } - bText = TRUE; + bText = sal_True; sCurrentText = ""; sCurrentOpenTag = rToken; Output( rToken ); @@ -391,7 +391,7 @@ int XRMResParser::Execute( int nToken, char * pToken ) ByteString sLang = GetAttribute( sCurrentOpenTag, "xml:lang" ); if( sLang.EqualsIgnoreCaseAscii("de") ){ - ULONG nLen = 0; + sal_uIntPtr nLen = 0; while ( sCurrentText.Len() != nLen ) { nLen = sCurrentText.Len(); @@ -407,7 +407,7 @@ int XRMResParser::Execute( int nToken, char * pToken ) //fprintf( stdout, "%s %s\n", sGID.GetBuffer(), sLID.GetBuffer()); //fprintf( stdout, "%s\n\n", sCurrentText.GetBuffer()); - bText = FALSE; + bText = sal_False; } } break; @@ -444,7 +444,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 ); @@ -717,7 +717,7 @@ void XRMResMerge::EndOfText( // if ( Export::isAllowed( sCur ) && //>>>>>>> 1.17 ( pEntrys->GetText( - sContent, STRING_TYP_TEXT, sCur, TRUE )) && + sContent, STRING_TYP_TEXT, sCur, sal_True )) && ( sContent != "-" ) && ( sContent.Len())) { ByteString sText( sContent ); @@ -737,7 +737,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/rsc/inc/rscall.h b/rsc/inc/rscall.h index e556758054b8..4a1b20663904 100644 --- a/rsc/inc/rscall.h +++ b/rsc/inc/rscall.h @@ -95,7 +95,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 e47c11e03777..6a5ebb934dc2 100644 --- a/rsc/inc/rscarray.hxx +++ b/rsc/inc/rscarray.hxx @@ -80,9 +80,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, @@ -92,10 +92,10 @@ public: // Gibt die Groesse der Klasse in Bytes sal_uInt32 Size(){ return( nSize ); }; - BOOL IsConsistent( const RSCINST & rInst, RscInconsList * pList ); + sal_Bool IsConsistent( const RSCINST & rInst, RscInconsList * pList ); 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, @@ -103,7 +103,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 * ); }; @@ -121,7 +121,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 67cc59628fd0..d0a66cd2b301 100644 --- a/rsc/inc/rscclass.hxx +++ b/rsc/inc/rscclass.hxx @@ -37,7 +37,7 @@ class RscClass : public RscTop { protected: struct RscClassInst{ - ULONG nVarDflt; + sal_uIntPtr nVarDflt; }; struct VARTYPE_STRUCT { Atom nVarName; // Variablenname @@ -54,13 +54,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 ); @@ -76,29 +76,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, RscInconsList * pList ); + sal_Bool IsConsistent( const RSCINST & rInst, RscInconsList * pList ); 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, @@ -111,10 +111,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 @@ -123,7 +123,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 34bc38350399..a1eb7affc23d 100644 --- a/rsc/inc/rscclobj.hxx +++ b/rsc/inc/rscclobj.hxx @@ -51,23 +51,23 @@ DECLARE_LIST( RscInconsList, RscInconsistent * ) class ObjNode : public IdNode{ RscId aRscId; // Id der Resource CLASS_DATA pRscObj;// pointer to a resourceobject - ULONG lFileKey;// Dateischluessel + sal_uIntPtr 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_uIntPtr lKey ); + ObjNode * DelObjNode( RscTop * pClass, sal_uIntPtr lFileKey ); sal_uInt32 GetId() const; RscId GetRscId(){ return( aRscId ); } - ULONG GetFileKey(){ return lFileKey; }; + sal_uIntPtr 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 ) ); } @@ -75,7 +75,7 @@ public: // get the Object from this Node return( pRscObj ); } - BOOL IsConsistent( RscInconsList * pList = NULL ); + sal_Bool IsConsistent( RscInconsList * pList = NULL ); }; /******************* R e f N o d e ***************************************/ @@ -94,11 +94,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 70612310fbab..a48ec3c05ab3 100644 --- a/rsc/inc/rscconst.hxx +++ b/rsc/inc/rscconst.hxx @@ -38,7 +38,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 @@ -48,10 +48,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, @@ -62,34 +62,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 49d2600d91df..668a40e0508e 100644 --- a/rsc/inc/rsccont.hxx +++ b/rsc/inc/rsccont.hxx @@ -41,7 +41,7 @@ struct ENTRY_STRUCT { struct RscBaseContInst { sal_uInt32 nEntries; ENTRY_STRUCT * pEntries; - BOOL bDflt; + sal_Bool bDflt; }; class RscBaseCont : public RscTop @@ -49,7 +49,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 @@ -60,13 +60,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 ) @@ -74,7 +74,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, @@ -89,19 +89,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, RscInconsList * pList ); + sal_Bool IsConsistent( const RSCINST & rInst, RscInconsList * pList ); 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 ); @@ -110,7 +110,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, @@ -123,7 +123,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 * ); }; @@ -133,9 +133,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 * ); }; @@ -145,9 +145,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 1d5af35de9ff..c9cc02cfaa40 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -79,7 +79,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_uIntPtr 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 @@ -146,8 +146,8 @@ class RscTypCont 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(); @@ -266,7 +266,7 @@ class RscTypCont void InsWinBit( RscTop * pClass, const ByteString & rName, Atom nVal ); - void WriteInc( FILE * fOutput, ULONG lKey ); + void WriteInc( FILE * fOutput, sal_uIntPtr lKey ); public: RscBool aBool; @@ -296,7 +296,7 @@ public: RscNameTable aNmTb; // Tabelle fuer Namen RscFileTab aFileTab; // Tabelle der Dateinamen sal_uInt32 nFlags; - std::map aIdTranslator; //Ordnet Resourcetypen und Id's einen Id zu + std::map 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 ); @@ -304,14 +304,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; } @@ -337,23 +337,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_uIntPtr 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_uIntPtr nFileIndex, + CharSet nCharSet, sal_Bool bName = sal_True ); + ERRTYPE WriteHxx( FILE * fOutput, sal_uIntPtr nFileKey); + ERRTYPE WriteCxx( FILE * fOutput, sal_uIntPtr nFileKey, const ByteString & rHxxName ); void WriteSyntax( FILE * fOutput ); void WriteRcCtor( FILE * fOutput ); - void FillNameIdList( REResourceList * pList, ULONG lFileKey ); - BOOL MakeConsistent( RscInconsList * pList ); + void FillNameIdList( REResourceList * pList, sal_uIntPtr lFileKey ); + sal_Bool MakeConsistent( RscInconsList * pList ); sal_uInt32 PutTranslatorKey( sal_uInt64 nKey ); - void IncFilePos( ULONG nOffset ){ nFilePos += nOffset; } + void IncFilePos( sal_uIntPtr nOffset ){ nFilePos += nOffset; } }; #endif diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx index a21b03685325..68dc47a47419 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_uIntPtr 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_uIntPtr lFileKey, const ByteString & rDefName, + sal_Int32 lDefId ); + RscDefine( sal_uIntPtr 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_uIntPtr GetFileKey() const { return lFileKey; } + sal_Bool Evaluate(); + sal_Int32 GetNumber() const { return lId; } ByteString GetMacro(); }; @@ -160,14 +160,14 @@ friend class RscFile; friend class RscFileTab; private: // pExpression wird auf jedenfall Eigentum der Liste - RscDefine * New( ULONG lFileKey, const ByteString & rDefName, - INT32 lDefId, ULONG lPos ); - RscDefine * New( ULONG lFileKey, const ByteString & rDefName, - RscExpression * pExpression, ULONG lPos ); - BOOL Befor( const RscDefine * pFree, const RscDefine * pDepend ); - BOOL Remove( RscDefine * pDef ); - BOOL Remove( ULONG nIndex ); - BOOL Remove(); + RscDefine * New( sal_uIntPtr lFileKey, const ByteString & rDefName, + sal_Int32 lDefId, sal_uIntPtr lPos ); + RscDefine * New( sal_uIntPtr lFileKey, const ByteString & rDefName, + RscExpression * pExpression, sal_uIntPtr lPos ); + sal_Bool Befor( const RscDefine * pFree, const RscDefine * pDepend ); + sal_Bool Remove( RscDefine * pDef ); + sal_Bool Remove( sal_uIntPtr nIndex ); + sal_Bool Remove(); public: void WriteAll( FILE * fOutput ); }; @@ -182,16 +182,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_uIntPtr lKey; public: - RscDepend( ULONG lIncKey ){ lKey = lIncKey; }; - ULONG GetFileKey(){ return lKey; } + RscDepend( sal_uIntPtr lIncKey ){ lKey = lIncKey; }; + sal_uIntPtr GetFileKey(){ return lKey; } }; DECLARE_LIST( RscDependList, RscDepend * ) @@ -199,22 +199,22 @@ DECLARE_LIST( RscDependList, RscDepend * ) class RscFile : public RscDependList { 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 RscFile(); ~RscFile(); - BOOL InsertDependFile( ULONG lDepFile, ULONG lPos ); - void RemoveDependFile( ULONG lDepFile ); - BOOL Depend( ULONG lDepend, ULONG lFree ); - void SetIncFlag(){ bIncFile = TRUE; }; - BOOL IsIncFile(){ return bIncFile; }; + sal_Bool InsertDependFile( sal_uIntPtr lDepFile, sal_uIntPtr lPos ); + void RemoveDependFile( sal_uIntPtr lDepFile ); + sal_Bool Depend( sal_uIntPtr lDepend, sal_uIntPtr lFree ); + void SetIncFlag(){ bIncFile = sal_True; }; + sal_Bool IsIncFile(){ return bIncFile; }; }; DECLARE_UNIQUEINDEX( RscSubFileTab, RscFile * ) @@ -223,11 +223,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 ); @@ -235,40 +235,40 @@ public: class RscFileTab : public RscSubFileTab { RscDefTree aDefTree; - ULONG Find( const ByteString & rName ); + sal_uIntPtr 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_uIntPtr lKey, const ByteString & ); - BOOL Depend( ULONG lDepend, ULONG lFree ); - BOOL TestDef( ULONG lFileKey, ULONG lPos, + sal_Bool Depend( sal_uIntPtr lDepend, sal_uIntPtr lFree ); + sal_Bool TestDef( sal_uIntPtr lFileKey, sal_uIntPtr lPos, const RscDefine * pDefDec ); - BOOL TestDef( ULONG lFileKey, ULONG lPos, + sal_Bool TestDef( sal_uIntPtr lFileKey, sal_uIntPtr 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_uIntPtr lKey, const ByteString & rDefName, + sal_Int32 lId, sal_uIntPtr lPos ); + RscDefine * NewDef( sal_uIntPtr lKey, const ByteString & rDefName, + RscExpression *, sal_uIntPtr 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_uIntPtr lKey ); + void DeleteFile( sal_uIntPtr lKey ); + sal_uIntPtr NewCodeFile( const ByteString & rName ); + sal_uIntPtr NewIncFile( const ByteString & rName, const ByteString & rPath ); + RscFile * GetFile( sal_uIntPtr lFileKey ){ return Get( lFileKey ); } }; #endif // _RSCDEF_HXX diff --git a/rsc/inc/rscerror.h b/rsc/inc/rscerror.h index f3a4428127f3..41f012040a0c 100644 --- a/rsc/inc/rscerror.h +++ b/rsc/inc/rscerror.h @@ -105,9 +105,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 d517e0e0d2b3..2c36fdde6221 100644 --- a/rsc/inc/rscflag.hxx +++ b/rsc/inc/rscflag.hxx @@ -41,30 +41,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 ***********************************/ @@ -76,26 +76,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 6cdfac1173e7..5e21d31ea88c 100644 --- a/rsc/inc/rscinst.hxx +++ b/rsc/inc/rscinst.hxx @@ -59,7 +59,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 ); @@ -75,17 +75,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 ); @@ -93,17 +93,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 ); @@ -148,62 +148,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_uIntPtr lKey ); - ULONG AddSrcFile( const ByteString & rFileName ); - ULONG AddHrcFile( const ByteString & rFileName ); + sal_uIntPtr AddSrcFile( const ByteString & rFileName ); + sal_uIntPtr 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_uIntPtr lFileKey ); + void RemoveFile( sal_uIntPtr lKey ); // Suche ueber alle DEFINES RscDefine * FindDef( const ByteString & rName ); - ULONG GetFileKey( const ByteString & rFileName ); + sal_uIntPtr GetFileKey( const ByteString & rFileName ); }; class RscHrc { protected: - ULONG lFileKey; // Index der Instanz + sal_uIntPtr lFileKey; // Index der Instanz RscDataBase * pDataBase;// Datenbasis public: // Kompilerinstanz erzeugen - RscHrc( RscDataBase * pDBase, ULONG lKey ); + RscHrc( RscDataBase * pDBase, sal_uIntPtr lKey ); ~RscHrc(); // Daten von Datei uebernehmen ERRTYPE ReadFile(); - ULONG GetFileKey() const { return lFileKey; } + sal_uIntPtr 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_uIntPtr lKey, sal_uIntPtr 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_uIntPtr lPos ); ERRTYPE NewDef( const ByteString & rMacroName, const ByteString & rMacro, - ULONG lPos ); - ERRTYPE ChangeDef( const ByteString & rMacroName, INT32 lValue ); + sal_uIntPtr 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 ); @@ -220,7 +220,7 @@ public: class RscSrc : public RscHrc { public: // Kompilerinstanz erzeugen - RscSrc( RscDataBase * pDBase, ULONG lKey ); + RscSrc( RscDataBase * pDBase, sal_uIntPtr lKey ); ~RscSrc(); diff --git a/rsc/inc/rsckey.hxx b/rsc/inc/rsckey.hxx index 717be1009154..221512e73eaf 100644 --- a/rsc/inc/rsckey.hxx +++ b/rsc/inc/rsckey.hxx @@ -39,13 +39,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 ); @@ -53,8 +53,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 89e4bfda2402..942205c5671e 100644 --- a/rsc/inc/rsclst.hxx +++ b/rsc/inc/rsclst.hxx @@ -43,14 +43,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; } @@ -59,9 +59,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 b8c0e43031ee..43c2b9720958 100644 --- a/rsc/inc/rscmgr.hxx +++ b/rsc/inc/rscmgr.hxx @@ -37,8 +37,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 ); @@ -46,10 +46,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, @@ -60,9 +60,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, @@ -71,7 +71,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, RscInconsList * pList = NULL ); 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 989ec924550c..0f3a3f8c1ad1 100644 --- a/rsc/inc/rscpar.hxx +++ b/rsc/inc/rscpar.hxx @@ -41,10 +41,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_uIntPtr lFileIndex; // Index auf Eingabedatei + sal_uIntPtr lSrcIndex; // Index auf Basisdatei FILE * fInputFile; // Eingabedatei char * pInput; // Lesepuffer sal_uInt32 nInputBufLen; // Laenge des Lesepuffers @@ -54,20 +54,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_uIntPtr lIndexSrc, + sal_uIntPtr lFileIndex, FILE * fFile ); + RscFileInst( RscTypCont * pTC, sal_uIntPtr lIndexSrc, + sal_uIntPtr 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_uIntPtr lFIndex ) { lFileIndex = lFIndex; } + sal_uIntPtr GetFileIndex() { return( lFileIndex ); } + sal_uIntPtr 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 96559037e51f..c23b2b97e715 100644 --- a/rsc/inc/rscrange.hxx +++ b/rsc/inc/rscrange.hxx @@ -38,36 +38,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 * ); }; @@ -78,37 +78,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 * ); @@ -121,7 +121,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 ***********************************/ @@ -129,41 +129,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, RscInconsList * pList ); + RscTypCont * pTC, sal_uInt32, sal_Bool bExtra ); + sal_Bool IsConsistent( const RSCINST & rInst, RscInconsList * pList ); void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, const char * ); @@ -176,14 +176,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 ); @@ -196,14 +196,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 c2b0a70a1b66..1bf311b4eb76 100644 --- a/rsc/inc/rscrsc.hxx +++ b/rsc/inc/rscrsc.hxx @@ -129,8 +129,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_uIntPtr lFileKey ); + ERRTYPE ParseOneFile( sal_uIntPtr 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 6d32a437b09e..e485a023d933 100644 --- a/rsc/inc/rscstr.hxx +++ b/rsc/inc/rscstr.hxx @@ -38,7 +38,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; @@ -50,20 +50,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 * ); @@ -71,7 +71,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 3a3eff653cd7..a119ab7f1431 100644 --- a/rsc/inc/rsctools.hxx +++ b/rsc/inc/rsctools.hxx @@ -48,8 +48,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, @@ -67,7 +67,7 @@ DECLARE_LIST( RscStrList, ByteString * ) 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 ************************************/ @@ -92,7 +92,7 @@ public: class RscWriteRc { sal_uInt32 nLen; - BOOL bSwap; + sal_Bool bSwap; RSCBYTEORDER_TYPE nByteOrder; char * pMem; char * GetPointer( sal_uInt32 nSize ); @@ -178,7 +178,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 { @@ -200,7 +200,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 85aa06614574..2e23d5ef410a 100644 --- a/rsc/inc/rsctop.hxx +++ b/rsc/inc/rsctop.hxx @@ -70,8 +70,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() ); } @@ -114,7 +114,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 ); @@ -129,7 +129,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 ); @@ -161,46 +161,46 @@ 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, RscInconsList * pList = NULL ); // 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 0ee0f3b5056f..30f56da2cdd7 100644 --- a/rsc/inc/rsctree.hxx +++ b/rsc/inc/rsctree.hxx @@ -70,15 +70,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 19677171dcb2..0bcc1d03fd07 100644 --- a/rsc/inc/vclrsc.hxx +++ b/rsc/inc/vclrsc.hxx @@ -163,8 +163,8 @@ typedef sal_Int64 WinBits; // -------------- // from vcl/inc/help.hxx -#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF) -#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE) +#define OOO_HELP_INDEX ((sal_uIntPtr)0xFFFFFFFF) +#define OOO_HELP_HELPONHELP ((sal_uIntPtr)0xFFFFFFFE) // -------------- // - FieldTypes - diff --git a/rsc/source/misc/rscdbl.cxx b/rsc/source/misc/rscdbl.cxx index 591f6b3fd4f6..868e38b71d69 100644 --- a/rsc/source/misc/rscdbl.cxx +++ b/rsc/source/misc/rscdbl.cxx @@ -81,7 +81,7 @@ void FillSubList( RSCINST & rInst, REResourceList * pList ) } void FillListObj( ObjNode * pObjNode, RscTop * pRscTop, - REResourceList * pList, ULONG lFileKey ) + REResourceList * pList, sal_uIntPtr lFileKey ) { if( pObjNode ){ if( pObjNode->GetFileKey() == lFileKey ){ @@ -104,7 +104,7 @@ void FillListObj( ObjNode * pObjNode, RscTop * pRscTop, }; } -void FillList( RscTop * pRscTop, REResourceList * pList, ULONG lFileKey ){ +void FillList( RscTop * pRscTop, REResourceList * pList, sal_uIntPtr lFileKey ){ if( pRscTop ){ FillList( (RscTop*)pRscTop->Left(), pList, lFileKey ); @@ -114,6 +114,6 @@ void FillList( RscTop * pRscTop, REResourceList * pList, ULONG lFileKey ){ }; } -void RscTypCont::FillNameIdList( REResourceList * pList, ULONG lFileKey ){ +void RscTypCont::FillNameIdList( REResourceList * pList, sal_uIntPtr lFileKey ){ FillList( pRoot, pList, lFileKey ); } diff --git a/rsc/source/misc/rsclst.cxx b/rsc/source/misc/rsclst.cxx index ee2d4a14f328..ec70635efc44 100644 --- a/rsc/source/misc/rsclst.cxx +++ b/rsc/source/misc/rsclst.cxx @@ -32,13 +32,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/rscdb.cxx b/rsc/source/parser/rscdb.cxx index 97d23d4e3b53..b0b40e47a08e 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -65,9 +65,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 ), @@ -393,16 +393,16 @@ 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; - BOOL bId1 = FALSE; + sal_Bool bId1 = sal_False; pSysEntry = aSysLst.First(); while( pSysEntry ) { if( pSysEntry->nKey == 1 ) - bId1 = TRUE; + bId1 = sal_True; if( !strcmp( pSysEntry->aFileName.GetBuffer(), pFileName ) ) if( pSysEntry->nRscTyp == nRscTyp && pSysEntry->nTyp == nConst @@ -422,7 +422,7 @@ sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName, if( bFirst && !bId1 ) { pSysEntry->nKey = 1; - aSysLst.Insert( pSysEntry, (ULONG)0 ); + aSysLst.Insert( pSysEntry, (sal_uIntPtr)0 ); } else aSysLst.Insert( pSysEntry, LIST_APPEND ); @@ -440,7 +440,7 @@ sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName, |* Letzte Aenderung MM 21.06.90 |* *************************************************************************/ -void RscTypCont :: WriteInc( FILE * fOutput, ULONG lFileKey ) +void RscTypCont :: WriteInc( FILE * fOutput, sal_uIntPtr lFileKey ) { RscFile * pFName; @@ -502,7 +502,7 @@ private: ERRTYPE aError; // Enthaelt den ersten Fehler RscTypCont* pTypCont; FILE * fOutput; // AusgabeDatei - ULONG lFileKey; // Welche src-Datei + sal_uIntPtr lFileKey; // Welche src-Datei RscTop * pClass; DECL_LINK( CallBackWriteRc, ObjNode * ); @@ -554,7 +554,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() ); @@ -649,18 +649,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_uIntPtr >::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 } @@ -702,7 +702,7 @@ public: return aEnumObj.aError; }; - ERRTYPE WriteSrc( ULONG lFileKey ) + ERRTYPE WriteSrc( sal_uIntPtr lFileKey ) { aEnumObj.lFileKey = lFileKey; @@ -711,7 +711,7 @@ public: return aEnumObj.aError; } - ERRTYPE WriteCxx( ULONG lFileKey ) + ERRTYPE WriteCxx( sal_uIntPtr lFileKey ) { aEnumObj.lFileKey = lFileKey; @@ -720,7 +720,7 @@ public: return aEnumObj.aError; } - ERRTYPE WriteHxx( ULONG lFileKey ) + ERRTYPE WriteHxx( sal_uIntPtr lFileKey ) { aEnumObj.lFileKey = lFileKey; @@ -813,7 +813,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; @@ -828,8 +828,8 @@ ERRTYPE RscTypCont::WriteRc( WriteRcContext& rContext ) |* Letzte Aenderung MM 27.06.90 |* *************************************************************************/ -void RscTypCont :: WriteSrc( FILE * fOutput, ULONG nFileKey, - CharSet /*nCharSet*/, BOOL bName ) +void RscTypCont :: WriteSrc( FILE * fOutput, sal_uIntPtr nFileKey, + CharSet /*nCharSet*/, sal_Bool bName ) { RscFile * pFName; RscEnumerateRef aEnumRef( this, pRoot, fOutput ); @@ -861,7 +861,7 @@ void RscTypCont :: WriteSrc( FILE * fOutput, ULONG nFileKey, } else { - RscId::SetNames( FALSE ); + RscId::SetNames( sal_False ); if( NOFILE_INDEX == nFileKey ) { pFName = aFileTab.First(); @@ -886,7 +886,7 @@ void RscTypCont :: WriteSrc( FILE * fOutput, ULONG nFileKey, |* Letzte Aenderung MM 30.05.91 |* *************************************************************************/ -ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, ULONG nFileKey ) +ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, sal_uIntPtr nFileKey ) { fprintf( fOutput, "#include \n" ); fprintf( fOutput, "#include \n" ); @@ -952,7 +952,7 @@ ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, ULONG nFileKey ) |* Letzte Aenderung MM 30.05.91 |* *************************************************************************/ -ERRTYPE RscTypCont::WriteCxx( FILE * fOutput, ULONG nFileKey, +ERRTYPE RscTypCont::WriteCxx( FILE * fOutput, sal_uIntPtr nFileKey, const ByteString & rHxxName ) { RscEnumerateRef aEnumRef( this, pRoot, fOutput ); @@ -1018,14 +1018,14 @@ void RscTypCont::WriteRcCtor *************************************************************************/ class RscDel { - ULONG lFileKey; + sal_uIntPtr lFileKey; DECL_LINK( Delete, RscTop * ); public: - RscDel( RscTop * pRoot, ULONG lKey ); + RscDel( RscTop * pRoot, sal_uIntPtr lKey ); }; -inline RscDel::RscDel( RscTop * pRoot, ULONG lKey ) +inline RscDel::RscDel( RscTop * pRoot, sal_uIntPtr lKey ) { lFileKey = lKey; pRoot->EnumNodes( LINK( this, RscDel, Delete ) ); @@ -1039,7 +1039,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_uIntPtr lFileKey ){ // Resourceinstanzen loeschen RscDel aDel( pRoot, lFileKey ); // Defines loeschen @@ -1055,55 +1055,55 @@ void RscTypCont :: Delete( ULONG lFileKey ){ |* Letzte Aenderung MM 23.09.91 |* *************************************************************************/ -BOOL IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop, +sal_Bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop, RscInconsList * pList ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( pObjNode ){ RSCINST aTmpI; if( ! IsInstConsistent( (ObjNode*)pObjNode->Left(), pRscTop, pList ) ) - bRet = FALSE; + bRet = sal_False; aTmpI.pClass = pRscTop; aTmpI.pData = pObjNode->GetRscObj(); if( ! aTmpI.pClass->IsConsistent( aTmpI, pList ) ) - bRet = FALSE; + bRet = sal_False; if( ! IsInstConsistent( (ObjNode*)pObjNode->Right(), pRscTop, pList ) ) - bRet = FALSE; + bRet = sal_False; }; return( bRet ); } -BOOL MakeConsistent( RscTop * pRscTop, RscInconsList * pList ) +sal_Bool MakeConsistent( RscTop * pRscTop, RscInconsList * pList ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( pRscTop ){ if( ! ::MakeConsistent( (RscTop*)pRscTop->Left(), pList ) ) - bRet = FALSE; + bRet = sal_False; if( pRscTop->GetObjNode() ){ if( ! pRscTop->GetObjNode()->IsConsistent() ){ pRscTop->GetObjNode()->OrderTree(); if( ! pRscTop->GetObjNode()->IsConsistent( pList ) ) - bRet = FALSE; + bRet = sal_False; } if( ! IsInstConsistent( pRscTop->GetObjNode(), pRscTop, pList ) ) - bRet = FALSE; + bRet = sal_False; } if( ! ::MakeConsistent( (RscTop*)pRscTop->Right(), pList ) ) - bRet = FALSE; + bRet = sal_False; }; return bRet; } -BOOL RscTypCont :: MakeConsistent( RscInconsList * pList ){ +sal_Bool RscTypCont :: MakeConsistent( RscInconsList * pList ){ return( ::MakeConsistent( pRoot, pList ) ); } diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx index 1a896c897e27..c68fa6ac7ebf 100644 --- a/rsc/source/parser/rscibas.cxx +++ b/rsc/source/parser/rscibas.cxx @@ -52,7 +52,7 @@ #include /****************** 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 ); @@ -61,7 +61,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 ); @@ -484,12 +484,12 @@ RscEnum * RscTypCont::InitMessButtons() { RscEnum * pMessButtons; pMessButtons = new RscEnum( pHS->getID( "EnumMessButtons" ), RSC_NOTYPE ); - SETCONST( pMessButtons, "WB_OK", sal::static_int_cast(WB_OK) ); - SETCONST( pMessButtons, "WB_OK_CANCEL", sal::static_int_cast(WB_OK_CANCEL) ); - SETCONST( pMessButtons, "WB_YES_NO", sal::static_int_cast(WB_YES_NO) ); - SETCONST( pMessButtons, "WB_YES_NO_CANCEL", sal::static_int_cast(WB_YES_NO_CANCEL) ); - SETCONST( pMessButtons, "WB_RETRY_CANCEL", sal::static_int_cast(WB_RETRY_CANCEL) ); - SETCONST( pMessButtons, "WB_ABORT_RETRY_IGNORE", sal::static_int_cast(WB_ABORT_RETRY_IGNORE) ); + SETCONST( pMessButtons, "WB_OK", sal::static_int_cast(WB_OK) ); + SETCONST( pMessButtons, "WB_OK_CANCEL", sal::static_int_cast(WB_OK_CANCEL) ); + SETCONST( pMessButtons, "WB_YES_NO", sal::static_int_cast(WB_YES_NO) ); + SETCONST( pMessButtons, "WB_YES_NO_CANCEL", sal::static_int_cast(WB_YES_NO_CANCEL) ); + SETCONST( pMessButtons, "WB_RETRY_CANCEL", sal::static_int_cast(WB_RETRY_CANCEL) ); + SETCONST( pMessButtons, "WB_ABORT_RETRY_IGNORE", sal::static_int_cast(WB_ABORT_RETRY_IGNORE) ); return( pMessButtons ); } @@ -507,12 +507,12 @@ RscEnum * RscTypCont::InitMessDefButton(){ pMessDefButton = new RscEnum( pHS->getID( "EnumMessDefButton" ), RSC_NOTYPE ); - SETCONST( pMessDefButton, "WB_DEF_OK", sal::static_int_cast(WB_DEF_OK) ); - SETCONST( pMessDefButton, "WB_DEF_CANCEL", sal::static_int_cast(WB_DEF_CANCEL) ); - SETCONST( pMessDefButton, "WB_DEF_RETRY", sal::static_int_cast(WB_DEF_RETRY) ); - SETCONST( pMessDefButton, "WB_DEF_YES", sal::static_int_cast(WB_DEF_YES) ); - SETCONST( pMessDefButton, "WB_DEF_NO", sal::static_int_cast(WB_DEF_NO) ); - SETCONST( pMessDefButton, "WB_DEF_IGNORE", sal::static_int_cast(WB_DEF_IGNORE) ); + SETCONST( pMessDefButton, "WB_DEF_OK", sal::static_int_cast(WB_DEF_OK) ); + SETCONST( pMessDefButton, "WB_DEF_CANCEL", sal::static_int_cast(WB_DEF_CANCEL) ); + SETCONST( pMessDefButton, "WB_DEF_RETRY", sal::static_int_cast(WB_DEF_RETRY) ); + SETCONST( pMessDefButton, "WB_DEF_YES", sal::static_int_cast(WB_DEF_YES) ); + SETCONST( pMessDefButton, "WB_DEF_NO", sal::static_int_cast(WB_DEF_NO) ); + SETCONST( pMessDefButton, "WB_DEF_IGNORE", sal::static_int_cast(WB_DEF_IGNORE) ); return( pMessDefButton ); } diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index 625417769f45..d3afafdc2d29 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -55,7 +55,7 @@ void RscTypCont::InsWinBit( RscTop * pClass, const ByteString & rName, // Clientvariablen einfuegen aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, &aWinBits, nVal ), LIST_APPEND ); Atom nId = aNmTb.Put( rName.GetBuffer(), VARNAME ); @@ -76,7 +76,7 @@ RscTop * RscTypCont::InitClassMgr() Atom nId; aBaseLst.Insert( pClass = - new RscBaseCont( InvalidAtom, RSC_NOTYPE, NULL, FALSE ), + new RscBaseCont( InvalidAtom, RSC_NOTYPE, NULL, sal_False ), LIST_APPEND ); nId = pHS->getID( "Resource" ); @@ -218,7 +218,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.Insert( pCont, LIST_APPEND ); nId = aNmTb.Put( "IdList", VARNAME ); @@ -271,7 +271,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit, VAR_HIDDEN | VAR_NOENUM ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nDisableId ), LIST_APPEND ); nId = aNmTb.Put( "Disable", VARNAME ); @@ -279,7 +279,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit, VAR_NODATAINST, 0, nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nOutputSizeId ), LIST_APPEND ); nId = aNmTb.Put( "OutputSize", VARNAME ); @@ -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, 100 ); // aDfltI.pClass->MakeDefault( aDfltI ); @@ -712,7 +712,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 ); @@ -722,7 +722,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 ); @@ -762,8 +762,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 ); } @@ -982,7 +982,7 @@ RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey ) // Clientvariablen einfuegen aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nShiftId ), LIST_APPEND ); nId = aNmTb.Put( "Shift", VARNAME ); @@ -990,7 +990,7 @@ RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey ) VAR_NODATAINST, 0, nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nMod1Id ), LIST_APPEND ); nId = aNmTb.Put( "Modifier1", VARNAME ); @@ -999,7 +999,7 @@ RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey ) aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nMod2Id ), LIST_APPEND ); nId = aNmTb.Put( "Modifier2", VARNAME ); @@ -1151,7 +1151,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper, // Clientvariablen einfuegen aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nCheckableId ), LIST_APPEND ); nId = aNmTb.Put( "Checkable", VARNAME ); @@ -1159,7 +1159,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper, VAR_NODATAINST, 0, nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nAutoCheckId ), LIST_APPEND ); nId = aNmTb.Put( "AutoCheck", VARNAME ); @@ -1167,7 +1167,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper, VAR_NODATAINST, 0, nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nRadioCheckId ), LIST_APPEND ); nId = aNmTb.Put( "RadioCheck", VARNAME ); @@ -1175,7 +1175,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper, VAR_NODATAINST, 0, nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nAboutId ), LIST_APPEND ); nId = aNmTb.Put( "About", VARNAME ); @@ -1183,7 +1183,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper, VAR_NODATAINST, 0, nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nHelpId ), LIST_APPEND ); nId = aNmTb.Put( "Help", VARNAME ); @@ -1979,37 +1979,37 @@ RscTop * RscTypCont::InitClassToolBoxItem( RscTop * pSuper, // Clientvariablen einfuegen aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nCheckableId ), LIST_APPEND ); nId = aNmTb.Put( "Checkable", VARNAME ); pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nAutoCheckId ), LIST_APPEND ); nId = aNmTb.Put( "AutoCheck", VARNAME ); pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nRadioCheckId ), LIST_APPEND ); nId = aNmTb.Put( "RadioCheck", VARNAME ); pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nLeftId ), LIST_APPEND ); nId = aNmTb.Put( "Left", VARNAME ); pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nAutoSizeId ), LIST_APPEND ); nId = aNmTb.Put( "AutoSize", VARNAME ); pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId ); aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nDropDownId ), LIST_APPEND ); nId = aNmTb.Put( "DropDown", VARNAME ); pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId ); diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx index a763b92f0bb1..88eeed419175 100644 --- a/rsc/source/parser/rscinit.cxx +++ b/rsc/source/parser/rscinit.cxx @@ -194,7 +194,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 ); @@ -207,8 +207,8 @@ 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( "sal_True", BOOLEAN, (long)sal_True ); + aNmTb.Put( "sal_False", BOOLEAN, (long)sal_False ); /* Vordefinierte HilfeId's */ aNmTb.Put( "HELP_INDEX", NUMBER, OOO_HELP_INDEX ); @@ -263,117 +263,117 @@ void RscTypCont::Init() // Windows nBorderId = pHS->getID( "WB_BORDER" ); - aWinBits.SetConstant( nBorderId, sal::static_int_cast(WB_BORDER) ); + aWinBits.SetConstant( nBorderId, sal::static_int_cast(WB_BORDER) ); nHideId = pHS->getID( "WB_HIDE" ); - aWinBits.SetConstant( nHideId, sal::static_int_cast(WB_HIDE) ); + aWinBits.SetConstant( nHideId, sal::static_int_cast(WB_HIDE) ); nClipChildrenId = pHS->getID( "WB_CLIPCHILDREN" ); - aWinBits.SetConstant( nClipChildrenId, sal::static_int_cast(WB_CLIPCHILDREN) ); + aWinBits.SetConstant( nClipChildrenId, sal::static_int_cast(WB_CLIPCHILDREN) ); nSizeableId = pHS->getID( "WB_SIZEABLE" ); - aWinBits.SetConstant( nSizeableId, sal::static_int_cast(WB_SIZEABLE) ); + aWinBits.SetConstant( nSizeableId, sal::static_int_cast(WB_SIZEABLE) ); nMoveableId = pHS->getID( "WB_MOVEABLE" ); - aWinBits.SetConstant( nMoveableId, sal::static_int_cast(WB_MOVEABLE) ); + aWinBits.SetConstant( nMoveableId, sal::static_int_cast(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(WB_CLOSEABLE) ); + aWinBits.SetConstant( nCloseableId, sal::static_int_cast(WB_CLOSEABLE) ); nAppId = pHS->getID( "WB_APP" ); - aWinBits.SetConstant( nAppId, sal::static_int_cast(WB_APP) ); + aWinBits.SetConstant( nAppId, sal::static_int_cast(WB_APP) ); nTabstopId = pHS->getID( "WB_TABSTOP" ); - aWinBits.SetConstant( nTabstopId, sal::static_int_cast(WB_TABSTOP) ); + aWinBits.SetConstant( nTabstopId, sal::static_int_cast(WB_TABSTOP) ); nGroupId = pHS->getID( "WB_GROUP" ); - aWinBits.SetConstant( nGroupId, sal::static_int_cast(WB_GROUP) ); + aWinBits.SetConstant( nGroupId, sal::static_int_cast(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(WB_LEFT) ); + aWinBits.SetConstant( nLeftId, sal::static_int_cast(WB_LEFT) ); nCenterId = pHS->getID( "WB_CENTER" ); - aWinBits.SetConstant( nCenterId, sal::static_int_cast(WB_CENTER) ); + aWinBits.SetConstant( nCenterId, sal::static_int_cast(WB_CENTER) ); nRightId = pHS->getID( "WB_RIGHT" ); - aWinBits.SetConstant( nRightId, sal::static_int_cast(WB_RIGHT) ); + aWinBits.SetConstant( nRightId, sal::static_int_cast(WB_RIGHT) ); nTopId = pHS->getID( "WB_TOP" ); - aWinBits.SetConstant( nTopId, sal::static_int_cast(WB_TOP) ); + aWinBits.SetConstant( nTopId, sal::static_int_cast(WB_TOP) ); nVCenterId = pHS->getID( "WB_VCENTER" ); - aWinBits.SetConstant( nVCenterId, sal::static_int_cast(WB_VCENTER) ); + aWinBits.SetConstant( nVCenterId, sal::static_int_cast(WB_VCENTER) ); nBottomId = pHS->getID( "WB_BOTTOM" ); - aWinBits.SetConstant( nBottomId, sal::static_int_cast(WB_BOTTOM) ); + aWinBits.SetConstant( nBottomId, sal::static_int_cast(WB_BOTTOM) ); nHScrollId = pHS->getID( "WB_HSCROLL" ); - aWinBits.SetConstant( nHScrollId, sal::static_int_cast(WB_HSCROLL) ); + aWinBits.SetConstant( nHScrollId, sal::static_int_cast(WB_HSCROLL) ); nVScrollId = pHS->getID( "WB_VSCROLL" ); - aWinBits.SetConstant( nVScrollId, sal::static_int_cast(WB_VSCROLL) ); + aWinBits.SetConstant( nVScrollId, sal::static_int_cast(WB_VSCROLL) ); nSortId = pHS->getID( "WB_SORT" ); - aWinBits.SetConstant( nSortId, sal::static_int_cast(WB_SORT) ); + aWinBits.SetConstant( nSortId, sal::static_int_cast(WB_SORT) ); nDefaultId = pHS->getID( "WB_DEFBUTTON" ); - aWinBits.SetConstant( nDefaultId, sal::static_int_cast(WB_DEFBUTTON) ); + aWinBits.SetConstant( nDefaultId, sal::static_int_cast(WB_DEFBUTTON) ); nRepeatId = pHS->getID( "WB_REPEAT" ); - aWinBits.SetConstant( nRepeatId, sal::static_int_cast(WB_REPEAT) ); + aWinBits.SetConstant( nRepeatId, sal::static_int_cast(WB_REPEAT) ); nSVLookId = pHS->getID( "WB_SVLOOK" ); - aWinBits.SetConstant( nSVLookId, sal::static_int_cast(WB_3DLOOK) ); + aWinBits.SetConstant( nSVLookId, sal::static_int_cast(WB_3DLOOK) ); nDropDownId = pHS->getID( "WB_DROPDOWN" ); - aWinBits.SetConstant( nDropDownId, sal::static_int_cast(WB_DROPDOWN) ); + aWinBits.SetConstant( nDropDownId, sal::static_int_cast(WB_DROPDOWN) ); nPassWordId = pHS->getID( "WB_PASSWORD" ); - aWinBits.SetConstant( nPassWordId, sal::static_int_cast(WB_PASSWORD) ); + aWinBits.SetConstant( nPassWordId, sal::static_int_cast(WB_PASSWORD) ); nReadOnlyId = pHS->getID( "WB_READONLY" ); - aWinBits.SetConstant( nReadOnlyId, sal::static_int_cast(WB_READONLY) ); + aWinBits.SetConstant( nReadOnlyId, sal::static_int_cast(WB_READONLY) ); nAutoSizeId = pHS->getID( "WB_AUTOSIZE" ); - aWinBits.SetConstant( nAutoSizeId, sal::static_int_cast(WB_AUTOSIZE) ); + aWinBits.SetConstant( nAutoSizeId, sal::static_int_cast(WB_AUTOSIZE) ); nSpinId = pHS->getID( "WB_SPIN" ); - aWinBits.SetConstant( nSpinId, sal::static_int_cast(WB_SPIN) ); + aWinBits.SetConstant( nSpinId, sal::static_int_cast(WB_SPIN) ); nTabControlId = pHS->getID( "WB_DIALOGCONTROL" ); - aWinBits.SetConstant( nTabControlId, sal::static_int_cast(WB_DIALOGCONTROL) ); + aWinBits.SetConstant( nTabControlId, sal::static_int_cast(WB_DIALOGCONTROL) ); nSimpleModeId = pHS->getID( "WB_SIMPLEMODE" ); - aWinBits.SetConstant( nSimpleModeId, sal::static_int_cast(WB_SIMPLEMODE) ); + aWinBits.SetConstant( nSimpleModeId, sal::static_int_cast(WB_SIMPLEMODE) ); nDragId = pHS->getID( "WB_DRAG" ); - aWinBits.SetConstant( nDragId, sal::static_int_cast(WB_DRAG) ); + aWinBits.SetConstant( nDragId, sal::static_int_cast(WB_DRAG) ); nScrollId = pHS->getID( "WB_SCROLL" ); - aWinBits.SetConstant( nScrollId, sal::static_int_cast(WB_SCROLL) ); + aWinBits.SetConstant( nScrollId, sal::static_int_cast(WB_SCROLL) ); nZoomableId = pHS->getID( "WB_ZOOMABLE" ); - aWinBits.SetConstant( nZoomableId, sal::static_int_cast(WB_ROLLABLE) ); + aWinBits.SetConstant( nZoomableId, sal::static_int_cast(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(WB_AUTOHSCROLL) ); + aWinBits.SetConstant( nAutoHScrollId, sal::static_int_cast(WB_AUTOHSCROLL) ); nAutoVScrollId = pHS->getID( "WB_AUTOVSCROLL" ); - aWinBits.SetConstant( nAutoVScrollId, sal::static_int_cast(WB_AUTOVSCROLL) ); + aWinBits.SetConstant( nAutoVScrollId, sal::static_int_cast(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(WB_WORDBREAK) ); + aWinBits.SetConstant( nWordBreakId, sal::static_int_cast(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(WB_HASLINES) ); + aWinBits.SetConstant( nHasLinesId, sal::static_int_cast(WB_HASLINES) ); nHasButtonsId = pHS->getID( "WB_HASBUTTONS" ); - aWinBits.SetConstant( nHasButtonsId, sal::static_int_cast(WB_HASBUTTONS) ); + aWinBits.SetConstant( nHasButtonsId, sal::static_int_cast(WB_HASBUTTONS) ); nRectStyleId = pHS->getID( "WB_RECTSTYLE" ); - aWinBits.SetConstant( nRectStyleId, sal::static_int_cast(WB_RECTSTYLE) ); + aWinBits.SetConstant( nRectStyleId, sal::static_int_cast(WB_RECTSTYLE) ); nLineSpacingId = pHS->getID( "WB_LINESPACING" ); - aWinBits.SetConstant( nLineSpacingId, sal::static_int_cast(WB_LINESPACING) ); + aWinBits.SetConstant( nLineSpacingId, sal::static_int_cast(WB_LINESPACING) ); nSmallStyleId = pHS->getID( "WB_SMALLSTYLE" ); - aWinBits.SetConstant( nSmallStyleId, sal::static_int_cast(WB_SMALLSTYLE) ); + aWinBits.SetConstant( nSmallStyleId, sal::static_int_cast(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(WB_DOCKABLE) ); + aWinBits.SetConstant( nDockableId, sal::static_int_cast(WB_DOCKABLE) ); nScaleId = pHS->getID( "WB_SCALE" ); - aWinBits.SetConstant( nScaleId, sal::static_int_cast(WB_SCALE) ); + aWinBits.SetConstant( nScaleId, sal::static_int_cast(WB_SCALE) ); nIgnoreTabId = pHS->getID( "WB_IGNORETAB" ); - aWinBits.SetConstant( nIgnoreTabId, sal::static_int_cast(WB_IGNORETAB) ); + aWinBits.SetConstant( nIgnoreTabId, sal::static_int_cast(WB_IGNORETAB) ); nNoSplitDrawId = pHS->getID( "WB_NOSPLITDRAW" ); - aWinBits.SetConstant( nNoSplitDrawId, sal::static_int_cast(WB_NOSPLITDRAW) ); + aWinBits.SetConstant( nNoSplitDrawId, sal::static_int_cast(WB_NOSPLITDRAW) ); nTopImageId = pHS->getID( "WB_TOPIMAGE" ); - aWinBits.SetConstant( nTopImageId, sal::static_int_cast(WB_TOPIMAGE) ); + aWinBits.SetConstant( nTopImageId, sal::static_int_cast(WB_TOPIMAGE) ); nNoLabelId = pHS->getID( "WB_NOLABEL" ); - aWinBits.SetConstant( nNoLabelId, sal::static_int_cast(WB_NOLABEL) ); + aWinBits.SetConstant( nNoLabelId, sal::static_int_cast(WB_NOLABEL) ); nVertId = pHS->getID( "WB_VERT" ); - aWinBits.SetConstant( nVertId, sal::static_int_cast(WB_VERT) ); + aWinBits.SetConstant( nVertId, sal::static_int_cast(WB_VERT) ); nSingleLineId = pHS->getID( "WB_SINGLELINE" ); - aWinBits.SetConstant( nSingleLineId, sal::static_int_cast(WB_SINGLELINE) ); + aWinBits.SetConstant( nSingleLineId, sal::static_int_cast(WB_SINGLELINE) ); nSysWinId = pHS->getID( "WB_SYSTEMWINDOW" ); - aWinBits.SetConstant( nSysWinId, sal::static_int_cast(WB_SYSTEMWINDOW) ); + aWinBits.SetConstant( nSysWinId, sal::static_int_cast(WB_SYSTEMWINDOW) ); } { /********** I n i t B a s i c T y p e s **************************/ @@ -702,7 +702,7 @@ void RscTypCont::Init() // Clientvariablen einfuegen // Sysmodal aBaseLst.Insert( - pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, + pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, &aWinBits, nRepeatId ), LIST_APPEND ); nId = aNmTb.Put( "Repeat", VARNAME ); diff --git a/rsc/source/parser/rsckey.cxx b/rsc/source/parser/rsckey.cxx index 4a42bea138bf..2108b0f349dc 100644 --- a/rsc/source/parser/rsckey.cxx +++ b/rsc/source/parser/rsckey.cxx @@ -78,7 +78,7 @@ int KeyCompare( const void * pFirst, const void * pSecond ){ |* *************************************************************************/ RscNameTable::RscNameTable() { - bSort = TRUE; + bSort = sal_True; nEntries = 0; pTable = NULL; }; @@ -107,7 +107,7 @@ RscNameTable::~RscNameTable() { |* Letzte Aenderung MM 28.02.91 |* *************************************************************************/ -void RscNameTable::SetSort( BOOL bSorted ){ +void RscNameTable::SetSort( sal_Bool bSorted ){ bSort = bSorted; if( bSort && pTable){ // Schluesselwort Feld sortieren @@ -180,7 +180,7 @@ Atom RscNameTable::Put( const char * pName, sal_uInt32 nTyp, RscTop * pClass ) |* Letzte Aenderung MM 28.02.91 |* *************************************************************************/ -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; @@ -207,8 +207,8 @@ BOOL RscNameTable::Get( Atom nName, KEY_STRUCT * pEle ){ if( pKey ){ // Schluesselwort gefunden *pEle = *pKey; - return( TRUE ); + return( sal_True ); }; - return( FALSE ); + return( sal_False ); }; diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index e0df5de254f9..42466dc3f490 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -64,7 +64,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; @@ -72,15 +72,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(); @@ -119,7 +119,7 @@ int MakeToken( YYSTYPE * pTokenVal ){ int c1; char * pStr; - while( TRUE ){ // Kommentare und Leerzeichen ueberlesen + while( sal_True ){ // Kommentare und Leerzeichen ueberlesen while( isspace( c ) ) c = pFI->GetFastChar(); if( '/' == c ){ @@ -151,7 +151,7 @@ int MakeToken( YYSTYPE * pTokenVal ){ } if( bLastInclude ){ - bLastInclude = FALSE; //Zuruecksetzten + bLastInclude = sal_False; //Zuruecksetzten if( '<' == c ){ OStringBuffer aBuf( 256 ); c = pFI->GetFastChar(); @@ -169,7 +169,7 @@ 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(); @@ -182,7 +182,7 @@ int MakeToken( YYSTYPE * pTokenVal ){ aBuf.append( '"' ); } else - bDone = TRUE; + bDone = sal_True; } else if( c == '\\' ) { @@ -235,10 +235,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; }; @@ -302,7 +302,7 @@ int yylex() #endif { if( bTargetDefined ) - bTargetDefined = FALSE; + bTargetDefined = sal_False; else aKeyVal[ 0 ].nKeyWord = MakeToken( &aKeyVal[ 0 ].aYYSType ); @@ -330,10 +330,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(); } @@ -359,7 +359,7 @@ void IncludeParser( RscFileInst * pFileInst ) int nToken; // Wert des Tokens YYSTYPE aYYSType; // Daten des Tokens RscFile * pFName; // Filestruktur - ULONG lKey; // Fileschluessel + sal_uIntPtr lKey; // Fileschluessel RscTypCont * pTypCon = pFileInst->pTypCont; pFName = pTypCon->aFileTab.Get( pFileInst->GetFileIndex() ); @@ -415,7 +415,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 06c04f4126a3..ebda82aa4fdd 100644 --- a/rsc/source/parser/rsclex.hxx +++ b/rsc/source/parser/rsclex.hxx @@ -76,7 +76,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 22606e2f8bf2..359e1a3390e0 100644 --- a/rsc/source/parser/rscpar.cxx +++ b/rsc/source/parser/rscpar.cxx @@ -52,7 +52,7 @@ void RscFileInst::Init() *pLine = '\0'; nScanPos = 0; cLastChar = '\0'; - bEof = FALSE; + bEof = sal_False; }; /************************************************************************* @@ -64,8 +64,8 @@ void RscFileInst::Init() |* Letzte Aenderung MM 06.06.91 |* *************************************************************************/ -RscFileInst::RscFileInst( RscTypCont * pTC, ULONG lIndexSrc, - ULONG lFIndex, FILE * fFile ) +RscFileInst::RscFileInst( RscTypCont * pTC, sal_uIntPtr lIndexSrc, + sal_uIntPtr lFIndex, FILE * fFile ) { pTypCont = pTC; Init(); @@ -79,8 +79,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_uIntPtr lIndexSrc, + sal_uIntPtr lFIndex, const ByteString& rBuf ) { pTypCont = pTC; Init(); @@ -128,7 +128,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 89891581d9ba..f6c9d9a17cc8 100644 --- a/rsc/source/parser/rscyacc.cxx +++ b/rsc/source/parser/rscyacc.cxx @@ -63,7 +63,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; @@ -79,7 +79,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; @@ -111,11 +111,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() ); @@ -129,7 +129,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 ); @@ -177,7 +177,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() ) @@ -199,7 +199,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 ); @@ -217,7 +217,7 @@ BOOL DoClassHeader( RSCHEADER * pHeader, BOOL bMember ) pHeader->pClass, RSCINST(), &aTmpI ); if( !aTmpI.IsInst() ) - return( FALSE ); + return( sal_False ); } S.Push( aTmpI ); }; @@ -230,7 +230,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 ) 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 a2841dd9765b..e25f68cff10a 100644 --- a/rsc/source/prj/start.cxx +++ b/rsc/source/prj/start.cxx @@ -89,11 +89,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 @@ -193,9 +193,9 @@ static BOOL CallPrePro( const ByteString& rPrePro, unlink( aRspFileName.GetBuffer() ); #endif if ( nExit ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } @@ -204,7 +204,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 ) @@ -310,8 +310,8 @@ static BOOL CallRsc2( ByteString aRsc2Name, unlink( aRspFileName.GetBuffer() ); #endif if( nExit ) - return( FALSE ); - return( TRUE ); + return( sal_False ); + return( sal_True ); } /************************************************************************* @@ -325,11 +325,11 @@ static BOOL CallRsc2( ByteString aRsc2Name, *************************************************************************/ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { - BOOL bPrePro = TRUE; - BOOL bResFile = TRUE; - BOOL bHelp = FALSE; - BOOL bError = FALSE; - BOOL bResponse = FALSE; + sal_Bool bPrePro = sal_True; + sal_Bool bResFile = 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")); @@ -362,7 +362,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 ) @@ -370,20 +370,20 @@ 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, "r" ) || !rsc_stricmp( (*ppStr) + 1, "s" ) ) { // erzeugt kein .res-file - bResFile = FALSE; + bResFile = 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 @@ -399,7 +399,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); } } @@ -426,8 +426,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) if( bHelp ) { - bPrePro = FALSE; - bResFile = FALSE; + bPrePro = sal_False; + bResFile = sal_False; }; if( bPrePro && aInputList.Count() ) { @@ -440,7 +440,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.Insert( new ByteString( aTmpName ), CONTAINER_APPEND ); @@ -456,7 +456,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 d04903ea8692..d4f28f598e3f 100644 --- a/rsc/source/res/rscall.cxx +++ b/rsc/source/res/rscall.cxx @@ -49,11 +49,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 5e9023a83e83..cda959ebb79c 100644 --- a/rsc/source/res/rscarray.cxx +++ b/rsc/source/res/rscarray.cxx @@ -176,7 +176,7 @@ static RscInstNode * Create( RscInstNode * pNode ) } RSCINST RscArray::Create( RSCINST * pInst, const RSCINST & rDflt, - BOOL bOwnClass ) + sal_Bool bOwnClass ) { RSCINST aInst; RscArrayInst * pClassData; @@ -245,7 +245,7 @@ void RscArray::Destroy( const RSCINST & rInst ) ERRTYPE RscArray::GetValueEle ( const RSCINST & rInst, - INT32 lValue, + sal_Int32 lValue, RscTop * pCreateClass, RSCINST * pGetInst ) @@ -313,7 +313,7 @@ ERRTYPE RscArray::GetArrayEle RSCINST * pGetInst ) { - INT32 lValue; + sal_Int32 lValue; if( !pTypeClass->GetConstValue( nId, &lValue ) ) { // nicht gefunden return ERR_ARRAY_INVALIDINDEX; @@ -331,31 +331,31 @@ ERRTYPE RscArray::GetArrayEle |* Letzte Aenderung MM 23.09.91 |* *************************************************************************/ -static BOOL IsConsistent( RscInstNode * pNode, RscInconsList * pList ) +static sal_Bool IsConsistent( RscInstNode * pNode, RscInconsList * pList ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( pNode ) { bRet = pNode->aInst.pClass->IsConsistent( pNode->aInst, pList ); if( !IsConsistent( pNode->Left(), pList ) ) - bRet = FALSE; + bRet = sal_False; if( !IsConsistent( pNode->Right(), pList ) ) - bRet = FALSE; + bRet = sal_False; } return bRet; } -BOOL RscArray::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) +sal_Bool RscArray::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) { RscArrayInst * pClassData; - BOOL bRet; + sal_Bool bRet; bRet = RscTop::IsConsistent( rInst, pList ); pClassData = (RscArrayInst *)(rInst.pData + nOffInstData); if( !::IsConsistent( pClassData->pNode, pList ) ) - bRet = FALSE; + bRet = sal_False; return( bRet ); } @@ -399,9 +399,9 @@ void RscArray::SetToDefault( const RSCINST & rInst ) |* Letzte Aenderung MM 25.04.91 |* *************************************************************************/ -static BOOL IsDefault( RscInstNode * pNode ) +static sal_Bool IsDefault( RscInstNode * pNode ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( pNode ) { @@ -414,13 +414,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 ); @@ -436,9 +436,9 @@ BOOL RscArray::IsDefault( const RSCINST & rInst ) |* Letzte Aenderung MM 15.01.92 |* *************************************************************************/ -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 ) { @@ -451,10 +451,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 ); @@ -569,7 +569,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; @@ -686,7 +686,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 877d11afee83..4c3380af8c39 100644 --- a/rsc/source/res/rscclass.cxx +++ b/rsc/source/res/rscclass.cxx @@ -132,7 +132,7 @@ RSCINST RscClass::GetInstData ( CLASS_DATA pData, sal_uInt32 nEle, - BOOL bGetCopy + sal_Bool bGetCopy ) { RSCINST aInst; @@ -197,15 +197,15 @@ CLASS_DATA RscClass::GetDfltData( sal_uInt32 nEle ) |* Letzte Aenderung MM 22.07.91 |* *************************************************************************/ -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_uIntPtr)1 << nEle); else - pClass->nVarDflt &= ~((ULONG)1 << nEle); + pClass->nVarDflt &= ~((sal_uIntPtr)1 << nEle); } /************************************************************************* @@ -217,23 +217,23 @@ void RscClass::SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle, BOOL bSet ) |* Letzte Aenderung MM 08.01.92 |* *************************************************************************/ -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_uIntPtr)1 << nEle) ) + bRet = sal_True; else - bRet = FALSE; + bRet = sal_False; /* { //Variablenname ist Default RSCINST aTmpI; - aTmpI = GetInstData( pData, nEle, TRUE ); + aTmpI = GetInstData( pData, nEle, sal_True ); if( aTmpI.IsInst() && !aTmpI.pClass->IsDefault( aTmpI ) ) - bRet = FALSE; + bRet = sal_False; } */ return bRet; @@ -252,7 +252,7 @@ RSCINST RscClass::Create ( RSCINST * pInst, const RSCINST & rDflt, - BOOL bOwnClass + sal_Bool bOwnClass ) { sal_uInt32 i; @@ -276,11 +276,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_uIntPtr)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) ) @@ -304,7 +304,7 @@ RSCINST RscClass::Create } else { - aMemInst = GetInstData( aInst.pData, i, TRUE ); + aMemInst = GetInstData( aInst.pData, i, sal_True ); aMemInst = aMemInst.pClass->Create( &aMemInst, aDfltI ); }; } @@ -331,7 +331,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 @@ -400,7 +400,7 @@ ERRTYPE RscClass::SetVariable } nEntries++; - if( nEntries > (sizeof( ULONG ) * 8) ) + if( nEntries > (sizeof( sal_uIntPtr ) * 8) ) { // Bereich fuer Default zu klein RscExit( 16 ); @@ -440,7 +440,7 @@ RSCINST RscClass::GetVariable const RSCINST & rInst, Atom nVarName, const RSCINST & rInitInst, - BOOL bInitDflt, + sal_Bool bInitDflt, RscTop * pCreateClass ) { @@ -500,7 +500,7 @@ RSCINST RscClass::GetVariable } }; // auf nicht Default setzen - SetVarDflt( rInst.pData, i, FALSE ); + SetVarDflt( rInst.pData, i, sal_False ); return( aTmpI ); }; @@ -539,11 +539,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 ; @@ -559,11 +559,11 @@ RSCINST RscClass::GetCopyVar |* Beschreibung |* *************************************************************************/ -BOOL RscClass::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) +sal_Bool RscClass::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) { sal_uInt32 i = 0; RSCINST aTmpI; - BOOL bRet; + sal_Bool bRet; bRet = RscTop::IsConsistent( rInst, pList ); @@ -571,11 +571,11 @@ BOOL RscClass::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) { 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, pList ) ) - bRet = FALSE; + bRet = sal_False; } }; @@ -603,12 +603,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_uIntPtr)0); // alles auf Default RscTop::SetToDefault( rInst ); } @@ -620,7 +620,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; @@ -631,7 +631,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 ) ); @@ -670,24 +670,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; } /************************************************************************* @@ -697,39 +697,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; } /************************************************************************* @@ -749,12 +749,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 @@ -805,20 +805,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( @@ -830,7 +830,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() ) { @@ -858,7 +858,7 @@ void RscClass::WriteSrc |* Beschreibung |* *************************************************************************/ -INT32 RscClass::GetCorrectValues +sal_Int32 RscClass::GetCorrectValues ( const RSCINST & rInst, sal_uInt32 nVarPos, @@ -866,11 +866,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 @@ -878,8 +878,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; @@ -891,7 +891,7 @@ ERRTYPE RscClass::WriteInstRc RscWriteRc & rMem, RscTypCont * pTC, sal_uInt32 nDeep, - BOOL bExtra + sal_Bool bExtra ) { sal_uInt32 i = 0; @@ -920,35 +920,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; @@ -962,15 +962,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 ); } } } @@ -991,7 +991,7 @@ ERRTYPE RscClass::WriteRc RscWriteRc & rMem, RscTypCont * pTC, sal_uInt32 nDeep, - BOOL bExtra + sal_Bool bExtra ) { ERRTYPE aError; @@ -1067,7 +1067,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 = (sal_uInt8 *)GetClassRes();\n\n" ); fprintf( fOutput, "\tnObjMask = *(sal_uInt32*)pResData;\n" ); fprintf( fOutput, "\tnOffset += 4;\n\n" ); @@ -1111,7 +1111,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; @@ -1152,7 +1152,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 ); @@ -1182,10 +1182,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; } @@ -1242,7 +1242,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 b2632a73857c..67955c193cf0 100644 --- a/rsc/source/res/rscclobj.cxx +++ b/rsc/source/res/rscclobj.cxx @@ -78,16 +78,16 @@ sal_uInt32 RefNode::GetId() const |* Letzte Aenderung MM 27.06.90 |* *************************************************************************/ -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 ****************************************/ @@ -120,7 +120,7 @@ ObjNode * RefNode :: GetObjNode( const RscId & rRscId ){ |* Letzte Aenderung MM 15.05.91 |* *************************************************************************/ -ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, ULONG lKey ){ +ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, sal_uIntPtr lKey ){ pRscObj = pData; aRscId = rId; lFileKey = lKey; @@ -135,7 +135,7 @@ ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, ULONG lKey ){ |* Letzte Aenderung MM 09.12.91 |* *************************************************************************/ -ObjNode * ObjNode::DelObjNode( RscTop * pClass, ULONG nFileKey ){ +ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uIntPtr nFileKey ){ ObjNode * pRetNode = this; if( Right() ) @@ -183,13 +183,13 @@ sal_uInt32 ObjNode::GetId() const |* Letzte Aenderung MM 23.09.91 |* *************************************************************************/ -BOOL ObjNode::IsConsistent( RscInconsList * pList ) +sal_Bool ObjNode::IsConsistent( RscInconsList * pList ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( (long)aRscId > 0x7FFF || (long)aRscId < 1 ) { - bRet = FALSE; + bRet = sal_False; if( pList ) pList->Insert( new RscInconsistent( aRscId, aRscId ) ); } @@ -198,10 +198,10 @@ BOOL ObjNode::IsConsistent( RscInconsList * pList ) if( Left() ) { if( !((ObjNode *)Left())->IsConsistent( pList ) ) - bRet = FALSE; + bRet = sal_False; if( ((ObjNode *)Left())->aRscId >= aRscId ) { - bRet = FALSE; + bRet = sal_False; if( pList ) pList->Insert( new RscInconsistent( ((ObjNode *)Left())->GetRscId(), @@ -212,14 +212,14 @@ BOOL ObjNode::IsConsistent( RscInconsList * pList ) { if( ((ObjNode *)Right())->aRscId <= aRscId ) { - bRet = FALSE; + bRet = sal_False; if( pList ) pList->Insert( new RscInconsistent( GetRscId(), ((ObjNode *)Right())->GetRscId() ) ); } if( !((ObjNode *)Right())->IsConsistent( pList ) ) - bRet = FALSE; + bRet = sal_False; }; }; diff --git a/rsc/source/res/rscconst.cxx b/rsc/source/res/rscconst.cxx index 3961cbd539de..c089027a9a5b 100644 --- a/rsc/source/res/rscconst.cxx +++ b/rsc/source/res/rscconst.cxx @@ -99,7 +99,7 @@ RSCCLASS_TYPE RscConst::GetClassType() const |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -ERRTYPE RscConst::SetConstant( Atom nVarName, INT32 lValue ){ +ERRTYPE RscConst::SetConstant( Atom nVarName, sal_Int32 lValue ){ if( pVarArray ) pVarArray = (VarEle *) rtl_reallocateMemory( (void *)pVarArray, @@ -138,7 +138,7 @@ Atom RscConst::GetConstant( sal_uInt32 nPos ){ |* Letzte Aenderung MM 15.05.91 |* *************************************************************************/ -BOOL RscConst::GetConstValue( Atom nConst, INT32 * pValue ) const +sal_Bool RscConst::GetConstValue( Atom nConst, sal_Int32 * pValue ) const { sal_uInt32 i = 0; @@ -146,9 +146,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; } /************************************************************************* @@ -160,7 +160,7 @@ BOOL RscConst::GetConstValue( Atom nConst, INT32 * pValue ) const |* Letzte Aenderung MM 15.05.91 |* *************************************************************************/ -BOOL RscConst::GetValueConst( INT32 lValue, Atom * pConst ) const +sal_Bool RscConst::GetValueConst( sal_Int32 lValue, Atom * pConst ) const { sal_uInt32 i = 0; @@ -168,9 +168,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; } /************************************************************************* @@ -260,14 +260,14 @@ RscEnum::RscEnum( Atom nId, sal_uInt32 nTypeId ) |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -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 ); }; @@ -283,12 +283,12 @@ ERRTYPE RscEnum::SetConst( const RSCINST & rInst, Atom nConst, INT32 /*nVal*/ ) |* Letzte Aenderung MM 18.07.91 |* *************************************************************************/ -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 ) ); }; @@ -318,7 +318,7 @@ ERRTYPE RscEnum::GetConst( const RSCINST & rInst, Atom * pH ){ |* Letzte Aenderung MM 16.09.91 |* *************************************************************************/ -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 ); } @@ -332,7 +332,7 @@ ERRTYPE RscEnum::GetNumber( const RSCINST & rInst, INT32 * pNumber ){ |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -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 ){ @@ -349,7 +349,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 ); @@ -364,16 +364,16 @@ RSCINST RscEnum::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnClass |* Letzte Aenderung MM 15.01.92 |* *************************************************************************/ -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; } /************************************************************************* @@ -402,9 +402,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 072c5feaa31d..fabfe6bf0b17 100644 --- a/rsc/source/res/rsccont.cxx +++ b/rsc/source/res/rsccont.cxx @@ -70,7 +70,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 ) { @@ -141,7 +141,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; @@ -161,7 +161,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; @@ -290,7 +290,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 @@ -513,11 +513,11 @@ else |* Letzte Aenderung MM 12.06.91 |* *************************************************************************/ -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); @@ -549,13 +549,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); @@ -589,7 +589,7 @@ ERRTYPE RscBaseCont::SetConst ( const RSCINST & rInst, Atom nValueId, - INT32 lValue + sal_Int32 lValue ) { RscBaseContInst * pClassData; @@ -673,10 +673,10 @@ else |* Letzte Aenderung MM 23.09.91 |* *************************************************************************/ -BOOL RscBaseCont::IsConsistent( const RSCINST & rInst, RscInconsList * pList ){ +sal_Bool RscBaseCont::IsConsistent( const RSCINST & rInst, RscInconsList * pList ){ sal_uInt32 i = 0; RscBaseContInst * pClassData; - BOOL bRet; + sal_Bool bRet; bRet = RscTop::IsConsistent( rInst, pList ); @@ -686,9 +686,9 @@ BOOL RscBaseCont::IsConsistent( const RSCINST & rInst, RscInconsList * pList ){ // 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; if( pList ) pList->Insert( new RscInconsistent( pClassData->pEntries[ i ].aName, @@ -697,7 +697,7 @@ BOOL RscBaseCont::IsConsistent( const RSCINST & rInst, RscInconsList * pList ){ else if( SearchElePos( rInst, pClassData->pEntries[ i ].aName, pClassData->pEntries[ i ].aInst.pClass, i +1 ).IsInst() ) { - bRet = FALSE; + bRet = sal_False; if( pList ) pList->Insert( new RscInconsistent( pClassData->pEntries[ i ].aName, @@ -706,7 +706,7 @@ BOOL RscBaseCont::IsConsistent( const RSCINST & rInst, RscInconsList * pList ){ } if( ! pClassData->pEntries[ i ].aInst.pClass-> IsConsistent( pClassData->pEntries[ i ].aInst, pList ) ) - bRet = FALSE; + bRet = sal_False; }; return( bRet ); @@ -746,20 +746,20 @@ void RscBaseCont::SetToDefault( const RSCINST & rInst ) |* Letzte Aenderung MM 25.04.91 |* *************************************************************************/ -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 ); }; }; @@ -775,19 +775,19 @@ BOOL RscBaseCont::IsDefault( const RSCINST & rInst ){ |* Letzte Aenderung MM 15.01.92 |* *************************************************************************/ -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; } /************************************************************************* @@ -886,14 +886,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++ ){ @@ -914,7 +914,7 @@ void RscBaseCont::ContWriteRcAccess FILE * fOutput, RscTypCont * pTC, const char * pName, - BOOL bWriteSize + sal_Bool bWriteSize ) { if( (bNoId || bWriteSize) && !pTypeClass1 ) @@ -965,7 +965,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; @@ -1057,7 +1057,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 ) {} @@ -1100,7 +1100,7 @@ void RscContWriteSrc::WriteSrc( const RSCINST & rInst, FILE * fOutput, |* Letzte Aenderung MM 08.05.91 |* *************************************************************************/ -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 ) {} @@ -1114,7 +1114,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; @@ -1139,7 +1139,7 @@ void RscCont::WriteRcAccess const char * pName ) { - ContWriteRcAccess( fOutput, pTC, pName, TRUE ); + ContWriteRcAccess( fOutput, pTC, pName, sal_True ); } /************************************************************************* @@ -1152,7 +1152,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 ) {} @@ -1166,7 +1166,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 e742b806408e..a1844c5a057c 100644 --- a/rsc/source/res/rscflag.cxx +++ b/rsc/source/res/rscflag.cxx @@ -100,7 +100,7 @@ ERRTYPE RscFlag::SetNotConst( const RSCINST & rInst, Atom nConst ) |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -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; @@ -147,7 +147,7 @@ RSCINST RscFlag::CreateBasic( RSCINST * pInst ) |* Letzte Aenderung MM 16.01.92 |* *************************************************************************/ -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; @@ -179,7 +179,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; @@ -231,17 +231,17 @@ void RscFlag::SetToDefault( const RSCINST & rInst ) |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -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; @@ -249,11 +249,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 ); } /************************************************************************* @@ -265,7 +265,7 @@ BOOL RscFlag::IsDefault( const RSCINST & rInst, Atom nConstId ) |* Letzte Aenderung MM 25.04.91 |* *************************************************************************/ -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; @@ -278,15 +278,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; @@ -299,7 +299,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 ) @@ -307,9 +307,9 @@ BOOL RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) }; } else - return FALSE; + return sal_False; - return TRUE; + return sal_True; } /************************************************************************* @@ -321,7 +321,7 @@ BOOL RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) |* Letzte Aenderung MM 10.04.91 |* *************************************************************************/ -BOOL RscFlag::IsSet( const RSCINST & rInst, Atom nConstId ) +sal_Bool RscFlag::IsSet( const RSCINST & rInst, Atom nConstId ) { sal_uInt32 i = 0, nFlag = 0; @@ -329,11 +329,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 ); } /************************************************************************* @@ -349,7 +349,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++ ){ @@ -363,7 +363,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 ) @@ -381,9 +381,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; @@ -397,7 +397,7 @@ ERRTYPE RscFlag::WriteRc( const RSCINST & rInst, RscWriteRc & aMem, Flag = 1; }; - aMem.Put( (INT32)lVal ); + aMem.Put( (sal_Int32)lVal ); return( ERR_OK ); } @@ -445,9 +445,9 @@ void RscClient::WriteSrc( const RSCINST & rInst, FILE * fOutput, RscTypCont *, sal_uInt32, const char * ) { if( pRefClass->IsSet( rInst, nConstId ) ) - fprintf( fOutput, "TRUE" ); + fprintf( fOutput, "sal_True" ); else - fprintf( fOutput, "FALSE" ); + fprintf( fOutput, "sal_False" ); } /************************************************************************* @@ -460,7 +460,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 3e3d29372fe7..da8f19b68685 100644 --- a/rsc/source/res/rscmgr.cxx +++ b/rsc/source/res/rscmgr.cxx @@ -78,7 +78,7 @@ sal_uInt32 RscMgr::Size() |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -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; @@ -136,7 +136,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 ); } @@ -150,12 +150,12 @@ void RscMgr::SetToDefault( const RSCINST & rInst ) |* Letzte Aenderung MM 12.06.91 |* *************************************************************************/ -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 ) ); } @@ -169,23 +169,23 @@ BOOL RscMgr::IsDefault( const RSCINST & rInst ){ |* Letzte Aenderung MM 12.06.91 |* *************************************************************************/ -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; } @@ -254,7 +254,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; @@ -350,7 +350,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 ); @@ -453,7 +453,7 @@ ERRTYPE RscMgr::WriteHxxHeader( const RSCINST & rInst, FILE * fOutput, if( aError.IsOk() ) { fprintf( fOutput, "public:\n " ); - fprintf( fOutput, "%s%s bFreeRes = TRUE )", + fprintf( fOutput, "%s%s bFreeRes = sal_True )", MakeName( pTC, rInst.pClass, rId.GetName() ).GetBuffer(), (rInst.pClass->aCallParType).GetBuffer() ); @@ -593,9 +593,9 @@ ERRTYPE RscMgr::WriteCxx( const RSCINST & rInst, FILE * fOutput, |* Letzte Aenderung MM 23.09.91 |* *************************************************************************/ -BOOL RscMgr::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) +sal_Bool RscMgr::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) { - BOOL bRet; + sal_Bool bRet; RscMgrInst * pClassData; bRet = RscClass::IsConsistent( rInst, pList ); @@ -610,7 +610,7 @@ BOOL RscMgr::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) pList->Insert( new RscInconsistent( pClassData->aRefId, pClassData->aRefId ) ); - bRet = FALSE; + bRet = sal_False; } return( bRet ); @@ -664,7 +664,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; } @@ -708,7 +708,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 5ade3936bdf8..69fcb1b73d6a 100644 --- a/rsc/source/res/rscrange.cxx +++ b/rsc/source/res/rscrange.cxx @@ -82,7 +82,7 @@ RSCCLASS_TYPE RscRange::GetClassType() const |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -ERRTYPE RscRange::SetRange( INT32 nMinimum, INT32 nMaximum ) +ERRTYPE RscRange::SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ) { if( nMinimum > nMaximum ) { @@ -107,18 +107,18 @@ ERRTYPE RscRange::SetRange( INT32 nMinimum, INT32 nMaximum ) |* Letzte Aenderung MM 15.02.92 |* *************************************************************************/ -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; } /************************************************************************* @@ -130,12 +130,12 @@ BOOL RscRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -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 ); } @@ -148,7 +148,7 @@ ERRTYPE RscRange::SetNumber( const RSCINST & rInst, INT32 nValue ) |* Letzte Aenderung MM 22.04.91 |* *************************************************************************/ -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 ); @@ -164,7 +164,7 @@ ERRTYPE RscRange::GetNumber( const RSCINST & rInst, INT32 * pN ) |* *************************************************************************/ RSCINST RscRange::Create( RSCINST * pInst, const RSCINST & rDflt, - BOOL bOwnClass ) + sal_Bool bOwnClass ) { RSCINST aInst; @@ -187,7 +187,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 ); @@ -218,7 +218,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 ) { @@ -292,7 +292,7 @@ RSCCLASS_TYPE RscLongRange::GetClassType() const |* Letzte Aenderung MM 18.07.94 |* *************************************************************************/ -ERRTYPE RscLongRange::SetRange( INT32 nMinimum, INT32 nMaximum ) +ERRTYPE RscLongRange::SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ) { if( nMinimum > nMaximum ) { @@ -317,14 +317,14 @@ ERRTYPE RscLongRange::SetRange( INT32 nMinimum, INT32 nMaximum ) |* Letzte Aenderung MM 15.02.92 |* *************************************************************************/ -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; } /************************************************************************* @@ -336,13 +336,13 @@ BOOL RscLongRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) |* Letzte Aenderung MM 18.07.94 |* *************************************************************************/ -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 ); } @@ -355,10 +355,10 @@ ERRTYPE RscLongRange::SetNumber( const RSCINST & rInst, INT32 nValue ) |* Letzte Aenderung MM 22.04.91 |* *************************************************************************/ -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 ); } @@ -372,7 +372,7 @@ ERRTYPE RscLongRange::GetNumber( const RSCINST & rInst, INT32 * pN ) |* *************************************************************************/ RSCINST RscLongRange::Create( RSCINST * pInst, const RSCINST & rDflt, - BOOL bOwnClass ) + sal_Bool bOwnClass ) { RSCINST aInst; @@ -391,14 +391,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 ); @@ -416,7 +416,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(lVal) ); } @@ -431,12 +431,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 ); } @@ -451,7 +451,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 *********************/ @@ -471,7 +471,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 ); } @@ -516,7 +516,7 @@ RSCCLASS_TYPE RscIdRange::GetClassType() const |* Letzte Aenderung MM 03.04.91 |* *************************************************************************/ -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; @@ -539,11 +539,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 ); @@ -571,7 +571,7 @@ void RscIdRange :: Destroy( const RSCINST & rInst ){ |* Letzte Aenderung MM 15.01.92 |* *************************************************************************/ -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() ) @@ -579,12 +579,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; } /************************************************************************* @@ -596,13 +596,13 @@ BOOL RscIdRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){ |* Letzte Aenderung MM 25.11.91 |* *************************************************************************/ -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 ); } @@ -615,7 +615,7 @@ ERRTYPE RscIdRange::SetNumber( const RSCINST & rInst, INT32 nValue ) |* Letzte Aenderung MM 25.11.91 |* *************************************************************************/ -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 ); } @@ -635,7 +635,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 @@ -684,11 +684,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 ); } @@ -703,7 +703,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" ); } /************************************************************************* @@ -715,16 +715,16 @@ void RscIdRange::WriteRcAccess |* Letzte Aenderung MM 22.11.91 |* *************************************************************************/ -BOOL RscIdRange::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) +sal_Bool RscIdRange::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) { long nValue = ((RscId *)rInst.pData)->GetNumber(); if( (nMax >= nValue) && (nMin <= nValue) ) - return TRUE; + return sal_True; else { if( pList ) pList->Insert( new RscInconsistent( *(RscId *)rInst.pData, *(RscId *)rInst.pData ) ); - return FALSE; + return sal_False; } } @@ -770,13 +770,13 @@ 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 ) - fprintf( fOutput, "TRUE" ); + fprintf( fOutput, "sal_True" ); else - fprintf( fOutput, "FALSE" ); + fprintf( fOutput, "sal_False" ); } //======================================================================= @@ -788,7 +788,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" ); } @@ -817,7 +817,7 @@ RscBreakRange :: RscBreakRange( Atom nId, sal_uInt32 nTypeId ) |* Letzte Aenderung MM 24.06.91 |* *************************************************************************/ -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 @@ -834,10 +834,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 6bf25cf4dd58..ad668ac2b3cb 100644 --- a/rsc/source/res/rscstr.cxx +++ b/rsc/source/res/rscstr.cxx @@ -87,7 +87,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 ){ @@ -147,7 +147,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 ); @@ -165,7 +165,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; @@ -181,7 +181,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 = @@ -218,7 +218,7 @@ void RscString::Destroy( const RSCINST & rInst ){ |* Letzte Aenderung MM 15.01.92 |* *************************************************************************/ -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; @@ -231,34 +231,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; } /************************************************************************* @@ -319,7 +319,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 4b7887ebf298..cff9c92ab508 100644 --- a/rsc/source/res/rsctop.cxx +++ b/rsc/source/res/rsctop.cxx @@ -180,12 +180,12 @@ ERRTYPE RscTop :: GetRef( const RSCINST & rInst, RscId * pRscId ){ |* Letzte Aenderung MM 17.05.91 |* *************************************************************************/ -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 ); } /************************************************************************* @@ -238,7 +238,7 @@ RSCINST RscTop::GetVariable const RSCINST & rInst, Atom nVarName, const RSCINST & rInitInst, - BOOL bInitDflt, + sal_Bool bInitDflt, RscTop * pCreateClass ) { @@ -342,7 +342,7 @@ ERRTYPE RscTop::GetArrayEle ERRTYPE RscTop::GetValueEle ( const RSCINST & rInst, - INT32 lValue, + sal_Int32 lValue, RscTop * pCreateClass, RSCINST * pGetInst ) @@ -469,7 +469,7 @@ sal_uInt32 RscTop::GetCount( const RSCINST & rInst ){ |* Letzte Aenderung MM 29.10.91 |* *************************************************************************/ -ERRTYPE RscTop::SetNumber( const RSCINST & rInst, INT32 lValue ){ +ERRTYPE RscTop::SetNumber( const RSCINST & rInst, sal_Int32 lValue ){ if( pSuperClass ) return pSuperClass-> SetNumber( rInst, lValue ); @@ -486,7 +486,7 @@ ERRTYPE RscTop::SetNumber( const RSCINST & rInst, INT32 lValue ){ |* Letzte Aenderung MM 29.10.91 |* *************************************************************************/ -ERRTYPE RscTop::SetBool( const RSCINST & rInst, BOOL bValue ){ +ERRTYPE RscTop::SetBool( const RSCINST & rInst, sal_Bool bValue ){ if( pSuperClass ) return pSuperClass-> SetBool( rInst, bValue ); @@ -503,7 +503,7 @@ ERRTYPE RscTop::SetBool( const RSCINST & rInst, BOOL bValue ){ |* Letzte Aenderung MM 29.10.91 |* *************************************************************************/ -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 ); @@ -554,7 +554,7 @@ ERRTYPE RscTop::SetString( const RSCINST & rInst, const char * pStr ){ |* Letzte Aenderung MM 29.10.91 |* *************************************************************************/ -ERRTYPE RscTop::GetNumber( const RSCINST & rInst, INT32 * pN ){ +ERRTYPE RscTop::GetNumber( const RSCINST & rInst, sal_Int32 * pN ){ if( pSuperClass ) return pSuperClass-> GetNumber( rInst, pN ); @@ -571,7 +571,7 @@ ERRTYPE RscTop::GetNumber( const RSCINST & rInst, INT32 * pN ){ |* Letzte Aenderung MM 29.10.91 |* *************************************************************************/ -ERRTYPE RscTop::GetBool( const RSCINST & rInst, BOOL * pB ){ +ERRTYPE RscTop::GetBool( const RSCINST & rInst, sal_Bool * pB ){ if( pSuperClass ) return pSuperClass-> GetBool( rInst, pB ); @@ -622,7 +622,7 @@ ERRTYPE RscTop::GetString( const RSCINST & rInst, char ** ppStr ){ |* Letzte Aenderung MM 17.07.91 |* *************************************************************************/ -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-> @@ -657,13 +657,13 @@ void RscTop::Destroy( const RSCINST & rInst ){ |* Letzte Aenderung MM 29.10.91 |* *************************************************************************/ -BOOL RscTop::IsConsistent( const RSCINST & rInst, +sal_Bool RscTop::IsConsistent( const RSCINST & rInst, RscInconsList * pList ) { if( pSuperClass ) return pSuperClass->IsConsistent( rInst, pList ); else - return TRUE; + return sal_True; } /************************************************************************* @@ -690,11 +690,11 @@ void RscTop::SetToDefault( const RSCINST & rInst ) |* Letzte Aenderung MM 29.10.91 |* *************************************************************************/ -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; } /************************************************************************* @@ -706,11 +706,11 @@ BOOL RscTop::IsDefault( const RSCINST & rInst ){ |* Letzte Aenderung MM 29.10.91 |* *************************************************************************/ -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; } /************************************************************************* @@ -907,7 +907,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-> @@ -926,7 +926,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 40d589aea359..00c105b7fca6 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -139,7 +139,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 @@ -251,7 +251,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 @@ -346,9 +346,9 @@ RscCmdLine::~RscCmdLine() { ByteString *pString; - while( NULL != (pString = aInputList.Remove( (ULONG)0 )) ) + while( NULL != (pString = aInputList.Remove( (sal_uIntPtr)0 )) ) delete pString; - while( NULL != (pString = aSymbolList.Remove( (ULONG)0 )) ) + while( NULL != (pString = aSymbolList.Remove( (sal_uIntPtr)0 )) ) delete pString; } @@ -576,7 +576,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 } }; @@ -656,7 +656,7 @@ void RscCompiler::EndCompile() |* Letzte Aenderung MM 21.06.91 |* *************************************************************************/ -ERRTYPE RscCompiler :: IncludeParser( ULONG lFileKey ) +ERRTYPE RscCompiler :: IncludeParser( sal_uIntPtr lFileKey ) { FILE * finput; RscFile * pFName; @@ -681,7 +681,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 ); @@ -724,7 +724,7 @@ ERRTYPE RscCompiler :: IncludeParser( ULONG lFileKey ) |* Letzte Aenderung MM 26.06.91 |* *************************************************************************/ -ERRTYPE RscCompiler :: ParseOneFile( ULONG lFileKey, +ERRTYPE RscCompiler :: ParseOneFile( sal_uIntPtr lFileKey, const RscCmdLine::OutputFile* pOutputFile, const WriteRcContext* pContext ) { @@ -740,7 +740,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 pDep = pFName->First(); while( pDep && aError.IsOk() ) { @@ -750,7 +750,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 ); @@ -838,7 +838,7 @@ ERRTYPE RscCompiler::Link() { pTC->Delete( pTC->aFileTab.GetIndex( pFName ) ); pTC->aFileTab.Seek( pFName ); - pFName->bLoaded = FALSE; + pFName->bLoaded = sal_False; } } @@ -1132,7 +1132,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. */ diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h index 11327d4fb9d1..3c8102d1b614 100644 --- a/rsc/source/rscpp/cpp.h +++ b/rsc/source/rscpp/cpp.h @@ -26,9 +26,9 @@ ************************************************************************/ -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 +#ifndef sal_True +#define sal_True 1 +#define sal_False 0 #endif /* in cpp1.c: file-pointer auf stdout oder file */ @@ -150,9 +150,9 @@ extern FILE *pDefOut; /* ER */ /* * These bits are set in ifstack[] */ -#define WAS_COMPILING 1 /* TRUE if compile set at entry */ -#define ELSE_SEEN 2 /* TRUE when #else processed */ -#define TRUE_SEEN 4 /* TRUE when #if TRUE processed */ +#define WAS_COMPILING 1 /* sal_True if compile set at entry */ +#define ELSE_SEEN 2 /* sal_True when #else processed */ +#define TRUE_SEEN 4 /* sal_True when #if sal_True processed */ /* * Define bits for the basic types and their adjectives @@ -256,8 +256,8 @@ extern int line; /* Current line number */ extern int wrongline; /* Force #line to cc pass 1 */ extern char type[]; /* Character classifier */ extern char token[IDMAX + 1]; /* Current input token */ -extern int instring; /* TRUE if scanning string */ -extern int inmacro; /* TRUE if scanning #define */ +extern int instring; /* sal_True if scanning string */ +extern int inmacro; /* sal_True if scanning #define */ extern int errors; /* Error counter */ extern int recursion; /* Macro depth counter */ extern char ifstack[BLK_NEST]; /* #if information */ @@ -277,8 +277,8 @@ extern char *workp; /* Free space in work */ #if OSL_DEBUG_LEVEL > 1 extern int debug; /* Debug level */ /* ER dump & evaluate #define's */ -extern int bDumpDefs; /* TRUE if #define's dump req. */ -extern int bIsInEval; /* TRUE if #define dumping now */ +extern int bDumpDefs; /* sal_True if #define's dump req. */ +extern int bIsInEval; /* sal_True if #define dumping now */ #ifdef EVALDEFS extern char EvalBuf[NEVALBUF + 1]; /* evaluation buffer */ extern int nEvalOff; /* offset to free buffer pos */ diff --git a/rsc/source/rscpp/cpp1.c b/rsc/source/rscpp/cpp1.c index 1eb7561a2db0..ace0206c7d9b 100644 --- a/rsc/source/rscpp/cpp1.c +++ b/rsc/source/rscpp/cpp1.c @@ -66,10 +66,10 @@ char token[IDMAX + 1]; /* Current input token */ int errors; /* cpp error counter */ FILEINFO *infile = NULL; /* Current input file */ #if OSL_DEBUG_LEVEL > 1 -int debug; /* TRUE if debugging now */ -int bDumpDefs; /* TRUE if #define's dump req. */ +int debug; /* sal_True if debugging now */ +int bDumpDefs; /* sal_True if #define's dump req. */ #ifdef EVALDEFS -int bIsInEval; /* TRUE if #define eval now */ +int bIsInEval; /* sal_True if #define eval now */ char EvalBuf[NEVALBUF + 1]; /* evaluation buffer */ int nEvalOff = 0; /* offset to free buffer pos */ #endif @@ -85,10 +85,10 @@ int nEvalOff = 0; /* offset to free buffer pos */ * currently: it is a hook for an eventual invocation flag.) */ int recursion; /* Infinite recursion counter */ -int rec_recover = TRUE; /* Unwind recursive macros */ +int rec_recover = sal_True; /* Unwind recursive macros */ /* - * instring is set TRUE when a string is scanned. It modifies the + * instring is set sal_True when a string is scanned. It modifies the * behavior of the "get next character" routine, causing all characters * to be passed to the caller (except ). Note especially that * comments and \ are not removed from the source. (This @@ -103,8 +103,8 @@ int rec_recover = TRUE; /* Unwind recursive macros */ * instring and inmarcor are parameters to the get() routine which * were made global for speed. */ -int instring = FALSE; /* TRUE if scanning string */ -int inmacro = FALSE; /* TRUE if #defining a macro */ +int instring = sal_False; /* sal_True if scanning string */ +int inmacro = sal_False; /* sal_True if #defining a macro */ /* * work[] and workp are used to store one piece of text in a temporay @@ -119,7 +119,7 @@ char work[NWORK + 1]; /* Work buffer */ char *workp; /* Work buffer pointer */ /* - * keepcomments is set TRUE by the -C option. If TRUE, comments + * keepcomments is set sal_True by the -C option. If sal_True, comments * are written directly to the output stream. This is needed if * the output from cpp is to be passed to lint (which uses commands * embedded in comments). cflag contains the permanent state of the @@ -133,21 +133,21 @@ char *workp; /* Work buffer pointer */ * __FILE__, and __DATE__. If nflag > 1, absolutely no symbols * are predefined. */ -int keepcomments = FALSE; /* Write out comments flag */ -int cflag = FALSE; /* -C option (keep comments) */ -int eflag = FALSE; /* -E option (never fail) */ +int keepcomments = sal_False; /* Write out comments flag */ +int cflag = sal_False; /* -C option (keep comments) */ +int eflag = sal_False; /* -E option (never fail) */ int nflag = 0; /* -N option (no predefines) */ /* * ifstack[] holds information about nested #if's. It is always * accessed via *ifptr. The information is as follows: * WAS_COMPILING state of compiling flag at outer level. - * ELSE_SEEN set TRUE when #else seen to prevent 2nd #else. - * TRUE_SEEN set TRUE when #if or #elif succeeds - * ifstack[0] holds the compiling flag. It is TRUE if compilation - * is currently enabled. Note that this must be initialized TRUE. + * ELSE_SEEN set sal_True when #else seen to prevent 2nd #else. + * TRUE_SEEN set sal_True when #if or #elif succeeds + * ifstack[0] holds the compiling flag. It is sal_True if compilation + * is currently enabled. Note that this must be initialized sal_True. */ -char ifstack[BLK_NEST] = { TRUE }; /* #if information */ +char ifstack[BLK_NEST] = { sal_True }; /* #if information */ char *ifptr = ifstack; /* -> current ifstack[] */ /* @@ -211,7 +211,7 @@ void InitCpp1() workp = NULL; for( i = 0; i < BLK_NEST; i++ ) - ifstack[ i ] = TRUE; + ifstack[ i ] = sal_True; ifptr = ifstack; pCppOut = stdout; @@ -227,9 +227,9 @@ void InitCpp1() nEvalOff = 0; #endif #endif - rec_recover = TRUE; + rec_recover = sal_True; infile = NULL; - instring = inmacro = keepcomments = cflag = eflag = FALSE; + instring = inmacro = keepcomments = cflag = eflag = sal_False; nflag = 0; incend = incdir; sharpfilename = NULL; @@ -426,7 +426,7 @@ void cppmain() } /* * This loop is started "from the top" at the beginning of each line - * wrongline is set TRUE in many places if it is necessary to write + * wrongline is set sal_True in many places if it is necessary to write * a #line record. (But we don't write them when expanding macros.) * * The counter variable has two different uses: at @@ -446,7 +446,7 @@ void cppmain() if (c == '\n') /* If line's all blank, */ ++counter; /* Do nothing now */ else if (c == '#') { /* Is 1st non-space '#' */ - keepcomments = FALSE; /* Don't pass comments */ + keepcomments = sal_False; /* Don't pass comments */ counter = control(counter); /* Yes, do a #command */ keepcomments = (cflag && compiling); } @@ -542,7 +542,7 @@ void cppmain() end_line: if (c == '\n') { /* Compiling at EOL? */ PUTCHAR('\n'); /* Output newline, if */ if (infile->fp == NULL) /* Expanding a macro, */ - wrongline = TRUE; /* Output # line later */ + wrongline = sal_True; /* Output # line later */ } } /* Continue until EOF */ #ifdef EVALDEFS @@ -612,5 +612,5 @@ void sharp() } } PUTCHAR('\n'); - wrongline = FALSE; + wrongline = sal_False; } diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c index 68d1d2dc72ba..c421308654e5 100644 --- a/rsc/source/rscpp/cpp2.c +++ b/rsc/source/rscpp/cpp2.c @@ -189,7 +189,7 @@ dump_line: skipnl(); /* Ignore rest of line */ free(infile->progname); /* if it's allocated. */ infile->progname = savestring(tp); } - wrongline = TRUE; /* Force output later */ + wrongline = sal_True; /* Force output later */ break; case L_include: @@ -212,9 +212,9 @@ dump_line: skipnl(); /* Ignore rest of line */ *ifptr |= ELSE_SEEN; if ((*ifptr & WAS_COMPILING) != 0) { if (compiling || (*ifptr & TRUE_SEEN) != 0) - compiling = FALSE; + compiling = sal_False; else { - compiling = TRUE; + compiling = sal_True; } } break; @@ -227,7 +227,7 @@ else_seen_err: cerror("#%s may not follow #else", token); goto dump_line; } if ((*ifptr & (WAS_COMPILING | TRUE_SEEN)) != WAS_COMPILING) { - compiling = FALSE; /* Done compiling stuff */ + compiling = sal_False; /* Done compiling stuff */ goto dump_line; /* Skip this clause */ } doif(L_if); @@ -248,7 +248,7 @@ nest_err: cerror("#%s must be in an #if", token); goto dump_line; } if (!compiling && (*ifptr & WAS_COMPILING) != 0) - wrongline = TRUE; + wrongline = sal_True; compiling = ((*ifptr & WAS_COMPILING) != 0); --ifptr; break; @@ -323,7 +323,7 @@ void doif(int hash) * Process an #if, #ifdef, or #ifndef. The latter two are straightforward, * while #if needs a subroutine of its own to evaluate the expression. * - * doif() is called only if compiling is TRUE. If false, compilation + * doif() is called only if compiling is sal_True. If false, compilation * is always supressed, so we don't need to evaluate anything. This * supresses unnecessary warnings. */ @@ -337,7 +337,7 @@ void doif(int hash) } if (hash == L_if) { unget(); - found = (eval() != 0); /* Evaluate expr, != 0 is TRUE */ + found = (eval() != 0); /* Evaluate expr, != 0 is sal_True */ hash = L_ifdef; /* #if is now like #ifdef */ } else { @@ -346,11 +346,11 @@ void doif(int hash) found = (lookid(c) != NULL); /* Look for it in symbol table */ } if (found == (hash == L_ifdef)) { - compiling = TRUE; + compiling = sal_True; *ifptr |= TRUE_SEEN; } else { - compiling = FALSE; + compiling = sal_False; } return; @@ -391,7 +391,7 @@ void doinclude() if (delim == '<') delim = '>'; workp = work; - instring = TRUE; /* Accept all characters */ + instring = sal_True; /* Accept all characters */ #ifdef CONTROL_COMMENTS_NOT_ALLOWED while ((c = get()) != '\n' && c != EOF_CHAR) save(c); /* Put it away. */ @@ -408,7 +408,7 @@ void doinclude() save(c); #endif *workp = EOS; /* Terminate filename */ - instring = FALSE; + instring = sal_False; #if HOST == SYS_VMS /* * Assume the default .h filetype. @@ -439,7 +439,7 @@ openinclude(char* filename, int searchlocal) * doinclude() above, but was written as a separate subroutine for * programmer convenience. It searches the list of directories * and actually opens the file, linking it into the list of - * active files. Returns TRUE if the file was opened, FALSE + * active files. Returns sal_True if the file was opened, sal_False * if openinclude() fails. No error message is printed. */ { @@ -475,7 +475,7 @@ openinclude(char* filename, int searchlocal) } #endif if (openfile(tmpname)) - return (TRUE); + return (sal_True); } /* * Look in any directories specified by -I command line @@ -502,10 +502,10 @@ openinclude(char* filename, int searchlocal) sprintf(tmpname, "%s%s", *incptr, filename); #endif if (openfile(tmpname)) - return (TRUE); + return (sal_True); } } - return (FALSE); + return (sal_False); } FILE_LOCAL int @@ -513,26 +513,26 @@ hasdirectory(char* source, char* result) /* * If a device or directory is found in the source filename string, the * node/device/directory part of the string is copied to result and - * hasdirectory returns TRUE. Else, nothing is copied and it returns FALSE. + * hasdirectory returns sal_True. Else, nothing is copied and it returns sal_False. */ { #if HOST == SYS_UNIX register char *tp; if ((tp = strrchr(source, '/')) == NULL) - return (FALSE); + return (sal_False); else { strncpy(result, source, tp - source + 1); result[tp - source + 1] = EOS; - return (TRUE); + return (sal_True); } #else #if HOST == SYS_VMS if (vmsparse(source, NULLST, result) && result[0] != EOS) - return (TRUE); + return (sal_True); else { - return (FALSE); + return (sal_False); } #else /* @@ -542,11 +542,11 @@ hasdirectory(char* source, char* result) if ((tp = strrchr(source, ']')) == NULL && (tp = strrchr(source, ':')) == NULL) - return (FALSE); + return (sal_False); else { strncpy(result, source, tp - source + 1); result[tp - source + 1] = EOS; - return (TRUE); + return (sal_True); } #endif #endif @@ -569,7 +569,7 @@ char *result; /* Size is at least NAM$C_MAXRSS + 1 */ /* * Parse the source string, applying the default (properly, using * the system parse routine), storing it in result. - * TRUE if it parsed, FALSE on error. + * sal_True if it parsed, sal_False on error. * * If defstring is NULL, there are no defaults and result gets * (just) the node::[directory] part of the string (possibly "") @@ -617,9 +617,9 @@ char *result; /* Size is at least NAM$C_MAXRSS + 1 */ rp[nam.nam$b_ver] = EOS; } } - return (TRUE); + return (sal_True); } - return (FALSE); + return (sal_False); } #endif diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c index e9c03cdd4874..02a59efa8ea4 100644 --- a/rsc/source/rscpp/cpp3.c +++ b/rsc/source/rscpp/cpp3.c @@ -69,14 +69,14 @@ openfile(char* filename) if ( debug || !bDumpDefs ) perror(filename); #endif - return (FALSE); + return (sal_False); } #if OSL_DEBUG_LEVEL > 1 if (debug) fprintf(stderr, "Reading from \"%s\"\n", filename); #endif addfile(fp, filename); - return (TRUE); + return (sal_True); } void addfile(FILE* fp, char* filename) @@ -96,7 +96,7 @@ void addfile(FILE* fp, char* filename) file->fp = fp; /* Better remember FILE * */ file->buffer[0] = EOS; /* Initialize for first read */ line = 1; /* Working on line 1 now */ - wrongline = TRUE; /* Force out initial #line */ + wrongline = sal_True; /* Force out initial #line */ } void setincdirs() @@ -128,9 +128,9 @@ void setincdirs() #endif #if HOST == SYS_RSX - extern int $$rsts; /* TRUE on RSTS/E */ - extern int $$pos; /* TRUE on PRO-350 P/OS */ - extern int $$vms; /* TRUE on VMS compat. */ + extern int $$rsts; /* sal_True on RSTS/E */ + extern int $$pos; /* sal_True on PRO-350 P/OS */ + extern int $$vms; /* sal_True on VMS compat. */ if ($$pos) { /* P/OS? */ *incend++ = "SY:[ZZDECUSC]"; /* C #includes */ @@ -230,7 +230,7 @@ dooptions(int argc, char** argv) char *arg; SIZES *sizp; /* For -S */ int size; /* For -S */ - int isdatum; /* FALSE for -S* */ + int isdatum; /* sal_False for -S* */ int endtest; /* For -S */ for (i = j = 1; i < argc; i++) { @@ -246,8 +246,8 @@ dooptions(int argc, char** argv) c = toupper(c); switch (c) { /* Command character */ case 'C': /* Keep comments */ - cflag = TRUE; - keepcomments = TRUE; + cflag = sal_True; + keepcomments = sal_True; break; case 'D': /* Define symbol */ @@ -266,13 +266,13 @@ dooptions(int argc, char** argv) /* * Now, save the word and its definition. */ - dp = defendel(argv[i] + 2, FALSE); + dp = defendel(argv[i] + 2, sal_False); dp->repl = savestring(ap); dp->nargs = DEF_NOARGS; break; case 'E': /* Ignore non-fatal */ - eflag = TRUE; /* errors. */ + eflag = sal_True; /* errors. */ break; case 'I': /* Include directory */ @@ -317,7 +317,7 @@ dooptions(int argc, char** argv) #if HOST != SYS_UNIX /* zap_uc(ap);*/ #endif - if (defendel(ap, TRUE) == NULL) + if (defendel(ap, sal_True) == NULL) cwarn("\"%s\" wasn't defined", ap); break; @@ -386,7 +386,7 @@ readoptions(char* filename, char*** pfargv) if ( debug || !bDumpDefs ) perror(filename); #endif - return (FALSE); + return (sal_False); } do { @@ -480,7 +480,7 @@ void initdefines() if (nflag == 0) { for (pp = preset; *pp != NULL; pp++) { if (*pp[0] != EOS) { - dp = defendel(*pp, FALSE); + dp = defendel(*pp, sal_False); dp->repl = savestring("1"); dp->nargs = DEF_NOARGS; } @@ -494,14 +494,14 @@ void initdefines() */ if (nflag < 2) { for (pp = magic, i = DEF_NOARGS; *pp != NULL; pp++) { - dp = defendel(*pp, FALSE); + dp = defendel(*pp, sal_False); dp->nargs = --i; } #if OK_DATE /* * Define __DATE__ as today's date. */ - dp = defendel("__DATE__", FALSE); + dp = defendel("__DATE__", sal_False); dp->repl = tp = getmem(27); dp->nargs = DEF_NOARGS; time( (time_t*)&tvec); diff --git a/rsc/source/rscpp/cpp4.c b/rsc/source/rscpp/cpp4.c index b8f90ab4f7ed..612d6873241d 100644 --- a/rsc/source/rscpp/cpp4.c +++ b/rsc/source/rscpp/cpp4.c @@ -91,16 +91,16 @@ void dodefine() { register int c; register DEFBUF *dp; /* -> new definition */ - int isredefine; /* TRUE if redefined */ + int isredefine; /* sal_True if redefined */ char *old = 0; /* Remember redefined */ if (type[(c = skipws())] != LET) goto bad_define; - isredefine = FALSE; /* Set if redefining */ + isredefine = sal_False; /* Set if redefining */ if ((dp = lookid(c)) == NULL) /* If not known now */ - dp = defendel(token, FALSE); /* Save the name */ + dp = defendel(token, sal_False); /* Save the name */ else { /* It's known: */ - isredefine = TRUE; /* Remember this fact */ + isredefine = sal_True; /* Remember this fact */ old = dp->repl; /* Remember replacement */ dp->repl = NULL; /* No replacement now */ } @@ -132,7 +132,7 @@ void dodefine() if (type[c] == SPA) /* At whitespace? */ c = skipws(); /* Not any more. */ workp = work; /* Replacement put here */ - inmacro = TRUE; /* Keep \ now */ + inmacro = sal_True; /* Keep \ now */ while (c != EOF_CHAR && c != '\n') { /* Compile macro body */ #if OK_CONCAT #if COMMENT_INVISIBLE @@ -184,7 +184,7 @@ void dodefine() case BSH: /* Backslash */ save('\\'); if ((c = get()) == '\n') - wrongline = TRUE; + wrongline = sal_True; save(c); break; @@ -204,7 +204,7 @@ void dodefine() } c = get(); } - inmacro = FALSE; /* Stop newline hack */ + inmacro = sal_False; /* Stop newline hack */ unget(); /* For control check */ if (workp > work && workp[-1] == ' ') /* Drop trailing blank */ workp--; @@ -234,7 +234,7 @@ void dodefine() bad_define: cerror("#define syntax error", NULLST); - inmacro = FALSE; /* Stop hack */ + inmacro = sal_False; /* Stop hack */ } void checkparm(int c, DEFBUF* dp) @@ -285,7 +285,7 @@ register DEFBUF *dp; * ANSI Standard C language. */ save(delim); - instring = TRUE; + instring = sal_True; while ((c = get()) != delim && c != '\n' && c != EOF_CHAR) { @@ -297,7 +297,7 @@ register DEFBUF *dp; save(get()); } } - instring = FALSE; + instring = sal_False; if (c != delim) cerror("Unterminated string in macro body", NULLST); save(c); @@ -349,7 +349,7 @@ void doundef() cerror("Illegal #undef argument", NULLST); else { scanid(c); /* Get name to token[] */ - if (defendel(token, TRUE) == NULL) { + if (defendel(token, sal_True) == NULL) { #ifdef STRICT_UNDEF cwarn("Symbol \"%s\" not defined in #undef", token); #endif @@ -459,7 +459,7 @@ void expand(DEFBUF* tokenp) if (tokenp->nargs < 0) cfatal("Bug: Illegal __ macro \"%s\"", tokenp->name); while ((c = skipws()) == '\n') /* Look for (, skipping */ - wrongline = TRUE; /* spaces and newlines */ + wrongline = sal_True; /* spaces and newlines */ if (c != '(') { /* * If the programmer writes @@ -491,7 +491,7 @@ void expand(DEFBUF* tokenp) FILE_LOCAL int expcollect() /* - * Collect the actual parameters for this macro. TRUE if ok. + * Collect the actual parameters for this macro. sal_True if ok. */ { register int c; @@ -499,7 +499,7 @@ expcollect() for (;;) { paren = 0; /* Collect next arg. */ while ((c = skipws()) == '\n') /* Skip over whitespace */ - wrongline = TRUE; /* and newlines. */ + wrongline = sal_True; /* and newlines. */ if (c == ')') { /* At end of all args? */ /* * Note that there is a guard byte in parm[] @@ -514,7 +514,7 @@ expcollect() for (;; c = cget()) { /* Collect arg's bytes */ if (c == EOF_CHAR) { cerror("end of file within macro argument", NULLST); - return (FALSE); /* Sorry. */ + return (sal_False); /* Sorry. */ } else if (c == '\\') { /* Quote next character */ charput(c); /* Save the \ for later */ @@ -537,7 +537,7 @@ expcollect() else if (c == ',' && paren == 0) /* Comma delimits args */ break; else if (c == '\n') /* Newline inside arg? */ - wrongline = TRUE; /* We'll need a #line */ + wrongline = sal_True; /* We'll need a #line */ charput(c); /* Store this one */ } /* Collect an argument */ charput(EOS); /* Terminate argument */ @@ -546,7 +546,7 @@ expcollect() fprintf( pCppOut, "parm[%d] = \"%s\"\n", nargs, parlist[nargs - 1]); #endif } /* Collect all args. */ - return (TRUE); /* Normal return */ + return (sal_True); /* Normal return */ } FILE_LOCAL diff --git a/rsc/source/rscpp/cpp5.c b/rsc/source/rscpp/cpp5.c index 70f05543c465..7472a462fb15 100644 --- a/rsc/source/rscpp/cpp5.c +++ b/rsc/source/rscpp/cpp5.c @@ -91,7 +91,7 @@ static char opdope[OP_MAX] = { typedef struct optab { char op; /* Operator */ char prec; /* Its precedence */ - char skip; /* Short-circuit: TRUE to skip */ + char skip; /* Short-circuit: sal_True to skip */ } OPTAB; static int evalue; /* Current value from evallex() */ @@ -222,7 +222,7 @@ eval() * evaleval Evaluate the current operator, given the values on * the value stack. Returns a pointer to the (new) * value stack. - * For compatiblity with older cpp's, this return returns 1 (TRUE) + * For compatiblity with older cpp's, this return returns 1 (sal_True) * if a syntax error is detected. */ { @@ -609,7 +609,7 @@ nogood: unget(); FILE_LOCAL int bittest(int value) /* - * TRUE if value is zero or exactly one bit is set in value. + * sal_True if value is zero or exactly one bit is set in value. */ { #if (4096 & ~(-4096)) == 0 @@ -674,7 +674,7 @@ evalchar(int skip) register int value; register int count; - instring = TRUE; + instring = sal_True; if ((c = cget()) == '\\') { switch ((c = cget())) { case 'a': /* New in Standard */ @@ -766,7 +766,7 @@ evalchar(int skip) value += c; #endif } - instring = FALSE; + instring = sal_False; return (value); } diff --git a/rsc/source/rscpp/cpp6.c b/rsc/source/rscpp/cpp6.c index fd2a2a9a0dd7..209ee4217067 100644 --- a/rsc/source/rscpp/cpp6.c +++ b/rsc/source/rscpp/cpp6.c @@ -44,8 +44,8 @@ * never expanded. * macroid() reads the next token (C identifier) into token[]. * If it is a #defined macro, it is expanded, and - * macroid() returns TRUE, otherwise, FALSE. - * catenate() Does the dirty work of token concatenation, TRUE if it did. + * macroid() returns sal_True, otherwise, sal_False. + * catenate() Does the dirty work of token concatenation, sal_True if it did. * scanstring() Reads a string from the input stream, calling * a user-supplied function for each character. * This function may be output() to write the @@ -273,9 +273,9 @@ catenate() /* * A token was just read (via macroid). * If the next character is TOK_SEP, concatenate the next token - * return TRUE -- which should recall macroid after refreshing + * return sal_True -- which should recall macroid after refreshing * macroid's argument. If it is not TOK_SEP, unget() the character - * and return FALSE. + * and return sal_False. */ { register int c; @@ -284,7 +284,7 @@ catenate() #if OK_CONCAT if (get() != TOK_SEP) { /* Token concatenation */ unget(); - return (FALSE); + return (sal_False); } else { token1 = savestring(token); /* Save first token */ @@ -327,10 +327,10 @@ catenate() */ free(token1); /* Free up memory */ ungetstring(work); /* Unget the new thing, */ - return (TRUE); + return (sal_True); } #else - return (FALSE); /* Not supported */ + return (sal_False); /* Not supported */ #endif } @@ -345,12 +345,12 @@ void (*outfun)() /* BP */ /* * Scan off a string. Warning if terminated by newline or EOF. * outfun() outputs the character -- to a buffer if in a macro. - * TRUE if ok, FALSE if error. + * sal_True if ok, sal_False if error. */ { register int c; - instring = TRUE; /* Don't strip comments */ + instring = sal_True; /* Don't strip comments */ (*outfun)(delim); while ((c = get()) != delim && c != '\n' @@ -361,15 +361,15 @@ void (*outfun)() /* BP */ if (c == '\\') (*outfun)(get()); } - instring = FALSE; + instring = sal_False; if (c == delim) { (*outfun)(c); - return (TRUE); + return (sal_True); } else { cerror("Unterminated string", NULLST); unget(); - return (FALSE); + return (sal_False); } } @@ -389,13 +389,13 @@ register void (*outfun)() /* BP */ int expseen; /* 'e' seen in floater */ int signseen; /* '+' or '-' seen */ int octal89; /* For bad octal test */ - int dotflag; /* TRUE if '.' was seen */ + int dotflag; /* sal_True if '.' was seen */ - expseen = FALSE; /* No exponent seen yet */ - signseen = TRUE; /* No +/- allowed yet */ - octal89 = FALSE; /* No bad octal yet */ + expseen = sal_False; /* No exponent seen yet */ + signseen = sal_True; /* No +/- allowed yet */ + octal89 = sal_False; /* No bad octal yet */ radix = 10; /* Assume decimal */ - if ((dotflag = (c == '.')) != FALSE) { /* . something? */ + if ((dotflag = (c == '.')) != sal_False) { /* . something? */ (*outfun)('.'); /* Always out the dot */ if (type[(c = get())] != DIG) { /* If not a float numb, */ unget(); /* Rescan strange char */ @@ -420,25 +420,25 @@ register void (*outfun)() /* BP */ if (radix != 16 && (c == 'e' || c == 'E')) { if (expseen) /* Already saw 'E'? */ break; /* Exit loop, bad nbr. */ - expseen = TRUE; /* Set exponent seen */ - signseen = FALSE; /* We can read '+' now */ + expseen = sal_True; /* Set exponent seen */ + signseen = sal_False; /* We can read '+' now */ radix = 10; /* Decimal exponent */ } else if (radix != 16 && c == '.') { if (dotflag) /* Saw dot already? */ break; /* Exit loop, two dots */ - dotflag = TRUE; /* Remember the dot */ + dotflag = sal_True; /* Remember the dot */ radix = 10; /* Decimal fraction */ } else if (c == '+' || c == '-') { /* 1.0e+10 */ if (signseen) /* Sign in wrong place? */ break; /* Exit loop, not nbr. */ - /* signseen = TRUE; */ /* Remember we saw it */ + /* signseen = sal_True; */ /* Remember we saw it */ } else { /* Check the digit */ switch (c) { case '8': case '9': /* Sometimes wrong */ - octal89 = TRUE; /* Do check later */ + octal89 = sal_True; /* Do check later */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': break; /* Always ok */ @@ -452,7 +452,7 @@ register void (*outfun)() /* BP */ } /* End of switch */ } /* End general case */ (*outfun)(c); /* Accept the character */ - signseen = TRUE; /* Don't read sign now */ + signseen = sal_True; /* Don't read sign now */ c = get(); /* Read another char */ } /* End of scan loop */ /* @@ -481,14 +481,14 @@ done: if (dotflag || expseen) { /* Floating point? */ case 'L': if (dotflag) goto nomore; - dotflag = TRUE; + dotflag = sal_True; break; case 'u': case 'U': if (expseen) goto nomore; - expseen = TRUE; + expseen = sal_True; break; default: @@ -607,10 +607,10 @@ lookid(int c) DEFBUF * defendel(char* name, int delete) /* - * Enter this name in the lookup table (delete = FALSE) - * or delete this name (delete = TRUE). - * Returns a pointer to the define block (delete = FALSE) - * Returns NULL if the symbol wasn't defined (delete = TRUE). + * Enter this name in the lookup table (delete = sal_False) + * or delete this name (delete = sal_True). + * Returns a pointer to the define block (delete = sal_False) + * Returns NULL if the symbol wasn't defined (delete = sal_True). */ { register DEFBUF *dp; @@ -839,7 +839,7 @@ newline: * is skipping over blank lines and will do a * #line at its convenience. */ - wrongline = TRUE; /* Need a #line now */ + wrongline = sal_True; /* Need a #line now */ } } } @@ -880,11 +880,11 @@ newline: if (instring) /* Strings just return */ return (c); /* the character. */ else if (c == '/') { /* Comment? */ - instring = TRUE; /* So get() won't loop */ + instring = sal_True; /* So get() won't loop */ /*MM c++ comments */ /*MM*/ c = get(); /*MM*/ if ((c != '*') && (c != '/')) { /* Next byte '*'? */ - instring = FALSE; /* Nope, no comment */ + instring = sal_False; /* Nope, no comment */ unget(); /* Push the char. back */ return ('/'); /* Return the slash */ } @@ -917,7 +917,7 @@ newline: case '*': if ((c = get()) != '/') /* If comment doesn't */ goto test; /* end, look at next */ - instring = FALSE; /* End of comment, */ + instring = sal_False; /* End of comment, */ if (keepcomments) { /* Put out the comment */ cput(c); /* terminator, too */ } @@ -950,7 +950,7 @@ newline: case '\n': /* we'll need a #line */ if (!keepcomments) - wrongline = TRUE; /* later... */ + wrongline = sal_True; /* later... */ default: /* Anything else is */ break; /* Just a character */ } /* End switch */ @@ -965,7 +965,7 @@ newline: if( EOF_CHAR == c ) return (EOF_CHAR); else if( '\n' == c ){ - instring = FALSE; /* End of comment, */ + instring = sal_False; /* End of comment, */ return( c ); } } @@ -973,7 +973,7 @@ newline: } /* End if in comment */ else if (!inmacro && c == '\\') { /* If backslash, peek */ if ((c = get()) == '\n') { /* for a . If so, */ - wrongline = TRUE; + wrongline = sal_True; goto newline; } else { /* Backslash anything */ diff --git a/rsc/source/rscpp/cppdef.h b/rsc/source/rscpp/cppdef.h index cdbf07766c8f..196dfbe65cf9 100644 --- a/rsc/source/rscpp/cppdef.h +++ b/rsc/source/rscpp/cppdef.h @@ -26,12 +26,12 @@ ************************************************************************/ /* - * This redundant definition of TRUE and FALSE works around + * This redundant definition of sal_True and sal_False works around * a limitation of Decus C. */ -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 +#ifndef sal_True +#define sal_True 1 +#define sal_False 0 #endif /* @@ -96,16 +96,16 @@ * to be marked "static" even though they are referenced * by "extern" statements elsewhere. * - * OK_DOLLAR Should be set TRUE if $ is a valid alphabetic character + * OK_DOLLAR Should be set sal_True if $ is a valid alphabetic character * in identifiers (default), or zero if $ is invalid. - * Default is TRUE. + * Default is sal_True. * - * OK_CONCAT Should be set TRUE if # may be used to concatenate + * OK_CONCAT Should be set sal_True if # may be used to concatenate * tokens in macros (per the Ansi Draft Standard) or - * FALSE for old-style # processing (needed if cpp is + * sal_False for old-style # processing (needed if cpp is * to process assembler source code). * - * OK_DATE Predefines the compilation date if set TRUE. + * OK_DATE Predefines the compilation date if set sal_True. * Not permitted by the Nov. 12, 1984 Draft Standard. * * S_CHAR etc. Define the sizeof the basic TARGET machine word types. @@ -192,14 +192,14 @@ */ #ifndef OLD_PREPROCESSOR -#define OLD_PREPROCESSOR FALSE +#define OLD_PREPROCESSOR sal_False #endif #if OLD_PREPROCESSOR -#define OK_DOLLAR FALSE -#define OK_CONCAT TRUE -#define COMMENT_INVISIBLE TRUE -#define STRING_FORMAL TRUE +#define OK_DOLLAR sal_False +#define OK_CONCAT sal_True +#define COMMENT_INVISIBLE sal_True +#define STRING_FORMAL sal_True #define IDMAX 63 /* actually, seems to be unlimited */ #endif @@ -219,14 +219,14 @@ #endif /* - * BIG_ENDIAN is set TRUE on machines (such as the IBM 360 series) + * BIG_ENDIAN is set sal_True on machines (such as the IBM 360 series) * where 'ab' stores 'a' in the high-bits and 'b' in the low-bits. - * It is set FALSE on machines (such as the PDP-11 and Vax-11) + * It is set sal_False on machines (such as the PDP-11 and Vax-11) * where 'ab' stores 'a' in the low-bits and 'b' in the high-bits. * (Or is it the other way around?) -- Warning: BIG_ENDIAN code is untested. */ #ifndef BIG_ENDIAN -#define BIG_ENDIAN FALSE +#define BIG_ENDIAN sal_False #endif /* @@ -236,7 +236,7 @@ * expansions. This was removed from the Draft Ansi Standard. */ #ifndef COMMENT_INVISIBLE -#define COMMENT_INVISIBLE FALSE +#define COMMENT_INVISIBLE sal_False #endif /* @@ -245,27 +245,27 @@ * Standard and a limited recognition capability added. */ #ifndef STRING_FORMAL -#define STRING_FORMAL FALSE +#define STRING_FORMAL sal_False #endif /* * OK_DOLLAR enables use of $ as a valid "letter" in identifiers. * This is a permitted extension to the Ansi Standard and is required - * for e.g., VMS, RSX-11M, etc. It should be set FALSE if cpp is + * for e.g., VMS, RSX-11M, etc. It should be set sal_False if cpp is * used to preprocess assembler source on Unix systems. OLD_PREPROCESSOR - * sets OK_DOLLAR FALSE for that reason. + * sets OK_DOLLAR sal_False for that reason. */ #ifndef OK_DOLLAR -#define OK_DOLLAR TRUE +#define OK_DOLLAR sal_True #endif /* * OK_CONCAT enables (one possible implementation of) token concatenation. * If cpp is used to preprocess Unix assembler source, this should be - * set FALSE as the concatenation character, #, is used by the assembler. + * set sal_False as the concatenation character, #, is used by the assembler. */ #ifndef OK_CONCAT -#define OK_CONCAT TRUE +#define OK_CONCAT sal_True #endif /* @@ -274,7 +274,7 @@ * by the Draft Ansi Standard. */ #ifndef OK_DATE -#define OK_DATE TRUE +#define OK_DATE sal_True #endif /* diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx index c23022e4222e..f666058617f8 100644 --- a/rsc/source/tools/rscchar.cxx +++ b/rsc/source/tools/rscchar.cxx @@ -53,7 +53,7 @@ |* Letzte Aenderung MM 20.03.91 |* *************************************************************************/ -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 ]; @@ -113,7 +113,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++; } @@ -135,11 +135,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 eb714bbcc3c2..8d7f4610b3db 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -34,7 +34,7 @@ /****************** C o d e **********************************************/ /****************** R s c I d ********************************************/ -BOOL RscId::bNames = TRUE; +sal_Bool RscId::bNames = sal_True; /************************************************************************* |* @@ -46,8 +46,8 @@ BOOL RscId::bNames = TRUE; |* Letzte Aenderung MM 26.06.91 |* *************************************************************************/ -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; } /************************************************************************* |* @@ -58,8 +58,8 @@ BOOL RscId::IsSetNames() { return bNames; } |* Letzte Aenderung MM 17.05.91 |* *************************************************************************/ -INT32 RscId::GetNumber() const{ - INT32 lVal; +sal_Int32 RscId::GetNumber() const{ + sal_Int32 lVal; aExp.Evaluate( &lVal ); return lVal; } @@ -79,7 +79,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 ); @@ -159,7 +159,7 @@ RscId& RscId::operator = ( const RscId& rRscId ){ |* Letzte Aenderung MM 16.05.91 |* *************************************************************************/ -BOOL RscId::operator == ( const RscId& rRscId ) const +sal_Bool RscId::operator == ( const RscId& rRscId ) const { return( GetNumber() == rRscId.GetNumber() ); } @@ -173,7 +173,7 @@ BOOL RscId::operator == ( const RscId& rRscId ) const |* Letzte Aenderung MM 16.05.91 |* *************************************************************************/ -BOOL RscId::operator < ( const RscId& rRscId ) const +sal_Bool RscId::operator < ( const RscId& rRscId ) const { return( GetNumber() < rRscId.GetNumber() ); } @@ -187,21 +187,21 @@ BOOL RscId::operator < ( const RscId& rRscId ) const |* Letzte Aenderung MM 16.05.91 |* *************************************************************************/ -BOOL RscId::operator > ( const RscId& rRscId ) const +sal_Bool RscId::operator > ( const RscId& rRscId ) const { return( GetNumber() > rRscId.GetNumber() ); } /************************************************************************* |* -|* RscId::INT32() +|* RscId::sal_Int32() |* |* Beschreibung |* Ersterstellung MM 16.05.91 |* Letzte Aenderung MM 16.05.91 |* *************************************************************************/ -RscId::operator INT32() const +RscId::operator sal_Int32() const { return( GetNumber() ); } @@ -261,7 +261,7 @@ ByteString RscId::GetMacro() const |* Letzte Aenderung MM 01.11.91 |* *************************************************************************/ -RscDefine::RscDefine( ULONG lKey, const ByteString & rDefName, INT32 lDefId ) +RscDefine::RscDefine( sal_uIntPtr lKey, const ByteString & rDefName, sal_Int32 lDefId ) : StringNode( rDefName ) { nRefCount = 0; @@ -270,7 +270,7 @@ RscDefine::RscDefine( ULONG lKey, const ByteString & rDefName, INT32 lDefId ) pExp = NULL; } -RscDefine::RscDefine( ULONG lKey, const ByteString & rDefName, +RscDefine::RscDefine( sal_uIntPtr lKey, const ByteString & rDefName, RscExpression * pExpression ) : StringNode( rDefName ) { @@ -345,7 +345,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; @@ -362,8 +362,8 @@ void RscDefine::ChangeMacro( INT32 lIdentifier ){ |* Letzte Aenderung MM 01.11.91 |* *************************************************************************/ -BOOL RscDefine::Evaluate(){ - BOOL bRet = TRUE; +sal_Bool RscDefine::Evaluate(){ + sal_Bool bRet = sal_True; if( pExp ) bRet = !pExp->Evaluate( &lId ); @@ -410,8 +410,8 @@ ByteString RscDefine::GetMacro() |* Letzte Aenderung MM 04.11.91 |* *************************************************************************/ -RscDefine * RscDefineList::New( ULONG lFileKey, const ByteString & rDefName, - INT32 lDefId, ULONG lPos ) +RscDefine * RscDefineList::New( sal_uIntPtr lFileKey, const ByteString & rDefName, + sal_Int32 lDefId, sal_uIntPtr lPos ) { RscDefine * pDef; @@ -421,8 +421,8 @@ RscDefine * RscDefineList::New( ULONG lFileKey, const ByteString & rDefName, return pDef; } -RscDefine * RscDefineList::New( ULONG lFileKey, const ByteString & rDefName, - RscExpression * pExpression, ULONG lPos ) +RscDefine * RscDefineList::New( sal_uIntPtr lFileKey, const ByteString & rDefName, + RscExpression * pExpression, sal_uIntPtr lPos ) { RscDefine * pDef; @@ -442,7 +442,7 @@ RscDefine * RscDefineList::New( ULONG lFileKey, const ByteString & rDefName, |* Letzte Aenderung MM 04.11.91 |* *************************************************************************/ -BOOL RscDefineList::Remove( RscDefine * pDef ){ +sal_Bool RscDefineList::Remove( RscDefine * pDef ){ pDef = RscSubDefList::Remove( pDef ); if( pDef ){ pDef->DefineToNumber(); @@ -452,7 +452,7 @@ BOOL RscDefineList::Remove( RscDefine * pDef ){ return( NULL != pDef ); } -BOOL RscDefineList::Remove( ULONG lIndex ){ +sal_Bool RscDefineList::Remove( sal_uIntPtr lIndex ){ RscDefine * pDef = RscSubDefList::Remove( lIndex ); if( pDef ){ pDef->DefineToNumber(); @@ -462,10 +462,10 @@ BOOL RscDefineList::Remove( ULONG lIndex ){ return( NULL != pDef ); } -BOOL RscDefineList::Remove(){ +sal_Bool RscDefineList::Remove(){ RscDefine * pDef; - pDef = RscSubDefList::Remove( (ULONG)0 ); + pDef = RscSubDefList::Remove( (sal_uIntPtr)0 ); if( pDef ){ pDef->DefineToNumber(); @@ -483,7 +483,7 @@ BOOL RscDefineList::Remove(){ |* Letzte Aenderung MM 12.11.91 |* *************************************************************************/ -BOOL RscDefineList::Befor( const RscDefine * pFree, +sal_Bool RscDefineList::Befor( const RscDefine * pFree, const RscDefine * pDepend ) { RscDefine * pDef; @@ -494,13 +494,13 @@ BOOL RscDefineList::Befor( const RscDefine * pFree, pDef = Next(); while( pDef ){ if( pDef == pDepend ) - return TRUE; + return sal_True; pDef = Next(); } } pDef = Next(); }; - return FALSE; + return sal_False; } /************************************************************************* @@ -535,7 +535,7 @@ void RscDefineList::WriteAll( FILE * fOutput ) |* Letzte Aenderung MM 01.11.91 |* *************************************************************************/ -BOOL RscExpType::Evaluate( INT32 * plValue ) const{ +sal_Bool RscExpType::Evaluate( sal_Int32 * plValue ) const{ if( IsDefinition() ){ aExp.pDef->Evaluate(); // Eventuellen Fehler ignorieren @@ -548,7 +548,7 @@ BOOL RscExpType::Evaluate( INT32 * plValue ) const{ else *plValue = GetLong(); - return TRUE; + return sal_True; } /************************************************************************* @@ -626,9 +626,9 @@ RscExpression::~RscExpression(){ |* Letzte Aenderung MM 01.11.91 |* *************************************************************************/ -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 ) ){ @@ -648,12 +648,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; } /************************************************************************* @@ -712,10 +712,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; } /************************************************************************* @@ -728,11 +728,11 @@ RscFile :: RscFile(){ |* *************************************************************************/ RscFile :: ~RscFile(){ - RscDepend * pDep = Remove( (ULONG)0 ); + RscDepend * pDep = Remove( (sal_uIntPtr)0 ); while( pDep ){ delete pDep; - pDep = Remove( (ULONG)0 ); + pDep = Remove( (sal_uIntPtr)0 ); } //von hinten nach vorne ist besser wegen der Abhaengigkeiten @@ -745,14 +745,14 @@ 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. |* Ersterstellung MM 12.11.91 |* Letzte Aenderung MM 12.11.91 |* *************************************************************************/ -BOOL RscFile::Depend( ULONG lDepend, ULONG lFree ){ +sal_Bool RscFile::Depend( sal_uIntPtr lDepend, sal_uIntPtr lFree ){ RscDepend * pDep; pDep = Last(); @@ -760,15 +760,15 @@ BOOL RscFile::Depend( ULONG lDepend, ULONG lFree ){ if( pDep->GetFileKey() == lDepend ){ while( pDep ){ if( pDep->GetFileKey() == lFree ) - return TRUE; + return sal_True; pDep = Prev(); } - return FALSE; + return sal_False; } pDep = Prev(); }; - return TRUE; + return sal_True; } /************************************************************************* @@ -780,14 +780,14 @@ BOOL RscFile::Depend( ULONG lDepend, ULONG lFree ){ |* Letzte Aenderung MM 06.01.92 |* *************************************************************************/ -BOOL RscFile :: InsertDependFile( ULONG lIncFile, ULONG lPos ) +sal_Bool RscFile :: InsertDependFile( sal_uIntPtr lIncFile, sal_uIntPtr lPos ) { RscDepend * pDep; pDep = First(); while( pDep ){ if( pDep->GetFileKey() == lIncFile ) - return TRUE; + return sal_True; pDep = Next(); } @@ -799,7 +799,7 @@ BOOL RscFile :: InsertDependFile( ULONG lIncFile, ULONG lPos ) else Insert( new RscDepend( lIncFile ), lPos ); - return TRUE; + return sal_True; } /************************************************************************* @@ -811,7 +811,7 @@ BOOL RscFile :: InsertDependFile( ULONG lIncFile, ULONG lPos ) |* Letzte Aenderung MM 18.11.91 |* *************************************************************************/ -void RscFile :: RemoveDependFile( ULONG lDepFile ) +void RscFile :: RemoveDependFile( sal_uIntPtr lDepFile ) { RscDepend * pDep = Last(); @@ -915,17 +915,17 @@ void RscDefTree::Remove( RscDefine * pDef ){ |* Letzte Aenderung MM 12.11.91 |* *************************************************************************/ -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 ); } @@ -973,7 +973,7 @@ RscFileTab :: ~RscFileTab(){ |* Letzte Aenderung MM 16.05.91 |* *************************************************************************/ -ULONG RscFileTab :: Find( const ByteString & rName ) +sal_uIntPtr RscFileTab :: Find( const ByteString & rName ) { RscFile * pFName; @@ -1009,7 +1009,7 @@ RscDefine * RscFileTab::FindDef( const char * pName ){ |* Letzte Aenderung MM 01.11.91 |* *************************************************************************/ -RscDefine * RscFileTab::FindDef( ULONG lFileKey, const ByteString & rName ) +RscDefine * RscFileTab::FindDef( sal_uIntPtr lFileKey, const ByteString & rName ) { RscDefine * pDef = FindDef( rName ); @@ -1030,20 +1030,20 @@ RscDefine * RscFileTab::FindDef( ULONG lFileKey, const ByteString & rName ) |* Letzte Aenderung MM 08.11.91 |* *************************************************************************/ -BOOL RscFileTab::Depend( ULONG lDepend, ULONG lFree ){ +sal_Bool RscFileTab::Depend( sal_uIntPtr lDepend, sal_uIntPtr 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; } /************************************************************************* @@ -1055,17 +1055,17 @@ BOOL RscFileTab::Depend( ULONG lDepend, ULONG lFree ){ |* Letzte Aenderung MM 14.01.92 |* *************************************************************************/ -BOOL RscFileTab::TestDef( ULONG lFileKey, ULONG lPos, +sal_Bool RscFileTab::TestDef( sal_uIntPtr lFileKey, sal_uIntPtr 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 ); } @@ -1079,29 +1079,29 @@ BOOL RscFileTab::TestDef( ULONG lFileKey, ULONG lPos, |* Letzte Aenderung MM 14.01.92 |* *************************************************************************/ -BOOL RscFileTab::TestDef( ULONG lFileKey, ULONG lPos, +sal_Bool RscFileTab::TestDef( sal_uIntPtr lFileKey, sal_uIntPtr 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; } /************************************************************************* @@ -1113,8 +1113,8 @@ BOOL RscFileTab::TestDef( ULONG lFileKey, ULONG lPos, |* Letzte Aenderung MM 04.11.91 |* *************************************************************************/ -RscDefine * RscFileTab::NewDef( ULONG lFileKey, const ByteString & rDefName, - INT32 lId, ULONG lPos ) +RscDefine * RscFileTab::NewDef( sal_uIntPtr lFileKey, const ByteString & rDefName, + sal_Int32 lId, sal_uIntPtr lPos ) { RscDefine * pDef = FindDef( rDefName ); @@ -1141,8 +1141,8 @@ RscDefine * RscFileTab::NewDef( ULONG lFileKey, const ByteString & rDefName, |* Letzte Aenderung MM 04.11.91 |* *************************************************************************/ -RscDefine * RscFileTab::NewDef( ULONG lFileKey, const ByteString & rDefName, - RscExpression * pExp, ULONG lPos ) +RscDefine * RscFileTab::NewDef( sal_uIntPtr lFileKey, const ByteString & rDefName, + RscExpression * pExp, sal_uIntPtr lPos ) { RscDefine * pDef = FindDef( rDefName ); @@ -1177,14 +1177,14 @@ RscDefine * RscFileTab::NewDef( ULONG lFileKey, const ByteString & rDefName, |* Letzte Aenderung MM 22.11.91 |* *************************************************************************/ -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; } /************************************************************************* @@ -1219,7 +1219,7 @@ void RscFileTab::DeleteDef( const ByteString & rDefName ) |* Letzte Aenderung MM 11.11.91 |* *************************************************************************/ -BOOL RscFileTab::ChangeDef( const ByteString & rDefName, INT32 lId ) +sal_Bool RscFileTab::ChangeDef( const ByteString & rDefName, sal_Int32 lId ) { RscDefine * pDef = FindDef( rDefName ); @@ -1228,7 +1228,7 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName, INT32 lId ) //alle Macros neu bewerten return aDefTree.Evaluate(); }; - return( FALSE ); + return( sal_False ); } /************************************************************************* @@ -1240,12 +1240,12 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName, INT32 lId ) |* Letzte Aenderung MM 11.11.91 |* *************************************************************************/ -BOOL RscFileTab::ChangeDef( const ByteString & rDefName, +sal_Bool RscFileTab::ChangeDef( const ByteString & rDefName, RscExpression * pExp ) { RscDefine * pDef = FindDef( rDefName ); RscFile * pFile; - ULONG lPos = 0; + sal_uIntPtr lPos = 0; if( pDef ){ pFile = GetFile( pDef->GetFileKey() ); @@ -1263,7 +1263,7 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName, // geloescht werden delete pExp; - return( FALSE ); + return( sal_False ); } /************************************************************************* @@ -1275,7 +1275,7 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName, |* Letzte Aenderung MM 04.11.91 |* *************************************************************************/ -BOOL RscFileTab::ChangeDefName( const ByteString & rDefName, +sal_Bool RscFileTab::ChangeDefName( const ByteString & rDefName, const ByteString & rNewName ) { RscDefine * pDef = FindDef( rDefName ); @@ -1287,11 +1287,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 ); } /************************************************************************* @@ -1303,7 +1303,7 @@ BOOL RscFileTab::ChangeDefName( const ByteString & rDefName, |* Letzte Aenderung MM 09.12.91 |* *************************************************************************/ -void RscFileTab :: DeleteFileContext( ULONG lFileKey ){ +void RscFileTab :: DeleteFileContext( sal_uIntPtr lFileKey ){ RscFile * pFName; pFName = GetFile( lFileKey ); @@ -1315,7 +1315,7 @@ void RscFileTab :: DeleteFileContext( ULONG lFileKey ){ aDefTree.Remove( pDef ); pDef = pFName->aDefLst.Next(); }; - while( pFName->aDefLst.Remove( (ULONG)0 ) ) ; + while( pFName->aDefLst.Remove( (sal_uIntPtr)0 ) ) ; } } @@ -1328,7 +1328,7 @@ void RscFileTab :: DeleteFileContext( ULONG lFileKey ){ |* Letzte Aenderung MM 16.05.91 |* *************************************************************************/ -void RscFileTab :: DeleteFile( ULONG lFileKey ){ +void RscFileTab :: DeleteFile( sal_uIntPtr lFileKey ){ RscFile * pFName; //Defines freigeben @@ -1355,9 +1355,9 @@ void RscFileTab :: DeleteFile( ULONG lFileKey ){ |* Letzte Aenderung MM 16.05.91 |* *************************************************************************/ -ULONG RscFileTab :: NewCodeFile( const ByteString & rName ) +sal_uIntPtr RscFileTab :: NewCodeFile( const ByteString & rName ) { - ULONG lKey; + sal_uIntPtr lKey; RscFile * pFName; lKey = Find( rName ); @@ -1381,10 +1381,10 @@ ULONG RscFileTab :: NewCodeFile( const ByteString & rName ) |* Letzte Aenderung MM 16.05.91 |* *************************************************************************/ -ULONG RscFileTab :: NewIncFile( const ByteString & rName, +sal_uIntPtr RscFileTab :: NewIncFile( const ByteString & rName, const ByteString & rPath ) { - ULONG lKey; + sal_uIntPtr lKey; RscFile * pFName; lKey = Find( rName ); diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx index 9904cd20d4e7..9632df25c641 100644 --- a/rsc/source/tools/rsctools.cxx +++ b/rsc/source/tools/rsctools.cxx @@ -148,7 +148,7 @@ ByteString GetTmpFileName() /* */ /* Description : appends text files */ /********************************************************************/ -BOOL Append( FILE * fDest, ByteString aTmpFile ) +sal_Bool Append( FILE * fDest, ByteString aTmpFile ) { #define MAX_BUF 4096 char szBuf[ MAX_BUF ]; @@ -159,7 +159,7 @@ BOOL Append( FILE * fDest, ByteString aTmpFile ) if( !fDest || !fSource ){ if( fSource ) fclose( fSource ); - return FALSE; + return sal_False; } else{ do{ // append @@ -169,14 +169,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 ); @@ -394,10 +394,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 991e32aa580c..e719cc39548e 100644 --- a/rsc/source/tools/rsctree.cxx +++ b/rsc/source/tools/rsctree.cxx @@ -316,12 +316,12 @@ NameNode* NameNode::Search( const void * pSearch ) const{ |* Letzte Aenderung MM 11.01.91 |* *************************************************************************/ -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; @@ -337,7 +337,7 @@ BOOL NameNode::Insert( NameNode * pTN, sal_uInt32* pnDepth ){ else pRight = pTN; if( nCmp == EQUAL ) - bRet = FALSE; + bRet = sal_False; }; return( bRet ); } @@ -351,12 +351,12 @@ BOOL NameNode::Insert( NameNode * pTN, sal_uInt32* pnDepth ){ |* Letzte Aenderung MM 11.01.91 |* *************************************************************************/ -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 ){ @@ -412,14 +412,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; @@ -428,13 +428,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/sot/inc/absdev.hxx b/sot/inc/absdev.hxx index 3d251d98e0b6..d882e6fc6b14 100644 --- a/sot/inc/absdev.hxx +++ b/sot/inc/absdev.hxx @@ -40,7 +40,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/agg.hxx index 2f8cc7587458..cf07f6a8faff 100644 --- a/sot/inc/agg.hxx +++ b/sot/inc/agg.hxx @@ -41,21 +41,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/filelist.hxx b/sot/inc/filelist.hxx index 4c6c55534319..fc04e92cb3d7 100644 --- a/sot/inc/filelist.hxx +++ b/sot/inc/filelist.hxx @@ -62,13 +62,13 @@ public: SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList ); // Clipboard, D&D usw. - static ULONG GetFormat(); + static sal_uIntPtr GetFormat(); // Liste fuellen/abfragen void AppendFile( const String& rStr ); - String GetFile( ULONG i ) const; - ULONG Count( void ) const; + String GetFile( sal_uIntPtr i ) const; + sal_uIntPtr Count( void ) const; }; diff --git a/sot/inc/sot/exchange.hxx b/sot/inc/sot/exchange.hxx index dc67e72a4f82..d079d9bfec2c 100644 --- a/sot/inc/sot/exchange.hxx +++ b/sot/inc/sot/exchange.hxx @@ -52,7 +52,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer { // - SotFormatStringId - // --------------------- -typedef ULONG SotFormatStringId; +typedef sal_uIntPtr SotFormatStringId; // ---------------- // - DataFlavorEx - @@ -77,7 +77,7 @@ 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_uIntPtr nId ); // ------------------------- // - Vordefinierte Formate - @@ -97,70 +97,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 @@ -188,66 +188,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_uIntPtr RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static sal_uIntPtr RegisterFormatName( const String& rName ); + static sal_uIntPtr 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_uIntPtr GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static String GetFormatName( sal_uIntPtr nFormat ); + static sal_Bool GetFormatDataFlavor( sal_uIntPtr nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static String GetFormatMimeType( sal_uIntPtr nFormat ); + static sal_Bool IsInternal( const SvGlobalName& ); + static sal_uIntPtr 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_uIntPtr nFormat ) { return nFormat; } static SotFormatStringId GetFormatStringId( const String& rName ) { return SotExchange::RegisterFormatMimeType( rName ); } - static ULONG RegisterSotFormatName( SotFormatStringId nId ) + static sal_uIntPtr 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_uIntPtr& 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_uIntPtr 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_uIntPtr& 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_uIntPtr 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 08dd21a88aa5..58cd26e3b5a0 100644 --- a/sot/inc/sot/factory.hxx +++ b/sot/inc/sot/factory.hxx @@ -47,13 +47,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: @@ -61,7 +61,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 & ); @@ -75,8 +75,8 @@ public: 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/sot/formats.hxx b/sot/inc/sot/formats.hxx index c9d7a3e69d78..8a61884c88e7 100644 --- a/sot/inc/sot/formats.hxx +++ b/sot/inc/sot/formats.hxx @@ -46,145 +46,145 @@ #endif #include -#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_uIntPtr)0) +#define SOT_FORMAT_STRING ((sal_uIntPtr)FORMAT_STRING) +#define SOT_FORMAT_BITMAP ((sal_uIntPtr)FORMAT_BITMAP) +#define SOT_FORMAT_GDIMETAFILE ((sal_uIntPtr)FORMAT_GDIMETAFILE) +#define SOT_FORMAT_PRIVATE ((sal_uIntPtr)FORMAT_PRIVATE) +#define SOT_FORMAT_FILE ((sal_uIntPtr)FORMAT_FILE) +#define SOT_FORMAT_FILE_LIST ((sal_uIntPtr)FORMAT_FILE_LIST) +#define SOT_FORMAT_RTF ((sal_uIntPtr)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_uIntPtr)11) +#define SOT_FORMATSTR_ID_SVXB ((sal_uIntPtr)12) +#define SOT_FORMATSTR_ID_SVIM ((sal_uIntPtr)13) +#define SOT_FORMATSTR_ID_XFA ((sal_uIntPtr)14) +#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uIntPtr)15) +#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uIntPtr)16) +#define SOT_FORMATSTR_ID_SOLK ((sal_uIntPtr)17) +#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uIntPtr)18) +#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uIntPtr)19) +#define SOT_FORMATSTR_ID_NATIVE ((sal_uIntPtr)20) +#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uIntPtr)21) +#define SOT_FORMATSTR_ID_STARSERVER ((sal_uIntPtr)22) +#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uIntPtr)23) +#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uIntPtr)24) +#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uIntPtr)25) +#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uIntPtr)26) +#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uIntPtr)27) +#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uIntPtr)28) +#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uIntPtr)29) +#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uIntPtr)30) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uIntPtr)31) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uIntPtr)32) +#define SOT_FORMATSTR_ID_STARDRAW ((sal_uIntPtr)33) +#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uIntPtr)34) +#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uIntPtr)35) +#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uIntPtr)36) +#define SOT_FORMATSTR_ID_STARCALC ((sal_uIntPtr)37) +#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uIntPtr)38) +#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uIntPtr)39) +#define SOT_FORMATSTR_ID_STARCHART ((sal_uIntPtr)40) +#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uIntPtr)41) +#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uIntPtr)42) +#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uIntPtr)43) +#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uIntPtr)44) +#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uIntPtr)45) +#define SOT_FORMATSTR_ID_STARMATH ((sal_uIntPtr)46) +#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uIntPtr)47) +#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uIntPtr)48) +#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uIntPtr)49) +#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uIntPtr)50) +#define SOT_FORMATSTR_ID_HTML ((sal_uIntPtr)51) +#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uIntPtr)52) +#define SOT_FORMATSTR_ID_CHAOS ((sal_uIntPtr)53) +#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uIntPtr)54) +#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uIntPtr)55) +#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uIntPtr)56) +#define SOT_FORMATSTR_ID_SYLK ((sal_uIntPtr)57) +#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uIntPtr)58) +#define SOT_FORMATSTR_ID_LINK ((sal_uIntPtr)59) +#define SOT_FORMATSTR_ID_DIF ((sal_uIntPtr)60) +#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uIntPtr)61) +#define SOT_FORMATSTR_ID_SONLK ((sal_uIntPtr)62) +#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uIntPtr)63) +#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uIntPtr)64) +#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uIntPtr)65) +#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uIntPtr)66) +#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uIntPtr)67) +#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uIntPtr)68) +#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uIntPtr)69) +#define SOT_FORMATSTR_ID_EVDF ((sal_uIntPtr)70) +#define SOT_FORMATSTR_ID_ESDF ((sal_uIntPtr)71) +#define SOT_FORMATSTR_ID_IDF ((sal_uIntPtr)72) +#define SOT_FORMATSTR_ID_EFTP ((sal_uIntPtr)73) +#define SOT_FORMATSTR_ID_EFD ((sal_uIntPtr)74) +#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uIntPtr)75) +#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uIntPtr)76) +#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uIntPtr)77) +#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uIntPtr)78) +#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uIntPtr)79) +#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uIntPtr)80) +#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uIntPtr)81) +#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uIntPtr)82) +#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uIntPtr)83) +#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uIntPtr)84) +#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uIntPtr)85) +#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uIntPtr)86) +#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uIntPtr)87) +#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uIntPtr)88) +#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uIntPtr)89) +#define SOT_FORMATSTR_ID_FILENAME ((sal_uIntPtr)90) +#define SOT_FORMATSTR_ID_SD_OLE ((sal_uIntPtr)91) +#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uIntPtr)92) +#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uIntPtr)93) +#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uIntPtr)94) +#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uIntPtr)95) +#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uIntPtr)96) +#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uIntPtr)97) +#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uIntPtr)98) +#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uIntPtr)99) +#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uIntPtr)100) +#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uIntPtr)101) +#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uIntPtr)102) +#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uIntPtr)103) +#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uIntPtr)104) +#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uIntPtr)105) +#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uIntPtr)106) +#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uIntPtr)107) +#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uIntPtr)108) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uIntPtr)109) +#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uIntPtr)110) +#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uIntPtr)111) +#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uIntPtr)112) +#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uIntPtr)113) +#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uIntPtr)114) +#define SOT_FORMATSTR_ID_WMF ((sal_uIntPtr)115) +#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uIntPtr)116) +#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uIntPtr)117) +#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uIntPtr)118) +#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uIntPtr)119) +#define SOT_FORMATSTR_ID_EMF ((sal_uIntPtr)120) +#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uIntPtr)121) +#define SOT_FORMATSTR_ID_BMP ((sal_uIntPtr)122) +#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uIntPtr)123) +#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uIntPtr)124) +#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uIntPtr)125) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uIntPtr)126) +#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uIntPtr)127) +#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uIntPtr)128) +#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uIntPtr)129) +#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uIntPtr)130) +#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uIntPtr)131) +#define SOT_FORMATSTR_ID_XFORMS ((sal_uIntPtr)132) +#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uIntPtr)133) +#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uIntPtr)134) +#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uIntPtr)135) +#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uIntPtr)136) +#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uIntPtr)137) +#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uIntPtr)138) +#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uIntPtr)139) +#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uIntPtr)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 db2ac3b30ffc..5b6cedfbf410 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -43,41 +43,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 __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ } #define SO2_IMPL_INVARIANT1(ClassName,Super1) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ } #define SO2_IMPL_INVARIANT2(ClassName,Super1,Super2) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ Super2::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -85,14 +85,14 @@ void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ } #define SO2_IMPL_INVARIANT3(ClassName,Super1,Super2,Super3) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ Super2::TestObjRef( bFree ); \ Super3::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -101,7 +101,7 @@ void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ } #define SO2_IMPL_INVARIANT4(ClassName,Super1,Super2,Super3,Super4) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ @@ -109,7 +109,7 @@ void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ Super3::TestObjRef( bFree ); \ Super4::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -388,14 +388,14 @@ 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, - bSVObject:1, // Ist Proxy, dann TRUE wenn andere Seite SV ist - bInClose:1; // TRUE, im DoClose + sal_uInt16 nStrongLockCount; + sal_uInt16 nOwnerLockCount; + sal_Bool bOwner:1, + bSVObject:1, // Ist Proxy, dann sal_True wenn andere Seite SV ist + bInClose:1; // sal_True, im DoClose void * DownAggCast( const SotFactory * pFact ); - void RemoveInterface( ULONG ); + void RemoveInterface( sal_uIntPtr ); void RemoveInterface( SotObject * ); #if defined (GCC) && (defined (C281) || defined (C290) || defined (C291)) public: @@ -403,8 +403,8 @@ public: 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()) @@ -413,11 +413,11 @@ public: // Nur damit die Makros in So3 nicht ganz ausufern virtual IUnknown * GetInterface( const SvGlobalName & ); - BOOL Owner() const { return bOwner; } - BOOL IsSvObject() const; + sal_Bool Owner() const { return bOwner; } + sal_Bool IsSvObject() const; // Methoden fuer die Aggregation (siehe OLE2-Spec) - BOOL ShouldDelete(); + sal_Bool ShouldDelete(); virtual void QueryDelete(); SvAggregateMemberList & GetAggList(); void AddInterface( SotObject * ); @@ -428,18 +428,18 @@ public: SotObject * GetMainObj() const; // !!! Read the Manual !!! - virtual USHORT FuzzyLock( BOOL bLock, BOOL bIntern, BOOL bClose ); - void Lock( BOOL bLock ) + virtual sal_uInt16 FuzzyLock( sal_Bool bLock, sal_Bool bIntern, sal_Bool bClose ); + void Lock( sal_Bool bLock ) { - FuzzyLock( bLock, TRUE, TRUE ); + FuzzyLock( bLock, sal_True, sal_True ); } - USHORT GetOwnerLockCount() const { return nOwnerLockCount; } - USHORT GetStrongLockCount() const { return nStrongLockCount; } + sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; } + sal_uInt16 GetStrongLockCount() const { return nStrongLockCount; } - void OwnerLock( BOOL bLock ); + 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 diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx index 8d8775b5e181..213eea7f4ed3 100644 --- a/sot/inc/sot/sotdata.hxx +++ b/sot/inc/sot/sotdata.hxx @@ -45,7 +45,7 @@ class SotObjectList; struct SotData_Impl { - UINT32 nSvObjCount; + sal_uInt32 nSvObjCount; SotObjectList * pObjectList; SotFactoryList * pFactoryList; SotFactory * pSotObjectFactory; diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index 572e100c7299..ccfeae4d9193 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -71,9 +71,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_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(); ~SotStorageStream(); public: @@ -91,13 +91,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_uIntPtr 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; }; @@ -125,21 +125,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_uIntPtr 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 &, @@ -147,8 +147,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() @@ -156,12 +156,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; } @@ -175,37 +175,37 @@ public: return m_nVersion; } - ULONG GetErrorCode() const { return m_nError; } - ULONG GetError() const { return ERRCODE_TOERROR(m_nError); } - void SetError( ULONG nErrorCode ) + sal_uIntPtr GetErrorCode() const { return m_nError; } + sal_uIntPtr GetError() const { return ERRCODE_TOERROR(m_nError); } + void SetError( sal_uIntPtr 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_uIntPtr bOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG bOriginalClipFormat, + sal_uIntPtr bOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName();// Typ der Daten im Storage - virtual ULONG GetFormat(); + virtual sal_uIntPtr 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, @@ -226,26 +226,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/stg.hxx b/sot/inc/stg.hxx index 84373e26d596..b4f13b8d2660 100644 --- a/sot/inc/stg.hxx +++ b/sot/inc/stg.hxx @@ -65,30 +65,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_uIntPtr 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_uIntPtr ) const; + sal_uIntPtr 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; } }; @@ -96,16 +96,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_uIntPtr Read( void * pData, sal_uIntPtr nSize ) = 0; + virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ) = 0; + virtual sal_uIntPtr Seek( sal_uIntPtr nPos ) = 0; + virtual sal_uIntPtr 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_uIntPtr 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; @@ -114,45 +114,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_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual SvGlobalName GetClassName() = 0; - virtual ULONG GetFormat() = 0; + virtual sal_uIntPtr 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 @@ -163,8 +163,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: }; @@ -172,26 +172,26 @@ public: class StorageStream : public BaseStorageStream, public OLEStorageBase { //friend class Storage; - ULONG nPos; // current position + sal_uIntPtr 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_uIntPtr Read( void * pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr Seek( sal_uIntPtr nPos ); + virtual sal_uIntPtr 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_uIntPtr 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; @@ -199,64 +199,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_uIntPtr nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual ULONG GetFormat(); + virtual sal_uIntPtr 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; @@ -270,25 +270,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_uIntPtr Read( void * pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr Seek( sal_uIntPtr nPos ); + virtual sal_uIntPtr 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_uIntPtr 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(); @@ -309,76 +309,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_uIntPtr nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual ULONG GetFormat(); + virtual sal_uIntPtr 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 @@ -386,10 +386,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/storinfo.hxx b/sot/inc/storinfo.hxx index dab1f6d4540e..5f225c26d0de 100644 --- a/sot/inc/storinfo.hxx +++ b/sot/inc/storinfo.hxx @@ -39,14 +39,14 @@ class SvStorageInfo friend class SvStorage; String aName; SvGlobalName aClassName; - ULONG nSize; - BOOL bStream:1, + sal_uIntPtr 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_uIntPtr nSz, sal_Bool bIsStorage ) : aName( rName ) , nSize( nSz ) , bStream( !bIsStorage ) @@ -55,9 +55,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_uIntPtr GetSize() const { return nSize; } }; class SOT_DLLPUBLIC SvStorageInfoList @@ -66,7 +66,7 @@ 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_uIntPtr ReadClipboardFormat( SvStream & rStm ); +SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uIntPtr nFormat ); #endif // _STORINFO_HXX diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index 67c2b64f105f..2b51162df3a0 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -237,11 +237,11 @@ static List& InitFormats_Impl() |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::RegisterFormatName( const String& rName ) +sal_uIntPtr 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_uIntPtr 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; @@ -277,11 +277,11 @@ ULONG SotExchange::RegisterFormatName( const String& rName ) return nMax + SOT_FORMATSTR_ID_USER_END + 1; } -ULONG SotExchange::RegisterFormatMimeType( const String& rMimeType ) +sal_uIntPtr 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_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) return i; @@ -318,9 +318,9 @@ ULONG SotExchange::RegisterFormatMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::RegisterFormat( const DataFlavor& rFlavor ) +sal_uIntPtr SotExchange::RegisterFormat( const DataFlavor& rFlavor ) { - ULONG nRet = GetFormat( rFlavor ); + sal_uIntPtr nRet = GetFormat( rFlavor ); if( !nRet ) { @@ -338,7 +338,7 @@ ULONG SotExchange::RegisterFormat( const DataFlavor& rFlavor ) |* *************************************************************************/ -sal_Bool SotExchange::GetFormatDataFlavor( ULONG nFormat, DataFlavor& rFlavor ) +sal_Bool SotExchange::GetFormatDataFlavor( sal_uIntPtr nFormat, DataFlavor& rFlavor ) { sal_Bool bRet; @@ -376,11 +376,11 @@ sal_Bool SotExchange::GetFormatDataFlavor( ULONG nFormat, DataFlavor& rFlavor ) /************************************************************************* |* -|* SotExchange::GetFormatMimeType( ULONG nFormat ) +|* SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) |* *************************************************************************/ -String SotExchange::GetFormatMimeType( ULONG nFormat ) +String SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) { String sMimeType; if( SOT_FORMATSTR_ID_USER_END >= nFormat ) @@ -406,10 +406,10 @@ String SotExchange::GetFormatMimeType( ULONG nFormat ) |* *************************************************************************/ -ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) +sal_uIntPtr SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) return i; @@ -443,12 +443,12 @@ ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::GetFormat( const DataFlavor& rFlavor ) +sal_uIntPtr 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_uIntPtr 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 ) ) @@ -482,7 +482,7 @@ ULONG SotExchange::GetFormat( const DataFlavor& rFlavor ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -String SotExchange::GetFormatName( ULONG nFormat ) +String SotExchange::GetFormatName( sal_uIntPtr nFormat ) { DataFlavor aFlavor; String aRet; @@ -493,7 +493,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) || @@ -503,6 +503,6 @@ 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; } diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index 4934f99e78c6..5c4757188f38 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -96,10 +96,10 @@ void SotFactory::DeInit() aStr += " Count: "; aStr += p->GetRefCount(); DBG_TRACE( "\tReferences:" ); - p->TestObjRef( FALSE ); + p->TestObjRef( sal_False ); #ifdef TEST_INVARIANT DBG_TRACE( "\tInvariant:" ); - p->TestInvariant( TRUE ); + p->TestInvariant( sal_True ); #endif p = pObjList->Next(); } @@ -129,7 +129,7 @@ void SotFactory::DeInit() if( pSotData->pDataFlavorList ) { - for( ULONG i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ ) + for( sal_uIntPtr 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; @@ -194,7 +194,7 @@ SotFactory::~SotFactory() |* |* Beschreibung Zugriffsmethoden auf SotData_Impl-Daten *************************************************************************/ -UINT32 SotFactory::GetSvObjectCount() +sal_uInt32 SotFactory::GetSvObjectCount() { return SOTDATA()->nSvObjCount; } @@ -295,10 +295,10 @@ void SotFactory::TestInvariant() SotData_Impl * pSotData = SOTDATA(); if( pSotData->pObjectList ) { - ULONG nCount = pSotData->pObjectList->Count(); - for( ULONG i = 0; i < nCount ; i++ ) + sal_uIntPtr nCount = pSotData->pObjectList->Count(); + for( sal_uIntPtr i = 0; i < nCount ; i++ ) { - pSotData->pObjectList->GetObject( i )->TestInvariant( FALSE ); + pSotData->pObjectList->GetObject( i )->TestInvariant( sal_False ); } } #endif @@ -388,17 +388,17 @@ void * SotFactory::AggCastAndAddRef |* |* 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 4f854add304d..80828e596538 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -61,8 +61,8 @@ FileList::~FileList() void FileList::ClearAll( void ) { // Strings in der Liste loeschen - ULONG nCount = pStrList->Count(); - for( ULONG i = 0 ; i < nCount ; i++ ) + sal_uIntPtr nCount = pStrList->Count(); + for( sal_uIntPtr i = 0 ; i < nCount ; i++ ) delete pStrList->GetObject( i ); // Liste loeschen @@ -81,8 +81,8 @@ FileList& FileList::operator=( const FileList& rFileList ) *pStrList = *rFileList.pStrList; // Strings in der Liste kopieren - ULONG nCount = pStrList->Count(); - for( ULONG i = 0 ; i < nCount ; i++ ) + sal_uIntPtr nCount = pStrList->Count(); + for( sal_uIntPtr i = 0 ; i < nCount ; i++ ) pStrList->Replace( new String( *rFileList.pStrList->GetObject( i ) ), i ); return *this; @@ -94,7 +94,7 @@ FileList& FileList::operator=( const FileList& rFileList ) |* \*************************************************************************/ -ULONG FileList::GetFormat() +sal_uIntPtr FileList::GetFormat() { return FORMAT_FILE_LIST; } @@ -184,7 +184,7 @@ void FileList::AppendFile( const String& rStr ) pStrList->Insert( new String( rStr ) , pStrList->Count() ); } -String FileList::GetFile( ULONG i ) const +String FileList::GetFile( sal_uIntPtr i ) const { String aStr; if( i < pStrList->Count() ) @@ -192,7 +192,7 @@ String FileList::GetFile( ULONG i ) const return aStr; } -ULONG FileList::Count( void ) const +sal_uIntPtr FileList::Count( void ) const { return pStrList->Count(); } diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index baddde6e716f..10b6958ca4ac 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -46,9 +46,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_uIntPtr nFormatId; // Clipboard Id + sal_uInt16 nAction; // Action Id + sal_uInt8 nContextCheckId; // additional check of content in clipboard }; @@ -68,7 +68,7 @@ struct SotAction_Impl struct SotDestinationEntry_Impl { - USHORT nDestination; + sal_uInt16 nDestination; const SotAction_Impl* aDefaultActions; const SotAction_Impl* aMoveActions; const SotAction_Impl* aCopyActions; @@ -1283,7 +1283,7 @@ static SotDestinationEntry_Impl __READONLY_DATA aDestinationArray[] = \ // - new style GetExchange methods - // --------------------------------- -sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, ULONG nId ) +sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_uIntPtr nId ) { DataFlavorExVector::iterator aIter( ( (DataFlavorExVector&) rDataFlavorExVector ).begin() ); DataFlavorExVector::iterator aEnd( ( (DataFlavorExVector&) rDataFlavorExVector ).end() ); @@ -1303,14 +1303,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 { @@ -1323,7 +1323,7 @@ rEntry { case FILEGRPDSC_ONLY_URL: { - bRet = FALSE; + bRet = sal_False; if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_FILECONTENT, aFlavor ) && (*pxTransferable)->isDataFlavorSupported( aFlavor ) && @@ -1367,11 +1367,11 @@ rEntry // ----------------------------------------------------------------------------- -static USHORT GetTransferableAction_Impl( +static sal_uInt16 GetTransferableAction_Impl( const DataFlavorExVector& rDataFlavorExVector, const SotAction_Impl* pArray, - ULONG& rFormat, - ULONG nOnlyTestFormat, + sal_uIntPtr& rFormat, + sal_uIntPtr nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { try @@ -1380,11 +1380,11 @@ static USHORT GetTransferableAction_Impl( { DataFlavor aFlavor; const SotAction_Impl* pArrayStart = pArray; - ULONG nId = pArray->nFormatId; + sal_uIntPtr 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_uIntPtr nChkFormat = 0; if( nChkFormat ) { for( ; 0xffff != pArray->nFormatId && @@ -1454,13 +1454,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_uIntPtr& rFormat, + sal_uInt16& rDefaultAction, + sal_uIntPtr nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { // hier wird jetzt die oben definierte Tabelle "implementiert" @@ -1568,11 +1568,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_uIntPtr& rFormat, + sal_uInt16& rDefaultAction, sal_uIntPtr nOnlyTestFormat ) { DataFlavorExVector aVector; @@ -1625,9 +1625,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 @@ -1643,9 +1643,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/object.cxx b/sot/source/base/object.cxx index 403a1c6bb61d..bdd3862d8d52 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -63,7 +63,7 @@ SO2_IMPL_INVARIANT(SotObject) |* |* Beschreibung: *************************************************************************/ -void SotObject::TestMemberObjRef( BOOL /*bFree*/ ) +void SotObject::TestMemberObjRef( sal_Bool /*bFree*/ ) { } @@ -73,7 +73,7 @@ void SotObject::TestMemberObjRef( BOOL /*bFree*/ ) |* Beschreibung: *************************************************************************/ #ifdef TEST_INVARIANT -void SotObject::TestMemberInvariant( BOOL /*bPrint*/ ) +void SotObject::TestMemberInvariant( sal_Bool /*bPrint*/ ) { } #endif @@ -87,9 +87,9 @@ SotObject::SotObject() : pAggList ( NULL ) , nStrongLockCount( 0 ) , nOwnerLockCount( 0 ) - , bOwner ( TRUE ) - , bSVObject ( FALSE ) - , bInClose ( FALSE ) + , bOwner ( sal_True ) + , bSVObject ( sal_False ) + , bInClose ( sal_False ) { SotFactory::IncSvObjectCount( this ); } @@ -123,7 +123,7 @@ IUnknown * SotObject::GetInterface( const SvGlobalName & ) |* |* Beschreibung *************************************************************************/ -BOOL SotObject::IsSvObject() const +sal_Bool SotObject::IsSvObject() const { return Owner() || bSVObject; } @@ -138,20 +138,20 @@ BOOL SotObject::IsSvObject() const |* Objekte um 1 erhoeht, muss dies bei der Berechnung |* des 0-RefCounts beruecksichtigt werden. *************************************************************************/ -BOOL SotObject::ShouldDelete() +sal_Bool SotObject::ShouldDelete() { if( !pAggList ) - return TRUE; + return sal_True; SvAggregate & rMO = pAggList->GetObject( 0 ); if( rMO.bMainObj ) { AddRef(); pAggList->GetObject( 0 ).pObj->ReleaseRef(); - return FALSE; + return sal_False; } - ULONG i; + sal_uIntPtr i; for( i = 1; i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); @@ -162,7 +162,7 @@ BOOL SotObject::ShouldDelete() AddRef(); // einen Aggregierten runterzaehlen rAgg.pObj->ReleaseRef(); - return FALSE; + return sal_False; } } AddNextRef(); // rekursion stoppen @@ -175,7 +175,7 @@ BOOL SotObject::ShouldDelete() delete pAggList; pAggList = NULL; // und zerstoeren, dies ist unabhaengig vom RefCount - return TRUE; + return sal_True; } /************************************************************************* @@ -212,7 +212,7 @@ SvAggregateMemberList & SotObject::GetAggList() |* |* Beschreibung *************************************************************************/ -void SotObject::RemoveInterface( ULONG nPos ) +void SotObject::RemoveInterface( sal_uIntPtr nPos ) { SvAggregate & rAgg = pAggList->GetObject( nPos ); if( !rAgg.bFactory ) @@ -238,7 +238,7 @@ void SotObject::RemoveInterface( SotObject * pObjP ) { DBG_ASSERT( pObjP, "null pointer" ); DBG_ASSERT( pAggList, "no aggregation list" ); - ULONG i; + sal_uIntPtr i; for( i = 0; i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); @@ -257,12 +257,12 @@ void SotObject::AddInterface( SotObject * pObjP ) { pObjP->AddRef(); // Objekt festhalten GetAggList(); - pAggList->Append( SvAggregate( pObjP, FALSE ) ); + pAggList->Append( SvAggregate( pObjP, sal_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 ); + rAList[ 0 ] = SvAggregate( this, sal_True ); } /************************************************************************* @@ -298,7 +298,7 @@ void * SotObject::DownAggCast( const SotFactory * pFact ) // geht den Pfad nur Richtung aggregierte Objekte if( pAggList ) { - for( ULONG i = 1; !pCast || i < pAggList->Count(); i++ ) + for( sal_uIntPtr i = 1; !pCast || i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); if( rAgg.bFactory ) @@ -307,14 +307,14 @@ void * SotObject::DownAggCast( const SotFactory * pFact ) { // On-Demand erzeugen, wenn Typ gebraucht SotObjectRef aObj( CreateAggObj( rAgg.pFact ) ); - rAgg.bFactory = FALSE; + rAgg.bFactory = sal_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 ); + rAList[ 0 ] = SvAggregate( this, sal_True ); } } if( !rAgg.bFactory ) @@ -382,23 +382,23 @@ SotObject * SotObject::GetMainObj() const } //========================================================================= -USHORT SotObject::FuzzyLock +sal_uInt16 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 */ + sal_Bool bLock, /* sal_True, lock. sal_False, unlock. */ + sal_Bool /*bIntern*/, /* sal_True, es handelt sich um einen internen Lock. + sal_False, der Lock kam von aussen (Ole2, Ipc2) */ + sal_Bool bClose /* sal_True, Close aufrufen wenn letzte Lock */ ) /* [Beschreibung] Erlaubte Parameterkombinationen: - ( TRUE, TRUE, * ) -> interner Lock. - ( FALSE, TRUE, TRUE ) -> interner Unlock mit Close, + ( sal_True, sal_True, * ) -> interner Lock. + ( sal_False, sal_True, sal_True ) -> interner Unlock mit Close, wenn LockCount() == 0 - ( TRUE, FALSE, * ) -> externer Lock. - ( FALSE, FALSE, TRUE ) -> externer Unlock mit Close, + ( sal_True, sal_False, * ) -> externer Lock. + ( sal_False, sal_False, sal_True ) -> externer Unlock mit Close, wenn LockCount() == 0 - ( FALSE, FALSE, FALSE ) -> externer Unlock + ( sal_False, sal_False, sal_False ) -> externer Unlock F"ur !Owner() wird der Aufruf an das externe Objekt weitergeleitet. F"ur diese muss das -Interface zur Vef"ugung stehen. @@ -411,7 +411,7 @@ USHORT SotObject::FuzzyLock */ { SotObjectRef xHoldAlive( this ); - USHORT nRet; + sal_uInt16 nRet; if( bLock ) { AddRef(); @@ -431,7 +431,7 @@ USHORT SotObject::FuzzyLock //========================================================================= void SotObject::OwnerLock ( - BOOL bLock /* TRUE, lock. FALSE, unlock. */ + sal_Bool bLock /* sal_True, lock. sal_False, unlock. */ ) /* [Beschreibung] @@ -467,23 +467,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/stg.cxx b/sot/source/sdstor/stg.cxx index 1c749aa05cb8..5adfb735d47b 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -66,7 +66,7 @@ TYPEINIT1( BaseStorageStream, StorageBase ); TYPEINIT1( BaseStorage, StorageBase ); StorageBase::StorageBase() - : m_bAutoCommit( FALSE ) + : m_bAutoCommit( sal_False ) { m_nMode = STREAM_READ; m_nError = SVSTREAM_OK; @@ -79,14 +79,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_uIntPtr StorageBase::GetError() const { - ULONG n = m_nError; + sal_uIntPtr n = m_nError; ((StorageBase*) this)->m_nError = SVSTREAM_OK; return n; } -void StorageBase::SetError( ULONG n ) const +void StorageBase::SetError( sal_uIntPtr n ) const { if( !m_nError ) ((StorageBase*) this)->m_nError = n; @@ -133,20 +133,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 @@ -154,7 +154,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 { @@ -163,9 +163,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; } @@ -199,18 +199,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_uIntPtr StorageStream::Read( void* pData, sal_uIntPtr nSize ) { if( Validate() ) { pEntry->Seek( nPos ); - nSize = pEntry->Read( pData, (INT32) nSize ); + nSize = pEntry->Read( pData, (sal_Int32) nSize ); pIo->MoveError( *this ); nPos += nSize; } @@ -219,12 +219,12 @@ ULONG StorageStream::Read( void* pData, ULONG nSize ) return nSize; } -ULONG StorageStream::Write( const void* pData, ULONG nSize ) +sal_uIntPtr StorageStream::Write( const void* pData, sal_uIntPtr 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; } @@ -233,7 +233,7 @@ ULONG StorageStream::Write( const void* pData, ULONG nSize ) return nSize; } -ULONG StorageStream::Seek( ULONG n ) +sal_uIntPtr StorageStream::Seek( sal_uIntPtr n ) { if( Validate() ) return nPos = pEntry->Seek( n ); @@ -247,26 +247,26 @@ void StorageStream::Flush() Commit(); } -BOOL StorageStream::SetSize( ULONG nNewSize ) +sal_Bool StorageStream::SetSize( sal_uIntPtr 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 { @@ -276,22 +276,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 @@ -299,25 +299,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; @@ -328,26 +328,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_uIntPtr 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 ) @@ -361,21 +361,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; @@ -392,19 +392,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_uIntPtr 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; @@ -420,8 +420,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; @@ -435,7 +435,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; @@ -446,10 +446,10 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) pIo->SetStrm( &rStrm ); - ULONG nSize = pStream->Seek( STREAM_SEEK_TO_END ); + sal_uIntPtr 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; @@ -462,14 +462,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_uIntPtr nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); pIo->GetStrm()->Seek( 0L ); if( nSize ) { @@ -498,7 +498,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 ); @@ -561,7 +561,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 ) { DBG_ERROR("Not supported!"); /* @@ -572,20 +572,20 @@ 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 ); - BOOL bSetAutoCommit = FALSE; + sal_Bool bSetAutoCommit = sal_False; if( bDirect && !pEntry->bDirect ) { - bSetAutoCommit = TRUE; - bDirect = FALSE; + bSetAutoCommit = sal_True; + bDirect = sal_False; } StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); @@ -593,14 +593,14 @@ BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, BOOL bDire { 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 ) @@ -630,13 +630,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 @@ -648,7 +648,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 ) ) @@ -660,7 +660,7 @@ pB { aNewName.AssignAscii( "Temp Strm " ); aNewName.Append( String::CreateFromInt32( ++nTmpCount ) ); - bTemp = TRUE; + bTemp = sal_True; } p = pIo->pTOC->Create( *pEntry, aNewName, STG_STREAM ); } @@ -682,50 +682,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 ) { @@ -734,7 +734,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 ) @@ -743,7 +743,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_uIntPtr nTmpErr = p2->GetError(); if( !nTmpErr ) { p2->SetClassId( p1->GetClassId() ); @@ -761,7 +761,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 { @@ -769,7 +769,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_uIntPtr nTmpErr = p2->GetError(); if( !nTmpErr ) { p1->CopyTo( p2 ); @@ -786,58 +786,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 ) { @@ -848,14 +848,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_uIntPtr nErr = GetError(); if( !nErr ) nErr = pDest->GetError(); SetError( nErr ); @@ -873,51 +873,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 { @@ -936,9 +936,9 @@ BOOL Storage::Commit() return bRes; } -BOOL Storage::Revert() +sal_Bool Storage::Revert() { - return TRUE; + return sal_True; } ///////////////////////////// OLE Support //////////////////////////////// @@ -946,16 +946,16 @@ BOOL Storage::Revert() // Set the storage type void Storage::SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uIntPtr 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; @@ -973,14 +973,14 @@ void Storage::SetClass( const SvGlobalName & rClass, } void Storage::SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uIntPtr 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() ); @@ -989,7 +989,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(); @@ -1000,9 +1000,9 @@ SvGlobalName Storage::GetClassName() return SvGlobalName(); } -ULONG Storage::GetFormat() +sal_uIntPtr Storage::GetFormat() { - StgCompObjStream aCompObj( *this, FALSE ); + StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) return aCompObj.GetCbFormat(); pIo->ResetError(); @@ -1011,26 +1011,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(); @@ -1058,31 +1058,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 3542a965da33..ad400f85dee5 100644 --- a/sot/source/sdstor/stgavl.cxx +++ b/sot/source/sdstor/stgavl.cxx @@ -212,7 +212,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 ) { @@ -279,21 +279,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; @@ -323,19 +323,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 ) @@ -345,30 +345,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 66f424888e6d..29b33ae81109 100644 --- a/sot/source/sdstor/stgavl.hxx +++ b/sot/source/sdstor/stgavl.hxx @@ -46,7 +46,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 @@ -55,9 +55,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 88a8187ee9dd..6a0d1117f934 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -52,10 +52,10 @@ //----------------------------------------------------------------------------- typedef std::hash_map < - INT32, + sal_Int32, StgPage *, - std::hash< INT32 >, - NAMESPACE_STD(equal_to)< INT32 > + std::hash< sal_Int32 >, + NAMESPACE_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_uIntPtr 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_uIntPtr nPos = pStrm->Tell(); + sal_uIntPtr 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_uIntPtr 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_uIntPtr nPos = Page2Pos( nPage ); + sal_Int32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; + sal_uIntPtr 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_uIntPtr nPos = Page2Pos( nPage ); + sal_uIntPtr 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_uIntPtr 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_uIntPtr 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 5379f837b8b1..0c1fc3eab1ff 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -47,9 +47,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_uIntPtr 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 @@ -57,40 +57,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_uIntPtr GetError() { return nError; } void MoveError( StorageBase& ); - void SetError( ULONG ); + void SetError( sal_uIntPtr ); 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 }; @@ -101,32 +101,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 f093dc60cbe7..0b1cf2582501 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -54,7 +54,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 ); @@ -81,14 +81,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() @@ -113,9 +113,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 ) { @@ -137,17 +137,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 ) @@ -157,12 +157,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; } } } @@ -170,26 +170,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 ) { @@ -206,27 +206,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 @@ -244,24 +244,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 ); @@ -271,7 +271,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; } @@ -291,9 +291,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 ) @@ -304,14 +304,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 ) @@ -320,26 +320,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 @@ -351,16 +351,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(pBuf); + bRes = sal_True; + delete[] static_cast(pBuf); } else - bRes = TRUE; + bRes = sal_True; if( bRes ) { pOld->SetSize( 0 ); @@ -378,7 +378,7 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) else { pStgStrm->Pos2Page( nPos ); - bRes = TRUE; + bRes = sal_True; } } return bRes; @@ -387,7 +387,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 ) { @@ -403,7 +403,7 @@ INT32 StgDirEntry::Seek( INT32 nNew ) } else { - INT32 nSize = aEntry.GetSize(); + sal_Int32 nSize = aEntry.GetSize(); if( nNew < 0 ) nNew = nSize; @@ -427,7 +427,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; @@ -443,7 +443,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; @@ -461,7 +461,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 ) ) @@ -478,16 +478,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( 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 ) @@ -501,22 +501,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_uIntPtr Pos = rDest.Tell(); + sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast( 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(rDest.Write( p, nn )) != nn ) + if( sal::static_int_cast(rDest.Write( p, nn )) != nn ) break; n -= nn; } @@ -526,12 +526,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 ) @@ -552,7 +552,7 @@ BOOL StgDirEntry::Commit() // Revert the entry -BOOL StgDirEntry::Revert() +sal_Bool StgDirEntry::Revert() { aEntry = aSave; switch( aEntry.GetType() ) @@ -563,24 +563,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 @@ -595,12 +595,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: @@ -609,22 +609,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_uIntPtr 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 @@ -635,15 +635,15 @@ BOOL StgDirEntry::Strm2Tmp() { if( n ) { - BYTE aTempBytes[ 4096 ]; + sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast( aTempBytes ); pStgStrm->Pos2Page( 0L ); while( n ) { - ULONG nn = n; + sal_uIntPtr nn = n; if( nn > 4096 ) nn = 4096; - if( (ULONG) pStgStrm->Read( p, nn ) != nn ) + if( (sal_uIntPtr) pStgStrm->Read( p, nn ) != nn ) break; if( pTmpStrm->Write( p, nn ) != nn ) break; @@ -661,41 +661,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_uIntPtr n = pTmpStrm->GetSize(); StgStrm* pNewStrm; StgIo& rIo = pStgStrm->GetIo(); - ULONG nThreshold = (ULONG) rIo.aHdr.GetThreshold(); + sal_uIntPtr nThreshold = (sal_uIntPtr) 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_uIntPtr nn = n; if( nn > 4096 ) nn = 4096; if( pTmpStrm->Read( p, nn ) != nn ) break; - if( (ULONG) pNewStrm->Write( p, nn ) != nn ) + if( (sal_uIntPtr) pNewStrm->Write( p, nn ) != nn ) break; n -= nn; } @@ -704,7 +704,7 @@ BOOL StgDirEntry::Tmp2Strm() pTmpStrm->Seek( nPos ); pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); delete pNewStrm; - return FALSE; + return sal_False; } else { @@ -720,12 +720,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 ) { @@ -734,25 +734,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: @@ -807,12 +807,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 ) @@ -827,10 +827,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 ); @@ -865,7 +865,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; @@ -874,72 +874,72 @@ 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 ) { n *= STGENTRY_SIZE; if( n >= nSize ) return NULL; - return GetPtr( n, TRUE, bDirty ); + return GetPtr( n, sal_True, bDirty ); } // Find a dir entry. @@ -986,9 +986,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 { @@ -998,7 +998,7 @@ StgDirEntry* StgDirStrm::Create pRes->pUp = &rStg; pRes->ppRoot = &pRoot; pRes->bCreated = - pRes->bDirty = TRUE; + pRes->bDirty = sal_True; } else { @@ -1011,44 +1011,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 3ef510a12e50..e3cf2cb78072 100644 --- a/sot/source/sdstor/stgdir.hxx +++ b/sot/source/sdstor/stgdir.hxx @@ -49,52 +49,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& ); }; @@ -104,19 +104,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 46d7f1803140..917a4c2adb61 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -39,7 +39,7 @@ #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 ///////////////////////////// @@ -62,17 +62,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 //////////////////////////// @@ -99,14 +99,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 ); @@ -129,10 +129,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 ); @@ -140,7 +140,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 @@ -152,7 +152,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) @@ -161,15 +161,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 ]; @@ -177,50 +177,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 ///////////////////////////// @@ -237,11 +237,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 = ' '; } @@ -253,14 +253,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 ) @@ -278,7 +278,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 ); @@ -290,12 +290,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; @@ -306,7 +306,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 ) { @@ -317,12 +317,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; @@ -337,7 +337,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 ); @@ -362,7 +362,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++ ) @@ -383,14 +383,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 ); @@ -398,7 +398,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 7a5b7bc52b26..8b7d547ca416 100644 --- a/sot/source/sdstor/stgelem.hxx +++ b/sot/source/sdstor/stgelem.hxx @@ -46,51 +46,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: @@ -119,42 +119,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 00dd454233e2..580a3ddad4a6 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -46,7 +46,7 @@ StgIo::StgIo() : StgCache() pDataFAT = NULL; pDataStrm = NULL; pFAT = NULL; - bCopied = FALSE; + bCopied = sal_False; } StgIo::~StgIo() @@ -59,7 +59,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 ) { @@ -68,7 +68,7 @@ BOOL StgIo::Load() if( aHdr.Check() ) SetupStreams(); else - return FALSE; + return sal_False; } } return Good(); @@ -76,7 +76,7 @@ BOOL StgIo::Load() // Set up an initial, empty storage -BOOL StgIo::Init() +sal_Bool StgIo::Init() { aHdr.Init(); SetupStreams(); @@ -122,7 +122,7 @@ short StgIo::GetDataPageSize() // Commit everything -BOOL StgIo::CommitAll() +sal_Bool StgIo::CommitAll() { // Store the data (all streams and the TOC) if( pTOC->Store() ) @@ -135,81 +135,81 @@ BOOL StgIo::CommitAll() if( aHdr.Store( *this ) ) { pStrm->Flush(); - ULONG n = pStrm->GetError(); + sal_uIntPtr 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_uIntPtr 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_uIntPtr 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 ) @@ -231,22 +231,22 @@ ULONG EasyFat::Mark( INT32 nPage, INT32 nCount, INT32 nExpect ) class Validator { - ULONG nError; + sal_uIntPtr nError; EasyFat aSmallFat; EasyFat aFat; StgIo &rIo; - ULONG ValidateMasterFATs(); - ULONG ValidateDirectoryEntries(); - ULONG FindUnrefedChains(); - ULONG MarkAll( StgDirEntry *pEntry ); + sal_uIntPtr ValidateMasterFATs(); + sal_uIntPtr ValidateDirectoryEntries(); + sal_uIntPtr FindUnrefedChains(); + sal_uIntPtr MarkAll( StgDirEntry *pEntry ); public: Validator( StgIo &rIo ); - BOOL IsError() { return nError != 0; } + sal_Bool IsError() { return nError != 0; } }; Validator::Validator( StgIo &rIoP ) @@ -254,7 +254,7 @@ Validator::Validator( StgIo &rIoP ) aFat( rIoP, rIoP.pFAT, 1 << rIoP.aHdr.GetPageSize() ), rIo( rIoP ) { - ULONG nErr = nError = FAT_OK; + sal_uIntPtr nErr = nError = FAT_OK; if( ( nErr = ValidateMasterFATs() ) != FAT_OK ) nError = nErr; @@ -264,13 +264,13 @@ Validator::Validator( StgIo &rIoP ) nError = nErr; } -ULONG Validator::ValidateMasterFATs() +sal_uIntPtr Validator::ValidateMasterFATs() { - INT32 nCount = rIo.aHdr.GetFATSize(); - ULONG nErr; - for( INT32 i = 0; i < nCount; i++ ) + sal_Int32 nCount = rIo.aHdr.GetFATSize(); + sal_uIntPtr 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() ) @@ -279,10 +279,10 @@ ULONG Validator::ValidateMasterFATs() return FAT_OK; } -ULONG Validator::MarkAll( StgDirEntry *pEntry ) +sal_uIntPtr Validator::MarkAll( StgDirEntry *pEntry ) { StgIterator aIter( *pEntry ); - ULONG nErr = FAT_OK; + sal_uIntPtr nErr = FAT_OK; for( StgDirEntry* p = aIter.First(); p ; p = aIter.Next() ) { if( p->aEntry.GetType() == STG_STORAGE ) @@ -293,7 +293,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 @@ -305,10 +305,10 @@ ULONG Validator::MarkAll( StgDirEntry *pEntry ) return FAT_OK; } -ULONG Validator::ValidateDirectoryEntries() +sal_uIntPtr Validator::ValidateDirectoryEntries() { // Normale DirEntries - ULONG nErr = MarkAll( rIo.pTOC->GetRoot() ); + sal_uIntPtr nErr = MarkAll( rIo.pTOC->GetRoot() ); if( nErr != FAT_OK ) return nErr; // Small Data @@ -328,7 +328,7 @@ ULONG Validator::ValidateDirectoryEntries() return nErr; } -ULONG Validator::FindUnrefedChains() +sal_uIntPtr Validator::FindUnrefedChains() { if( aSmallFat.HasUnrefChains() || aFat.HasUnrefChains() ) @@ -349,12 +349,12 @@ const Link& StgIo::GetErrorLink() return ErrorLink::get(); } -ULONG StgIo::ValidateFATs() +sal_uIntPtr 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; @@ -367,7 +367,7 @@ ULONG StgIo::ValidateFATs() delete pV; } - ULONG nErr; + sal_uIntPtr nErr; if( bRet1 != bRet2 ) nErr = bRet1 ? FAT_ONFILEERROR : FAT_INMEMORYERROR; else nErr = bRet1 ? FAT_OK : FAT_BOTHERROR; @@ -377,7 +377,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 db1c00b8d521..43f72ebefd59 100644 --- a/sot/source/sdstor/stgio.hxx +++ b/sot/source/sdstor/stgio.hxx @@ -53,12 +53,12 @@ enum FAT_ERROR struct StgLinkArg { String aFile; - ULONG nErr; + sal_uIntPtr nErr; }; class StgIo : public StgCache { void SetupStreams(); // load all internal streams - BOOL bCopied; + sal_Bool bCopied; public: StgIo(); ~StgIo(); @@ -68,13 +68,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_uIntPtr ValidateFATs( ); }; #endif diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 148f1e87585c..e3d02bc597ab 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -40,10 +40,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 ); @@ -58,7 +58,7 @@ StgInternalStream::~StgInternalStream() delete pStrm; } -ULONG StgInternalStream::GetData( void* pData, ULONG nSize ) +sal_uIntPtr StgInternalStream::GetData( void* pData, sal_uIntPtr nSize ) { if( pStrm ) { @@ -70,7 +70,7 @@ ULONG StgInternalStream::GetData( void* pData, ULONG nSize ) return 0; } -ULONG StgInternalStream::PutData( const void* pData, ULONG nSize ) +sal_uIntPtr StgInternalStream::PutData( const void* pData, sal_uIntPtr nSize ) { if( pStrm ) { @@ -82,7 +82,7 @@ ULONG StgInternalStream::PutData( const void* pData, ULONG nSize ) return 0; } -ULONG StgInternalStream::SeekPos( ULONG nPos ) +sal_uIntPtr StgInternalStream::SeekPos( sal_uIntPtr nPos ) { return pStrm ? pStrm->Seek( nPos ) : 0; } @@ -104,43 +104,43 @@ 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_uIntPtr) nLen1 ) { aUserName = nLen1 ? String( p, gsl_getSystemTextEncoding() ) : String(); /* // Now we can read the CB format - INT32 nLen2 = 0; + sal_Int32 nLen2 = 0; *this >> nLen2; if( nLen2 > 0 ) { // get a string name if( nLen2 > nLen1 ) delete p, p = new char[ nLen2 ]; - if( Read( p, nLen2 ) == (ULONG) nLen2 && nLen2 ) + if( Read( p, nLen2 ) == (sal_uIntPtr) nLen2 && nLen2 ) nCbFormat = Exchange::RegisterFormatName( String( p ) ); else SetError( SVSTREAM_GENERALERROR ); @@ -158,73 +158,73 @@ 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_ASCII_US ); - *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 /* // determine the clipboard format string String aCbFmt; if( nCbFormat > FORMAT_GDIMETAFILE ) aCbFmt = Exchange::GetFormatName( nCbFormat ); if( aCbFmt.Len() ) - *this << (INT32) aCbFmt.Len() + 1 + *this << (sal_Int32) aCbFmt.Len() + 1 << (const char*) aCbFmt - << (UINT8) 0; + << (sal_uInt8) 0; else if( nCbFormat ) - *this << (INT32) -1 // for Windows - << (INT32) nCbFormat; + *this << (sal_Int32) -1 // for Windows + << (sal_Int32) nCbFormat; else - *this << (INT32) 0; // no clipboard format + *this << (sal_Int32) 0; // no clipboard format */ 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 ); } diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 346f21035f06..b8c569c81ded 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -36,12 +36,12 @@ 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_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(); public: - StgInternalStream( BaseStorage&, const String&, BOOL ); + StgInternalStream( BaseStorage&, const String&, sal_Bool ); ~StgInternalStream(); void Commit(); }; @@ -52,14 +52,14 @@ class StgCompObjStream : public StgInternalStream { ClsId aClsId; String aUserName; - ULONG nCbFormat; + sal_uIntPtr 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_uIntPtr& GetCbFormat() { return nCbFormat; } + sal_Bool Load(); + sal_Bool Store(); }; // standard stream "\1Ole" @@ -68,10 +68,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 07711133bf4b..74e21903f087 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -52,10 +52,10 @@ ///////////////////////////// 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(); @@ -67,7 +67,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 @@ -75,16 +75,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 ) { @@ -100,16 +100,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 ) ) { @@ -119,7 +119,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 @@ -137,12 +137,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; } @@ -163,8 +163,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; } @@ -180,19 +180,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; @@ -202,22 +202,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 ) @@ -253,7 +253,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++; } @@ -273,9 +273,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; @@ -285,29 +285,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 //////////////////////////////// @@ -345,21 +345,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 @@ -376,7 +376,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; @@ -394,12 +394,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; @@ -409,16 +409,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 ) @@ -427,34 +427,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; } @@ -468,12 +468,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; } @@ -486,11 +486,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 ) @@ -498,38 +498,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 ) { @@ -556,7 +556,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 ); @@ -570,7 +570,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 ); @@ -587,30 +587,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 ); } @@ -619,7 +619,7 @@ BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage ) else { rIo.SetError( SVSTREAM_GENERALERROR ); - bRes = FALSE; + bRes = sal_False; } } @@ -627,16 +627,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 ); @@ -654,17 +654,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 @@ -677,12 +677,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 ); @@ -693,22 +693,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 ); } @@ -721,7 +721,7 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) } nSize = nNew * nPageSize; rIo.aHdr.SetFATSize( nNew ); - return TRUE; + return sal_True; } /////////////////////////// class StgDataStrm ////////////////////////////// @@ -731,7 +731,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 ); } @@ -743,9 +743,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; @@ -755,7 +755,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; @@ -769,18 +769,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. @@ -791,14 +791,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 ) ) { @@ -808,7 +808,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; @@ -818,24 +818,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; short nRes; StgPage* pPg; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { - void *p = (BYTE *) pBuf + nDone; + void *p = (sal_uInt8 *) pBuf + nDone; if( nBytes == nPageSize ) { pPg = rIo.Find( nPage ); @@ -853,11 +853,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; @@ -874,14 +874,14 @@ 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 ) @@ -889,11 +889,11 @@ INT32 StgDataStrm::Write( const void* pBuf, INT32 n ) short nBytes = nPageSize - nOffset; short nRes; StgPage* pPg; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { - const void *p = (const BYTE *) pBuf + nDone; + const void *p = (const sal_uInt8 *) pBuf + nDone; if( nBytes == nPageSize ) { pPg = rIo.Find( nPage ); @@ -912,11 +912,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; } @@ -941,7 +941,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 ); } @@ -953,9 +953,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 = @@ -967,7 +967,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. @@ -977,14 +977,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; @@ -1000,33 +1000,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; @@ -1049,7 +1049,7 @@ INT32 StgSmallStrm::Write( const void* pBuf, INT32 n ) #define THRESHOLD 32768L -StgTmpStrm::StgTmpStrm( ULONG nInitSize ) +StgTmpStrm::StgTmpStrm( sal_uIntPtr nInitSize ) : SvMemoryStream( nInitSize > THRESHOLD ? 16 : ( nInitSize ? nInitSize : 16 ), 4096 ) @@ -1061,19 +1061,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_uIntPtr n = rSrc.GetSize(); + sal_uIntPtr 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_uIntPtr nn = n; if( nn > 4096 ) nn = 4096; if( rSrc.Read( p, nn ) != nn ) @@ -1085,10 +1085,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() @@ -1101,12 +1101,12 @@ StgTmpStrm::~StgTmpStrm() } } -ULONG StgTmpStrm::GetSize() const +sal_uIntPtr StgTmpStrm::GetSize() const { - ULONG n; + sal_uIntPtr n; if( pStrm ) { - ULONG old = pStrm->Tell(); + sal_uIntPtr old = pStrm->Tell(); n = pStrm->Seek( STREAM_SEEK_TO_END ); pStrm->Seek( old ); } @@ -1115,7 +1115,7 @@ ULONG StgTmpStrm::GetSize() const return n; } -void StgTmpStrm::SetSize( ULONG n ) +void StgTmpStrm::SetSize( sal_uIntPtr n ) { if( pStrm ) pStrm->SetStreamSize( n ); @@ -1125,15 +1125,15 @@ void StgTmpStrm::SetSize( ULONG n ) { aName = TempFile::CreateTempName(); SvFileStream* s = new SvFileStream( aName, STREAM_READWRITE ); - ULONG nCur = Tell(); - ULONG i = nEndOfData; + sal_uIntPtr nCur = Tell(); + sal_uIntPtr 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_uIntPtr nb = ( i > 4096 ) ? 4096 : i; if( Read( p, nb ) == nb && s->Write( p, nb ) == nb ) i -= nb; @@ -1169,9 +1169,9 @@ void StgTmpStrm::SetSize( ULONG n ) { if( n > nEndOfData ) { - ULONG nCur = Tell(); + sal_uIntPtr nCur = Tell(); Seek( nEndOfData - 1 ); - *this << (BYTE) 0; + *this << (sal_uInt8) 0; Seek( nCur ); } else @@ -1180,7 +1180,7 @@ void StgTmpStrm::SetSize( ULONG n ) } } -ULONG StgTmpStrm::GetData( void* pData, ULONG n ) +sal_uIntPtr StgTmpStrm::GetData( void* pData, sal_uIntPtr n ) { if( pStrm ) { @@ -1192,10 +1192,10 @@ ULONG StgTmpStrm::GetData( void* pData, ULONG n ) return SvMemoryStream::GetData( (sal_Char *)pData, n ); } -ULONG StgTmpStrm::PutData( const void* pData, ULONG n ) +sal_uIntPtr StgTmpStrm::PutData( const void* pData, sal_uIntPtr n ) { - UINT32 nCur = Tell(); - UINT32 nNew = nCur + n; + sal_uInt32 nCur = Tell(); + sal_uInt32 nNew = nCur + n; if( nNew > THRESHOLD && !pStrm ) { SetSize( nNew ); @@ -1212,7 +1212,7 @@ ULONG StgTmpStrm::PutData( const void* pData, ULONG n ) return nNew; } -ULONG StgTmpStrm::SeekPos( ULONG n ) +sal_uIntPtr StgTmpStrm::SeekPos( sal_uIntPtr n ) { if( n == STREAM_SEEK_TO_END ) n = GetSize(); diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 9b09f51db43f..1ececadae35e 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -38,29 +38,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 @@ -72,31 +72,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. @@ -104,15 +104,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 @@ -121,15 +121,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. @@ -140,13 +140,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 @@ -154,17 +154,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_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(); public: - StgTmpStrm( ULONG=16 ); + StgTmpStrm( sal_uIntPtr=16 ); ~StgTmpStrm(); - BOOL Copy( StgTmpStrm& ); - void SetSize( ULONG ); - ULONG GetSize() const; + sal_Bool Copy( StgTmpStrm& ); + void SetSize( sal_uIntPtr ); + sal_uIntPtr GetSize() const; }; #endif diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 136abb29a98e..9b5d3a95b92f 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -75,12 +75,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 @@ -96,12 +96,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; } @@ -116,9 +116,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" ); } @@ -128,9 +128,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() ); @@ -139,7 +139,7 @@ SotStorageStream::SotStorageStream( BaseStorageStream * pStm ) else { pOwnStm = NULL; - bIsWritable = TRUE; + bIsWritable = sal_True; SetError( SVSTREAM_INVALID_PARAMETER ); } } @@ -148,7 +148,7 @@ SotStorageStream::SotStorageStream() : pOwnStm( NULL ) { // ??? wenn Init virtuell ist, entsprechen setzen - bIsWritable = TRUE; + bIsWritable = sal_True; } /************************************************************************ @@ -170,7 +170,7 @@ SotStorageStream::~SotStorageStream() *************************************************************************/ void SotStorageStream::SyncSvStream() { - ULONG nPos = 0; + sal_uIntPtr nPos = 0; if( pOwnStm ) { pOwnStm->Flush(); @@ -197,9 +197,9 @@ void SotStorageStream::ResetError() |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::GetData( void* pData, ULONG nSize ) +sal_uIntPtr SotStorageStream::GetData( void* pData, sal_uIntPtr nSize ) { - ULONG nRet = 0; + sal_uIntPtr nRet = 0; if( pOwnStm ) { @@ -216,9 +216,9 @@ ULONG SotStorageStream::GetData( void* pData, ULONG nSize ) |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::PutData( const void* pData, ULONG nSize ) +sal_uIntPtr SotStorageStream::PutData( const void* pData, sal_uIntPtr nSize ) { - ULONG nRet = 0; + sal_uIntPtr nRet = 0; if( pOwnStm ) { @@ -235,9 +235,9 @@ ULONG SotStorageStream::PutData( const void* pData, ULONG nSize ) |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::SeekPos( ULONG nPos ) +sal_uIntPtr SotStorageStream::SeekPos( sal_uIntPtr nPos ) { - ULONG nRet = 0; + sal_uIntPtr nRet = 0; if( pOwnStm ) { @@ -270,9 +270,9 @@ void SotStorageStream::FlushData() |* |* Beschreibung *************************************************************************/ -void SotStorageStream::SetSize( ULONG nNewSize ) +void SotStorageStream::SetSize( sal_uIntPtr nNewSize ) { - ULONG nPos = Tell(); + sal_uIntPtr nPos = Tell(); if( pOwnStm ) { pOwnStm->SetSize( nNewSize ); @@ -295,11 +295,11 @@ void SotStorageStream::SetSize( ULONG nNewSize ) |* Beschreibung |* *************************************************************************/ -UINT32 SotStorageStream::GetSize() const +sal_uInt32 SotStorageStream::GetSize() const { - ULONG nPos = Tell(); + sal_uIntPtr nPos = Tell(); ((SotStorageStream *)this)->Seek( STREAM_SEEK_TO_END ); - ULONG nSize = Tell(); + sal_uIntPtr nSize = Tell(); ((SotStorageStream *)this)->Seek( nPos ); return nSize; } @@ -309,19 +309,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_uIntPtr 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_uIntPtr nRead; while( 0 != (nRead = Read( pMem, 8192 )) ) { if( nRead != pDestStm->Write( pMem, nRead ) ) @@ -330,7 +330,7 @@ BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm ) break; } } - delete [] static_cast(pMem); + delete [] static_cast(pMem); // Position setzen pDestStm->Seek( nPos ); Seek( nPos ); @@ -361,7 +361,7 @@ BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorageStream::Commit() +sal_Bool SotStorageStream::Commit() { if( pOwnStm ) { @@ -373,7 +373,7 @@ BOOL SotStorageStream::Commit() return GetError() == SVSTREAM_OK; } -BOOL SotStorageStream::Revert() +sal_Bool SotStorageStream::Revert() { if( !pOwnStm ) { @@ -383,7 +383,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 ) @@ -393,11 +393,11 @@ BOOL SotStorageStream::SetProperty( const String& rName, const ::com::sun::star: else { DBG_ERROR("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 ) @@ -407,7 +407,7 @@ BOOL SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno:: else { DBG_ERROR("Not implemented!"); - return FALSE; + return sal_False; } } @@ -454,12 +454,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 @@ -471,7 +471,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 @@ -491,8 +491,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() @@ -510,7 +510,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() ); @@ -524,12 +524,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() ) @@ -555,11 +555,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 ); } } @@ -573,7 +573,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 ); @@ -583,8 +583,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 { @@ -594,24 +594,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 ); } } @@ -620,9 +620,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(); } @@ -631,7 +631,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; @@ -651,22 +651,22 @@ SotStorage::SotStorage( BaseStorage * pStor ) } m_pOwnStg = pStor; - ULONG nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE; + sal_uIntPtr 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() ); @@ -683,9 +683,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() ); @@ -695,16 +695,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() ); @@ -798,7 +798,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 ); @@ -896,7 +896,7 @@ SvMemoryStream * SotStorage::CreateMemoryStream() |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::IsStorageFile( const String & rFileName ) +sal_Bool SotStorage::IsStorageFile( const String & rFileName ) { String aName( rFileName ); INetURLObject aObj( aName ); @@ -909,25 +909,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() @@ -973,7 +973,7 @@ void SotStorage::ResetError() |* Beschreibung *************************************************************************/ void SotStorage::SetClass( const SvGlobalName & rName, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -984,7 +984,7 @@ void SotStorage::SetClass( const SvGlobalName & rName, } void SotStorage::SetConvertClass( const SvGlobalName & rName, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1013,9 +1013,9 @@ SvGlobalName SotStorage::GetClassName() return aGN; } -ULONG SotStorage::GetFormat() +sal_uIntPtr SotStorage::GetFormat() { - ULONG nFormat = 0; + sal_uIntPtr nFormat = 0; DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) nFormat = m_pOwnStg->GetFormat(); @@ -1035,14 +1035,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; } /************************************************************************* @@ -1062,7 +1062,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" ); @@ -1083,7 +1083,7 @@ BOOL SotStorage::CopyTo( SotStorage * pDestStg ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Commit() +sal_Bool SotStorage::Commit() { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1101,7 +1101,7 @@ BOOL SotStorage::Commit() |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Revert() +sal_Bool SotStorage::Revert() { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1133,7 +1133,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 ) @@ -1160,7 +1160,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 ) @@ -1189,7 +1189,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 ); @@ -1216,7 +1216,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 @@ -1237,7 +1237,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 @@ -1254,31 +1254,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; } /************************************************************************* @@ -1286,7 +1286,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 ) @@ -1304,7 +1304,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 ) @@ -1322,7 +1322,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" ); @@ -1343,7 +1343,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" ); @@ -1378,16 +1378,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 ) @@ -1397,11 +1397,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 ) @@ -1411,20 +1411,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 ) @@ -1434,22 +1434,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 ); } @@ -1506,7 +1506,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 2aaaadd5a151..f326025fd0ac 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -39,7 +39,7 @@ PRV_SV_IMPL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) { - for( ULONG i = 0; i < Count(); i++ ) + for( sal_uIntPtr i = 0; i < Count(); i++ ) { const SvStorageInfo & rType = GetObject( i ); if( rType.GetName() == rEleName ) @@ -50,10 +50,10 @@ const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) /************** class SvStorageInfo ************************************** *************************************************************************/ -ULONG ReadClipboardFormat( SvStream & rStm ) +sal_uIntPtr ReadClipboardFormat( SvStream & rStm ) { sal_uInt32 nFormat = 0; - INT32 nLen = 0; + sal_Int32 nLen = 0; rStm >> nLen; if( rStm.IsEof() ) rStm.SetError( SVSTREAM_GENERALERROR ); @@ -61,7 +61,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_uIntPtr) nLen ) { nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( p, short(nLen-1) ) ); } @@ -88,7 +88,7 @@ ULONG ReadClipboardFormat( SvStream & rStm ) return nFormat; } -void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ) +void WriteClipboardFormat( SvStream & rStm, sal_uIntPtr nFormat ) { // determine the clipboard format string String aCbFmt; @@ -97,15 +97,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 ea3b656272db..ede41ec3aec9 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -443,10 +443,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_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 SetSize( sal_uIntPtr nSize ); virtual void FlushData(); virtual void ResetError(); @@ -466,35 +466,35 @@ 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_uIntPtr GetSize(); - ULONG ReadSourceWriteTemporary( ULONG aLength ); // read aLength from source and copy to temporary, + sal_uIntPtr ReadSourceWriteTemporary( sal_uIntPtr 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_uIntPtr ReadSourceWriteTemporary(); // read source till the end and copy to temporary, // no seeking is produced #if 0 - ULONG CopySourceToTemporary( ULONG aLength ); // same as ReadSourceWriteToTemporary( aLength ) + sal_uIntPtr CopySourceToTemporary( sal_uIntPtr aLength ); // same as ReadSourceWriteToTemporary( aLength ) // but the writing is done at the end of temporary // pointer position is not changed #endif - ULONG CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() + sal_uIntPtr CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() // but the writing is done at the end of temporary // pointer position is not changed Reference GetXInputStream(); // return XInputStream, after that @@ -527,34 +527,34 @@ public: //SvStream* m_pStream; // the corresponding editable stream, only for storage 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_uIntPtr 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(); @@ -589,32 +589,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_uIntPtr 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_uIntPtr 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(); } }; @@ -664,9 +664,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() ) @@ -678,7 +678,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 ) @@ -687,10 +687,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 ); @@ -775,7 +775,7 @@ Reference 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() ) @@ -812,13 +812,13 @@ Reference UCBStorageStream_Impl::GetXInputStream() return aResult; } -BOOL UCBStorageStream_Impl::Init() +sal_Bool UCBStorageStream_Impl::Init() { if( m_nRepresentMode == xinputstream ) { DBG_ERROR( "XInputStream misuse!" ); SetError( ERRCODE_IO_ACCESSDENIED ); - return FALSE; + return sal_False; } if( !m_pStream ) @@ -840,7 +840,7 @@ BOOL UCBStorageStream_Impl::Init() { DBG_ERROR( "Suspicious temporary stream creation!" ); SetError( SVSTREAM_CANNOT_MAKE ); - return FALSE; + return sal_False; } SetError( m_pStream->GetError() ); @@ -871,12 +871,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; DBG_ERROR( "Can not operate original stream!" ); SetError( SVSTREAM_CANNOT_MAKE ); } @@ -886,7 +886,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 ); } } @@ -896,12 +896,12 @@ BOOL UCBStorageStream_Impl::Init() return sal_True; } -ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() +sal_uIntPtr 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_uIntPtr aResult = 0; if( m_bSourceRead ) { @@ -909,7 +909,7 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() try { - ULONG aReaded; + sal_uIntPtr aReaded; do { aReaded = m_rSource->readBytes( aData, 32000 ); @@ -919,7 +919,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 & ) { @@ -927,18 +927,18 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() } } - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; return aResult; } -ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) +sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uIntPtr aLength ) { // read aLength bite from the source stream and copy them to the current // position of the temporary stream - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( m_bSourceRead ) { @@ -947,22 +947,22 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) try { - ULONG aReaded = 32000; + sal_uIntPtr aReaded = 32000; - for( ULONG pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) + for( sal_uIntPtr pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) { - ULONG aToCopy = min( aLength - pInd, 32000 ); + sal_uIntPtr 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 & ) { @@ -973,14 +973,14 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) return aResult; } -ULONG UCBStorageStream_Impl::CopySourceToTemporary() +sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary() { // current position of the temporary stream is not changed - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( m_bSourceRead ) { - ULONG aPos = m_pStream->Tell(); + sal_uIntPtr aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary(); m_pStream->Seek( aPos ); @@ -991,14 +991,14 @@ ULONG UCBStorageStream_Impl::CopySourceToTemporary() } #if 0 -ULONG UCBStorageStream_Impl::CopySourceToTemporary( ULONG aLength ) +sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary( sal_uIntPtr aLength ) { // current position of the temporary stream is not changed - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( m_bSourceRead ) { - ULONG aPos = m_pStream->Tell(); + sal_uIntPtr aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary( aLength ); m_pStream->Seek( aPos ); @@ -1011,9 +1011,9 @@ ULONG UCBStorageStream_Impl::CopySourceToTemporary( ULONG aLength ) // 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_uIntPtr UCBStorageStream_Impl::GetData( void* pData, sal_uIntPtr nSize ) { - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( !Init() ) return 0; @@ -1026,20 +1026,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_uIntPtr aToRead = nSize - aResult; pData = (void*)( (char*)pData + aResult ); try { Sequence aData( aToRead ); - ULONG aReaded = m_rSource->readBytes( aData, aToRead ); + sal_uIntPtr 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 & ) { @@ -1047,13 +1047,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_uIntPtr UCBStorageStream_Impl::PutData( const void* pData, sal_uIntPtr nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1064,7 +1064,7 @@ ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize ) if( !nSize || !Init() ) return 0; - ULONG aResult = m_pStream->Write( pData, nSize ); + sal_uIntPtr aResult = m_pStream->Write( pData, nSize ); m_bModified = aResult > 0; @@ -1072,12 +1072,12 @@ ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize ) } -ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) +sal_uIntPtr UCBStorageStream_Impl::SeekPos( sal_uIntPtr nPos ) { if( !Init() ) return 0; - ULONG aResult; + sal_uIntPtr aResult; if( nPos == STREAM_SEEK_TO_END ) { @@ -1108,7 +1108,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" ); } @@ -1129,7 +1129,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) return aResult; } -void UCBStorageStream_Impl::SetSize( ULONG nSize ) +void UCBStorageStream_Impl::SetSize( sal_uIntPtr nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1140,11 +1140,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_uIntPtr aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); if( m_pStream->Tell() < nSize ) ReadSourceWriteTemporary( nSize - m_pStream->Tell() ); @@ -1152,7 +1152,7 @@ void UCBStorageStream_Impl::SetSize( ULONG nSize ) } m_pStream->SetStreamSize( nSize ); - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } void UCBStorageStream_Impl::FlushData() @@ -1163,7 +1163,7 @@ void UCBStorageStream_Impl::FlushData() m_pStream->Flush(); } - m_bCommited = TRUE; + m_bCommited = sal_True; } void UCBStorageStream_Impl::SetError( sal_uInt32 nErr ) @@ -1184,15 +1184,15 @@ void UCBStorageStream_Impl::ResetError() m_pAntiImpl->ResetError(); } -ULONG UCBStorageStream_Impl::GetSize() +sal_uIntPtr UCBStorageStream_Impl::GetSize() { if( !Init() ) return 0; - ULONG nPos = m_pStream->Tell(); + sal_uIntPtr nPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); ReadSourceWriteTemporary(); - ULONG nRet = m_pStream->Tell(); + sal_uIntPtr nRet = m_pStream->Tell(); m_pStream->Seek( nPos ); return nRet; @@ -1252,8 +1252,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& ) { @@ -1274,7 +1274,7 @@ sal_Int16 UCBStorageStream_Impl::Commit() return COMMIT_RESULT_FAILURE; } - m_bCommited = FALSE; + m_bCommited = sal_False; return COMMIT_RESULT_SUCCESS; } } @@ -1282,13 +1282,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 ) { DBG_ERROR("Revert while commit is in progress!" ); - return FALSE; // ??? + return sal_False; // ??? } Free(); @@ -1298,7 +1298,7 @@ BOOL UCBStorageStream_Impl::Revert() m_aTempURL.Erase(); } - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; try { m_rSource = m_pContent->openStream(); @@ -1306,11 +1306,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 @@ -1328,15 +1328,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 ) { @@ -1387,7 +1387,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 ! @@ -1396,7 +1396,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 ! @@ -1423,13 +1423,13 @@ UCBStorageStream::~UCBStorageStream() pImp->ReleaseRef(); } -ULONG UCBStorageStream::Read( void * pData, ULONG nSize ) +sal_uIntPtr UCBStorageStream::Read( void * pData, sal_uIntPtr nSize ) { //return pImp->m_pStream->Read( pData, nSize ); return pImp->GetData( pData, nSize ); } -ULONG UCBStorageStream::Write( const void* pData, ULONG nSize ) +sal_uIntPtr UCBStorageStream::Write( const void* pData, sal_uIntPtr nSize ) { /* // mba: does occur in writer ! @@ -1439,18 +1439,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_uIntPtr UCBStorageStream::Seek( sal_uIntPtr nPos ) { //return pImp->m_pStream->Seek( nPos ); return pImp->Seek( nPos ); } -ULONG UCBStorageStream::Tell() +sal_uIntPtr UCBStorageStream::Tell() { if( !pImp->Init() ) return 0; @@ -1463,32 +1463,32 @@ void UCBStorageStream::Flush() Commit(); } -BOOL UCBStorageStream::SetSize( ULONG nNewSize ) +sal_Bool UCBStorageStream::SetSize( sal_uIntPtr nNewSize ) { /* if ( pImp->m_bCommited ) { DBG_ERROR("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 @@ -1496,7 +1496,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 { @@ -1505,10 +1505,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 @@ -1530,28 +1530,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 ) @@ -1559,18 +1559,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 ) @@ -1583,13 +1583,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 ) { @@ -1603,34 +1603,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() ) @@ -1640,7 +1640,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 { @@ -1654,7 +1654,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 ! @@ -1664,7 +1664,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 ! @@ -1674,7 +1674,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 ! @@ -1703,7 +1703,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 ) @@ -1711,13 +1711,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 ) @@ -1731,14 +1731,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 ) @@ -1746,13 +1746,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 ) @@ -1765,7 +1765,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(); } @@ -1788,31 +1788,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 @@ -1973,7 +1973,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); @@ -2011,9 +2011,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_uIntPtr) nSize ); m_aChildrenList.Insert( pElement, LIST_APPEND ); sal_Bool bIsOfficeDocument = m_bIsLinked || ( m_aClassId != SvGlobalName() ); @@ -2044,13 +2044,13 @@ void UCBStorage_Impl::ReadContent() ::rtl::OUString aMediaType; Any aAny = aContent.getPropertyValue( ::rtl::OUString::createFromAscii( "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(); } @@ -2118,7 +2118,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& rMyProps = rSequence[nSeqs]; @@ -2131,7 +2131,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount() { rtl::OUString aTmp; if ( ( rAny.Value >>= aTmp ) && aTmp == rPath ) - bFound = TRUE; + bFound = sal_True; if ( aType.getLength() ) break; } @@ -2269,11 +2269,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 { @@ -2310,7 +2310,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; } } } @@ -2349,11 +2349,11 @@ sal_Int16 UCBStorage_Impl::Commit() while ( pElement && nRet ) { ::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; @@ -2401,7 +2401,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 ); } @@ -2483,7 +2483,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 @@ -2584,7 +2584,7 @@ sal_Int16 UCBStorage_Impl::Commit() // after successfull root commit all elements names and types are adjusted and all removed elements // are also removed from the lists UCBStorageElement_Impl* pInnerElement = m_aChildrenList.First(); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; while ( pInnerElement && bRet ) { UCBStorageElement_Impl* pNext = m_aChildrenList.Next(); @@ -2596,26 +2596,26 @@ sal_Int16 UCBStorage_Impl::Commit() else { pInnerElement->m_aOriginalName = pInnerElement->m_aName; - pInnerElement->m_bIsInserted = FALSE; + pInnerElement->m_bIsInserted = sal_False; } pInnerElement = pNext; } } - m_bCommited = FALSE; + m_bCommited = sal_False; } return nRet; } -BOOL UCBStorage_Impl::Revert() +sal_Bool UCBStorage_Impl::Revert() { UCBStorageElement_Impl* pElement = m_aChildrenList.First(); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; while ( pElement && bRet ) { - pElement->m_bIsRemoved = FALSE; + pElement->m_bIsRemoved = sal_False; if ( pElement->m_bIsInserted ) { m_aChildrenList.Remove( pElement ); // correct usage of list ??? @@ -2634,7 +2634,7 @@ BOOL UCBStorage_Impl::Revert() } pElement->m_aName = pElement->m_aOriginalName; - pElement->m_bIsRemoved = FALSE; + pElement->m_bIsRemoved = sal_False; } pElement = m_aChildrenList.Next(); @@ -2648,17 +2648,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_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) { pImp->m_aClassId = rClass; pImp->m_nFormat = nOriginalClipFormat; @@ -2697,15 +2697,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_uIntPtr /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) { // ??? } -BOOL UCBStorage::ShouldConvert() +sal_Bool UCBStorage::ShouldConvert() { // ??? - return FALSE; + return sal_False; } SvGlobalName UCBStorage::GetClassName() @@ -2713,7 +2713,7 @@ SvGlobalName UCBStorage::GetClassName() return pImp->m_aClassId; } -ULONG UCBStorage::GetFormat() +sal_uIntPtr UCBStorage::GetFormat() { return pImp->m_nFormat; } @@ -2733,7 +2733,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_uIntPtr nSize = pElement->m_nSize; if ( pElement->m_xStream.Is() ) nSize = pElement->m_xStream->GetSize(); SvStorageInfo aInfo( pElement->m_aName, nSize, pElement->m_bIsStorage ); @@ -2744,7 +2744,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 ! @@ -2755,7 +2755,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() ) @@ -2763,7 +2763,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 ); @@ -2784,19 +2784,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 ); @@ -2821,7 +2821,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 @@ -2838,11 +2838,11 @@ UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const String& rName ) cons return pElement; } -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 ?! @@ -2856,7 +2856,7 @@ BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const pDestStg->SetClassId( GetClassId() ); pDestStg->SetDirty(); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; UCBStorageElement_Impl* pElement = pImp->GetChildrenList().First(); while ( pElement && bRet ) { @@ -2867,18 +2867,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 { @@ -2889,28 +2889,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; @@ -2935,7 +2935,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.Insert( pElement, LIST_APPEND ); } } @@ -2980,7 +2980,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 += '/'; @@ -2989,31 +2989,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 ); @@ -3026,8 +3026,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; @@ -3037,7 +3037,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.Insert( pElement, LIST_APPEND ); } @@ -3064,7 +3064,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() ) @@ -3077,13 +3077,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; } @@ -3097,7 +3097,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 @@ -3107,7 +3107,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 ); @@ -3128,31 +3128,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; @@ -3165,41 +3165,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 ); @@ -3207,16 +3207,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 ); @@ -3230,10 +3230,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 ) ) { @@ -3257,31 +3257,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 @@ -3289,7 +3289,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 { @@ -3298,10 +3298,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 @@ -3311,13 +3311,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 ); @@ -3329,27 +3329,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_uIntPtr 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 @@ -3365,22 +3365,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_uIntPtr 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; @@ -3394,13 +3394,13 @@ BOOL UCBStorage::IsDiskSpannedFile( SvStream* pFile ) String UCBStorage::GetLinkedFile( SvStream &rStream ) { String aString; - ULONG nPos = rStream.Tell(); + sal_uIntPtr 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 ) { @@ -3430,7 +3430,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 ); @@ -3441,7 +3441,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 ); @@ -3487,15 +3487,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 ) { @@ -3509,38 +3509,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 ) { @@ -3549,7 +3549,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 @@ -3557,7 +3557,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& ) @@ -3571,7 +3571,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 @@ -3579,7 +3579,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& ) @@ -3587,7 +3587,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 55c205557648..aa84ed0cf87c 100644 --- a/sot/source/sdstor/unostorageholder.cxx +++ b/sot/source/sdstor/unostorageholder.cxx @@ -133,7 +133,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/svl/inc/broadcast.hxx b/svl/inc/broadcast.hxx index 2acddb5e4f6b..758906877bc1 100644 --- a/svl/inc/broadcast.hxx +++ b/svl/inc/broadcast.hxx @@ -59,7 +59,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/cntnrsrt.hxx b/svl/inc/cntnrsrt.hxx index 48ebef50ea58..f7c114274981 100644 --- a/svl/inc/cntnrsrt.hxx +++ b/svl/inc/cntnrsrt.hxx @@ -63,17 +63,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_uIntPtr nPos ) \ { return (Type *)Container::Remove( nPos ); } \ \ Type *Remove( Type* pObj ); \ \ - void DeleteAndDestroy( ULONG nPos ) \ + void DeleteAndDestroy( sal_uIntPtr nPos ) \ { \ Type *pObj = Remove( nPos ); \ if( pObj ) \ @@ -83,15 +83,15 @@ public: \ void DeleteAndDestroy() \ { while( Count() ) DeleteAndDestroy( 0 ); } \ \ - Type* GetObject( ULONG nPos ) const \ + Type* GetObject( sal_uIntPtr nPos ) const \ { return (Type *)Container::GetObject( nPos ); } \ \ - Type* operator[]( ULONG nPos ) const \ + Type* operator[]( sal_uIntPtr nPos ) const \ { return GetObject(nPos); } \ \ - BOOL Seek_Entry( const Type *pObj, ULONG* pPos ) const; \ + sal_Bool Seek_Entry( const Type *pObj, sal_uIntPtr* pPos ) const; \ \ - ULONG GetPos( const Type* pObj ) const; \ + sal_uIntPtr GetPos( const Type* pObj ) const; \ #define DECLARE_CONTAINER_SORT( ClassName, Type ) \ @@ -111,10 +111,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_uIntPtr nPos; \ + sal_Bool bExist = Seek_Entry( pObj, &nPos ); \ if( !bExist ) \ Container::Insert( pObj, nPos ); \ return !bExist; \ @@ -122,25 +122,25 @@ BOOL ClassName::Insert( Type *pObj ) \ \ Type *ClassName::Remove( Type* pObj ) \ { \ - ULONG nPos; \ + sal_uIntPtr nPos; \ if( Seek_Entry( pObj, &nPos ) ) \ return Remove( nPos ); \ else \ return 0; \ } \ \ -ULONG ClassName::GetPos( const Type* pObj ) const \ +sal_uIntPtr ClassName::GetPos( const Type* pObj ) const \ { \ - ULONG nPos; \ + sal_uIntPtr 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_uIntPtr* pPos ) const \ { \ - register ULONG nO = Count(), \ + register sal_uIntPtr nO = Count(), \ nM, \ nU = 0; \ if( nO > 0 ) \ @@ -154,21 +154,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/converter.hxx b/svl/inc/converter.hxx index 062feafe6f29..c208a370bceb 100644 --- a/svl/inc/converter.hxx +++ b/svl/inc/converter.hxx @@ -33,8 +33,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/instrm.hxx b/svl/inc/instrm.hxx index d7585c13c3b7..f27375baff25 100644 --- a/svl/inc/instrm.hxx +++ b/svl/inc/instrm.hxx @@ -47,19 +47,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_uIntPtr m_nSeekedFrom; SVL_DLLPRIVATE bool open(); - SVL_DLLPRIVATE virtual ULONG GetData(void * pData, ULONG nSize); + SVL_DLLPRIVATE virtual sal_uIntPtr GetData(void * pData, sal_uIntPtr nSize); - SVL_DLLPRIVATE virtual ULONG PutData(void const *, ULONG); + SVL_DLLPRIVATE virtual sal_uIntPtr PutData(void const *, sal_uIntPtr); - SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG nPos); + SVL_DLLPRIVATE virtual sal_uIntPtr SeekPos(sal_uIntPtr nPos); SVL_DLLPRIVATE virtual void FlushData(); - SVL_DLLPRIVATE virtual void SetSize(ULONG); + SVL_DLLPRIVATE virtual void SetSize(sal_uIntPtr); public: SvInputStream( @@ -69,11 +69,11 @@ public: virtual ~SvInputStream(); - virtual USHORT IsA() const; + virtual sal_uInt16 IsA() const; - virtual void AddMark(ULONG nPos); + virtual void AddMark(sal_uIntPtr nPos); - virtual void RemoveMark(ULONG nPos); + virtual void RemoveMark(sal_uIntPtr nPos); }; #endif // SVTOOLS_INSTRM_HXX diff --git a/svl/inc/listener.hxx b/svl/inc/listener.hxx index 3107f5ceee56..e3bdea45169e 100644 --- a/svl/inc/listener.hxx +++ b/svl/inc/listener.hxx @@ -50,12 +50,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/lngmisc.hxx b/svl/inc/lngmisc.hxx index d85de673c4c9..cf8a498dc206 100644 --- a/svl/inc/lngmisc.hxx +++ b/svl/inc/lngmisc.hxx @@ -44,29 +44,29 @@ 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 = ' ' ); } // namespace linguistic diff --git a/svl/inc/outstrm.hxx b/svl/inc/outstrm.hxx index f80f6f2c9616..8846bd84e5df 100644 --- a/svl/inc/outstrm.hxx +++ b/svl/inc/outstrm.hxx @@ -42,15 +42,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_uIntPtr GetData(void *, sal_uIntPtr); - SVL_DLLPRIVATE virtual ULONG PutData(void const * pData, ULONG nSize); + SVL_DLLPRIVATE virtual sal_uIntPtr PutData(void const * pData, sal_uIntPtr nSize); - SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG); + SVL_DLLPRIVATE virtual sal_uIntPtr SeekPos(sal_uIntPtr); SVL_DLLPRIVATE virtual void FlushData(); - SVL_DLLPRIVATE virtual void SetSize(ULONG); + SVL_DLLPRIVATE virtual void SetSize(sal_uIntPtr); public: SvOutputStream(com::sun::star::uno::Reference< @@ -59,7 +59,7 @@ public: virtual ~SvOutputStream(); - virtual USHORT IsA() const; + virtual sal_uInt16 IsA() const; }; #endif // SVTOOLS_OUTSTRM_HXX diff --git a/svl/inc/poolcach.hxx b/svl/inc/poolcach.hxx index 949c0aee5bad..1d534955ed92 100644 --- a/svl/inc/poolcach.hxx +++ b/svl/inc/poolcach.hxx @@ -50,7 +50,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/strmadpt.hxx b/svl/inc/strmadpt.hxx index 76ecf0223543..0d2779504daf 100644 --- a/svl/inc/strmadpt.hxx +++ b/svl/inc/strmadpt.hxx @@ -51,23 +51,23 @@ public: rTheOutputStream): m_xOutputStream(rTheOutputStream), m_nPosition(0) {} - virtual ErrCode ReadAt(ULONG, void *, ULONG, ULONG *) const; + virtual ErrCode ReadAt(sal_uIntPtr, void *, sal_uIntPtr, sal_uIntPtr *) const; - virtual ErrCode WriteAt(ULONG nPos, const void * pBuffer, ULONG nCount, - ULONG * pWritten); + virtual ErrCode WriteAt(sal_uIntPtr nPos, const void * pBuffer, sal_uIntPtr nCount, + sal_uIntPtr * pWritten); virtual ErrCode Flush() const; - virtual ErrCode SetSize(ULONG); + virtual ErrCode SetSize(sal_uIntPtr); virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const; - virtual ErrCode FillAppend(const void * pBuffer, ULONG nCount, - ULONG * pWritten); + virtual ErrCode FillAppend(const void * pBuffer, sal_uIntPtr nCount, + sal_uIntPtr * pWritten); - virtual ULONG Tell() const; + virtual sal_uIntPtr Tell() const; - virtual ULONG Seek(ULONG); + virtual sal_uIntPtr Seek(sal_uIntPtr); virtual void Terminate(); }; diff --git a/svl/inc/svl/aeitem.hxx b/svl/inc/svl/aeitem.hxx index 34029c7563f4..b9ff02a69e78 100644 --- a/svl/inc/svl/aeitem.hxx +++ b/svl/inc/svl/aeitem.hxx @@ -40,32 +40,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 b55d78f99540..87eeab351b3c 100644 --- a/svl/inc/svl/brdcst.hxx +++ b/svl/inc/svl/brdcst.hxx @@ -47,7 +47,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 @@ -66,9 +66,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/svl/cancel.hxx b/svl/inc/svl/cancel.hxx index d268044a611d..192db6102ee8 100644 --- a/svl/inc/svl/cancel.hxx +++ b/svl/inc/svl/cancel.hxx @@ -77,15 +77,15 @@ public: SfxCancelManager( SfxCancelManager *pParent = 0 ); ~SfxCancelManager(); - BOOL CanCancel() const; - void Cancel( BOOL bDeep ); + sal_Bool CanCancel() const; + void Cancel( sal_Bool bDeep ); SfxCancelManager* GetParent() const { return _pParent; } void InsertCancellable( SfxCancellable *pJob ); void RemoveCancellable( SfxCancellable *pJob ); - USHORT GetCancellableCount() const + sal_uInt16 GetCancellableCount() const { return _aJobs.Count(); } - SfxCancellable* GetCancellable( USHORT nPos ) const + SfxCancellable* GetCancellable( sal_uInt16 nPos ) const { return (SfxCancellable*) _aJobs[nPos]; } }; @@ -116,14 +116,14 @@ class SVL_DLLPUBLIC SfxCancellable { SfxCancelManager* _pMgr; - BOOL _bCancelled; + sal_Bool _bCancelled; String _aTitle; public: SfxCancellable( SfxCancelManager *pMgr, const String &rTitle ) : _pMgr( pMgr ), - _bCancelled( FALSE ), + _bCancelled( sal_False ), _aTitle( rTitle ) { pMgr->InsertCancellable( this ); } @@ -133,8 +133,8 @@ public: SfxCancelManager* GetManager() const { return _pMgr; } virtual void Cancel(); - BOOL IsCancelled() const { return _bCancelled; } - operator BOOL() const { return _bCancelled; } + sal_Bool IsCancelled() const { return _bCancelled; } + operator sal_Bool() const { return _bCancelled; } const String& GetTitle() const { return _aTitle; } }; diff --git a/svl/inc/svl/cenumitm.hxx b/svl/inc/svl/cenumitm.hxx index 42c9d60373db..0d0cf3d7c053 100644 --- a/svl/inc/svl/cenumitm.hxx +++ b/svl/inc/svl/cenumitm.hxx @@ -38,7 +38,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) {} @@ -54,15 +54,15 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any & rVal, BYTE = 0) const; + virtual sal_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 sal_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. /// @@ -74,19 +74,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); }; //============================================================================ @@ -94,13 +94,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) {} @@ -108,18 +108,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; @@ -130,15 +130,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) {} @@ -154,23 +154,23 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, BYTE = 0) const; + virtual sal_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 sal_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 929521d57cb1..68a532cee613 100644 --- a/svl/inc/svl/cintitem.hxx +++ b/svl/inc/svl/cintitem.hxx @@ -37,15 +37,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) @@ -64,30 +64,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + 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; @@ -98,16 +98,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) @@ -126,30 +126,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + 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; @@ -160,16 +160,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) @@ -188,30 +188,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + 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; @@ -222,16 +222,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) @@ -250,30 +250,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + 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/svl/cnclhint.hxx b/svl/inc/svl/cnclhint.hxx index 17a6627f31b6..864e9f367aa2 100644 --- a/svl/inc/svl/cnclhint.hxx +++ b/svl/inc/svl/cnclhint.hxx @@ -37,11 +37,11 @@ class SfxCancelHint: public SfxHint { private: SfxCancellable* pCancellable; - USHORT nAction; + sal_uInt16 nAction; public: TYPEINFO(); - SfxCancelHint( SfxCancellable*, USHORT nAction ); - USHORT GetAction() const { return nAction; } + SfxCancelHint( SfxCancellable*, sal_uInt16 nAction ); + sal_uInt16 GetAction() const { return nAction; } const SfxCancellable& GetCancellable() const { return *pCancellable; } }; diff --git a/svl/inc/svl/cntwall.hxx b/svl/inc/svl/cntwall.hxx index a7f3dd0111a6..070795e6faf3 100644 --- a/svl/inc/svl/cntwall.hxx +++ b/svl/inc/svl/cntwall.hxx @@ -43,35 +43,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; - virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); 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/svl/ctypeitm.hxx b/svl/inc/svl/ctypeitm.hxx index e83d37b8925e..bb3efc756187 100644 --- a/svl/inc/svl/ctypeitm.hxx +++ b/svl/inc/svl/ctypeitm.hxx @@ -42,17 +42,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; @@ -68,10 +68,10 @@ public: XubString &rText, const IntlWrapper* pIntlWrapper = 0 ) 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 sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0); INetContentType GetEnumValue() const; diff --git a/svl/inc/svl/custritm.hxx b/svl/inc/svl/custritm.hxx index a24135e392c2..f0e01a6a7c32 100644 --- a/svl/inc/svl/custritm.hxx +++ b/svl/inc/svl/custritm.hxx @@ -42,10 +42,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); } @@ -68,11 +68,11 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + 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 3ae5506d809a..bf2c7a3c6e54 100644 --- a/svl/inc/svl/dateitem.hxx +++ b/svl/inc/svl/dateitem.hxx @@ -46,8 +46,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 ); @@ -57,8 +57,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, @@ -74,10 +74,10 @@ public: "SetDateTime() with pooled item" ); aDateTime = rDT; } - 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 sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; }; class SfxColumnDateTimeItem : public SfxDateTimeItem @@ -85,8 +85,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 bc65db9c31dc..f6dbb9951d84 100644 --- a/svl/inc/svl/eitem.hxx +++ b/svl/inc/svl/eitem.hxx @@ -35,10 +35,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: @@ -52,13 +52,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/svl/filerec.hxx b/svl/inc/svl/filerec.hxx index d0cc27b94b96..2742d2ce537f 100644 --- a/svl/inc/svl/filerec.hxx +++ b/svl/inc/svl/filerec.hxx @@ -35,24 +35,24 @@ #include #include -SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) +SV_DECL_VARARR( SfxUINT32s, sal_uInt32, 8, 8 ) //------------------------------------------------------------------------ -#define SFX_BOOL_DONTCARE BOOL(2) // Don't-Care-Wert f"ur BOOLs +#define SFX_BOOL_DONTCARE sal_Bool(2) // Don't-Care-Wert f"ur BOOLs -#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_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 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_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 @@ -124,9 +124,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 @@ -134,13 +134,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) @@ -160,7 +160,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 @@ -191,7 +191,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. @@ -206,9 +206,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] @@ -222,18 +222,18 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter { protected: SvStream* _pStream; // , in dem der Record liegt - UINT32 _nStartPos; // Start-Position des Gesamt-Records im Stream - FASTBOOL _bHeaderOk; /* TRUE, wenn der Header schon geschrieben ist; + sal_uInt32 _nStartPos; // Start-Position des Gesamt-Records im Stream + int _bHeaderOk; /* sal_True, wenn der Header schon geschrieben ist; bei DBG_UTIL wird SFX_BOOL_DONTCARE ver- wendet, um die Gr"o\se von Fix-Sized-Records zu pr"ufen. */ - 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(); @@ -241,7 +241,7 @@ public: inline void Reset(); - UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); + sal_uInt32 Close( int bSeekToEndOfRec = sal_True ); private: // not implementend, not allowed @@ -280,36 +280,36 @@ class SVL_DLLPUBLIC SfxMiniRecordReader { protected: SvStream* _pStream; // , aus dem gelesen wird - UINT32 _nEofRec; // Position direkt hinter dem Record - FASTBOOL _bSkipped; // TRUE: der Record wurde explizit geskippt - BYTE _nPreTag; // aus dem Header gelesenes Pre-Tag + sal_uInt32 _nEofRec; // Position direkt hinter dem Record + int _bSkipped; // sal_True: der Record wurde explizit geskippt + 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 FASTBOOL SetHeader_Impl( UINT32 nHeader ); + inline int 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 FASTBOOL IsValid() const; + inline sal_uInt8 GetTag() const; + inline int IsValid() const; inline SvStream& operator*() const; @@ -328,8 +328,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. @@ -343,12 +343,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] @@ -361,20 +361,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( FASTBOOL bSeekToEndOfRec = TRUE ); + sal_uInt32 Close( int bSeekToEndOfRec = sal_True ); }; //------------------------------------------------------------------------ @@ -409,9 +409,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() {} @@ -420,17 +420,17 @@ protected: SfxMiniRecordReader::Construct_Impl( pStream, SFX_REC_PRETAG_EXT ); } - FASTBOOL FindHeader_Impl( UINT16 nTypes, UINT16 nTag ); - FASTBOOL ReadHeader_Impl( USHORT nTypes ); + int FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag ); + int 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 FASTBOOL HasVersion( USHORT nVersion ) const; + inline sal_uInt8 GetVersion() const; + inline int HasVersion( sal_uInt16 nVersion ) const; }; //------------------------------------------------------------------------ @@ -458,22 +458,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]; @@ -484,28 +484,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( FASTBOOL bSeekToEndOfRec = TRUE ); + sal_uInt32 Close( int bSeekToEndOfRec = sal_True ); }; //------------------------------------------------------------------------ @@ -531,23 +531,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]; @@ -559,24 +559,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( FASTBOOL bSeekToEndOfRec = TRUE ); + virtual sal_uInt32 Close( int bSeekToEndOfRec = sal_True ); }; //------------------------------------------------------------------------ @@ -601,27 +601,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() @@ -646,7 +646,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() ) { @@ -665,30 +665,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 - FASTBOOL ReadHeader_Impl(); + int ReadHeader_Impl(); public: SfxMultiRecordReader( SvStream *pStream ); - SfxMultiRecordReader( SvStream *pStream, UINT16 nTag ); + SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag ); ~SfxMultiRecordReader(); - FASTBOOL GetContent(); - inline UINT16 GetContentTag(); - inline BYTE GetContentVersion() const; - inline FASTBOOL HasContentVersion( USHORT nVersion ) const; + int GetContent(); + inline sal_uInt16 GetContentTag(); + inline sal_uInt8 GetContentVersion() const; + inline int HasContentVersion( sal_uInt16 nVersion ) const; - inline UINT32 ContentCount() const; + inline sal_uInt32 ContentCount() const; }; //========================================================================= @@ -696,7 +696,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] @@ -708,7 +708,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter : _pStream( pStream ), _nStartPos( pStream->Tell() ), - _bHeaderOk(FALSE), + _bHeaderOk(sal_False), _nPreTag( nTag ) { DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" ); @@ -722,8 +722,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] @@ -757,7 +757,7 @@ inline SfxMiniRecordWriter::~SfxMiniRecordWriter() { // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden - if ( !_bHeaderOk DBG(||TRUE) ) + if ( !_bHeaderOk DBG(||sal_True) ) Close(); } @@ -781,7 +781,7 @@ inline SvStream& SfxMiniRecordWriter::operator*() const inline void SfxMiniRecordWriter::Reset() { _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI ); - _bHeaderOk = FALSE; + _bHeaderOk = sal_False; } //========================================================================= @@ -813,12 +813,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] @@ -835,7 +835,7 @@ inline BYTE SfxMiniRecordReader::GetTag() const //------------------------------------------------------------------------- -inline FASTBOOL SfxMiniRecordReader::IsValid() const +inline int SfxMiniRecordReader::IsValid() const /* [Beschreibung] @@ -865,18 +865,18 @@ inline SvStream& SfxMiniRecordReader::operator*() const //========================================================================= -inline UINT32 SfxSingleRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) +inline sal_uInt32 SfxSingleRecordWriter::Close( int bSeekToEndOfRec ) -// siehe +// siehe { - 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 ) @@ -900,12 +900,12 @@ inline void SfxSingleRecordWriter::Reset() { _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI + SFX_REC_HEADERSIZE_SINGLE ); - _bHeaderOk = FALSE; + _bHeaderOk = sal_False; } //========================================================================= -inline UINT16 SfxSingleRecordReader::GetTag() const +inline sal_uInt16 SfxSingleRecordReader::GetTag() const /* [Beschreibung] @@ -918,7 +918,7 @@ inline UINT16 SfxSingleRecordReader::GetTag() const //------------------------------------------------------------------------- -inline BYTE SfxSingleRecordReader::GetVersion() const +inline sal_uInt8 SfxSingleRecordReader::GetVersion() const /* [Beschreibung] @@ -931,7 +931,7 @@ inline BYTE SfxSingleRecordReader::GetVersion() const //------------------------------------------------------------------------- -inline FASTBOOL SfxSingleRecordReader::HasVersion( USHORT nVersion ) const +inline int SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const /* [Beschreibung] @@ -973,7 +973,7 @@ inline void SfxMultiFixRecordWriter::NewContent() { #ifdef DBG_UTIL - ULONG nOldStartPos; + sal_uIntPtr nOldStartPos; // Startposition des aktuellen Contents merken - Achtung Subklassen! nOldStartPos = _nContentStartPos; #endif @@ -998,8 +998,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] @@ -1021,12 +1021,12 @@ inline void SfxMultiFixRecordWriter::Reset() _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI + SFX_REC_HEADERSIZE_SINGLE + SFX_REC_HEADERSIZE_MULTI ); - _bHeaderOk = FALSE; + _bHeaderOk = sal_False; } //========================================================================= -inline UINT16 SfxMultiRecordReader::GetContentTag() +inline sal_uInt16 SfxMultiRecordReader::GetContentTag() /* [Beschreibung] @@ -1040,7 +1040,7 @@ inline UINT16 SfxMultiRecordReader::GetContentTag() //------------------------------------------------------------------------- -inline BYTE SfxMultiRecordReader::GetContentVersion() const +inline sal_uInt8 SfxMultiRecordReader::GetContentVersion() const /* [Beschreibung] @@ -1054,7 +1054,7 @@ inline BYTE SfxMultiRecordReader::GetContentVersion() const //------------------------------------------------------------------------- -inline FASTBOOL SfxMultiRecordReader::HasContentVersion( USHORT nVersion ) const +inline int SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const /* [Beschreibung] @@ -1069,7 +1069,7 @@ inline FASTBOOL 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 f7fd52d2e714..ce9d3cb635e7 100644 --- a/svl/inc/svl/flagitem.hxx +++ b/svl/inc/svl/flagitem.hxx @@ -34,7 +34,7 @@ class SvStream; -extern USHORT nSfxFlagVal[16]; +extern sal_uInt16 nSfxFlagVal[16]; // ----------------------------------------------------------------------- @@ -42,24 +42,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, @@ -67,14 +67,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/svl/globalnameitem.hxx b/svl/inc/svl/globalnameitem.hxx index 727f06681b45..897bb09fc8ba 100644 --- a/svl/inc/svl/globalnameitem.hxx +++ b/svl/inc/svl/globalnameitem.hxx @@ -42,17 +42,17 @@ 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; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; SvGlobalName GetValue() const { return m_aName; } - 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 sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/svl/hint.hxx b/svl/inc/svl/hint.hxx index f8f64fbd759b..a523ac68224f 100644 --- a/svl/inc/svl/hint.hxx +++ b/svl/inc/svl/hint.hxx @@ -44,26 +44,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 b7b4a3cb0e90..9d2555d77848 100644 --- a/svl/inc/svl/httpcook.hxx +++ b/svl/inc/svl/httpcook.hxx @@ -61,8 +61,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)), @@ -70,14 +70,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 ) && @@ -136,7 +136,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 6ecc317f7299..eddbe9e0efaa 100644 --- a/svl/inc/svl/ilstitem.hxx +++ b/svl/inc/svl/ilstitem.hxx @@ -42,7 +42,7 @@ public: TYPEINFO(); SfxIntegerListItem(); - SfxIntegerListItem( USHORT nWhich, const SvULongs& rList ); + SfxIntegerListItem( sal_uInt16 nWhich, const SvULongs& rList ); SfxIntegerListItem( const SfxIntegerListItem& rItem ); ~SfxIntegerListItem(); @@ -55,8 +55,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 sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual sal_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 63dc4c470a55..4dff6f5faebe 100644 --- a/svl/inc/svl/imageitm.hxx +++ b/svl/inc/svl/imageitm.hxx @@ -39,20 +39,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 sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 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/svl/inethist.hxx b/svl/inc/svl/inethist.hxx index aceac630924f..65e9f026a072 100644 --- a/svl/inc/svl/inethist.hxx +++ b/svl/inc/svl/inethist.hxx @@ -62,7 +62,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. */ @@ -76,7 +76,7 @@ public: /** QueryProtocol. */ - BOOL QueryProtocol (INetProtocol eProto) const + sal_Bool QueryProtocol (INetProtocol eProto) const { return ((eProto == INET_PROT_FILE ) || (eProto == INET_PROT_FTP ) || @@ -86,22 +86,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/svl/intitem.hxx b/svl/inc/svl/intitem.hxx index f0fff8440518..0ee15d1738e5 100644 --- a/svl/inc/svl/intitem.hxx +++ b/svl/inc/svl/intitem.hxx @@ -37,13 +37,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); } @@ -54,16 +54,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) @@ -82,30 +82,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + 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; @@ -117,13 +117,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 @@ -136,13 +136,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 @@ -156,13 +156,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 f80031871caf..db3f8d4cea8d 100644 --- a/svl/inc/svl/itemiter.hxx +++ b/svl/inc/svl/itemiter.hxx @@ -39,7 +39,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 ); @@ -57,12 +57,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 cbc6b7c4dd11..c97aa85497cb 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.hxx @@ -70,8 +70,8 @@ DBG_NAMEEX(SfxItemPool) struct SfxItemInfo { - USHORT _nSID; - USHORT _nFlags; + sal_uInt16 _nSID; + sal_uInt16 _nFlags; }; //==================================================================== @@ -104,24 +104,24 @@ class SVL_DLLPUBLIC SfxItemPool */ { - SVL_DLLPRIVATE void readTheItems(SvStream & rStream, USHORT nCount, USHORT nVersion, + SVL_DLLPRIVATE void readTheItems(SvStream & rStream, sal_uInt16 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; - FASTBOOL bPersistentRefCounts; + sal_uInt16* _pPoolRanges; + int bPersistentRefCounts; private: // ObjectUser section @@ -137,40 +137,40 @@ 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 FASTBOOL IsItemFlag_Impl( USHORT nWhich, USHORT nFlag ) const; + SVL_DLLPRIVATE int 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; } - FASTBOOL IsVer2_Impl() const; + int IsVer2_Impl() const; #endif //--------------------------------------------------------------------- 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_uIntPtr n ); + static inline sal_uIntPtr AddRef( const SfxPoolItem& rItem, sal_uIntPtr n = 1 ); + static inline sal_uIntPtr ReleaseRef( const SfxPoolItem& rItem, sal_uIntPtr 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 - FASTBOOL bLoadRefCounts = TRUE ); + int bLoadRefCounts = sal_True ); protected: virtual ~SfxItemPool(); public: @@ -179,14 +179,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, @@ -197,24 +197,24 @@ 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, - FASTBOOL bDirect = FALSE, + int bDirect = sal_False, const SfxItemPool *pRefPool = 0 ); - FASTBOOL StoreItem( SvStream &rStream, + int StoreItem( SvStream &rStream, const SfxPoolItem &rItem, - FASTBOOL bDirect = FALSE ) const; + int bDirect = sal_False ) const; - USHORT GetSurrogate(const SfxPoolItem *) const; - const SfxPoolItem * GetItem(USHORT nWhich, USHORT nSurrogate) const; - USHORT GetItemCount(USHORT nWhich) const; + sal_uInt16 GetSurrogate(const SfxPoolItem *) const; + const SfxPoolItem * GetItem(sal_uInt16 nWhich, sal_uInt16 nSurrogate) const; + sal_uInt16 GetItemCount(sal_uInt16 nWhich) const; const SfxPoolItem* LoadSurrogate(SvStream& rStream, - USHORT &rWhich, USHORT nSlotId, + sal_uInt16 &rWhich, sal_uInt16 nSlotId, const SfxItemPool* pRefPool = 0 ); - FASTBOOL StoreSurrogate(SvStream& rStream, + int StoreSurrogate(SvStream& rStream, const SfxPoolItem *pItem ) const; virtual SvStream & Load(SvStream &); @@ -223,14 +223,14 @@ public: return bPersistentRefCounts; } void LoadCompleted(); - USHORT GetFirstWhich() const { return nStart; } - USHORT GetLastWhich() const { return nEnd; } - FASTBOOL IsInRange( USHORT nWhich ) const { + sal_uInt16 GetFirstWhich() const { return nStart; } + sal_uInt16 GetLastWhich() const { return nEnd; } + int IsInRange( sal_uInt16 nWhich ) const { return nWhich >= nStart && nWhich <= nEnd; } - FASTBOOL IsInVersionsRange( USHORT nWhich ) const; - FASTBOOL IsInStoringRange( USHORT nWhich ) const; - void SetStoringRange( USHORT nFrom, USHORT nTo ); + int IsInVersionsRange( sal_uInt16 nWhich ) const; + int IsInStoringRange( sal_uInt16 nWhich ) const; + void SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo ); void SetSecondaryPool( SfxItemPool *pPool ); SfxItemPool* GetSecondaryPool() const { return pSecondary; } @@ -242,35 +242,35 @@ public: void Delete(); #ifdef TF_POOLABLE - FASTBOOL IsItemFlag( USHORT nWhich, USHORT nFlag ) const; - FASTBOOL IsItemFlag( const SfxPoolItem &rItem, USHORT nFlag ) const + int IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; + int 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; - FASTBOOL IsCurrentVersionLoading() const; + void SetFileFormatVersion( sal_uInt16 nFileFormatVersion ); + sal_uInt16 GetLoadingVersion() const; + int 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(); @@ -283,19 +283,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_uIntPtr n ) { rItem.SetRefCount(n); } // nur der Pool darf den Referenz-Zaehler manipulieren !!! -inline ULONG SfxItemPool::AddRef( const SfxPoolItem& rItem, ULONG n ) +inline sal_uIntPtr SfxItemPool::AddRef( const SfxPoolItem& rItem, sal_uIntPtr n ) { return rItem.AddRef(n); } // nur der Pool darf den Referenz-Zaehler manipulieren !!! -inline ULONG SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, ULONG n ) +inline sal_uIntPtr SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, sal_uIntPtr n ) { return rItem.ReleaseRef(n); } diff --git a/svl/inc/svl/itemprop.hxx b/svl/inc/svl/itemprop.hxx index 3a993b47ed47..c755f6e93f34 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 ), @@ -116,7 +116,7 @@ class SVL_DLLPUBLIC SfxItemPropertySet SfxItemPropertyMap m_aMap; mutable com::sun::star::uno::Reference 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 30c4cc411fad..7ef299442e5b 100644 --- a/svl/inc/svl/itemset.hxx +++ b/svl/inc/svl/itemset.hxx @@ -50,8 +50,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) @@ -79,8 +79,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 @@ -90,9 +90,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; } @@ -113,64 +113,64 @@ 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 &, FASTBOOL bDirect = FALSE, + virtual SvStream & Load( SvStream &, int bDirect = sal_False, const SfxItemPool *pRefPool = 0 ); - virtual SvStream & Store( SvStream &, FASTBOOL bDirect = FALSE ) const; + virtual SvStream & Store( SvStream &, int bDirect = sal_False ) const; virtual int operator==(const SfxItemSet &) const; }; @@ -194,19 +194,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 2204a57c17d4..6535264eeb78 100644 --- a/svl/inc/svl/lckbitem.hxx +++ b/svl/inc/svl/lckbitem.hxx @@ -42,23 +42,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 ); - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/svl/lstner.hxx b/svl/inc/svl/lstner.hxx index bc95573228f5..963ab3f2b654 100644 --- a/svl/inc/svl/lstner.hxx +++ b/svl/inc/svl/lstner.hxx @@ -57,15 +57,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 48bc55cd1aa0..a82f4d11d58c 100644 --- a/svl/inc/svl/macitem.hxx +++ b/svl/inc/svl/macitem.hxx @@ -93,7 +93,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 @@ -125,7 +125,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 ); @@ -133,14 +133,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 ) {} @@ -154,7 +154,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; @@ -164,17 +164,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; @@ -183,7 +183,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 ) @@ -191,15 +191,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 e25fd2cfdcd2..bfce28ed00db 100644 --- a/svl/inc/svl/mailenum.hxx +++ b/svl/inc/svl/mailenum.hxx @@ -85,10 +85,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 5e7e792b61e7..a5eecbebfa61 100644 --- a/svl/inc/svl/metitem.hxx +++ b/svl/inc/svl/metitem.hxx @@ -38,8 +38,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/svl/nranges.hxx b/svl/inc/svl/nranges.hxx index b04f131d6e89..9571fc79cb47 100644 --- a/svl/inc/svl/nranges.hxx +++ b/svl/inc/svl/nranges.hxx @@ -35,12 +35,12 @@ #ifndef NUMTYPE -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SfxNumRanges SfxUShortRanges #include #undef NUMTYPE -#define NUMTYPE ULONG +#define NUMTYPE sal_uIntPtr #define SfxNumRanges SfxULongRanges #include @@ -66,8 +66,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 & ); @@ -77,10 +77,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/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx index 41f6cbff40d1..801441c297a1 100644 --- a/svl/inc/svl/ownlist.hxx +++ b/svl/inc/svl/ownlist.hxx @@ -86,10 +86,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/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx index c0cf53fb6ded..23bfcc23f3cd 100644 --- a/svl/inc/svl/poolitem.hxx +++ b/svl/inc/svl/poolitem.hxx @@ -142,7 +142,7 @@ enum SfxItemPresentation // ----------------------------------------------------------------------- -typedef USHORT SfxItemState; +typedef sal_uInt16 SfxItemState; #define SFX_ITEM_UNKNOWN 0x0000 @@ -182,17 +182,17 @@ friend class SfxItemPoolCache; friend class SfxItemSet; friend class SfxVoidItem; - ULONG nRefCount; // Referenzzaehler - USHORT nWhich; - USHORT nKind; + sal_uIntPtr nRefCount; // Referenzzaehler + sal_uInt16 nWhich; + sal_uInt16 nKind; private: - inline void SetRefCount( ULONG n ); - inline void SetKind( USHORT n ); + inline void SetRefCount( sal_uIntPtr n ); + inline void SetKind( sal_uInt16 n ); public: - inline ULONG AddRef( ULONG n = 1 ) const; + inline sal_uIntPtr AddRef( sal_uIntPtr n = 1 ) const; private: - inline ULONG ReleaseRef( ULONG n = 1 ) const; + inline sal_uIntPtr ReleaseRef( sal_uIntPtr n = 1 ) const; SVL_DLLPRIVATE long Delete_Impl(void*); #if 0 @@ -202,17 +202,17 @@ private: #endif 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; @@ -227,19 +227,19 @@ public: XubString &rText, const IntlWrapper * pIntlWrapper = 0 ) const; - virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; virtual int ScaleMetrics( long lMult, long lDiv ); virtual int 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 sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual 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_uIntPtr GetRefCount() const { return nRefCount; } + inline sal_uInt16 GetKind() const { return nKind; } /** Read in a Unicode string from a streamed byte string representation. @@ -294,21 +294,21 @@ private: // ----------------------------------------------------------------------- -inline void SfxPoolItem::SetRefCount( ULONG n ) +inline void SfxPoolItem::SetRefCount( sal_uIntPtr 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_uIntPtr SfxPoolItem::AddRef( sal_uIntPtr n ) const { DBG_CHKTHIS( SfxPoolItem, 0 ); DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); @@ -316,7 +316,7 @@ inline ULONG SfxPoolItem::AddRef( ULONG n ) const return ( ((SfxPoolItem *)this)->nRefCount += n ); } -inline ULONG SfxPoolItem::ReleaseRef( ULONG n ) const +inline sal_uIntPtr SfxPoolItem::ReleaseRef( sal_uIntPtr n ) const { DBG_CHKTHIS( SfxPoolItem, 0 ); DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); @@ -359,8 +359,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(); @@ -374,7 +374,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; } }; // ----------------------------------------------------------------------- @@ -387,8 +387,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(); @@ -402,8 +402,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; } @@ -422,7 +422,7 @@ friend class SfxItemSet; private: TYPEINFO(); - SfxInvalidItem( USHORT nWhich, const SfxPoolItem &rDefault ); + SfxInvalidItem( sal_uInt16 nWhich, const SfxPoolItem &rDefault ); SfxInvalidItem( const SfxInvalidItem& ); virtual ~SfxInvalidItem(); @@ -438,8 +438,8 @@ public: // von sich selbst eine Kopie erzeugen virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; - virtual SvStream& Store(SvStream &, USHORT nVer ) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nVer ) const; }; #endif /* @@@ NOT USED @@@ */ @@ -448,7 +448,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 1911ac997527..c3072acdb933 100644 --- a/svl/inc/svl/ptitem.hxx +++ b/svl/inc/svl/ptitem.hxx @@ -44,8 +44,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); } @@ -59,8 +59,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 ) { @@ -68,10 +68,10 @@ public: aVal = rNewVal; } - 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 sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); }; #endif diff --git a/svl/inc/svl/rectitem.hxx b/svl/inc/svl/rectitem.hxx index da080ac95e11..b63d06096bd8 100644 --- a/svl/inc/svl/rectitem.hxx +++ b/svl/inc/svl/rectitem.hxx @@ -45,8 +45,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); } @@ -59,18 +59,18 @@ 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 ) { DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); aVal = rNewVal; } - 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 sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); }; #endif diff --git a/svl/inc/svl/restrictedpaths.hxx b/svl/inc/svl/restrictedpaths.hxx index 11d57af35ce0..1bbd5f1bd48f 100644 --- a/svl/inc/svl/restrictedpaths.hxx +++ b/svl/inc/svl/restrictedpaths.hxx @@ -59,7 +59,7 @@ namespace svt only certain URLs can be browsed. This method checks whether a given URL belongs to this set of permitted URLs.

-

If no "access restriction" is effective, this method always returns .

+

If no "access restriction" is effective, this method always returns .

*/ virtual bool isUrlAllowed( const String& _rURL ) const; @@ -70,9 +70,9 @@ namespace svt to this set of permitted URLs.

Default behavior allows access to parent folder of a restricted folder (but not to its siblings). - If allowParents is set to parent folders will be treated as forbidden. + If allowParents is set to parent folders will be treated as forbidden. -

If no "access restriction" is effective, this method always returns .

+

If no "access restriction" is effective, this method always returns .

*/ bool isUrlAllowed( const String& _rURL, bool allowParents ) const; }; diff --git a/svl/inc/svl/rngitem.hxx b/svl/inc/svl/rngitem.hxx index 890c9d4438c0..914fb5f4cd9a 100644 --- a/svl/inc/svl/rngitem.hxx +++ b/svl/inc/svl/rngitem.hxx @@ -29,7 +29,7 @@ #ifndef NUMTYPE -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SfxXRangeItem SfxRangeItem #define SfxXRangesItem SfxUShortRangesItem #include @@ -38,7 +38,7 @@ #undef SfxXRangesItem #ifndef _SFXITEMS_HXX -#define NUMTYPE ULONG +#define NUMTYPE sal_uIntPtr #define SfxXRangeItem SfxULongRangeItem #define SfxXRangesItem SfxULongRangesItem #include @@ -65,8 +65,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, @@ -79,9 +79,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; }; // ----------------------------------------------------------------------- @@ -94,8 +94,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; @@ -106,8 +106,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 e7a6ecb366d0..3ce183ecbead 100644 --- a/svl/inc/svl/sfontitm.hxx +++ b/svl/inc/svl/sfontitm.hxx @@ -62,13 +62,13 @@ 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 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 { return new SfxFontItem(*this); } @@ -142,7 +142,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 0936524c298a..d3f0249c18ea 100644 --- a/svl/inc/svl/slstitm.hxx +++ b/svl/inc/svl/slstitm.hxx @@ -44,8 +44,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(); @@ -72,13 +72,13 @@ 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 ); - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/svl/smplhint.hxx b/svl/inc/svl/smplhint.hxx index cf705b41c5ae..42e5aa4f69a4 100644 --- a/svl/inc/svl/smplhint.hxx +++ b/svl/inc/svl/smplhint.hxx @@ -68,11 +68,11 @@ class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint { private: - ULONG nId; + sal_uIntPtr nId; public: TYPEINFO(); - SfxSimpleHint( ULONG nId ); - ULONG GetId() const { return nId; } + SfxSimpleHint( sal_uIntPtr nId ); + sal_uIntPtr GetId() const { return nId; } }; //-------------------------------------------------------------------- @@ -84,14 +84,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 3974a8f57b80..8053a204881a 100644 --- a/svl/inc/svl/srchitem.hxx +++ b/svl/inc/svl/srchitem.hxx @@ -89,8 +89,8 @@ public: SvxSearchItem( const SvxSearchItem& rItem ); virtual ~SvxSearchItem(); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual int operator == ( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -234,7 +234,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 ) @@ -244,7 +244,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 ) @@ -254,7 +254,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 5604eb3de6ed..e7885f9065da 100644 --- a/svl/inc/svl/stritem.hxx +++ b/svl/inc/svl/stritem.hxx @@ -39,14 +39,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/svl/style.hxx b/svl/inc/svl/style.hxx index b3138309293f..667fe7137994 100644 --- a/svl/inc/svl/style.hxx +++ b/svl/inc/svl/style.hxx @@ -76,7 +76,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 ) @@ -100,17 +100,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_uIntPtr 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: @@ -120,7 +120,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. */ @@ -130,13 +130,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(); @@ -144,16 +144,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_uIntPtr GetHelpId( String& rFile ); + virtual void SetHelpId( const String& r, sal_uIntPtr nId ); virtual SfxItemSet& GetItemSet(); - virtual USHORT GetVersion() const; + virtual sal_uInt16 GetVersion() const; }; //========================================================================= @@ -173,11 +173,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); @@ -187,18 +187,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; }; @@ -215,18 +215,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(); @@ -242,14 +242,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 ); @@ -265,21 +265,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 ); }; //========================================================================= @@ -290,11 +290,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! @@ -307,13 +307,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); }; //========================================================================= @@ -333,13 +333,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; } }; @@ -348,16 +348,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; } }; @@ -369,9 +369,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; } }; @@ -379,7 +379,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/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index 99b2901b95f9..b905e7128baf 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -128,15 +128,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 ) @@ -144,64 +144,64 @@ 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]; } \ + AERef GetObject(sal_uInt16 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; }\ + 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 );\ \ @@ -229,7 +229,7 @@ SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, 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)\ @@ -243,7 +243,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))\ {\ @@ -252,7 +252,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)\ @@ -263,7 +263,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)= nE || nE > nA )\ @@ -335,15 +335,15 @@ 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); }\ +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 _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem ) @@ -351,63 +351,63 @@ void Insert( const nm *pI, USHORT nP,\ #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 ); +ArrElem& operator[](sal_uInt16 nP) const;\ +void Insert( const nm *pI, sal_uInt16 nP,\ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ); #define _SVOBJARR_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_OBJARR(nm, AE, IS, GS)\ -typedef BOOL (*FnForEach_##nm)( const AE&, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AE&, void* );\ class nm\ {\ protected:\ AE *pData;\ - USHORT nFree;\ - USHORT nA;\ + sal_uInt16 nFree;\ + sal_uInt16 nA;\ \ void _resize(size_t n);\ void _destroy();\ \ public:\ - nm( USHORT= IS, BYTE= GS );\ + nm( sal_uInt16= IS, sal_uInt8= GS );\ ~nm() { _destroy(); }\ \ _SVOBJARR_DEF_GET_OP_INLINE(nm,AE)\ - AE& GetObject(USHORT nP) const { return (*this)[nP]; } \ + AE& GetObject(sal_uInt16 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; }\ + void Insert( const AE &aE, sal_uInt16 nP );\ + void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP );\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );\ + 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 );\ \ @@ -419,7 +419,7 @@ nm& operator=( const nm& );\ }; #define SV_IMPL_OBJARR( nm, AE )\ -nm::nm( USHORT nInit, BYTE )\ +nm::nm( sal_uInt16 nInit, sal_uInt8 )\ : pData (0),\ nFree (nInit),\ nA (0)\ @@ -436,7 +436,7 @@ void nm::_destroy()\ if(pData)\ {\ AE* pTmp=pData;\ - for(USHORT n=0; n < nA; n++,pTmp++ )\ + for(sal_uInt16 n=0; n < nA; n++,pTmp++ )\ {\ pTmp->~AE();\ }\ @@ -447,7 +447,7 @@ void nm::_destroy()\ \ 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))\ {\ @@ -456,7 +456,7 @@ void nm::_resize (size_t n)\ }\ }\ \ -void nm::Insert( const AE &aE, USHORT nP )\ +void nm::Insert( const AE &aE, sal_uInt16 nP )\ {\ DBG_ASSERT( nP <= nA && nA < USHRT_MAX,"Ins 1");\ if (nFree < 1)\ @@ -468,7 +468,7 @@ void nm::Insert( const AE &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)\ @@ -478,7 +478,7 @@ void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ if( pE )\ {\ AE* pTmp = pData+nP;\ - for( USHORT n = 0; n < nL; n++, pTmp++, pE++)\ + for( sal_uInt16 n = 0; n < nL; n++, pTmp++, pE++)\ {\ new( (DummyType*) pTmp ) AE( (AE&)*pE );\ }\ @@ -486,14 +486,14 @@ void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ nA = nA + nL; nFree = nFree - nL;\ }\ \ -void nm::Remove( USHORT nP, USHORT nL )\ +void nm::Remove( sal_uInt16 nP, sal_uInt16 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++)\ + sal_uInt16 nCtr = nP;\ + for(sal_uInt16 n=0; n < nL; n++,pTmp++,nCtr++)\ {\ if( nCtr < nA )\ pTmp->~AE();\ @@ -505,7 +505,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 )\ @@ -518,7 +518,7 @@ _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 )\ @@ -527,29 +527,29 @@ _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE &, 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 {\ @@ -559,20 +559,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& );\ @@ -589,30 +589,30 @@ SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, 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 {\ @@ -622,20 +622,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& );\ @@ -652,11 +652,11 @@ SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, 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 ); \ } \ @@ -680,27 +680,27 @@ _SV_DECL_PTRARR_DEF_PLAIN( SvPtrarrPlain, VoidPtr, 0, 1, SVL_DLLPUBLIC ) #endif #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 : __MWERKS__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 )\ @@ -713,27 +713,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 )\ @@ -745,27 +745,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 )\ @@ -777,29 +777,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 )\ {\ @@ -813,39 +813,39 @@ 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);\ }\ @@ -853,20 +853,20 @@ void nm::Remove( const AE &aE, USHORT nL )\ #if defined(TCPP) #define _SORTARR_BLC_CASTS(nm, AE )\ - BOOL Insert( AE &aE ) {\ + sal_Bool Insert( AE &aE ) {\ return Insert( (const AE&)aE );\ }\ - USHORT GetPos( AE& aE ) const { \ + sal_uInt16 GetPos( AE& aE ) const { \ return SvPtrarr::GetPos((const VoidPtr&)aE);\ }\ - void Remove( AE& aE, USHORT nL = 1 ) { \ + void Remove( AE& aE, sal_uInt16 nL = 1 ) { \ Remove( (const AE&) aE, nL );\ } #else #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);\ } @@ -875,23 +875,23 @@ void nm::Remove( const AE &aE, USHORT nL )\ #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 !!! */ @@ -927,18 +927,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 );\ @@ -956,10 +956,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 ); \ } \ @@ -968,10 +968,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 ); \ } \ @@ -987,23 +987,23 @@ _SV_SEEK_OBJECT( nm,AE ) class nm: private SvPtrarr \ {\ public:\ - nm( USHORT nIni=IS, BYTE nG=GS )\ + nm( sal_uInt16 nIni=IS, sal_uInt8 nG=GS )\ : SvPtrarr(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 ) {\ SvPtrarr::Insert( pI, nP, nS, nE ); \ }\ - void Remove( USHORT nP, USHORT nL = 1 ) {\ + void Remove( sal_uInt16 nP, sal_uInt16 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 {\ + sal_uInt16 Count() const { return SvPtrarr::Count(); }\ + AE operator[](sal_uInt16 nP) const {\ return (AE)SvPtrarr::operator[]( nP );\ }\ - AE GetObject(USHORT nP) const {\ + AE GetObject(sal_uInt16 nP) const {\ return (AE)SvPtrarr::GetObject( nP );\ }\ AE Pop(){\ diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx index bb14d0fcdcdf..229ecbec8361 100644 --- a/svl/inc/svl/svdde.hxx +++ b/svl/inc/svl/svdde.hxx @@ -92,11 +92,11 @@ class SVL_DLLPUBLIC DdeData //#if 0 // _SOLAR__PRIVATE SVL_DLLPRIVATE void Lock(); //#endif - void SetFormat( ULONG nFmt ); + void SetFormat( sal_uIntPtr nFmt ); public: DdeData(); - DdeData( const void*, long, ULONG = FORMAT_STRING ); + DdeData( const void*, long, sal_uIntPtr = FORMAT_STRING ); DdeData( const String& ); DdeData( const DdeData& ); ~DdeData(); @@ -104,12 +104,12 @@ public: operator const void*() const; operator long() const; - ULONG GetFormat() const; + sal_uIntPtr GetFormat() const; DdeData& operator = ( const DdeData& ); - static ULONG GetExternalFormat( ULONG nFmt ); - static ULONG GetInternalFormat( ULONG nFmt ); + static sal_uIntPtr GetExternalFormat( sal_uIntPtr nFmt ); + static sal_uIntPtr GetInternalFormat( sal_uIntPtr nFmt ); }; // ------------------ // - DdeServiceList - @@ -156,7 +156,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; @@ -166,14 +166,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(); @@ -184,8 +184,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_uIntPtr nFmt ) { aDdeData.SetFormat( nFmt ); } + sal_uIntPtr GetFormat() const { return aDdeData.GetFormat(); } long GetError(); @@ -253,7 +253,7 @@ class SVL_DLLPUBLIC DdePoke : public DdeTransaction { public: DdePoke( DdeConnection&, const String&, const char*, long, - ULONG = FORMAT_STRING, long = 0 ); + sal_uIntPtr = FORMAT_STRING, long = 0 ); DdePoke( DdeConnection&, const String&, const DdeData&, long = 0 ); DdePoke( DdeConnection&, const String&, const String&, long = 0 ); }; @@ -290,7 +290,7 @@ public: static const DdeConnections& GetConnections(); - BOOL IsConnected(); + sal_Bool IsConnected(); const String& GetServiceName(); const String& GetTopicName(); @@ -312,11 +312,11 @@ class SVL_DLLPUBLIC DdeItem DdeTopic* pMyTopic; DdeItemImp* pImpData; - void IncMonitor( ULONG ); - void DecMonitor( ULONG ); + void IncMonitor( sal_uIntPtr ); + void DecMonitor( sal_uIntPtr ); protected: - BYTE nType; + sal_uInt8 nType; public: DdeItem( const sal_Unicode* ); @@ -340,9 +340,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_uIntPtr ); + virtual sal_Bool Put( const DdeData* ); + virtual void AdviseLoop( sal_Bool ); // AdviseLoop starten/stoppen }; // ------------ @@ -356,16 +356,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_uIntPtr ); + 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; @@ -401,7 +401,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 ! @@ -423,10 +423,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(); @@ -434,7 +434,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: @@ -445,7 +445,7 @@ private: ConvList* pConv; short nStatus; - SVL_DLLPRIVATE BOOL HasCbFormat( USHORT ); + SVL_DLLPRIVATE sal_Bool HasCbFormat( sal_uInt16 ); public: DdeService( const String& ); @@ -460,9 +460,9 @@ public: void AddTopic( const DdeTopic& ); void RemoveTopic( const DdeTopic& ); - void AddFormat( ULONG ); - void RemoveFormat( ULONG ); - BOOL HasFormat( ULONG ); + void AddFormat( sal_uIntPtr ); + void RemoveFormat( sal_uIntPtr ); + sal_Bool HasFormat( sal_uIntPtr ); private: // DdeService( const DdeService& ); diff --git a/svl/inc/svl/svldata.hxx b/svl/inc/svl/svldata.hxx index 24aef1fdf6d0..7d666a7e0d15 100644 --- a/svl/inc/svl/svldata.hxx +++ b/svl/inc/svl/svldata.hxx @@ -61,7 +61,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 fa3c94034256..58dc7c09abe3 100644 --- a/svl/inc/svl/svstdarr.hxx +++ b/svl/inc/svl/svstdarr.hxx @@ -45,35 +45,35 @@ //#ifdef _SVSTDARR_BOOLS #ifndef _SVSTDARR_BOOLS_DECL -SV_DECL_VARARR_VISIBILITY( SvBools, BOOL, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_VISIBILITY( SvBools, sal_Bool, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BOOLS_DECL #endif //#endif //#ifdef _SVSTDARR_BYTES #ifndef _SVSTDARR_BYTES_DECL -SV_DECL_VARARR_VISIBILITY( SvBytes, BYTE, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_VISIBILITY( SvBytes, sal_uInt8, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTES_DECL #endif //#endif //#ifdef _SVSTDARR_ULONGS #ifndef _SVSTDARR_ULONGS_DECL -SV_DECL_VARARR_VISIBILITY( SvULongs, ULONG, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_VISIBILITY( SvULongs, sal_uIntPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_ULONGS_DECL #endif //#endif //#ifdef _SVSTDARR_ULONGSSORT #ifndef _SVSTDARR_ULONGSSORT_DECL -SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, ULONG, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, sal_uIntPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_ULONGSSORT_DECL #endif //#endif //#ifdef _SVSTDARR_USHORTS #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 //#endif @@ -81,37 +81,37 @@ SV_DECL_VARARR_VISIBILITY( SvUShorts, USHORT, 1, 1, SVL_DLLPUBLIC ) //#ifdef _SVSTDARR_USHORTSSORT #ifndef _SVSTDARR_USHORTSSORT_DECL -typedef BOOL (*FnForEach_SvUShortsSort)( const USHORT&, void* ); +typedef sal_Bool (*FnForEach_SvUShortsSort)( const sal_uInt16&, void* ); class SVL_DLLPUBLIC SvUShortsSort : __MWERKS__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 ); diff --git a/svl/inc/svl/szitem.hxx b/svl/inc/svl/szitem.hxx index 31878aa34be5..0e1aa5b365b1 100644 --- a/svl/inc/svl/szitem.hxx +++ b/svl/inc/svl/szitem.hxx @@ -46,8 +46,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); } @@ -58,14 +58,14 @@ public: const IntlWrapper * = 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 sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); virtual 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 5aea03207626..66be49262656 100644 --- a/svl/inc/svl/undo.hxx +++ b/svl/inc/svl/undo.hxx @@ -45,24 +45,24 @@ public: 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 Redo(); 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 sal_uInt16 GetId() const; private: SfxUndoAction& operator=( const SfxUndoAction& ); // n.i.!! @@ -79,10 +79,10 @@ SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 ) struct SVL_DLLPUBLIC SfxUndoArray { SfxUndoActions aUndoActions; - USHORT nMaxUndoActions; - USHORT nCurUndoAction; + sal_uInt16 nMaxUndoActions; + sal_uInt16 nCurUndoAction; SfxUndoArray *pFatherUndoArray; - SfxUndoArray(USHORT nMax=0): + SfxUndoArray(sal_uInt16 nMax=0): nMaxUndoActions(nMax), nCurUndoAction(0), pFatherUndoArray(0) {} ~SfxUndoArray(); @@ -109,23 +109,23 @@ 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 Redo(); 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 sal_uInt16 GetId() const; void SetComment( const UniString& rComment ); private: - USHORT nId; + sal_uInt16 nId; UniString aComment, aRepeatComment; }; @@ -142,40 +142,40 @@ class SVL_DLLPUBLIC SfxUndoManager bool mbUndoEnabled; public: - SfxUndoManager( USHORT nMaxUndoActionCount = 20 ); + SfxUndoManager( sal_uInt16 nMaxUndoActionCount = 20 ); virtual ~SfxUndoManager(); - virtual void SetMaxUndoActionCount( USHORT nMaxUndoActionCount ); - virtual USHORT GetMaxUndoActionCount() const; + virtual void SetMaxUndoActionCount( sal_uInt16 nMaxUndoActionCount ); + virtual sal_uInt16 GetMaxUndoActionCount() const; virtual void Clear(); - virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE ); + virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ); - virtual USHORT GetUndoActionCount() const; - virtual USHORT GetUndoActionId(USHORT nNo=0) const; - virtual UniString GetUndoActionComment( USHORT nNo=0 ) const; + virtual sal_uInt16 GetUndoActionCount() const; + virtual sal_uInt16 GetUndoActionId(sal_uInt16 nNo=0) const; + virtual UniString GetUndoActionComment( sal_uInt16 nNo=0 ) const; /** returns the nNo'th undo action from the top */ - SfxUndoAction* GetUndoAction( USHORT nNo=0 ) const; + SfxUndoAction* GetUndoAction( sal_uInt16 nNo=0 ) const; - virtual BOOL Undo( USHORT nCount=1 ); + virtual sal_Bool Undo( sal_uInt16 nCount=1 ); virtual void Undo( SfxUndoAction &rAction ); - virtual USHORT GetRedoActionCount() const; - virtual USHORT GetRedoActionId(USHORT nNo=0) const; - virtual UniString GetRedoActionComment( USHORT nNo=0 ) const; + virtual sal_uInt16 GetRedoActionCount() const; + virtual sal_uInt16 GetRedoActionId(sal_uInt16 nNo=0) const; + virtual UniString GetRedoActionComment( sal_uInt16 nNo=0 ) const; - virtual BOOL Redo( USHORT nCount=1 ); + virtual sal_Bool Redo( sal_uInt16 nCount=1 ); virtual void Redo( SfxUndoAction &rAction ); virtual void ClearRedo(); - 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 sal_uInt16 GetRepeatActionCount() const; + virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget, sal_uInt16 nNo = 0) const; + virtual sal_Bool Repeat( SfxRepeatTarget &rTarget, sal_uInt16 nFrom=0, sal_uInt16 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; + virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget, sal_uInt16 nNo = 0 ) const; + virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const; - virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0); + virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, sal_uInt16 nId=0); virtual void LeaveListAction(); /** clears the redo stack and removes the top undo action */ @@ -218,13 +218,13 @@ public: 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 sal_uInt16 GetId() const; SfxUndoAction* GetAction() const { return pAction; } diff --git a/svl/inc/svl/visitem.hxx b/svl/inc/svl/visitem.hxx index 9e9a0fcf4126..0305e0563938 100644 --- a/svl/inc/svl/visitem.hxx +++ b/svl/inc/svl/visitem.hxx @@ -43,14 +43,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) @@ -69,25 +69,25 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + 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/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 598295797ea6..41aff1bd2974 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -233,9 +233,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 @@ -249,7 +249,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; //#endif // __PRIVATE 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 @@ -403,8 +403,8 @@ public: /** Create new entry of a format code string for language/country. @return - if string new and ok and inserted. - if string already exists or an unresolvable parse error + if string new and ok and inserted. + if string already exists or an unresolvable parse error occured, in which case nCheckPos is the error position within rString. If the error occurs at position 0 or rString is empty nCheckPos will be 1, so an error in the string is always indicated by @@ -414,13 +414,13 @@ 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 ); /** Same as PutEntry 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, + sal_Bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -428,7 +428,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, + sal_Bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -466,29 +466,29 @@ 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 - if input is a number or is matching a format F_Index + if input is a number or is matching a format F_Index F_Index is set to a matching format if number, the value is returned in fOutNumber - if input is not a number + 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, @@ -507,16 +507,16 @@ public: /** Format a number according to a format code string to be scanned. @return - if format code contains an error - else, in which case the string and color are returned. + if format code contains an error + 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 GetPreviewString 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,14 +528,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(); @@ -543,11 +543,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 @@ -556,12 +556,12 @@ public: 0 if format code string parsed without errors, otherwise error position (like nCheckPos on PutEntry) */ - 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 */ @@ -589,14 +589,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); @@ -607,7 +607,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; @@ -617,7 +617,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. */ @@ -650,12 +650,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); } @@ -715,21 +715,21 @@ public: /** Get all standard formats for a specific currency, formats are appended to the NfWSStringsDtor list. @param bBank - : generate only format strings with currency abbreviation - : mixed format strings + : generate only format strings with currency abbreviation + : mixed format strings @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 NfCurrencyEntry matching rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly @@ -746,7 +746,7 @@ public: @param bFoundBank Only used for output. - If the return value is not this value is set to if + If the return value is not this value is set to if the matching entry was found by comparing rSymbol against the CurrencyAbbreviation (AKA BankSymbol). If the return value is the value of bFoundBank is undefined. @@ -760,16 +760,16 @@ public: The language/country value of the format of which rSymbol and rExtension are obtained (SvNumberformat::GetLanguage()). @param bOnlyStringLanguage - If only entries with language/country of rExtension are + If only entries with language/country of rExtension are checked, no match on eFormatLanguage. If rExtension is empty all entries are checked. @return The matching entry if unique (in which case bFoundBank is set), else . */ - 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; @@ -782,7 +782,7 @@ public: /** Return a keyword for a language/country and NfKeywordIndex 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 */ @@ -812,7 +812,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; @@ -821,8 +821,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 @@ -833,29 +833,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 @@ -868,7 +868,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 ); @@ -905,16 +905,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 SvtSysLocaleOptions::SetCurrencyChangeLink() DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, void* ); @@ -997,15 +997,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 7c361382796a..6afaa6105d01 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -78,16 +78,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, @@ -95,32 +95,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; @@ -131,7 +131,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; @@ -144,7 +144,7 @@ public: const ImpSvNumberformatInfo& Info() const { return aI; } // Get count of substrings (symbols) - USHORT GetnAnz() const { return nAnzStrings;} + sal_uInt16 GetnAnz() const { return nAnzStrings;} Color* GetColor() const { return pColor; } void SetColor( Color* pCol, String& rName ) @@ -152,22 +152,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 }; @@ -184,7 +184,7 @@ public: ImpSvNumberInputScan* pISc, xub_StrLen& nCheckPos, LanguageType& eLan, - BOOL bStand = FALSE ); + sal_Bool bStand = sal_False ); // Copy ctor SvNumberformat( SvNumberformat& rFormat ); @@ -202,16 +202,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 eLnge;} @@ -221,12 +221,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 ); @@ -242,54 +242,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].GetnAnz() > 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 ) { @@ -298,19 +298,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].GetnAnz(); + sal_uInt16 nCnt = NumFor[nNumFor].GetnAnz(); 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) || @@ -319,37 +319,37 @@ public: } // Whether the negative format is without a sign or not - BOOL IsNegativeWithoutSign() const; + sal_Bool IsNegativeWithoutSign() 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 = '\\' ); @@ -401,23 +401,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 if E,EE,R,RR,AAA,AAAA in format code of subformat + /** @returns if E,EE,R,RR,AAA,AAAA in format code of subformat nNumFor (0..3) and no 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 @@ -436,16 +436,16 @@ public: calendar switched and rOrgCalendar was empty. @return - if a calendar was specified and switched to, - else. + if a calendar was specified and switched to, + 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: @@ -458,17 +458,17 @@ private: LanguageType eLnge; // Language/country of the format 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 ----- @@ -504,25 +504,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_uIntPtr ImpGGT(sal_uIntPtr x, sal_uIntPtr y); + SVL_DLLPRIVATE sal_uIntPtr ImpGGTRound(sal_uIntPtr x, sal_uIntPtr 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 @@ -531,18 +531,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 @@ -550,7 +550,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 @@ -558,8 +558,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 ); @@ -567,9 +567,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/inc/whiter.hxx b/svl/inc/whiter.hxx index 83a3e21e2b0e..eb9bb7d7e732 100644 --- a/svl/inc/whiter.hxx +++ b/svl/inc/whiter.hxx @@ -42,19 +42,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/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx index 8f9aabd59500..9d9a31b85b40 100644 --- a/svl/source/config/languageoptions.cxx +++ b/svl/source/config/languageoptions.cxx @@ -211,7 +211,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/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx index 0d1b06be5d11..3170db4e4f2a 100644 --- a/svl/source/filerec/filerec.cxx +++ b/svl/source/filerec/filerec.cxx @@ -32,12 +32,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. */ @@ -52,33 +52,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 ( - FASTBOOL bSeekToEndOfRec /* TRUE (default) + int bSeekToEndOfRec /* sal_True (default) Der Stream wird an das Ende des Records positioniert. - FALSE + sal_False Der Stream wird an den Anfang des Contents (also hinter den Header) positioniert. @@ -95,9 +95,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 @@ -109,7 +109,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 ); @@ -118,7 +118,7 @@ UINT32 SfxMiniRecordWriter::Close _pStream->Seek( nEndPos ); // Header wurde JETZT geschrieben - _bHeaderOk = TRUE; + _bHeaderOk = sal_True; return nEndPos; } #ifdef DBG_UTIL @@ -126,14 +126,14 @@ UINT32 SfxMiniRecordWriter::Close else if ( SFX_BOOL_DONTCARE == _bHeaderOk ) { // Header auslesen, um Soll-Gr"o\se zu bestimmen - UINT32 nEndPos = _pStream->Tell(); + sal_uInt32 nEndPos = _pStream->Tell(); _pStream->Seek( _nStartPos ); - UINT32 nHeader; + sal_uInt32 nHeader; *_pStream >> nHeader; _pStream->Seek( nEndPos ); // Soll-Gr"o\se mit Ist-Gr"o\se vergleichen - DBG_ASSERT( nEndPos - SFX_REC_OFS(nHeader) == _nStartPos + sizeof(UINT32), + DBG_ASSERT( nEndPos - SFX_REC_OFS(nHeader) == _nStartPos + sizeof(sal_uInt32), "fixed record size incorrect" ); DbgOutf( "SfxFileRec: written record until %ul", nEndPos ); } @@ -145,7 +145,7 @@ UINT32 SfxMiniRecordWriter::Close //========================================================================= -USHORT SfxMiniRecordReader::ScanRecordType +sal_uInt16 SfxMiniRecordReader::ScanRecordType ( SvStream* pStream /* an dessen aktueller Position ein Record liegt, dessen Typ erkannt werden @@ -175,7 +175,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. @@ -224,7 +224,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 @@ -234,7 +234,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; @@ -251,7 +251,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 @@ -260,29 +260,29 @@ USHORT SfxMiniRecordReader::ScanRecordType //------------------------------------------------------------------------- -FASTBOOL SfxMiniRecordReader::SetHeader_Impl( UINT32 nHeader ) +int 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. */ { - FASTBOOL bRet = TRUE; + int bRet = sal_True; // 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 ) { _pStream->SetError( ERRCODE_IO_WRONGFORMAT ); - bRet = FALSE; + bRet = sal_False; } return bRet; } @@ -309,12 +309,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 @@ -337,7 +337,7 @@ SfxMiniRecordReader::SfxMiniRecordReader Position sich ein befindet. */ - BYTE nTag // Pre-Tag des gew"unschten Records + sal_uInt8 nTag // Pre-Tag des gew"unschten Records ) /* [Beschreibung] @@ -350,13 +350,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 . @@ -384,14 +384,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 @@ -423,10 +423,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] @@ -445,8 +445,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] @@ -467,9 +467,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] @@ -487,7 +487,7 @@ SfxSingleRecordWriter::SfxSingleRecordWriter //========================================================================= -inline FASTBOOL SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes ) +inline int SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes ) /* [Beschreibung] @@ -498,22 +498,22 @@ inline FASTBOOL SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes ) */ { - FASTBOOL bRet; + int bRet; // Basisklassen-Header einlesen - UINT32 nHeader=0; + sal_uInt32 nHeader=0; *_pStream >> nHeader; if ( !SetHeader_Impl( nHeader ) ) - bRet = FALSE; + bRet = sal_False; else { // 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; @@ -526,7 +526,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 @@ -544,10 +544,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 ); @@ -561,10 +561,10 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, USHORT nTag ) //------------------------------------------------------------------------- -FASTBOOL SfxSingleRecordReader::FindHeader_Impl +int 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] @@ -574,18 +574,18 @@ FASTBOOL 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 ) ) @@ -597,17 +597,17 @@ FASTBOOL 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; @@ -622,18 +622,18 @@ FASTBOOL 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] @@ -653,9 +653,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] @@ -674,7 +674,7 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter //------------------------------------------------------------------------ -UINT32 SfxMultiFixRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) +sal_uInt32 SfxMultiFixRecordWriter::Close( int bSeekToEndOfRec ) // siehe @@ -683,7 +683,7 @@ UINT32 SfxMultiFixRecordWriter::Close( FASTBOOL 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; @@ -703,10 +703,10 @@ UINT32 SfxMultiFixRecordWriter::Close( FASTBOOL 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] @@ -724,8 +724,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] @@ -799,7 +799,7 @@ void SfxMultiVarRecordWriter::NewContent() //------------------------------------------------------------------------- -UINT32 SfxMultiVarRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) +sal_uInt32 SfxMultiVarRecordWriter::Close( int bSeekToEndOfRec ) // siehe @@ -812,24 +812,24 @@ UINT32 SfxMultiVarRecordWriter::Close( FASTBOOL 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(nContentOfsPos - ( _pStream->Tell() + sizeof(UINT32) )); + *_pStream << static_cast(nContentOfsPos - ( _pStream->Tell() + sizeof(sal_uInt32) )); else *_pStream << nContentOfsPos; @@ -847,8 +847,8 @@ UINT32 SfxMultiVarRecordWriter::Close( FASTBOOL 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] @@ -872,7 +872,7 @@ void SfxMultiMixRecordWriter::NewContent //========================================================================= -FASTBOOL SfxMultiRecordReader::ReadHeader_Impl() +int SfxMultiRecordReader::ReadHeader_Impl() /* [Beschreibung] @@ -891,18 +891,18 @@ FASTBOOL 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 ); @@ -934,7 +934,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 @@ -963,7 +963,7 @@ SfxMultiRecordReader::~SfxMultiRecordReader() //------------------------------------------------------------------------- -FASTBOOL SfxMultiRecordReader::GetContent() +int SfxMultiRecordReader::GetContent() /* [Beschreibung] @@ -971,8 +971,8 @@ FASTBOOL 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. */ @@ -982,10 +982,10 @@ FASTBOOL 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; @@ -1000,17 +1000,17 @@ FASTBOOL 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/inc/passwordcontainer.hxx b/svl/source/inc/passwordcontainer.hxx index 375632801368..6490ea667a6c 100644 --- a/svl/source/inc/passwordcontainer.hxx +++ b/svl/source/inc/passwordcontainer.hxx @@ -411,13 +411,13 @@ public: class RW_SvMemoryStream : public SvMemoryStream { public: - RW_SvMemoryStream( void* Buf, ULONG Size, StreamMode eMode ): + RW_SvMemoryStream( void* Buf, sal_uIntPtr Size, StreamMode eMode ): SvMemoryStream( Buf, Size, eMode){} - RW_SvMemoryStream( ULONG InitSize=512, ULONG Resize=64 ): + RW_SvMemoryStream( sal_uIntPtr InitSize=512, sal_uIntPtr Resize=64 ): SvMemoryStream( InitSize, Resize ){} - ULONG getActualSize(){ return nEndOfData; } + sal_uIntPtr getActualSize(){ return nEndOfData; } }; diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index 70122a5b1998..19dea8850be0 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.hxx @@ -34,12 +34,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 ), @@ -58,9 +58,9 @@ SV_DECL_PTRARR_DEL( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl*, 0, 2 ) struct SfxPoolItemArray_Impl: public SfxPoolItemArrayBase_Impl { - USHORT nFirstFree; + sal_uInt16 nFirstFree; - SfxPoolItemArray_Impl (USHORT nInitSize = 0) + SfxPoolItemArray_Impl (sal_uInt16 nInitSize = 0) : SfxPoolItemArrayBase_Impl( nInitSize ), nFirstFree( 0 ) {} @@ -73,17 +73,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; - FASTBOOL bInSetItem; - FASTBOOL bStreaming; // in Load() bzw. Store() + int bInSetItem; + int 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) ); @@ -123,76 +123,76 @@ struct SfxItemPool_Impl #endif #define CHECK_FILEFORMAT( rStream, nTag ) \ - { USHORT nFileTag; \ + { sal_uInt16 nFileTag; \ rStream >> nFileTag; \ if ( nTag != nFileTag ) \ { \ DBG_ERROR( #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 ) \ { \ DBG_ERROR( #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 ) \ { \ DBG_ERROR( #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 36445162424b..370a3ebeb44e 100644 --- a/svl/source/items/aeitem.cxx +++ b/svl/source/items/aeitem.cxx @@ -47,7 +47,7 @@ TYPEINIT1_AUTOFACTORY(SfxAllEnumItem, SfxEnumItem) struct SfxAllEnumValue_Impl { - USHORT nValue; + sal_uInt16 nValue; XubString aText; }; @@ -63,7 +63,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 ) @@ -74,7 +74,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 ) @@ -85,7 +85,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 ) @@ -97,7 +97,7 @@ SfxAllEnumItem::SfxAllEnumItem( USHORT which, SvStream &rStream ): // ----------------------------------------------------------------------- -SfxAllEnumItem::SfxAllEnumItem(USHORT which): +SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which): SfxEnumItem(which, 0), pValues( 0 ), pDisabledValues( 0 ) @@ -119,7 +119,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; @@ -131,7 +131,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 ); @@ -150,7 +150,7 @@ SfxAllEnumItem::~SfxAllEnumItem() // ----------------------------------------------------------------------- -USHORT SfxAllEnumItem::GetValueCount() const +sal_uInt16 SfxAllEnumItem::GetValueCount() const { DBG_CHKTHIS(SfxAllEnumItem, 0); return pValues ? pValues->Count() : 0; @@ -158,7 +158,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" ); @@ -167,7 +167,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" ); @@ -184,7 +184,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 ); @@ -193,11 +193,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 liefert + Im Ggs. zu liefert diese interne Methode bei nicht vorhandenen Values die Position, an der der Wert liegen w"urde. */ @@ -209,7 +209,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; @@ -218,11 +218,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 + Liefert im Gegensatz zu immer nValue zur"uck, solange nicht mindestens ein Wert mit einer der Methoden eingef"ugt wurde. */ @@ -238,7 +238,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; @@ -256,7 +256,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; @@ -269,7 +269,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 ) @@ -278,24 +278,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; iCount(); i++ ) + for ( sal_uInt16 i=0; iCount(); 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 c5e1a09ec324..b46066996671 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.cxx @@ -70,7 +70,7 @@ SfxEnumItemInterface::GetPresentation(SfxItemPresentation, SfxMapUnit, //============================================================================ // virtual -BOOL SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, BYTE) +sal_Bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= sal_Int32(GetEnumValue()); @@ -79,14 +79,14 @@ BOOL SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, BYTE) //============================================================================ // virtual -BOOL SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, - BYTE) +sal_Bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, + sal_uInt8) { sal_Int32 nTheValue = 0; if ( ::cppu::enum2int( nTheValue, rVal ) ) { - SetEnumValue(USHORT(nTheValue)); + SetEnumValue(sal_uInt16(nTheValue)); return true; } DBG_ERROR("SfxEnumItemInterface::PutValue(): Wrong type"); @@ -94,7 +94,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(); @@ -102,25 +102,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; } //============================================================================ @@ -132,14 +132,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) {} //============================================================================ @@ -151,7 +151,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; @@ -163,7 +163,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; @@ -171,14 +171,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); } @@ -195,7 +195,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; @@ -233,7 +233,7 @@ SfxItemPresentation CntBoolItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -BOOL CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const +sal_Bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= sal_Bool(m_bValue); return true; @@ -241,7 +241,7 @@ BOOL CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const //============================================================================ // virtual -BOOL CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, BYTE) +sal_Bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Bool bTheValue = sal_Bool(); if (rVal >>= bTheValue) @@ -255,14 +255,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; @@ -277,18 +277,18 @@ 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")); } diff --git a/svl/source/items/cintitem.cxx b/svl/source/items/cintitem.cxx index dd22ab757fe7..11f68ed69071 100644 --- a/svl/source/items/cintitem.cxx +++ b/svl/source/items/cintitem.cxx @@ -43,7 +43,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); @@ -87,41 +87,41 @@ SfxItemPresentation CntByteItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -BOOL CntByteItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +sal_Bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const { sal_Int8 nValue = m_nValue; rVal <<= nValue; - return TRUE; + return sal_True; } //============================================================================ // virtual -BOOL CntByteItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +sal_Bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) { sal_Int8 nValue = sal_Int8(); if (rVal >>= nValue) { m_nValue = nValue; - return TRUE; + return sal_True; } DBG_ERROR( "CntByteItem::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //============================================================================ // 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); @@ -138,7 +138,7 @@ SfxPoolItem * CntByteItem::Clone(SfxItemPool *) const //============================================================================ // virtual -BYTE CntByteItem::GetMin() const +sal_uInt8 CntByteItem::GetMin() const { DBG_CHKTHIS(CntByteItem, 0); return 0; @@ -146,7 +146,7 @@ BYTE CntByteItem::GetMin() const //============================================================================ // virtual -BYTE CntByteItem::GetMax() const +sal_uInt8 CntByteItem::GetMax() const { DBG_CHKTHIS(CntByteItem, 0); return 255; @@ -172,11 +172,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; } @@ -222,32 +222,32 @@ SfxItemPresentation CntUInt16Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -BOOL CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +sal_Bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const { sal_Int32 nValue = m_nValue; rVal <<= nValue; - return TRUE; + return sal_True; } //============================================================================ // virtual -BOOL CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +sal_Bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { DBG_ASSERT( nValue <= USHRT_MAX, "Overflow in UInt16 value!"); m_nValue = (sal_uInt16)nValue; - return TRUE; + return sal_True; } DBG_ERROR( "CntUInt16Item::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //============================================================================ // 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); @@ -255,10 +255,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; } @@ -272,7 +272,7 @@ SfxPoolItem * CntUInt16Item::Clone(SfxItemPool *) const //============================================================================ // virtual -UINT16 CntUInt16Item::GetMin() const +sal_uInt16 CntUInt16Item::GetMin() const { DBG_CHKTHIS(CntUInt16Item, 0); return 0; @@ -280,7 +280,7 @@ UINT16 CntUInt16Item::GetMin() const //============================================================================ // virtual -UINT16 CntUInt16Item::GetMax() const +sal_uInt16 CntUInt16Item::GetMax() const { DBG_CHKTHIS(CntUInt16Item, 0); return 65535; @@ -306,7 +306,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); @@ -354,31 +354,31 @@ SfxItemPresentation CntInt32Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -BOOL CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +sal_Bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const { sal_Int32 nValue = m_nValue; rVal <<= nValue; - return TRUE; + return sal_True; } //============================================================================ // virtual -BOOL CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +sal_Bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { m_nValue = nValue; - return TRUE; + return sal_True; } DBG_ERROR( "CntInt32Item::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //============================================================================ // 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); @@ -386,7 +386,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); @@ -403,15 +403,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; @@ -437,7 +437,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); @@ -487,33 +487,33 @@ SfxItemPresentation CntUInt32Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -BOOL CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +sal_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!"); rVal <<= nValue; - return TRUE; + return sal_True; } //============================================================================ // virtual -BOOL CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +sal_Bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { DBG_ASSERT( nValue>=0, "Overflow in UInt32 value!"); m_nValue = nValue; - return TRUE; + return sal_True; } DBG_ERROR( "CntUInt32Item::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //============================================================================ // 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); @@ -521,7 +521,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(m_nValue); @@ -538,7 +538,7 @@ SfxPoolItem * CntUInt32Item::Clone(SfxItemPool *) const //============================================================================ // virtual -UINT32 CntUInt32Item::GetMin() const +sal_uInt32 CntUInt32Item::GetMin() const { DBG_CHKTHIS(CntUInt32Item, 0); return 0; @@ -546,7 +546,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 56632c675d01..e5d635990086 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.cxx @@ -35,22 +35,22 @@ #include -#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 ) { @@ -59,7 +59,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 @@ -110,33 +110,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; @@ -150,18 +150,18 @@ SfxPoolItem* CntWallpaperItem::Clone( SfxItemPool* ) const //---------------------------------------------------------------------------- // virtual -BOOL CntWallpaperItem::QueryValue( com::sun::star::uno::Any&,BYTE ) const +sal_Bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&,sal_uInt8 ) const { DBG_ERROR("Not implemented!"); - return FALSE; + return sal_False; } //---------------------------------------------------------------------------- // virtual -BOOL CntWallpaperItem::PutValue( const com::sun::star::uno::Any&,BYTE ) +sal_Bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&,sal_uInt8 ) { DBG_ERROR("Not implemented!"); - return FALSE; + return sal_False; } diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx index 576071b56e1c..184b692eaad9 100644 --- a/svl/source/items/ctypeitm.cxx +++ b/svl/source/items/ctypeitm.cxx @@ -35,8 +35,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 ) ) ) ) //============================================================================ // @@ -56,14 +56,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 ) @@ -80,7 +80,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() } @@ -88,17 +88,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"); @@ -111,12 +111,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; } @@ -223,7 +223,7 @@ void CntContentTypeItem::SetValue( const INetContentType eType ) //---------------------------------------------------------------------------- // virtual -BOOL CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const +sal_Bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const { rVal <<= rtl::OUString(GetValue()); return true; @@ -231,7 +231,7 @@ BOOL CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const //---------------------------------------------------------------------------- // virtual -BOOL CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal,BYTE ) +sal_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 9d192cc7e7b8..ff5d2dadd751 100644 --- a/svl/source/items/custritm.cxx +++ b/svl/source/items/custritm.cxx @@ -106,7 +106,7 @@ CntUnencodedStringItem::GetPresentation(SfxItemPresentation, SfxMapUnit, //============================================================================ // virtual -BOOL CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) +sal_Bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= rtl::OUString(m_aValue); @@ -115,8 +115,8 @@ BOOL CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) //============================================================================ // virtual -BOOL CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, - BYTE) +sal_Bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, + sal_uInt8) { rtl::OUString aTheValue; if (rVal >>= aTheValue) diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx index 27170c1d4f6e..eeaebb3fa2a7 100644 --- a/svl/source/items/dateitem.cxx +++ b/svl/source/items/dateitem.cxx @@ -56,7 +56,7 @@ TYPEINIT1(SfxDateTimeItem, SfxPoolItem); // ----------------------------------------------------------------------- -SfxDateTimeItem::SfxDateTimeItem( USHORT which ) : +SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which ) : SfxPoolItem( which ) { DBG_CTOR(SfxDateTimeItem, 0); @@ -64,7 +64,7 @@ SfxDateTimeItem::SfxDateTimeItem( USHORT which ) : // ----------------------------------------------------------------------- -SfxDateTimeItem::SfxDateTimeItem( USHORT which, const DateTime& rDT ) : +SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which, const DateTime& rDT ) : SfxPoolItem( which ), aDateTime( rDT ) @@ -109,7 +109,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; @@ -122,7 +122,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(); @@ -174,8 +174,8 @@ SfxItemPresentation SfxDateTimeItem::GetPresentation //---------------------------------------------------------------------------- // virtual -BOOL SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) +sal_Bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; com::sun::star::util::DateTime aValue; @@ -188,17 +188,17 @@ BOOL SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, aValue.Minutes, aValue.Seconds, aValue.HundredthSeconds ) ); - return TRUE; + return sal_True; } DBG_ERROR( "SfxDateTimeItem::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //---------------------------------------------------------------------------- // virtual -BOOL SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId ) const +sal_Bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; com::sun::star::util::DateTime aValue( aDateTime.Get100Sec(), @@ -209,7 +209,7 @@ BOOL SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, aDateTime.GetMonth(), aDateTime.GetYear() ); rVal <<= aValue; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -219,11 +219,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 93d88889daef..d1c0b84078a4 100644 --- a/svl/source/items/flagitem.cxx +++ b/svl/source/items/flagitem.cxx @@ -36,7 +36,7 @@ DBG_NAME(SfxFlagItem) -USHORT nSfxFlagVal[16] = +sal_uInt16 nSfxFlagVal[16] = { 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, @@ -51,7 +51,7 @@ TYPEINIT1(SfxFlagItem, SfxPoolItem); // ----------------------------------------------------------------------- -SfxFlagItem::SfxFlagItem( USHORT nW, USHORT nV ) : +SfxFlagItem::SfxFlagItem( sal_uInt16 nW, sal_uInt16 nV ) : SfxPoolItem( nW ), nVal(nV) { @@ -60,7 +60,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); @@ -78,7 +78,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; @@ -98,32 +98,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!" ); @@ -141,7 +141,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 a0ebd97c89b6..c630a6b9b4f2 100644 --- a/svl/source/items/globalnameitem.cxx +++ b/svl/source/items/globalnameitem.cxx @@ -52,7 +52,7 @@ SfxGlobalNameItem::SfxGlobalNameItem() // ----------------------------------------------------------------------- -SfxGlobalNameItem::SfxGlobalNameItem( USHORT nW, const SvGlobalName& rName ) +SfxGlobalNameItem::SfxGlobalNameItem( sal_uInt16 nW, const SvGlobalName& rName ) : SfxPoolItem( nW ), m_aName( rName ) { @@ -80,7 +80,7 @@ SfxPoolItem* SfxGlobalNameItem::Clone(SfxItemPool *) const //---------------------------------------------------------------------------- // virtual -BOOL SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) +sal_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::createFromAscii("com.sun.star.script.Converter")), @@ -94,21 +94,21 @@ BOOL SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) if ( aSeq.getLength() == 16 ) { m_aName.MakeFromMemory( (void*) aSeq.getConstArray() ); - return TRUE; + return sal_True; } DBG_ERROR( "SfxGlobalNameItem::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //---------------------------------------------------------------------------- // virtual -BOOL SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const +sal_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(); memcpy( aSeq.getArray(), pData, 16 ); rVal <<= aSeq; - return TRUE; + return sal_True; } diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index 691fa7d131be..66bc832c8125 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.cxx @@ -43,11 +43,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 xConverter ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), @@ -84,20 +84,20 @@ BOOL SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, BYTE try { aNew = xConverter->convertTo( rVal, ::getCppuType((const ::com::sun::star::uno::Sequence < sal_Int32 >*)0) ); } catch (::com::sun::star::uno::Exception&) { - return FALSE; + return sal_False; } return ( aNew >>= m_aList ); } -BOOL SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const +sal_Bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { rVal <<= m_aList; - return TRUE; + return sal_True; } void SfxIntegerListItem::GetList( SvULongs& rList ) const { for ( sal_Int32 n=0; n(n) ); + rList.Insert( m_aList[n], sal::static_int_cast< sal_uInt16 >(n) ); } diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx index 88c3daa137dc..cd91f082ee1f 100644 --- a/svl/source/items/imageitm.cxx +++ b/svl/source/items/imageitm.cxx @@ -37,27 +37,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; } @@ -87,7 +87,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 +sal_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() ); @@ -96,10 +96,10 @@ BOOL SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const aSeq[3] = ::com::sun::star::uno::makeAny( rtl::OUString( pImp->aURL )); rVal = ::com::sun::star::uno::makeAny( aSeq ); - return TRUE; + return sal_True; } -BOOL SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) +sal_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 )) @@ -112,10 +112,10 @@ BOOL SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) aSeq[2] >>= pImp->bMirrored; if ( aSeq[3] >>= aURL ) pImp->aURL = aURL; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } void SfxImageItem::SetRotation( long nValue ) @@ -128,12 +128,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 0342af15e8cb..13c691123537 100644 --- a/svl/source/items/intitem.cxx +++ b/svl/source/items/intitem.cxx @@ -44,11 +44,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)); } //============================================================================ @@ -63,7 +63,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); @@ -111,31 +111,31 @@ SfxItemPresentation SfxInt16Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -BOOL SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const +sal_Bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int16 nValue = m_nValue; rVal <<= nValue; - return TRUE; + return sal_True; } //============================================================================ // virtual -BOOL SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, BYTE ) +sal_Bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 ) { sal_Int16 nValue = sal_Int16(); if (rVal >>= nValue) { m_nValue = nValue; - return TRUE; + return sal_True; } DBG_ERROR( "SfxInt16Item::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //============================================================================ // 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); @@ -143,7 +143,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); @@ -158,14 +158,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; @@ -217,14 +217,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 5c5f106a1c36..d692ca4e896a 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -64,7 +64,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; @@ -82,15 +82,15 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( USHORT nWhich ) const // ----------------------------------------------------------------------- -inline FASTBOOL SfxItemPool::IsItemFlag_Impl( USHORT nPos, USHORT nFlag ) const +inline int 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); } // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsItemFlag( USHORT nWhich, USHORT nFlag ) const +int SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const { for ( const SfxItemPool *pPool = this; pPool; pPool = pPool->pSecondary ) { @@ -98,7 +98,7 @@ FASTBOOL 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; } // ----------------------------------------------------------------------- @@ -115,8 +115,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 @@ -124,9 +124,9 @@ 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 - FASTBOOL bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ + int bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ ) /* [Beschreibung] @@ -156,8 +156,8 @@ SfxItemPool::SfxItemPool [Querverweise] - - + + */ : aName(rName), @@ -182,12 +182,12 @@ 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; pImp->nVerEnd = nEnd; - pImp->bInSetItem = FALSE; + pImp->bInSetItem = sal_False; pImp->nStoringStart = nStartWhich; pImp->nStoringEnd = nEndWhich; @@ -203,10 +203,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 */ ) @@ -241,12 +241,12 @@ 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; pImp->nVerEnd = rPool.pImp->nVerEnd; - pImp->bInSetItem = FALSE; + pImp->bInSetItem = sal_False; pImp->nStoringStart = nStart; pImp->nStoringEnd = nEnd; @@ -256,7 +256,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 ); @@ -268,7 +268,7 @@ 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); @@ -276,8 +276,8 @@ SfxItemPool::SfxItemPool } // Version-Map kopieren - USHORT nVerCount = rPool.pImp->aVersions.Count(); - for ( USHORT nVer = 0; nVer < nVerCount; ++nVer ) + sal_uInt16 nVerCount = rPool.pImp->aVersions.Count(); + for ( sal_uInt16 nVer = 0; nVer < nVerCount; ++nVer ) { const SfxPoolVersion_Impl *pOld = rPool.pImp->aVersions.GetObject(nVer); const SfxPoolVersion_Impl *pNew = new SfxPoolVersion_Impl( *pOld ); @@ -304,7 +304,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" ); @@ -318,11 +318,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 */ ) @@ -341,7 +341,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; } @@ -352,13 +352,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 */ ) @@ -376,7 +376,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" ); @@ -440,13 +440,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 ) { @@ -456,11 +456,11 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) { SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for( USHORT i = (*ppItemArr)->Count(); i; ++ppHtArr, --i ) + for( sal_uInt16 i = (*ppItemArr)->Count(); i; ++ppHtArr, --i ) if ( !(*ppHtArr) ) { DBG_ERROR( "old secondary pool must be empty" ); - bOK = FALSE; + bOK = sal_False; break; } } @@ -486,7 +486,7 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) // ----------------------------------------------------------------------- -SfxMapUnit SfxItemPool::GetMetric( USHORT ) const +SfxMapUnit SfxItemPool::GetMetric( sal_uInt16 ) const { DBG_CHKTHIS(SfxItemPool, 0); @@ -565,7 +565,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" ) @@ -583,7 +583,7 @@ void SfxItemPool::Delete() if ( *ppItemArr ) { SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + for ( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -615,7 +615,7 @@ void SfxItemPool::Delete() if ( *ppItemArr ) { SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + for ( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -649,7 +649,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!! @@ -664,7 +664,7 @@ void SfxItemPool::Cleanup() (*ppStaticDefaultItem)->ISA(SfxSetItem)) ) { SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + for ( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) if ( *ppHtArr && !(*ppHtArr)->GetRefCount() ) { DELETEZ(*ppHtArr); @@ -682,7 +682,7 @@ void SfxItemPool::Cleanup() if ( *ppItemArr ) { SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + for ( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) if ( *ppHtArr && !(*ppHtArr)->GetRefCount() ) DELETEZ( *ppHtArr ); } @@ -719,7 +719,7 @@ void SfxItemPool::SetPoolDefaultItem(const SfxPoolItem &rItem) * Resets the default of the given 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) ) @@ -742,7 +742,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(), @@ -753,7 +753,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 ) @@ -762,7 +762,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 ) ) { @@ -790,7 +790,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) if ( IsPooledItem(&rItem) ) { // 1. Schleife: teste ob der Pointer vorhanden ist. - for( USHORT n = (*ppItemArr)->Count(); n; ++ppHtArray, --n ) + for( sal_uInt16 n = (*ppItemArr)->Count(); n; ++ppHtArray, --n ) if( &rItem == (*ppHtArray) ) { AddRef( **ppHtArray ); @@ -799,7 +799,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) } // 2. Schleife: dann muessen eben die Attribute verglichen werden - USHORT n; + sal_uInt16 n; for ( n = (*ppItemArr)->Count(), ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData(); n; ++ppHtArray, --n ) { @@ -820,7 +820,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) { // freien Platz suchen SfxPoolItem** ppHtArr; - USHORT n, nCount = (*ppItemArr)->Count(); + sal_uInt16 n, nCount = (*ppItemArr)->Count(); for ( n = (*ppItemArr)->nFirstFree, ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData() + n; n < nCount; @@ -878,8 +878,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 ) @@ -891,7 +891,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 || @@ -916,7 +916,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) 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 ) + for( sal_uInt16 n = (*ppItemArr)->Count(); n; ++ppHtArr, --n ) if( *ppHtArr == &rItem ) { if ( (*ppHtArr)->GetRefCount() ) //! @@ -928,7 +928,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) } // ggf. kleinstmoegliche freie Position merken - USHORT nPos = (*ppItemArr)->Count() - n; + sal_uInt16 nPos = (*ppItemArr)->Count() - n; if ( (*ppItemArr)->nFirstFree > nPos ) (*ppItemArr)->nFirstFree = nPos; @@ -946,7 +946,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); @@ -958,7 +958,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; @@ -986,17 +986,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 ) @@ -1009,7 +1009,7 @@ void SfxItemPool::FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const // ----------------------------------------------------------------------- -const SfxPoolItem *SfxItemPool::GetItem(USHORT nWhich, USHORT nOfst) const +const SfxPoolItem *SfxItemPool::GetItem(sal_uInt16 nWhich, sal_uInt16 nOfst) const { DBG_CHKTHIS(SfxItemPool, 0); @@ -1034,7 +1034,7 @@ const SfxPoolItem *SfxItemPool::GetItem(USHORT nWhich, USHORT nOfst) const // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetItemCount(USHORT nWhich) const +sal_uInt16 SfxItemPool::GetItemCount(sal_uInt16 nWhich) const { DBG_CHKTHIS(SfxItemPool, 0); @@ -1054,21 +1054,21 @@ USHORT SfxItemPool::GetItemCount(USHORT nWhich) const // ----------------------------------------------------------------------- -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; } @@ -1080,7 +1080,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; @@ -1094,7 +1094,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 ) @@ -1105,21 +1105,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; } @@ -1131,7 +1131,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; @@ -1153,7 +1153,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 b3be80bc3d0b..eb146afe893b 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -214,9 +214,9 @@ SfxItemPropertySet::~SfxItemPropertySet() /* -----------------------------21.02.00 11:26-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SfxItemPropertySet::FillItem(SfxItemSet&, USHORT, BOOL) const +sal_Bool SfxItemPropertySet::FillItem(SfxItemSet&, sal_uInt16, sal_Bool) const { - return FALSE; + return sal_False; } /* -----------------------------06.06.01 12:32-------------------------------- @@ -227,7 +227,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 @@ -238,7 +238,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 ); @@ -252,7 +252,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 ); } } @@ -292,14 +292,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(); @@ -345,10 +345,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; @@ -368,11 +368,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 a79e5195187a..ce50cbbe84a3 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -53,16 +53,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' #ifdef DBG_UTIL -static ULONG nRangesCopyCount = 0; // wie oft wurden Ranges kopiert +static sal_uIntPtr 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" @@ -70,7 +70,7 @@ DBG_NAME(SfxItemSet) #undef SvNums #undef SfxNumRanges -#define NUMTYPE ULONG +#define NUMTYPE sal_uIntPtr #define SvNums SvULongs #define SfxNumRanges SfxULongRanges #include "nranges.cxx" @@ -87,8 +87,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 ) @@ -118,12 +118,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 ) @@ -155,19 +155,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 ) @@ -182,25 +182,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 ); } @@ -221,27 +221,27 @@ 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); DBG_TRACE1("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); - USHORT nCnt = 0; - const USHORT* pPtr = pWhichPairTable; + sal_uInt16 nCnt = 0; + const sal_uInt16* pPtr = pWhichPairTable; while( *pPtr ) { nCnt += ( *(pPtr+1) - *pPtr ) + 1; @@ -252,14 +252,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), @@ -287,8 +287,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; @@ -299,7 +299,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 +320,8 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ): // dann noch die Which Ranges kopieren DBG_TRACE1("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); 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 +333,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 +367,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 +376,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 +401,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 +423,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 +439,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 +467,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 +483,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 +506,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 +517,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 +563,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 +572,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 +624,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 +643,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 +705,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 +763,7 @@ void SfxItemSet::PutExtended // ----------------------------------------------------------------------- -void SfxItemSet::MergeRange( USHORT nFrom, USHORT nTo ) +void SfxItemSet::MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo ) /**

Description

Expands the ranges of settable items by 'nFrom' to 'nTo'. Keeps state of @@ -771,8 +771,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 +783,7 @@ void SfxItemSet::MergeRange( USHORT nFrom, USHORT nTo ) // ----------------------------------------------------------------------- -void SfxItemSet::SetRanges( const USHORT *pNewRanges ) +void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges ) /**

Description

@@ -795,8 +795,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 +805,20 @@ void SfxItemSet::SetRanges( const USHORT *pNewRanges ) } // create new item-array (by iterating through all new ranges) - ULONG nSize = Capacity_Impl(pNewRanges); + sal_uIntPtr 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 +844,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 +861,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 +880,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 +898,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 +918,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 +943,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 +961,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 +987,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 +997,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 +1053,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 +1084,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 +1113,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 +1132,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 +1155,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 +1184,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 +1203,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 +1228,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 +1313,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 +1333,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 +1344,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 +1365,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 +1401,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 +1423,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 +1445,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 +1479,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 +1492,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; } @@ -1501,22 +1501,22 @@ USHORT SfxItemSet::GetWhichByPos( USHORT nPos ) const SvStream &SfxItemSet::Store ( SvStream& rStream, // Zielstream f"ur normale Items - FASTBOOL bDirect // TRUE: Items direkt speicher, FALSE: Surrogate + int bDirect // sal_True: Items direkt speicher, sal_False: Surrogate ) const /* [Beschreibung] Speichert die -Instanz in den angegebenen Stream. Dabei - werden die Surrorage der gesetzten s bzw. ('bDirect==TRUE') + werden die Surrorage der gesetzten 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 [Querverweise] - + */ { @@ -1525,14 +1525,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_uIntPtr 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 +1552,7 @@ SvStream &SfxItemSet::Store if ( nWrittenCount != _nCount ) { // tats"achlichen Count im Stream ablegen - ULONG nPos = rStream.Tell(); + sal_uIntPtr nPos = rStream.Tell(); rStream.Seek( nCountPos ); rStream << nWrittenCount; rStream.Seek( nPos ); @@ -1568,11 +1568,11 @@ SvStream &SfxItemSet::Load ( SvStream& rStream, // Stream, aus dem geladen werden soll - FASTBOOL bDirect, /* TRUE + int bDirect, /* sal_True 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 +1588,7 @@ SvStream &SfxItemSet::Load [Querverweise] - + */ { @@ -1601,9 +1601,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 +1613,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 +1650,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 +1700,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 +1720,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 +1743,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 +1759,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 +1775,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 +1794,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 +1827,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 +1842,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 +1858,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 +1896,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 +1989,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 +2025,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 +2034,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 ); @@ -2043,18 +2043,18 @@ void SfxItemSet::DisableItem(USHORT nWhich) // ----------------------------------------------------------------------- #if 0 -BOOL SfxAllItemSet::Remove(USHORT nWhich) +sal_Bool SfxAllItemSet::Remove(sal_uInt16 nWhich) { DBG_CHKTHIS(SfxAllItemSet, 0); - USHORT *pPtr = _pWhichRanges; - USHORT nPos = 0; + sal_uInt16 *pPtr = _pWhichRanges; + sal_uInt16 nPos = 0; while( *pPtr ) { if( *pPtr <= nWhich && nWhich <= *(pPtr+1) ) { - USHORT *pTmp = pPtr; - USHORT nLeft = 0; - USHORT nRest = 0; + sal_uInt16 *pTmp = pPtr; + sal_uInt16 nLeft = 0; + sal_uInt16 nRest = 0; while(*++pTmp){ if( nLeft & 1 ) nRest = *pTmp - *(pTmp-1) + 1; @@ -2066,7 +2066,7 @@ BOOL SfxAllItemSet::Remove(USHORT nWhich) nRest -= nWhich - *pPtr; // 3,3 if(*pPtr == nWhich && *(pPtr+1) == nWhich) { - memmove(pPtr, pPtr + 2, nLeft * sizeof(USHORT)); + memmove(pPtr, pPtr + 2, nLeft * sizeof(sal_uInt16)); nFree += 2; } // Anfang @@ -2077,12 +2077,12 @@ BOOL SfxAllItemSet::Remove(USHORT nWhich) (*(pPtr+1))--; else { if(nPos + nRest + 2 > nFree) { - USHORT nOf = pPtr - _pWhichRanges; + sal_uInt16 nOf = pPtr - _pWhichRanges; _pWhichRanges = IncrSize(_pWhichRanges, nPos + nRest, nInitCount); nFree += nInitCount; pPtr = _pWhichRanges + nOf; } - memmove(pPtr +2, pPtr, (nLeft+2) * sizeof(USHORT)); + memmove(pPtr +2, pPtr, (nLeft+2) * sizeof(sal_uInt16)); *++pPtr = nWhich-1; *++pPtr = nWhich+1; nFree -= 2; @@ -2103,13 +2103,13 @@ BOOL SfxAllItemSet::Remove(USHORT nWhich) nPos += *(pPtr+1) - *pPtr + 1; pPtr += 2; } - return *pPtr? TRUE: FALSE; + return *pPtr? sal_True: sal_False; } #endif // ----------------------------------------------------------------------- -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 f1845fc251ee..38fe0d394f6e 100644 --- a/svl/source/items/lckbitem.cxx +++ b/svl/source/items/lckbitem.cxx @@ -50,7 +50,7 @@ SfxLockBytesItem::SfxLockBytesItem() // ----------------------------------------------------------------------- -SfxLockBytesItem::SfxLockBytesItem( USHORT nW, SvLockBytes *pLockBytes ) +SfxLockBytesItem::SfxLockBytesItem( sal_uInt16 nW, SvLockBytes *pLockBytes ) : SfxPoolItem( nW ), _xVal( pLockBytes ) { @@ -58,11 +58,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; @@ -100,16 +100,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_uIntPtr nActRead = 0; sal_Char cTmpBuf[MAX_BUF]; SvMemoryStream aNewStream; rStream >> nSize; do { - ULONG nToRead; + sal_uIntPtr nToRead; if( (nSize - nActRead) > MAX_BUF ) nToRead = MAX_BUF; else @@ -123,7 +123,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 ); @@ -137,7 +137,7 @@ SvStream& SfxLockBytesItem::Store(SvStream &rStream, USHORT ) const //---------------------------------------------------------------------------- // virtual -BOOL SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) +sal_Bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Sequence< sal_Int8 > aSeq; if ( rVal >>= aSeq ) @@ -148,21 +148,21 @@ 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; - return TRUE; + return sal_True; } DBG_ERROR( "SfxLockBytesItem::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //---------------------------------------------------------------------------- // virtual -BOOL SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const +sal_Bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const { if ( _xVal.Is() ) { @@ -172,9 +172,9 @@ BOOL SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const if ( _xVal->Stat( &aStat, SVSTATFLAG_DEFAULT ) == ERRCODE_NONE ) nLen = aStat.nSize; else - return FALSE; + return sal_False; - ULONG nRead = 0; + sal_uIntPtr nRead = 0; com::sun::star::uno::Sequence< sal_Int8 > aSeq( nLen ); _xVal->ReadAt( 0, aSeq.getArray(), nLen, &nRead ); @@ -186,6 +186,6 @@ BOOL SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const rVal <<= aSeq; } - return TRUE; + return sal_True; } diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index acaa66839981..1cd7e194d266 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -121,7 +121,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; @@ -130,7 +130,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); @@ -156,14 +156,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 ) @@ -173,7 +173,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; @@ -203,20 +203,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; } // ----------------------------------------------------------------------- @@ -257,14 +257,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 ); @@ -273,7 +273,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)) ) @@ -287,7 +287,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/nranges.cxx b/svl/source/items/nranges.cxx index 813c1fec8ebd..3684a748db14 100644 --- a/svl/source/items/nranges.cxx +++ b/svl/source/items/nranges.cxx @@ -63,7 +63,7 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *&rpRanges, va_list pArgs, /**

Description

- 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. @@ -73,7 +73,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++ ); @@ -232,20 +232,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; @@ -253,12 +253,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; } //------------------------------------------------------------------------ @@ -776,21 +776,21 @@ SfxNumRanges& SfxNumRanges::operator /= //------------------------------------------------------------------------ -BOOL SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const +sal_Bool SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const /**

Description

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; @@ -810,12 +810,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; } //------------------------------------------------------------------------ @@ -834,7 +834,7 @@ NUMTYPE SfxNumRanges::Count() const //------------------------------------------------------------------------ -BOOL SfxNumRanges::Contains( NUMTYPE n ) const +sal_Bool SfxNumRanges::Contains( NUMTYPE n ) const /**

Description

@@ -844,7 +844,7 @@ 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 b918add10f0f..adeef1d75a93 100644 --- a/svl/source/items/poolcach.cxx +++ b/svl/source/items/poolcach.cxx @@ -84,7 +84,7 @@ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool, SfxItemPoolCache::~SfxItemPoolCache() { DBG_DTOR(SfxItemPoolCache, 0); - for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos ) { + for ( sal_uInt16 nPos = 0; nPos < pCache->Count(); ++nPos ) { pPool->Remove( *(*pCache)[nPos].pPoolItem ); pPool->Remove( *(*pCache)[nPos].pOrigItem ); } @@ -96,7 +96,7 @@ 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" ); @@ -104,7 +104,7 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, BOOL b "original not in pool" ); // Suchen, ob diese Transformations schon einmal vorkam - for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < pCache->Count(); ++nPos ) { SfxItemModifyImpl &rMapEntry = (*pCache)[nPos]; if ( rMapEntry.pOrigItem == &rOrigItem ) diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index 6aeb64d76d1a..19efb02c4cef 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -99,43 +99,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 @@ -150,7 +150,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 @@ -160,8 +160,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 @@ -178,14 +178,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 ( sal_uInt16 nVerNo = 0; nVerNo < pImp->aVersions.Count(); ++nVerNo ) { aVerRec.NewContent(); SfxPoolVersion_Impl *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; @@ -193,7 +193,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); } } @@ -202,15 +202,15 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const SfxMultiMixRecordWriter aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS, 0 ); // erst Atomaren-Items und dann die Sets schreiben (wichtig beim Laden) - for ( pImp->bInSetItem = FALSE; pImp->bInSetItem <= TRUE && !rStream.GetError(); ++pImp->bInSetItem ) + for ( pImp->bInSetItem = sal_False; pImp->bInSetItem <= sal_True && !rStream.GetError(); ++pImp->bInSetItem ) { 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 ( sal_uInt16 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,17 +225,17 @@ 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(); + const sal_uInt16 nCount = (*pArr)->Count(); DBG_ASSERT(nCount, "ItemArr ist leer"); rStream << nCount; // Items an sich schreiben SfxMultiMixRecordWriter aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS, 0 ); - for ( USHORT j = 0; j < nCount; ++j ) + for ( sal_uInt16 j = 0; j < nCount; ++j ) { // Item selbst besorgen const SfxPoolItem *pItem = (*pArr)->GetObject(j); @@ -244,10 +244,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const aItemsRec.NewContent(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_uIntPtr 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; @@ -274,27 +274,27 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const } } - pImp->bInSetItem = FALSE; + pImp->bInSetItem = sal_False; } // die gesetzten Defaults speichern (Pool-Defaults) 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 ) + for( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -382,7 +382,7 @@ 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_uInt16 nItemCount, sal_uInt16 nVersion, SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** ppArr) { SfxMultiRecordReader aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS ); @@ -390,11 +390,11 @@ void SfxItemPool::readTheItems ( SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl( nItemCount ); SfxPoolItem *pItem = 0; - USHORT n, nLastSurrogate = USHORT(-1); + sal_uInt16 n, nLastSurrogate = sal_uInt16(-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" ); @@ -404,7 +404,7 @@ void SfxItemPool::readTheItems ( nLastSurrogate = nSurrogate; // Ref-Count und Item laden - USHORT nRef; + sal_uInt16 nRef; rStream >> nRef; pItem = pDefItem->Create(rStream, nVersion); @@ -430,7 +430,7 @@ void SfxItemPool::readTheItems ( *ppArr = pNewArr; // die Items merken, die schon im Pool sind - int bEmpty = TRUE; + int bEmpty = sal_True; if ( 0 != pOldArr ) for ( n = 0; bEmpty && n < pOldArr->Count(); ++n ) bEmpty = pOldArr->GetObject(n) == 0; @@ -438,15 +438,15 @@ void SfxItemPool::readTheItems ( if ( !bEmpty ) { // f"ur alle alten suchen, ob ein gleiches neues existiert - for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld ) + for ( sal_uInt16 nOld = 0; nOld < pOldArr->Count(); ++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_uInt16 nFree = USHRT_MAX; + int bFound = sal_False; + sal_uInt16 nCount = (*ppArr)->Count(); + for ( sal_uInt16 nNew = nCount; !bFound && nNew--; ) { // geladenes Item SfxPoolItem *&rpNewItem = @@ -464,7 +464,7 @@ void SfxItemPool::readTheItems ( SetRefCount( *rpNewItem, 0 ); delete rpNewItem; rpNewItem = pOldItem; - bFound = TRUE; + bFound = sal_True; } } @@ -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( 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 ) + for( sal_uInt16 n = (*ppItemArr)->Count(); 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() ) { // neue Version hinzufuegen - USHORT *pMap = new USHORT[nCount]; - for ( USHORT n = 0; n < nCount; ++n ) + sal_uInt16 *pMap = new sal_uInt16[nCount]; + for ( sal_uInt16 n = 0; n < nCount; ++n ) rStream >> pMap[n]; SetVersionMap( nVersion, nHStart, nHEnd, pMap ); } @@ -625,15 +625,15 @@ SvStream &SfxItemPool::Load(SvStream &rStream) } // Items laden - FASTBOOL bSecondaryLoaded = FALSE; + int bSecondaryLoaded = sal_False; long nSecondaryEnd = 0; { SfxMultiRecordReader aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS); while ( aWhichIdsRec.GetContent() ) { // SlotId, Which-Id und Item-Version besorgen - USHORT nCount, nVersion, nWhich; - //!USHORT nSlotId = aWhichIdsRec.GetContentTag(); + sal_uInt16 nCount, 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 +646,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,12 +659,12 @@ SvStream &SfxItemPool::Load(SvStream &rStream) if ( !bSecondaryLoaded && pSecondary && pImp->bInSetItem ) { // an das Ende des eigenen Pools seeken - ULONG nLastPos = rStream.Tell(); + sal_uIntPtr nLastPos = rStream.Tell(); aPoolRec.Skip(); // Sekund"arpool einlesen pSecondary->Load( rStream ); - bSecondaryLoaded = TRUE; + bSecondaryLoaded = sal_True; nSecondaryEnd = rStream.Tell(); // zur"uck zu unseren eigenen Items @@ -674,7 +674,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 +685,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 +697,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 +723,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) if ( aExternName != aName ) aName.Erase(); - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; }; @@ -739,19 +739,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 +760,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 +768,20 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) rStream >> nAttribSize; // Size-Table einlesen - ULONG nStartPos = rStream.Tell(); + sal_uIntPtr 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_uIntPtr 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_uIntPtr der Size-Table gibt Pos an) rStream.Seek( nEndOfSizes - sizeof(sal_uInt32) ); sal_uInt32 nVersionMapPos; rStream >> nVersionMapPos; @@ -789,22 +789,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() ) { // neue Version hinzufuegen - USHORT *pMap = new USHORT[nCount]; - for ( USHORT n = 0; n < nCount; ++n ) + sal_uInt16 *pMap = new sal_uInt16[nCount]; + for ( sal_uInt16 n = 0; n < nCount; ++n ) rStream >> pMap[n]; SetVersionMap( nVersion, nHStart, nHEnd, pMap ); } @@ -817,9 +817,9 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) // Items laden rStream.Seek( nStartPos ); CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_ITEMS ); - FASTBOOL bSecondaryLoaded = FALSE; + int bSecondaryLoaded = sal_False; long nSecondaryEnd = 0; - USHORT nWhich, nSlot; + sal_uInt16 nWhich, nSlot; while ( rStream >> nWhich, nWhich ) { // ggf. Which-Id aus alter Version verschieben? @@ -827,10 +827,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 +843,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 ); pDefItem = *(ppStaticDefaults + nIndex); } // Position vor ersten Item merken - ULONG nLastPos = rStream.Tell(); + sal_uIntPtr nLastPos = rStream.Tell(); // SfxSetItems k"onnten Items aus Sekund"arpools beinhalten if ( !bSecondaryLoaded && pSecondary && pDefItem->ISA(SfxSetItem) ) @@ -866,7 +866,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) // Sekund"arpool einlesen pSecondary->Load1_Impl( rStream ); - bSecondaryLoaded = TRUE; + bSecondaryLoaded = sal_True; nSecondaryEnd = rStream.Tell(); // zur"uck zu unseren eigenen Items @@ -874,9 +874,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_uIntPtr nPos = nLastPos; rStream >> nRef; if ( bKnownItem ) @@ -922,21 +922,21 @@ 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 ) + for ( sal_uInt16 n = 0; bEmpty && n < pOldArr->Count(); ++n ) bEmpty = pOldArr->GetObject(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 ( sal_uInt16 nOld = 0; nOld < pOldArr->Count(); ++nOld ) { SfxPoolItem *pOldItem = (*pOldArr)[nOld]; if ( pOldItem ) { - int bFound = FALSE; - for ( USHORT nNew = 0; + int bFound = sal_False; + for ( sal_uInt16 nNew = 0; !bFound && nNew < (*ppArr)->Count(); ++nNew ) { @@ -949,7 +949,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) SetRefCount( *rpNewItem, 0 ); delete rpNewItem; rpNewItem = pOldItem; - bFound = TRUE; + bFound = sal_True; SFX_TRACE( "reusing item", 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_uIntPtr 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_uIntPtr 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 s - USHORT nSlotId, // Slot-Id des zu ladenden s + sal_uInt16& rWhich, // Which-Id des zu ladenden s + sal_uInt16 nSlotId, // Slot-Id des zu ladenden s const SfxItemPool* pRefPool // in dem das Surrogat gilt ) @@ -1072,7 +1072,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate { // erstmal das Surrogat lesen - USHORT nSurrogat; + sal_uInt16 nSurrogat; rStream >> nSurrogat; // direkt gespeichertes Item? @@ -1090,17 +1090,17 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate // auf jeden Fall aufgel"ost werden. if ( !pRefPool ) pRefPool = this; - FASTBOOL bResolvable = pRefPool->GetName().Len() > 0; + int bResolvable = pRefPool->GetName().Len() > 0; if ( !bResolvable ) { // 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; } } @@ -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; @@ -1153,7 +1153,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::StoreSurrogate +int SfxItemPool::StoreSurrogate ( SvStream& rStream, const SfxPoolItem* pItem @@ -1166,13 +1166,13 @@ FASTBOOL SfxItemPool::StoreSurrogate [R"uckgabewert] - FASTBOOL TRUE + int sal_True es wurde ein echtes Surrogat gespeichert, auch SFX_ITEMS_NULL bei 'pItem==0', 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 @@ -1181,20 +1181,20 @@ FASTBOOL SfxItemPool::StoreSurrogate { if ( pItem ) { - FASTBOOL bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); + int bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); rStream << ( bRealSurrogate ? GetSurrogate( pItem ) - : (UINT16) SFX_ITEMS_DIRECT ); + : (sal_uInt16) SFX_ITEMS_DIRECT ); return bRealSurrogate; } - rStream << (UINT16) SFX_ITEMS_NULL; - return TRUE; + rStream << (sal_uInt16) SFX_ITEMS_NULL; + return sal_True; } // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const +sal_uInt16 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const { DBG_CHKTHIS(SfxItemPool, 0); DBG_ASSERT( pItem, "no 0-Pointer Surrogate" ); @@ -1214,8 +1214,8 @@ USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const 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 ) + const sal_uInt16 nCount = pItemArr->Count(); + for ( sal_uInt16 i = 0; i < nCount; ++i ) { const SfxPoolItem *p = (*pItemArr)[i]; if ( p == pItem ) @@ -1227,7 +1227,7 @@ USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsInStoringRange( USHORT nWhich ) const +int SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const { return nWhich >= pImp->nStoringStart && nWhich <= pImp->nStoringEnd; @@ -1235,7 +1235,7 @@ FASTBOOL 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,14 +1313,14 @@ 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] - + */ @@ -1335,9 +1335,9 @@ void SfxItemPool::SetVersionMap 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] - + */ @@ -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 ( sal_uInt16 nMap = pImp->aVersions.Count(); nMap > 0; --nMap ) { SfxPoolVersion_Impl *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,7 +1424,7 @@ 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 ( sal_uInt16 nMap = 0; nMap < pImp->aVersions.Count(); ++nMap ) { SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap]; if ( pVerInfo->_nVer > pImp->nLoadingVersion ) @@ -1444,14 +1444,14 @@ USHORT SfxItemPool::GetNewWhich // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsInVersionsRange( USHORT nWhich ) const +int SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const { return nWhich >= pImp->nVerStart && nWhich <= pImp->nVerEnd; } // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsCurrentVersionLoading() const +int SfxItemPool::IsCurrentVersionLoading() const /* [Beschreibung] @@ -1465,8 +1465,8 @@ FASTBOOL SfxItemPool::IsCurrentVersionLoading() const [Querverweise] - - + + */ @@ -1478,7 +1478,7 @@ FASTBOOL SfxItemPool::IsCurrentVersionLoading() const // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetVersion() const +sal_uInt16 SfxItemPool::GetVersion() const /* [Beschreibung] @@ -1499,8 +1499,8 @@ USHORT SfxItemPool::GetVersion() const [Querverweise] - - + + */ @@ -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] - - + + */ @@ -1542,7 +1542,7 @@ USHORT SfxItemPool::GetLoadingVersion() const //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsVer2_Impl() const +int SfxItemPool::IsVer2_Impl() const { return pMaster->pImp->nMajorVer >= 2; } @@ -1550,82 +1550,82 @@ FASTBOOL SfxItemPool::IsVer2_Impl() const //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, - FASTBOOL bDirect ) const +int SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, + int bDirect ) const /* [Beschreibung] Speichert das 'rItem' in den '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_uIntPtr Size Size rItem.Store() [Querverweise] - + */ { 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_uIntPtr nIStart = rStream.Tell(); rItem.Store(rStream, nItemVersion); - ULONG nIEnd = rStream.Tell(); + sal_uIntPtr nIEnd = rStream.Tell(); rStream.Seek( nIStart-4 ); - rStream << (INT32) ( nIEnd-nIStart ); + rStream << (sal_Int32) ( nIEnd-nIStart ); rStream.Seek( nIEnd ); } - return TRUE; + return sal_True; } //------------------------------------------------------------------------- -const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, +const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, int bDirect, const SfxItemPool *pRefPool ) // 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,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, else { // WID in der Version nicht vorhanden => ueberspringen - USHORT nSurro, nVersion, nLen; + sal_uInt16 nSurro, nVersion, nLen; rStream >> nSurro; if ( SFX_ITEMS_DIRECT == nSurro ) { @@ -1649,7 +1649,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, } // wird eine andere Version geladen? - FASTBOOL bCurVersion = pRefPool->IsCurrentVersionLoading(); + int bCurVersion = pRefPool->IsCurrentVersionLoading(); if ( !bCurVersion ) // Which-Id auf neue Version mappen nWhich = pRefPool->GetNewWhich( nWhich ); @@ -1668,17 +1668,17 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL 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_uIntPtr nIStart = rStream.Tell(); // Which-Id in dieser Version bekannt? if ( nWhich ) @@ -1696,7 +1696,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, } else pItem = 0; - ULONG nIEnd = rStream.Tell(); + sal_uIntPtr 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 77cf3dfff014..1f61b336a18a 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -38,18 +38,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_uIntPtr nSfxFlag32Val[32] = { 0x1L, 0x2L, 0x4L, 0x8L, 0x10L, 0x20L, 0x40L, 0x80L, @@ -71,7 +71,7 @@ TYPEINIT1(SfxSetItem, SfxPoolItem); // ------------------------------------------------------------------------ #if OSL_DEBUG_LEVEL > 1 -static ULONG nItemCount = 0; +static sal_uIntPtr nItemCount = 0; const char* pw1 = "Wow! 10.000 items!"; const char* pw2 = "Wow! 100.000 items!"; @@ -83,7 +83,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 ) @@ -192,26 +192,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; @@ -269,7 +269,7 @@ SfxItemPresentation SfxPoolItem::GetPresentation von allen UI-relevanten SfxPoolItem-Subklassen "uberladen werden. Da die Ma\seinheit des Wertes im SfxItemPool nur "uber - erfragbar ist, und nicht etwa + erfragbar ist, und nicht etwa in der SfxPoolItem-Instanz oder -Subklasse verf"ugbar ist, wird die eigene Ma\seinheit als 'eCoreMetric' "ubergeben. @@ -312,7 +312,7 @@ SfxItemPresentation SfxPoolItem::GetPresentation } // SfxVoidItem ------------------------------------------------------------ -SfxVoidItem::SfxVoidItem( USHORT which ): +SfxVoidItem::SfxVoidItem( sal_uInt16 which ): SfxPoolItem(which) { DBG_CTOR(SfxVoidItem, 0); @@ -334,7 +334,7 @@ rCmp { DBG_CHKTHIS(SfxVoidItem, 0); DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" ); - return TRUE; + return sal_True; } // ------------------------------------------------------------------------ @@ -361,7 +361,7 @@ SfxPoolItem* SfxVoidItem::Clone(SfxItemPool *) const // SfxInvalidItem --------------------------------------------------------- #if 0 /* @@@ NOT USED @@@ */ -SfxInvalidItem::SfxInvalidItem( USHORT nWhich, const SfxPoolItem &rDefault ): +SfxInvalidItem::SfxInvalidItem( sal_uInt16 nWhich, const SfxPoolItem &rDefault ): SfxPoolItem(nWhich), pDefaultItem(&rDefault) { @@ -414,7 +414,7 @@ SfxPoolItem* SfxInvalidItem::Clone(SfxItemPool *) const } // ------------------------------------------------------------------------ -SfxPoolItem* SfxInvalidItem::Create(SvStream &, USHORT nVersion) const +SfxPoolItem* SfxInvalidItem::Create(SvStream &, sal_uInt16 nVersion) const { DBG_CHKTHIS(SfxInvalidItem, 0); DBG_ERROR("SfxInvalidItem::Create() ist sinnlos"); @@ -422,7 +422,7 @@ SfxPoolItem* SfxInvalidItem::Create(SvStream &, USHORT nVersion) const } // ------------------------------------------------------------------------ -SvStream& SfxInvalidItem::Store(SvStream &rStream, USHORT nItemVersion ) const +SvStream& SfxInvalidItem::Store(SvStream &rStream, sal_uInt16 nItemVersion ) const { DBG_CHKTHIS(SfxInvalidItem, 0); DBG_ERROR("SfxInvalidItem::Store() ist sinnlos"); @@ -432,7 +432,7 @@ SvStream& SfxInvalidItem::Store(SvStream &rStream, USHORT nItemVersion ) const // SfxItemHandle ---------------------------------------------------------- SfxItemHandle::SfxItemHandle(SfxPoolItem &rItem): - pRef(new USHORT(1)), + pRef(new sal_uInt16(1)), pItem(rItem.Clone(0)) { DBG_CTOR(SfxItemHandle, 0); @@ -504,18 +504,18 @@ void SfxPoolItem::Store(SvStream &rStream) const // ----------------------------------------------------------------------- -BOOL SfxPoolItem::QueryValue( com::sun::star::uno::Any&, BYTE ) const +sal_Bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8 ) const { DBG_ERROR("There is no implementation for QueryValue for this item!"); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL SfxPoolItem::PutValue( const com::sun::star::uno::Any&, BYTE ) +sal_Bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8 ) { DBG_ERROR("There is no implementation for PutValue for this item!"); - return FALSE; + return sal_False; } SfxVoidItem::~SfxVoidItem() diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx index 3c12745e5967..cd557312932c 100644 --- a/svl/source/items/ptitem.cxx +++ b/svl/source/items/ptitem.cxx @@ -57,7 +57,7 @@ SfxPointItem::SfxPointItem() // ----------------------------------------------------------------------- -SfxPointItem::SfxPointItem( USHORT nW, const Point& rVal ) : +SfxPointItem::SfxPointItem( sal_uInt16 nW, const Point& rVal ) : SfxPoolItem( nW ), aVal( rVal ) { @@ -66,7 +66,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); @@ -120,7 +120,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; @@ -130,7 +130,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; @@ -139,8 +139,8 @@ SvStream& SfxPointItem::Store(SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- -BOOL SfxPointItem::QueryValue( uno::Any& rVal, - BYTE nMemberId ) const +sal_Bool SfxPointItem::QueryValue( uno::Any& rVal, + sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); awt::Point aTmp(aVal.X(), aVal.Y()); @@ -155,20 +155,20 @@ BOOL SfxPointItem::QueryValue( uno::Any& rVal, case 0: rVal <<= aTmp; break; case MID_X: rVal <<= aTmp.X; break; case MID_Y: rVal <<= aTmp.Y; break; - default: DBG_ERROR("Wrong MemberId!"); return FALSE; + default: DBG_ERROR("Wrong MemberId!"); return sal_False; } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL SfxPointItem::PutValue( const uno::Any& rVal, - BYTE nMemberId ) +sal_Bool SfxPointItem::PutValue( const uno::Any& rVal, + sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; awt::Point aValue; sal_Int32 nVal = 0; if ( !nMemberId ) @@ -194,7 +194,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: DBG_ERROR("Wrong MemberId!"); return FALSE; + default: DBG_ERROR("Wrong MemberId!"); return sal_False; } } diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx index 893ac3c125b0..7aae8caceac5 100644 --- a/svl/source/items/rectitem.cxx +++ b/svl/source/items/rectitem.cxx @@ -54,7 +54,7 @@ SfxRectangleItem::SfxRectangleItem() // ----------------------------------------------------------------------- -SfxRectangleItem::SfxRectangleItem( USHORT nW, const Rectangle& rVal ) : +SfxRectangleItem::SfxRectangleItem( sal_uInt16 nW, const Rectangle& rVal ) : SfxPoolItem( nW ), aVal( rVal ) { @@ -63,7 +63,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); @@ -120,7 +120,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; @@ -130,7 +130,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; @@ -139,8 +139,8 @@ SvStream& SfxRectangleItem::Store(SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- -BOOL SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId) const +sal_Bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -157,17 +157,17 @@ BOOL SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, case MID_RECT_RIGHT: rVal <<= aVal.getY(); break; case MID_WIDTH: rVal <<= aVal.getWidth(); break; case MID_HEIGHT: rVal <<= aVal.getHeight(); break; - default: DBG_ERROR("Wrong MemberID!"); return FALSE; + default: DBG_ERROR("Wrong MemberID!"); return sal_False; } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) +sal_Bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; nMemberId &= ~CONVERT_TWIPS; com::sun::star::awt::Rectangle aValue; sal_Int32 nVal = 0; @@ -190,7 +190,7 @@ BOOL SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, case MID_RECT_RIGHT: aVal.setY( nVal ); break; case MID_WIDTH: aVal.setWidth( nVal ); break; case MID_HEIGHT: aVal.setHeight( nVal ); break; - default: DBG_ERROR("Wrong MemberID!"); return FALSE; + default: DBG_ERROR("Wrong MemberID!"); return sal_False; } } diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx index 2f9c58a362f6..2bb4fb4236c9 100644 --- a/svl/source/items/rngitem.cxx +++ b/svl/source/items/rngitem.cxx @@ -31,7 +31,7 @@ #ifndef NUMTYPE -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SfxXRangeItem SfxRangeItem #define SfxXRangesItem SfxUShortRangesItem #include diff --git a/svl/source/items/rngitem_inc.cxx b/svl/source/items/rngitem_inc.cxx old mode 100644 new mode 100755 index ab8852756f7d..a9d68980ec6a --- a/svl/source/items/rngitem_inc.cxx +++ b/svl/source/items/rngitem_inc.cxx @@ -52,7 +52,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 ) @@ -62,7 +62,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; @@ -115,7 +115,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; @@ -125,7 +125,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; @@ -141,7 +141,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; @@ -151,7 +151,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; @@ -185,9 +185,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 ) @@ -218,14 +218,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 e76b3854c6be..f22c1cb7c26a 100644 --- a/svl/source/items/sfontitm.cxx +++ b/svl/source/items/sfontitm.cxx @@ -72,7 +72,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()); @@ -104,8 +104,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; @@ -116,7 +116,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); { @@ -130,8 +130,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 4a9c0af096ea..7f990aec36d3 100644 --- a/svl/source/items/sitem.cxx +++ b/svl/source/items/sitem.cxx @@ -45,16 +45,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) { @@ -66,7 +66,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); } @@ -105,7 +105,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 ec9757e278a8..6d183f111814 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.cxx @@ -45,12 +45,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* ); }; //------------------------------------------------------------------------ @@ -69,36 +69,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_uIntPtr 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_uIntPtr 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 ) @@ -123,7 +123,7 @@ SfxStringListItem::SfxStringListItem() : //------------------------------------------------------------------------ -SfxStringListItem::SfxStringListItem( USHORT which, const List* pList ) : +SfxStringListItem::SfxStringListItem( sal_uInt16 which, const List* pList ) : SfxPoolItem( which ), pImp(NULL) { @@ -146,7 +146,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) { @@ -214,9 +214,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; } //------------------------------------------------------------------------ @@ -250,14 +250,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 ) { @@ -347,14 +347,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 ) @@ -393,22 +393,22 @@ void SfxStringListItem::GetStringList( com::sun::star::uno::Sequence< rtl::OUStr //---------------------------------------------------------------------------- // virtual -BOOL SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal,BYTE ) +sal_Bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal,sal_uInt8 ) { com::sun::star::uno::Sequence< rtl::OUString > aValue; if ( rVal >>= aValue ) { SetStringList( aValue ); - return TRUE; + return sal_True; } DBG_ERROR( "SfxStringListItem::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //---------------------------------------------------------------------------- // virtual -BOOL SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const +sal_Bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const { // GetString() is not const!!! SfxStringListItem* pThis = const_cast< SfxStringListItem * >( this ); @@ -416,7 +416,7 @@ BOOL SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const com::sun::star::uno::Sequence< rtl::OUString > aStringList; pThis->GetStringList( aStringList ); rVal = ::com::sun::star::uno::makeAny( aStringList ); - return TRUE; + return sal_True; } diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index cc033bc6905e..225a5b99907b 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -99,7 +99,7 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames() const int nCount = sizeof( aTranslitNames ) / sizeof( aTranslitNames[0] ); 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; @@ -128,7 +128,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : bBackward ( sal_False ), bPattern ( sal_False ), bContent ( sal_False ), - bAsianOptions ( FALSE ) + bAsianOptions ( sal_False ) { EnableNotification( lcl_GetNotifyNames() ); @@ -145,7 +145,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; @@ -229,7 +229,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 && @@ -425,7 +425,7 @@ void SvxSearchItem::SetTransliterationFlags( sal_Int32 nFlags ) aSearchOpt.transliterateFlags = nFlags; } -sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const +sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -513,7 +513,7 @@ sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMember // ----------------------------------------------------------------------- -sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) +sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = sal_False; diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx index 6568dc3a99f5..de2d97d23c6a 100644 --- a/svl/source/items/stritem.cxx +++ b/svl/source/items/stritem.cxx @@ -39,7 +39,7 @@ TYPEINIT1_AUTOFACTORY(SfxStringItem, CntUnencodedStringItem) //============================================================================ // virtual -SfxStringItem::SfxStringItem(USHORT which, SvStream & rStream): +SfxStringItem::SfxStringItem(sal_uInt16 which, SvStream & rStream): CntUnencodedStringItem(which) { UniString aValue; @@ -50,14 +50,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 60c622208d53..1d8c25c085d9 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -54,7 +54,7 @@ #include #define STYLESTREAM "SfxStyleSheets" -#define STYLESTREAM_VERSION USHORT(50) +#define STYLESTREAM_VERSION sal_uInt16(50) #ifdef DBG_UTIL class DbgStyleSheetReferences @@ -86,7 +86,7 @@ TYPEINIT1(SfxStyleSheetPoolHint, SfxHint); SfxStyleSheetHintExtended::SfxStyleSheetHintExtended ( - USHORT nAction, // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) const String& rOldName ) : SfxStyleSheetHint( nAction ), @@ -94,7 +94,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 ) @@ -106,7 +106,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 ), @@ -115,7 +115,7 @@ SfxStyleSheetHint::SfxStyleSheetHint SfxStyleSheetHint::SfxStyleSheetHint ( - USHORT nAction // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction // SFX_STYLESHEET_... (s.o.) ) : pStyleSh( NULL ), nHint( nAction ) @@ -137,7 +137,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 ) @@ -146,7 +146,7 @@ SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBaseP , pSet( NULL ) , nMask(mask) , nHelpId( 0 ) - , bMySet( FALSE ) + , bMySet( sal_False ) { #ifdef DBG_UTIL aDbgStyleSheetReferences.mnStyles++; @@ -206,7 +206,7 @@ SfxStyleSheetBase::~SfxStyleSheetBase() } } -USHORT SfxStyleSheetBase::GetVersion() const +sal_uInt16 SfxStyleSheetBase::GetVersion() const { return 0x0000; } @@ -218,24 +218,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; @@ -243,7 +243,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 @@ -270,10 +270,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 ) { @@ -281,20 +281,20 @@ BOOL SfxStyleSheetBase::SetParent( const XubString& rName ) if( rName.Len() && !pIter ) { DBG_ERROR( "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 @@ -304,19 +304,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 ) ) { DBG_ERROR( "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. @@ -326,20 +326,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_uIntPtr SfxStyleSheetBase::GetHelpId( String& rFile ) { rFile = aHelpFile; return nHelpId; } -void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId ) +void SfxStyleSheetBase::SetHelpId( const String& rFile, sal_uIntPtr nId ) { aHelpFile = rFile; nHelpId = nId; @@ -347,30 +347,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 @@ -417,30 +417,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; @@ -451,13 +451,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; iaStyles.size(); i++) + for(sal_uInt16 i=0; iaStyles.size(); i++) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[i].get(); if(DoesStyleMatch(pStyle)) @@ -466,13 +466,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; naStyles.size(); n++) + sal_uInt16 z = 0; + for(sal_uInt16 n=0; naStyles.size(); n++) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); if( DoesStyleMatch(pStyle)) @@ -491,12 +491,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(); @@ -509,7 +509,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First() if ( nIdx != -1 ) { - nAktPosition = (USHORT)nIdx; + nAktPosition = (sal_uInt16)nIdx; return pAktStyle = pBasePool->aStyles[nIdx].get(); } return 0; @@ -518,13 +518,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(); @@ -537,7 +537,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() if ( nIdx != -1 ) { - nAktPosition = (USHORT)nIdx; + nAktPosition = (sal_uInt16)nIdx; return pAktStyle = pBasePool->aStyles[nIdx].get(); } return 0; @@ -546,11 +546,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 ) ) @@ -563,9 +563,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; @@ -637,7 +637,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 = @@ -646,16 +646,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; } @@ -675,7 +675,7 @@ String SfxStyleSheetBasePool::GetStreamName() SfxStyleSheetIterator* SfxStyleSheetBasePool::CreateIterator ( SfxStyleFamily eFam, - USHORT mask + sal_uInt16 mask ) { return new SfxStyleSheetIterator(this,eFam,mask); @@ -686,7 +686,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create ( const XubString& rName, SfxStyleFamily eFam, - USHORT mask + sal_uInt16 mask ) { return new SfxStyleSheetBase( rName, *this, eFam, mask ); @@ -697,7 +697,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) { DBG_ASSERT( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); @@ -765,19 +765,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); @@ -866,9 +866,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() ) { @@ -885,7 +885,7 @@ void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld, /////////////////////////// Laden/Speichern ///////////////////////////////// -void SfxStyleSheetBase::Load( SvStream&, USHORT ) +void SfxStyleSheetBase::Load( SvStream&, sal_uInt16 ) { } @@ -894,7 +894,7 @@ void SfxStyleSheetBase::Store( SvStream& ) } -BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) +sal_Bool SfxStyleSheetBasePool::Load( SvStream& rStream ) { // alte Version? if ( !rPool.IsVer2_Impl() ) @@ -909,7 +909,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; @@ -920,15 +920,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? @@ -938,7 +938,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 ); @@ -952,7 +952,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) { @@ -966,8 +966,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 ); @@ -975,13 +975,13 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) } // #72939# only loop through the styles that were really inserted - ULONG n = aStyles.size(); + sal_uIntPtr 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_uIntPtr i = 0; i < n; i++ ) { SfxStyleSheetBase* p = aStyles[ i ].get(); XubString aText = p->aParent; @@ -996,13 +996,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; @@ -1013,13 +1013,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? @@ -1032,7 +1032,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 ); @@ -1041,7 +1041,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) SfxPoolItem::readByteString(rStream, aHelpFile); if(nVersion!=STYLESTREAM_VERSION) { - USHORT nTmpHelpId; + sal_uInt16 nTmpHelpId; rStream >> nTmpHelpId; nHelpId=nTmpHelpId; } @@ -1053,7 +1053,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 ); @@ -1066,8 +1066,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 ); @@ -1091,16 +1091,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()) @@ -1111,7 +1111,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 ); @@ -1138,7 +1138,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 ); @@ -1150,7 +1150,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++ )); @@ -1161,9 +1161,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 ); @@ -1175,7 +1175,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() ) @@ -1187,7 +1187,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(); @@ -1214,18 +1214,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_uIntPtr nPos1 = rStream.Tell(); + rStream << (sal_uInt32) 0; p->Store( rStream ); - ULONG nPos2 = rStream.Tell(); + sal_uIntPtr 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; @@ -1235,7 +1235,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() @@ -1253,7 +1253,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) {} @@ -1273,10 +1273,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 @@ -1293,9 +1293,9 @@ BOOL SfxStyleSheet::SetParent( const XubString& rName ) if(pParent) StartListening(*pParent); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // alle Zuhoerer benachtichtigen @@ -1315,7 +1315,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 ); } @@ -1325,9 +1325,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; } */ @@ -1335,7 +1335,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 8a9f16052a8a..c61faa93bd34 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.cxx @@ -405,13 +405,13 @@ public: : maRoot(), mnCount(0), mpIgnorableItems( pIgnorableItems != 0 - ? pIgnorableItems->Clone( FALSE ) + ? pIgnorableItems->Clone( sal_False ) : 0 ) { DBG_ASSERT( !pIgnorableItems || !pIgnorableItems->Count(), " - misusage: item set for ignorable item should be empty. Please correct usage." ); DBG_ASSERT( !mpIgnorableItems || !mpIgnorableItems->Count(), - " - does not work as excepted - is not empty. Please inform OD." ); + " - does not work as excepted - is not empty. Please inform OD." ); } ~StylePoolImpl() diff --git a/svl/source/items/szitem.cxx b/svl/source/items/szitem.cxx index 6c5ab66b8422..161468b1009b 100644 --- a/svl/source/items/szitem.cxx +++ b/svl/source/items/szitem.cxx @@ -54,7 +54,7 @@ SfxSizeItem::SfxSizeItem() // ----------------------------------------------------------------------- -SfxSizeItem::SfxSizeItem( USHORT nW, const Size& rVal ) : +SfxSizeItem::SfxSizeItem( sal_uInt16 nW, const Size& rVal ) : SfxPoolItem( nW ), aVal( rVal ) { @@ -63,7 +63,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); @@ -117,7 +117,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; @@ -127,7 +127,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; @@ -135,8 +135,8 @@ SvStream& SfxSizeItem::Store(SvStream &rStream, USHORT ) const } // ----------------------------------------------------------------------- -BOOL SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId ) const +sal_Bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -159,20 +159,20 @@ BOOL SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, rVal <<= aTmp.getWidth(); break; case MID_HEIGHT: rVal <<= aTmp.getHeight(); break; - default: DBG_ERROR("Wrong MemberId!"); return FALSE; + default: DBG_ERROR("Wrong MemberId!"); return sal_False; } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) +sal_Bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; com::sun::star::awt::Size aValue; sal_Int32 nVal = 0; if ( !nMemberId ) diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx index 94fdf167496e..81726f017f3a 100644 --- a/svl/source/items/visitem.cxx +++ b/svl/source/items/visitem.cxx @@ -43,7 +43,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); @@ -85,26 +85,26 @@ SfxItemPresentation SfxVisibilityItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -BOOL SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +sal_Bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const { rVal <<= m_nValue; - return TRUE; + return sal_True; } //============================================================================ // virtual -BOOL SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +sal_Bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) { if (rVal >>= m_nValue) - return TRUE; + return sal_True; DBG_ERROR( "SfxInt16Item::PutValue - Wrong type!" ); - return FALSE; + return sal_False; } //============================================================================ // 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); @@ -112,7 +112,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; @@ -129,17 +129,17 @@ 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")); } diff --git a/svl/source/items/whiter.cxx b/svl/source/items/whiter.cxx index ec0e10d8e3d7..fe4a47b1dbaf 100644 --- a/svl/source/items/whiter.cxx +++ b/svl/source/items/whiter.cxx @@ -38,7 +38,7 @@ 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) @@ -57,19 +57,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; } @@ -78,7 +78,7 @@ USHORT SfxWhichIter::NextWhich() // ----------------------------------------------------------------------- -USHORT SfxWhichIter::PrevWhich() +sal_uInt16 SfxWhichIter::PrevWhich() { DBG_CHKTHIS(SfxWhichIter, 0); while ( pRanges != pStart || 0 != nOfst ) @@ -89,7 +89,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; } @@ -98,7 +98,7 @@ USHORT SfxWhichIter::PrevWhich() // ----------------------------------------------------------------------- -USHORT SfxWhichIter::FirstWhich() +sal_uInt16 SfxWhichIter::FirstWhich() { DBG_CHKTHIS(SfxWhichIter, 0); pRanges = pStart; @@ -110,13 +110,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 b2184442ea0e..4dbedc1e5642 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.cxx @@ -63,27 +63,27 @@ 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; +sal_uInt16 SvPtrarrPlain::GetPos( const VoidPtr aElement ) const +{ sal_uInt16 n; for( n=0; n < nA && *(GetData()+n) != aElement; ) n++; return ( n >= nA ? USHRT_MAX : n ); } -SV_IMPL_VARARR( SvBools, BOOL ) -SV_IMPL_VARARR( SvBytes, BYTE ) -SV_IMPL_VARARR( SvULongs, ULONG ) -SV_IMPL_VARARR( SvUShorts, USHORT ) +SV_IMPL_VARARR( SvBools, sal_Bool ) +SV_IMPL_VARARR( SvBytes, sal_uInt8 ) +SV_IMPL_VARARR( SvULongs, sal_uIntPtr ) +SV_IMPL_VARARR( SvUShorts, sal_uInt16 ) SV_IMPL_VARARR( SvLongs, long) SV_IMPL_VARARR( SvShorts, short ) -SV_IMPL_VARARR_SORT( SvULongsSort, ULONG ) +SV_IMPL_VARARR_SORT( SvULongsSort, sal_uIntPtr ) SV_IMPL_VARARR_SORT( SvLongsSort, long ) SV_IMPL_VARARR_SORT( SvXub_StrLensSort, xub_StrLen ) @@ -105,19 +105,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 ) @@ -131,40 +131,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 ) @@ -178,29 +178,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 ) @@ -212,29 +212,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) ) @@ -247,42 +247,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); } @@ -291,19 +291,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 ) @@ -317,39 +317,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 ) @@ -363,20 +363,20 @@ 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; } diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx index fc230856ef7d..b6dfec5cbb63 100644 --- a/svl/source/misc/adrparse.cxx +++ b/svl/source/misc/adrparse.cxx @@ -774,7 +774,7 @@ SvAddressParser::SvAddressParser(UniString const & rInput): m_bHasFirst(false) //============================================================================ SvAddressParser::~SvAddressParser() { - for (ULONG i = m_aRest.Count(); i != 0;) + for (sal_uIntPtr i = m_aRest.Count(); i != 0;) delete m_aRest.Remove(--i); } diff --git a/svl/source/misc/folderrestriction.cxx b/svl/source/misc/folderrestriction.cxx index ae50ed3cd55a..f7eef328de7d 100644 --- a/svl/source/misc/folderrestriction.cxx +++ b/svl/source/misc/folderrestriction.cxx @@ -74,7 +74,7 @@ static void convertStringListToUrls ( } /** retrieves the value of an environment variable - @return if and only if the retrieved string value is not empty + @return if and only if the retrieved string value is not empty */ static bool getEnvironmentValue( const sal_Char* _pAsciiEnvName, ::rtl::OUString& _rValue ) { diff --git a/svl/source/misc/fstathelper.cxx b/svl/source/misc/fstathelper.cxx index 329912f9d997..c373e035fe05 100644 --- a/svl/source/misc/fstathelper.cxx +++ b/svl/source/misc/fstathelper.cxx @@ -43,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, @@ -70,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, @@ -85,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 28986aca1194..6e637f1b35a5 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -71,9 +71,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. */ @@ -91,13 +91,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; @@ -106,20 +106,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); } @@ -131,13 +131,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; @@ -155,34 +155,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]; @@ -195,7 +195,7 @@ class INetURLHistory_Impl /** unlink. */ - void unlink (UINT16 nThis) + void unlink (sal_uInt16 nThis) { register lru_entry &rThis = m_pList[nThis]; @@ -217,7 +217,7 @@ public: /** putUrl/queryUrl. */ void putUrl (const String &rUrl); - BOOL queryUrl (const String &rUrl); + sal_Bool queryUrl (const String &rUrl); }; /*======================================================================== @@ -247,7 +247,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++) @@ -259,12 +259,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]; @@ -276,11 +276,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) @@ -295,15 +295,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; @@ -318,7 +318,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) @@ -345,12 +345,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. @@ -364,9 +364,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. @@ -379,7 +379,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)) @@ -400,19 +400,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; } } @@ -526,7 +526,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) @@ -536,7 +536,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 0b9efdf22afd..4c68922fce3b 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -337,7 +337,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 @@ -633,19 +633,19 @@ Registration * Registration::m_pRegistration = 0; //============================================================================ Registration::~Registration() { - {for (ULONG i = 0; i < m_aTypeIDMap.Count(); ++i) + {for (sal_uIntPtr 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()); } //============================================================================ @@ -657,7 +657,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. @@ -720,7 +720,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. @@ -764,7 +764,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. @@ -781,7 +781,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), @@ -943,7 +943,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 2203cc08458e..0cbd5d747882 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -42,11 +42,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; @@ -55,33 +55,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 )) @@ -92,7 +92,7 @@ BOOL RemoveControlChars( OUString &rTxt ) } DBG_ASSERT( nCnt == nSize, "wrong size" ); rTxt = aBuf.makeStringAndClear(); - bModified = TRUE; + bModified = sal_True; } return bModified; } @@ -101,20 +101,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) @@ -127,7 +127,7 @@ BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ ) } aBuf.setLength( nCnt ); rTxt = aBuf.makeStringAndClear(); - bModified = TRUE; + bModified = sal_True; } return bModified; } diff --git a/svl/source/misc/ownlist.cxx b/svl/source/misc/ownlist.cxx index 9fd767c2253f..967ec50d0ff5 100644 --- a/svl/source/misc/ownlist.cxx +++ b/svl/source/misc/ownlist.cxx @@ -41,14 +41,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) ++) != '\"') ; @@ -58,9 +58,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) ++; @@ -68,7 +68,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) ++; @@ -76,10 +76,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] @@ -88,11 +88,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()) { @@ -115,14 +115,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() && @@ -148,7 +148,7 @@ BOOL SvCommandList::AppendCommands // if( nPos != rCmd.Len() ) // { -// USHORT nLen = 0; +// sal_uInt16 nLen = 0; // nStt = nPos; // if( '"' == c ) // { @@ -181,7 +181,7 @@ BOOL SvCommandList::AppendCommands // nPos++; // } // *pEaten = nPos; - return TRUE; + return sal_True; } //========================================================================= @@ -198,7 +198,7 @@ String SvCommandList::GetCommands() const */ { String aRet; - for( ULONG i = 0; i < aTypes.Count(); i++ ) + for( sal_uIntPtr i = 0; i < aTypes.Count(); i++ ) { if( i != 0 ) aRet += ' '; @@ -252,7 +252,7 @@ SvStream & operator >> SvStream & Der "ubergebene Stream. */ { - UINT32 nCount = 0; + sal_uInt32 nCount = 0; rStm >> nCount; if( !rStm.GetError() ) { @@ -283,10 +283,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; @@ -294,7 +294,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; @@ -308,7 +308,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/restrictedpaths.cxx b/svl/source/misc/restrictedpaths.cxx index 8c6f136f3eee..8207d5765452 100644 --- a/svl/source/misc/restrictedpaths.cxx +++ b/svl/source/misc/restrictedpaths.cxx @@ -41,7 +41,7 @@ namespace svt { // ---------------------------------------------------------------- /** retrieves the value of an environment variable - @return if and only if the retrieved string value is not empty + @return if and only if the retrieved string value is not empty */ bool lcl_getEnvironmentValue( const sal_Char* _pAsciiEnvName, ::rtl::OUString& _rValue ) { diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index 9811618eb571..24ed126cde25 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -152,7 +152,7 @@ TYPEINIT1(SvOutputStreamOpenLockBytes, SvOpenLockBytes) //============================================================================ // virtual -ErrCode SvOutputStreamOpenLockBytes::ReadAt(ULONG, void *, ULONG, ULONG *) +ErrCode SvOutputStreamOpenLockBytes::ReadAt(sal_uIntPtr, void *, sal_uIntPtr, sal_uIntPtr *) 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_uIntPtr nPos, void const * pBuffer, + sal_uIntPtr nCount, sal_uIntPtr * 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_uIntPtr) { 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_uIntPtr nCount, + sal_uIntPtr * 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_uIntPtr >::max() - m_nPosition) { - nCount = std::numeric_limits< ULONG >::max() - m_nPosition; + nCount = std::numeric_limits< sal_uIntPtr >::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_uIntPtr SvOutputStreamOpenLockBytes::Tell() const { return m_nPosition; } //============================================================================ // virtual -ULONG SvOutputStreamOpenLockBytes::Seek(ULONG) +sal_uIntPtr SvOutputStreamOpenLockBytes::Seek(sal_uIntPtr) { return m_nPosition; } @@ -476,7 +476,7 @@ bool SvInputStream::open() //============================================================================ // virtual -ULONG SvInputStream::GetData(void * pData, ULONG nSize) +sal_uIntPtr SvInputStream::GetData(void * pData, sal_uIntPtr 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_uIntPtr(nSize - nRead), + sal_uIntPtr(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_uIntPtr(nSize - nRead), + sal_uIntPtr(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_uIntPtr SvInputStream::PutData(void const *, sal_uIntPtr) { SetError(ERRCODE_IO_NOTSUPPORTED); return 0; @@ -584,7 +584,7 @@ void SvInputStream::FlushData() //============================================================================ // virtual -ULONG SvInputStream::SeekPos(ULONG nPos) +sal_uIntPtr SvInputStream::SeekPos(sal_uIntPtr nPos) { if (open()) { @@ -601,7 +601,7 @@ ULONG SvInputStream::SeekPos(ULONG nPos) < STREAM_SEEK_TO_END) { m_nSeekedFrom = Tell(); - return ULONG(nLength); + return sal_uIntPtr(nLength); } } catch (io::IOException) {} @@ -636,7 +636,7 @@ ULONG SvInputStream::SeekPos(ULONG nPos) //============================================================================ // virtual -void SvInputStream::SetSize(ULONG) +void SvInputStream::SetSize(sal_uIntPtr) { 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_uIntPtr 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_uIntPtr 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_uIntPtr SvOutputStream::GetData(void *, sal_uIntPtr) { 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_uIntPtr SvOutputStream::PutData(void const * pData, sal_uIntPtr nSize) { if (!m_xStream.is()) { SetError(ERRCODE_IO_CANTWRITE); return 0; } - ULONG nWritten = 0; + sal_uIntPtr nWritten = 0; for (;;) { sal_Int32 nRemain = sal_Int32( - std::min(ULONG(nSize - nWritten), - ULONG(std::numeric_limits< sal_Int32 >::max()))); + std::min(sal_uIntPtr(nSize - nWritten), + sal_uIntPtr(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_uIntPtr SvOutputStream::SeekPos(sal_uIntPtr) { SetError(ERRCODE_IO_NOTSUPPORTED); return 0; @@ -763,7 +763,7 @@ void SvOutputStream::FlushData() //============================================================================ // virtual -void SvOutputStream::SetSize(ULONG) +void SvOutputStream::SetSize(sal_uIntPtr) { 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/notify/brdcst.cxx b/svl/source/notify/brdcst.cxx index 29983ecedc17..ad7da10ed4f4 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 { DBG_ERROR( "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 0179ceaebc34..b09288cc83e4 100644 --- a/svl/source/notify/broadcast.cxx +++ b/svl/source/notify/broadcast.cxx @@ -93,7 +93,7 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint ) if( HasListeners() /* && !IsModifyLocked()*/ ) { // LockModify(); -// bInModify = TRUE; +// bInModify = sal_True; SvtListenerIter aIter( *this ); SvtListener* pLast = aIter.GoStart(); @@ -104,7 +104,7 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint ) break; } while( 0 != ( pLast = aIter.GoNext() )); -// bInModify = FALSE; +// bInModify = sal_False; // UnlockModify(); } } @@ -128,7 +128,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(); @@ -139,7 +139,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/cancel.cxx b/svl/source/notify/cancel.cxx index ffa5c87a26be..2ae43bfaf1ae 100644 --- a/svl/source/notify/cancel.cxx +++ b/svl/source/notify/cancel.cxx @@ -51,17 +51,17 @@ SfxCancelManager::SfxCancelManager( SfxCancelManager *pParent ) SfxCancelManager::~SfxCancelManager() { DBG_ASSERT( _pParent || !_aJobs.Count(), "deleting SfxCancelManager in use" ); - for ( USHORT n = _aJobs.Count(); n--; ) + for ( sal_uInt16 n = _aJobs.Count(); n--; ) _aJobs.GetObject(n)->SetManager( _pParent ); } //------------------------------------------------------------------------- -BOOL SfxCancelManager::CanCancel() const +sal_Bool SfxCancelManager::CanCancel() const /* [Beschreibung] - Liefert TRUE wenn an diesem CancelManager oder an einem Parent + Liefert sal_True wenn an diesem CancelManager oder an einem Parent ein Job l"auft. */ @@ -72,7 +72,7 @@ BOOL SfxCancelManager::CanCancel() const //------------------------------------------------------------------------- -void SfxCancelManager::Cancel( BOOL bDeep ) +void SfxCancelManager::Cancel( sal_Bool bDeep ) /* [Beschreibung] @@ -83,7 +83,7 @@ void SfxCancelManager::Cancel( BOOL bDeep ) { ::vos::OGuard aGuard( lclMutex::get() ); SfxCancelManagerWeak xWeak( this ); - for ( USHORT n = _aJobs.Count(); n-- && xWeak.Is(); ) + for ( sal_uInt16 n = _aJobs.Count(); n-- && xWeak.Is(); ) if ( n < _aJobs.Count() ) _aJobs.GetObject(n)->Cancel(); if ( xWeak.Is() && _pParent ) @@ -133,7 +133,7 @@ void SfxCancelManager::RemoveCancellable( SfxCancellable *pJob ) { ::vos::OClearableGuard aGuard( lclMutex::get() ); const SfxCancellable *pTmp = pJob; - USHORT nPos = _aJobs.GetPos( pTmp ); + sal_uInt16 nPos = _aJobs.GetPos( pTmp ); if ( nPos != 0xFFFF ) { _aJobs.Remove( nPos , 1 ); @@ -172,7 +172,7 @@ void SfxCancellable::Cancel() delete this; } #else - _bCancelled = TRUE; + _bCancelled = sal_True; #endif } @@ -192,7 +192,7 @@ void SfxCancellable::SetManager( SfxCancelManager *pMgr ) TYPEINIT1(SfxCancelHint, SfxHint); -SfxCancelHint::SfxCancelHint( SfxCancellable* pJob, USHORT _nAction ) +SfxCancelHint::SfxCancelHint( SfxCancellable* pJob, sal_uInt16 _nAction ) { pCancellable = pJob; nAction = _nAction; diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx index 0269894bff81..7ee0f290ff31 100644 --- a/svl/source/notify/listener.cxx +++ b/svl/source/notify/listener.cxx @@ -77,7 +77,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 ) @@ -85,19 +85,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 ) @@ -110,12 +110,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; } //-------------------------------------------------------------------- @@ -137,7 +137,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/lstner.cxx b/svl/source/notify/lstner.cxx index 3f003e6dde8f..36c6b665dd6d 100644 --- a/svl/source/notify/lstner.cxx +++ b/svl/source/notify/lstner.cxx @@ -61,7 +61,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] ); } //-------------------------------------------------------------------- @@ -73,7 +73,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); @@ -96,7 +96,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); @@ -108,23 +108,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 { @@ -133,14 +133,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); @@ -168,7 +168,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/smplhint.cxx b/svl/source/notify/smplhint.cxx index 98eecb91cfe2..3a750f2f9a44 100644 --- a/svl/source/notify/smplhint.cxx +++ b/svl/source/notify/smplhint.cxx @@ -39,7 +39,7 @@ TYPEINIT1(SfxSimpleHint, SfxHint); //==================================================================== // creates a SimpleHint with the type nId -SfxSimpleHint::SfxSimpleHint( ULONG nIdP ) +SfxSimpleHint::SfxSimpleHint( sal_uIntPtr nIdP ) { nId = nIdP; } diff --git a/svl/source/numbers/nbdll.cxx b/svl/source/numbers/nbdll.cxx index b93eda3e7f37..0a49d9ed0524 100644 --- a/svl/source/numbers/nbdll.cxx +++ b/svl/source/numbers/nbdll.cxx @@ -58,7 +58,7 @@ extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) hDLLInst = hDLL; - return TRUE; + return sal_True; } /*************************************************************************** diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index f40b367ae2af..be5622fdf225 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -183,7 +183,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) { @@ -249,7 +249,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) { @@ -291,7 +291,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) { @@ -342,7 +342,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 ); @@ -369,7 +369,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) { @@ -378,7 +378,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 ); @@ -485,7 +485,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) { @@ -509,7 +509,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) { @@ -518,7 +518,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) @@ -540,7 +540,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) { @@ -550,7 +550,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) @@ -605,7 +605,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) { @@ -623,7 +623,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) { @@ -644,7 +644,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) { @@ -662,7 +662,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 ); @@ -677,7 +677,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) { @@ -715,7 +715,7 @@ uno::Sequence SAL_CALL SvNumberFormatsObj::getSupportedServiceNam //------------------------------------------------------------------------ -SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, ULONG nK, const ::comphelper::SharedMutex& _rMutex ) +SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uIntPtr nK, const ::comphelper::SharedMutex& _rMutex ) :rSupplier( rParent ) ,nKey( nK ) ,m_aMutex( _rMutex ) @@ -759,8 +759,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 )) @@ -784,12 +784,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 )) @@ -827,7 +827,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() ); @@ -889,7 +889,7 @@ uno::Sequence 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() ); @@ -898,11 +898,11 @@ uno::Sequence 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())); @@ -1057,7 +1057,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 09bc58a0b6ee..f60d0088f950 100644 --- a/svl/source/numbers/numfmuno.hxx +++ b/svl/source/numbers/numfmuno.hxx @@ -183,11 +183,11 @@ class SvNumberFormatObj : public cppu::WeakImplHelper3< { private: SvNumberFormatsSupplierObj& rSupplier; - ULONG nKey; + sal_uIntPtr nKey; mutable ::comphelper::SharedMutex m_aMutex; public: - SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, ULONG nK, const ::comphelper::SharedMutex& _rMutex ); + SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uIntPtr nK, const ::comphelper::SharedMutex& _rMutex ); virtual ~SvNumberFormatObj(); // XPropertySet diff --git a/svl/source/numbers/numhead.cxx b/svl/source/numbers/numhead.cxx index adf42fe26f8f..dc481d1f184c 100644 --- a/svl/source/numbers/numhead.cxx +++ b/svl/source/numbers/numhead.cxx @@ -47,7 +47,7 @@ SvNumReadHeader::SvNumReadHeader(SvStream& rNewStream) : rStream( rNewStream ) { - ULONG nDataSize; + sal_uIntPtr nDataSize; rStream >> nDataSize; nDataEnd = rStream.Tell() + nDataSize; } @@ -56,7 +56,7 @@ SvNumReadHeader::SvNumReadHeader(SvStream& rNewStream) : SvNumReadHeader::~SvNumReadHeader() { - ULONG nReadEnd = rStream.Tell(); + sal_uIntPtr nReadEnd = rStream.Tell(); DBG_ASSERT( nReadEnd <= nDataEnd, "zuviele Bytes gelesen" ); if ( nReadEnd != nDataEnd ) rStream.Seek(nDataEnd); // Rest ueberspringen @@ -64,9 +64,9 @@ SvNumReadHeader::~SvNumReadHeader() //#pragma SEG_FUNCDEF(numhead_03) -ULONG SvNumReadHeader::BytesLeft() const +sal_uIntPtr SvNumReadHeader::BytesLeft() const { - ULONG nReadEnd = rStream.Tell(); + sal_uIntPtr nReadEnd = rStream.Tell(); if (nReadEnd <= nDataEnd) return nDataEnd-nReadEnd; @@ -78,7 +78,7 @@ ULONG SvNumReadHeader::BytesLeft() const //#pragma SEG_FUNCDEF(numhead_04) -SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault) : +SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, sal_uIntPtr nDefault) : rStream( rNewStream ) { nDataSize = nDefault; @@ -90,7 +90,7 @@ SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault) : SvNumWriteHeader::~SvNumWriteHeader() { - ULONG nPos = rStream.Tell(); + sal_uIntPtr nPos = rStream.Tell(); if ( nPos - nDataPos != nDataSize ) // Default getroffen? { @@ -112,11 +112,11 @@ ImpSvNumMultipleReadHeader::ImpSvNumMultipleReadHeader(SvStream& rNewStream) : { sal_uInt32 nDataSize; rStream >> nDataSize; - ULONG nDataPos = rStream.Tell(); + sal_uIntPtr nDataPos = rStream.Tell(); nEntryEnd = nDataPos; rStream.SeekRel(nDataSize); - USHORT nID; + sal_uInt16 nID; rStream >> nID; if (nID != SV_NUMID_SIZES) { @@ -151,7 +151,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 ) { @@ -166,7 +166,7 @@ void ImpSvNumMultipleReadHeader::Skip( SvStream& rStream ) void ImpSvNumMultipleReadHeader::EndEntry() { - ULONG nPos = rStream.Tell(); + sal_uIntPtr nPos = rStream.Tell(); DBG_ASSERT( nPos <= nEntryEnd, "zuviel gelesen" ); if ( nPos != nEntryEnd ) rStream.Seek( nEntryEnd ); // Rest ueberspringen @@ -176,7 +176,7 @@ void ImpSvNumMultipleReadHeader::EndEntry() void ImpSvNumMultipleReadHeader::StartEntry() { - ULONG nPos = rStream.Tell(); + sal_uIntPtr nPos = rStream.Tell(); sal_uInt32 nEntrySize; (*pMemStream) >> nEntrySize; @@ -185,9 +185,9 @@ void ImpSvNumMultipleReadHeader::StartEntry() //#pragma SEG_FUNCDEF(numhead_09) -ULONG ImpSvNumMultipleReadHeader::BytesLeft() const +sal_uIntPtr ImpSvNumMultipleReadHeader::BytesLeft() const { - ULONG nReadEnd = rStream.Tell(); + sal_uIntPtr nReadEnd = rStream.Tell(); if (nReadEnd <= nEntryEnd) return nEntryEnd-nReadEnd; @@ -200,7 +200,7 @@ ULONG ImpSvNumMultipleReadHeader::BytesLeft() const //#pragma SEG_FUNCDEF(numhead_0a) ImpSvNumMultipleWriteHeader::ImpSvNumMultipleWriteHeader(SvStream& rNewStream, - ULONG nDefault) : + sal_uIntPtr nDefault) : rStream( rNewStream ), aMemStream( 4096, 4096 ) { @@ -215,16 +215,16 @@ ImpSvNumMultipleWriteHeader::ImpSvNumMultipleWriteHeader(SvStream& rNewStream, ImpSvNumMultipleWriteHeader::~ImpSvNumMultipleWriteHeader() { - ULONG nDataEnd = rStream.Tell(); + sal_uIntPtr nDataEnd = rStream.Tell(); - rStream << (USHORT) SV_NUMID_SIZES; + rStream << (sal_uInt16) SV_NUMID_SIZES; rStream << static_cast(aMemStream.Tell()); rStream.Write( aMemStream.GetData(), aMemStream.Tell() ); if ( nDataEnd - nDataPos != nDataSize ) // Default getroffen? { nDataSize = nDataEnd - nDataPos; - ULONG nPos = rStream.Tell(); + sal_uIntPtr nPos = rStream.Tell(); rStream.Seek(nDataPos-sizeof(sal_uInt32)); rStream << nDataSize; // Groesse am Anfang eintragen rStream.Seek(nPos); @@ -235,7 +235,7 @@ ImpSvNumMultipleWriteHeader::~ImpSvNumMultipleWriteHeader() void ImpSvNumMultipleWriteHeader::EndEntry() { - ULONG nPos = rStream.Tell(); + sal_uIntPtr nPos = rStream.Tell(); aMemStream << static_cast(nPos - nEntryStart); } @@ -243,7 +243,7 @@ void ImpSvNumMultipleWriteHeader::EndEntry() void ImpSvNumMultipleWriteHeader::StartEntry() { - ULONG nPos = rStream.Tell(); + sal_uIntPtr nPos = rStream.Tell(); nEntryStart = nPos; } diff --git a/svl/source/numbers/numhead.hxx b/svl/source/numbers/numhead.hxx index 7df06033e0d7..6ed95c39e3d5 100644 --- a/svl/source/numbers/numhead.hxx +++ b/svl/source/numbers/numhead.hxx @@ -39,24 +39,24 @@ class SvNumReadHeader { private: SvStream& rStream; - ULONG nDataEnd; + sal_uIntPtr nDataEnd; public: SvNumReadHeader(SvStream& rNewStream); ~SvNumReadHeader(); - ULONG BytesLeft() const; + sal_uIntPtr BytesLeft() const; }; class SvNumWriteHeader { private: SvStream& rStream; - ULONG nDataPos; - ULONG nDataSize; + sal_uIntPtr nDataPos; + sal_uIntPtr nDataSize; public: - SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault = 0); + SvNumWriteHeader(SvStream& rNewStream, sal_uIntPtr nDefault = 0); ~SvNumWriteHeader(); }; @@ -70,8 +70,8 @@ private: SvStream& rStream; char* pBuf; SvMemoryStream* pMemStream; - ULONG nEndPos; - ULONG nEntryEnd; + sal_uIntPtr nEndPos; + sal_uIntPtr nEntryEnd; public: ImpSvNumMultipleReadHeader(SvStream& rNewStream); @@ -79,7 +79,7 @@ public: void StartEntry(); void EndEntry(); - ULONG BytesLeft() const; + sal_uIntPtr BytesLeft() const; static void Skip( SvStream& ); // komplett ueberspringen }; @@ -89,12 +89,12 @@ class ImpSvNumMultipleWriteHeader private: SvStream& rStream; SvMemoryStream aMemStream; - ULONG nDataPos; + sal_uIntPtr nDataPos; sal_uInt32 nDataSize; - ULONG nEntryStart; + sal_uIntPtr nEntryStart; public: - ImpSvNumMultipleWriteHeader(SvStream& rNewStream, ULONG nDefault = 0); + ImpSvNumMultipleWriteHeader(SvStream& rNewStream, sal_uIntPtr nDefault = 0); ~ImpSvNumMultipleWriteHeader(); void StartEntry(); diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 8c63ed903825..ed845372b76e 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -61,11 +61,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 @@ -117,11 +117,11 @@ void ImpSvNumberInputScan::Reset() // ER 16.06.97 18:56 Vorbelegung erfolgt jetzt in NumberStringDivision, // wozu immer alles loeschen wenn einiges wieder benutzt oder gar nicht // gebraucht wird.. - for (USHORT i = 0; i < SV_MAX_ANZ_INPUT_STRINGS; i++) + for (sal_uInt16 i = 0; i < SV_MAX_ANZ_INPUT_STRINGS; i++) { sStrArray[i].Erase(); nNums[i] = SV_MAX_ANZ_INPUT_STRINGS-1; - IsNum[i] = FALSE; + IsNum[i] = sal_False; } #endif nMonth = 0; @@ -149,7 +149,7 @@ void ImpSvNumberInputScan::Reset() //--------------------------------------------------------------------------- // // static -inline BOOL ImpSvNumberInputScan::MyIsdigit( sal_Unicode c ) +inline sal_Bool ImpSvNumberInputScan::MyIsdigit( sal_Unicode c ) { // If the input string wouldn't be converted using TransformInput() we'd // to use something similar to the following and to adapt many places. @@ -158,7 +158,7 @@ inline BOOL ImpSvNumberInputScan::MyIsdigit( sal_Unicode c ) if ( c < 128 ) return isdigit( (unsigned char) c ) != 0; if ( c < 256 ) - return FALSE; + return sal_False; String aTmp( c ); return pFormatter->GetCharClass()->isDigit( aTmp, 0 ); #else @@ -190,19 +190,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 @@ -246,11 +246,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; @@ -265,7 +265,7 @@ BOOL ImpSvNumberInputScan::NextNumberStringSymbol( if ( MyIsdigit( cToken ) ) { eState = SsGetValue; - isNumber = TRUE; + isNumber = sal_True; } else eState = SsGetString; @@ -311,11 +311,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; @@ -348,7 +348,7 @@ BOOL ImpSvNumberInputScan::SkipThousands( if (nCounter == 3) { eState = SsStart; - res = TRUE; // .000 combination found + res = sal_True; // .000 combination found } } else @@ -385,7 +385,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 && @@ -395,7 +395,7 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString ) } else { - IsNum[nAnzStrings] = FALSE; + IsNum[nAnzStrings] = sal_False; } nAnzStrings++; } @@ -405,34 +405,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; } @@ -441,15 +441,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; } @@ -478,15 +478,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; } @@ -495,10 +495,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? @@ -507,7 +507,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()); @@ -524,9 +524,9 @@ inline BOOL ImpSvNumberInputScan::GetThousandSep( ) { nPos = nPos + rSep.Len(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -534,8 +534,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 ) @@ -642,10 +642,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 ) @@ -660,7 +660,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 ) { @@ -673,14 +673,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; } @@ -690,15 +690,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 ) @@ -709,17 +709,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; } @@ -727,10 +727,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 ) { @@ -738,17 +738,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 ) { @@ -756,10 +756,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; } @@ -827,15 +827,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; } @@ -844,19 +844,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; jGetCalendar()->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 } @@ -939,13 +939,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 ); } @@ -970,7 +970,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; @@ -997,7 +997,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(); @@ -1006,45 +1006,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: DBG_ERROR( "ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat" ); DateFmt = YMD; - bFormatTurn = FALSE; + bFormatTurn = sal_False; } if ( bFormatTurn ) { @@ -1083,7 +1083,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 ); @@ -1094,7 +1094,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 @@ -1116,7 +1116,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = FALSE; + res = sal_False; break; } break; @@ -1131,12 +1131,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; @@ -1223,7 +1223,7 @@ input for the following reasons: } break; default: - res = FALSE; + res = sal_False; break; } } @@ -1262,12 +1262,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; @@ -1280,7 +1280,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 ) { @@ -1312,7 +1312,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = FALSE; + res = sal_False; break; } } @@ -1327,7 +1327,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(1) ); break; default: - res = FALSE; + res = sal_False; break; } break; @@ -1345,13 +1345,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; @@ -1365,7 +1365,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 @@ -1463,10 +1463,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; @@ -1485,7 +1485,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; @@ -1558,7 +1558,7 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString, return MatchedReturn(); } - return TRUE; + return sal_True; } @@ -1566,11 +1566,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; @@ -1800,10 +1800,10 @@ BOOL ImpSvNumberInputScan::ScanMidString( const String& rString, if ( nMatchedAllStrings & ~nMatchedVirgin ) eScannedType = eOldScannedType; else - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } @@ -1811,10 +1811,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; @@ -2045,30 +2045,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 @@ -2077,22 +2077,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 ); @@ -2104,13 +2104,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() ) @@ -2138,7 +2138,7 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor( nStringScanSign = -1; } nStringScanNumFor = nSub; - return TRUE; + return sal_True; } @@ -2146,9 +2146,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 @@ -2156,7 +2156,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 { @@ -2172,17 +2172,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 ) { @@ -2197,14 +2197,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 @@ -2219,11 +2219,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 @@ -2231,16 +2231,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 '(' @@ -2250,7 +2250,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return TRUE; + return sal_True; } } } @@ -2260,24 +2260,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 '(' @@ -2287,11 +2287,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 @@ -2299,45 +2299,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 '(' @@ -2347,11 +2347,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 } } @@ -2359,18 +2359,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 @@ -2378,36 +2378,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; } @@ -2442,7 +2442,7 @@ void ImpSvNumberInputScan::InitText() pUpperDayText[j] = pChrCls->upper( xElems[j].FullName ); pUpperAbbrevDayText[j] = pChrCls->upper( xElems[j].AbbrevName ); } - bTextInitialized = TRUE; + bTextInitialized = sal_True; } @@ -2461,7 +2461,7 @@ void ImpSvNumberInputScan::ChangeIntl() cDecSep == '/' || cDecSep == '.' || cDecSep == pFormatter->GetDateSep().GetChar(0) ); - bTextInitialized = FALSE; + bTextInitialized = sal_False; aUpperCurrSymbol.Erase(); } @@ -2470,9 +2470,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); @@ -2486,7 +2486,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 @@ -2494,13 +2494,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 @@ -2516,7 +2516,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) @@ -2530,7 +2530,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if ( nMatchedAllStrings ) nThousand = nAnzNums - 1; else if ( nAnzNums != 1 ) - res = FALSE; + res = sal_False; } else if (nDecPos == 2) // 1.05 { @@ -2538,7 +2538,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. { @@ -2546,7 +2546,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if ( nMatchedAllStrings ) nThousand = nAnzNums - 1; else if ( nAnzNums != nThousand+1 ) - res = FALSE; + res = sal_False; } break; @@ -2554,17 +2554,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; @@ -2572,12 +2572,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; @@ -2585,12 +2585,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; @@ -2600,12 +2600,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 @@ -2613,12 +2613,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; @@ -2639,7 +2639,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( else if (nLogical == -1) fOutNumber = 0.0; // False else - res = FALSE; // Oops + res = sal_False; // Oops break; case NUMBERFORMAT_PERCENT: @@ -2652,13 +2652,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 @@ -2682,7 +2682,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( fOutNumber = 0.0; else fOutNumber = DBL_MAX; -/*!*/ return TRUE; +/*!*/ return sal_True; } } @@ -2719,12 +2719,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++) @@ -2738,7 +2738,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if (fNenner != 0.0) fOutNumber += fZaehler/fNenner; else - res = FALSE; + res = sal_False; } } @@ -2761,14 +2761,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 ) { @@ -2792,17 +2792,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 42571f56dd92..3dc7976f6a59 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -46,12 +46,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) @@ -61,12 +61,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; @@ -75,50 +75,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 @@ -128,17 +128,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 ); @@ -150,50 +150,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 @@ -202,17 +202,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 @@ -222,30 +222,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 ); @@ -255,27 +255,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 cb66a75558c2..bb490d6ba148 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -88,7 +88,7 @@ using namespace ::com::sun::star::lang; * (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 __FAR_DATA 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() ) { @@ -428,7 +428,7 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) // a duplicate. Also won't mix up any LastInsertKey. ChangeIntl( eOldLanguage ); LanguageType eLge = eOldLanguage; // ConvertMode changes this - BOOL bCheck = FALSE; + sal_Bool bCheck = sal_False; SvNumberformat* pNewEntry = new SvNumberformat( aString, pFormatScanner, pStringScanner, nCheckPos, eLge ); if ( nCheckPos != 0 ) @@ -444,40 +444,40 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) if ( !aFTable.Insert( nKey, pNewEntry ) ) delete pNewEntry; else - bCheck = TRUE; + bCheck = sal_True; } DBG_ASSERT( bCheck, "SvNumberFormatter::ReplaceSystemCL: couldn't convert" ); 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 @@ -487,14 +487,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, @@ -532,9 +532,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)); } } } @@ -543,48 +543,48 @@ BOOL SvNumberFormatter::PutEntry(String& rString, return bCheck; } -BOOL SvNumberFormatter::PutandConvertEntry(String& rString, +sal_Bool SvNumberFormatter::PutandConvertEntry(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); bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge); - pFormatScanner->SetConvertMode(FALSE); + pFormatScanner->SetConvertMode(sal_False); return bRes; } -BOOL SvNumberFormatter::PutandConvertEntrySystem(String& rString, +sal_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 @@ -639,7 +639,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); } @@ -659,7 +659,7 @@ void SvNumberFormatter::PrepareSave() SvNumberformat* pFormat = aFTable.First(); while (pFormat) { - pFormat->SetUsed(FALSE); + pFormat->SetUsed(sal_False); pFormat = aFTable.Next(); } } @@ -668,41 +668,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 ) @@ -712,13 +712,13 @@ BOOL SvNumberFormatter::Load( SvStream& rStream ) } else { - bConversionHack = FALSE; + bConversionHack = sal_False; eLoadSysLang = eSysLang; } } else { - bConversionHack = FALSE; + bConversionHack = sal_False; eLoadSysLang = eSaveSysLang; } @@ -735,7 +735,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 ) @@ -749,7 +749,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 : @@ -779,33 +779,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 ) { @@ -842,9 +842,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 @@ -861,28 +861,28 @@ BOOL SvNumberFormatter::Load( SvStream& rStream ) NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() ); SvUShorts aList; GetUsedLanguages( aList ); - USHORT nCount = aList.Count(); - for ( USHORT j=0; jFirst(); while (pEntry) @@ -895,8 +895,8 @@ BOOL SvNumberFormatter::Save( SvStream& rStream ) const (pTable->GetCurKey() % SV_COUNTRY_LANGUAGE_OFFSET == 0) ) { rStream << static_cast(pTable->GetCurKey()) - << (USHORT) LANGUAGE_SYSTEM - << (USHORT) pEntry->GetLanguage(); + << (sal_uInt16) LANGUAGE_SYSTEM + << (sal_uInt16) pEntry->GetLanguage(); pEntry->Save(rStream, aHdr); } pEntry = (SvNumberformat*) pTable->Next(); @@ -905,13 +905,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 @@ -940,14 +940,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(); @@ -1065,7 +1065,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); @@ -1187,7 +1187,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) { @@ -1206,12 +1206,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); @@ -1241,13 +1241,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) @@ -1262,9 +1262,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; @@ -1273,9 +1273,9 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType, switch (eOldType) { case NUMBERFORMAT_DATETIME: - return TRUE; + return sal_True; default: - return FALSE; + return sal_False; } } break; @@ -1284,9 +1284,9 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType, switch (eOldType) { case NUMBERFORMAT_DATETIME: - return TRUE; + return sal_True; default: - return FALSE; + return sal_False; } } break; @@ -1296,16 +1296,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; } } @@ -1414,7 +1414,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 @@ -1443,14 +1443,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 @@ -1562,14 +1562,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; @@ -1593,30 +1593,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 ); @@ -1624,7 +1624,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; @@ -1641,7 +1641,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; @@ -1649,7 +1649,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 ) @@ -1671,7 +1671,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() ) ) @@ -1691,10 +1691,10 @@ 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; } sal_uInt32 SvNumberFormatter::TestNewString(const String& sFormatString, @@ -1730,7 +1730,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 && @@ -1738,7 +1738,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() && @@ -1851,7 +1851,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, @@ -1863,10 +1863,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); @@ -1875,14 +1875,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 ) @@ -1915,8 +1915,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; @@ -1931,8 +1931,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; } @@ -2016,7 +2016,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; @@ -2122,20 +2122,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; jGetConvertMode(); + 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() ); @@ -2149,7 +2149,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 @@ -2301,7 +2301,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 @@ -2354,7 +2354,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 ); @@ -2545,22 +2545,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; @@ -2615,7 +2615,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++ ) @@ -2633,7 +2633,7 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset, } } - pStdFormat->SetLastInsertKey( (USHORT)(nPos - CLOffset) ); + pStdFormat->SetLastInsertKey( (sal_uInt16)(nPos - CLOffset) ); } @@ -2652,15 +2652,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(); @@ -2712,15 +2712,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, @@ -2730,12 +2730,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, @@ -2773,7 +2773,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) @@ -2783,11 +2783,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, @@ -2895,7 +2895,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 { @@ -2959,7 +2959,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; @@ -2968,19 +2968,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, @@ -2990,9 +2990,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(); } @@ -3027,9 +3027,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; @@ -3045,9 +3045,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 ) @@ -3064,9 +3064,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 ) @@ -3095,11 +3095,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 ) { @@ -3110,7 +3110,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 ) { @@ -3136,8 +3136,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 @@ -3181,8 +3181,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() ) { @@ -3213,39 +3213,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 @@ -3254,19 +3254,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 ) { @@ -3275,11 +3275,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; @@ -3305,17 +3305,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; @@ -3332,14 +3332,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 || @@ -3361,7 +3361,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 || @@ -3383,7 +3383,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 ); @@ -3529,10 +3529,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" ); @@ -3545,14 +3545,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(); @@ -3561,7 +3561,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( @@ -3569,8 +3569,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] ); @@ -3596,7 +3596,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 ) @@ -3617,15 +3617,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; jGetRedString(); 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 += ';'; @@ -3796,7 +3796,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 @@ -3817,10 +3817,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; } @@ -3834,8 +3834,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 += '$'; @@ -3862,7 +3862,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 ); @@ -3874,28 +3874,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 ); @@ -3903,8 +3903,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 ); @@ -3914,7 +3914,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 ) { @@ -3945,7 +3945,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 ) { @@ -4066,11 +4066,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 ) { @@ -4102,7 +4102,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 ) @@ -4187,8 +4187,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 707b2362f0ed..aba92a6c93d4 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -74,13 +74,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, @@ -94,7 +94,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-- ) @@ -127,15 +127,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]; @@ -148,9 +148,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]; @@ -175,9 +175,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]; @@ -190,9 +190,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 ) @@ -244,9 +244,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 ) @@ -330,7 +330,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; @@ -340,13 +340,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 ) { @@ -390,7 +390,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,21 +400,21 @@ void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc, } -BOOL ImpSvNumFor::HasNewCurrency() const +sal_Bool ImpSvNumFor::HasNewCurrency() const { - for ( USHORT j=0; j> nCnt; - for ( USHORT j=0; j> nPos >> nType; if ( nPos < nAnzStrings ) @@ -520,7 +520,7 @@ SvNumberformat::SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge ) rScan(rSc), eLnge(eLge), nNewStandardDefined(0), - bStarFlag( FALSE ) + bStarFlag( sal_False ) { } @@ -541,7 +541,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); } @@ -558,10 +558,10 @@ SvNumberformat::SvNumberformat( SvNumberformat& rFormat, ImpSvNumberformatScan& } -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 : @@ -595,9 +595,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; } @@ -606,11 +606,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 occurences by a simple space. @@ -633,15 +633,15 @@ SvNumberformat::SvNumberformat(String& rString, else eLnge = 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; @@ -649,7 +649,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 @@ -666,14 +666,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) @@ -707,7 +707,7 @@ SvNumberformat::SvNumberformat(String& rString, nPos++; else { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPos; } } @@ -721,7 +721,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 @@ -730,7 +730,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; } } @@ -759,16 +759,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; @@ -784,16 +784,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; @@ -801,7 +801,7 @@ SvNumberformat::SvNumberformat(String& rString, { if ( NumFor[nIndex].GetNatNum().GetLang() != LANGUAGE_DONTKNOW ) { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } else @@ -810,7 +810,7 @@ SvNumberformat::SvNumberformat(String& rString, LanguageType eLang = ImpGetLanguageType( sStr, nTmp ); if ( eLang == LANGUAGE_DONTKNOW ) { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } else @@ -851,7 +851,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 @@ -863,7 +863,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 @@ -916,19 +916,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 ) @@ -947,7 +947,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( @@ -963,7 +963,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); @@ -982,7 +982,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); @@ -1000,7 +1000,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); @@ -1416,12 +1416,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 ) @@ -1431,7 +1431,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 ) @@ -1477,25 +1477,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 ); } @@ -1507,7 +1507,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. } @@ -1529,7 +1529,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; @@ -1551,11 +1551,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" ); @@ -1565,7 +1565,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; @@ -1586,7 +1586,7 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, if ( bSystem ) eLnge = 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 ); @@ -1638,7 +1638,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 ); @@ -1649,7 +1649,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 ) @@ -1663,15 +1663,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() ); @@ -1681,7 +1681,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 ); } @@ -1698,34 +1698,34 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr } -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; @@ -1775,7 +1775,7 @@ String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, void SvNumberformat::Build50Formatstring( String& rStr ) const { - rStr = StripNewCurrencyDelimiters( sFormatstring, TRUE ); + rStr = StripNewCurrencyDelimiters( sFormatstring, sal_True ); } @@ -1841,7 +1841,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) @@ -1850,7 +1850,7 @@ void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString) return; } fNumber *= 100; - bModified = TRUE; + bModified = sal_True; } if (fNumber == 0.0) @@ -1885,12 +1885,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].GetnAnz() > 0) @@ -1898,15 +1898,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].GetnAnz(); - for (USHORT i = 0; i < nAnz; i++) + sal_Bool bRes = sal_False; + const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); + for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) { @@ -1915,7 +1915,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: @@ -1932,24 +1932,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_uIntPtr nPrec, sal_uIntPtr x0, sal_uIntPtr x1, + sal_uIntPtr y0, sal_uIntPtr y1, + sal_uIntPtr& x2,sal_uIntPtr& y2) { x2 = ((y0+nPrec)/y1)*x1 - x0; y2 = ((y0+nPrec)/y1)*y1 - y0; } */ -ULONG SvNumberformat::ImpGGT(ULONG x, ULONG y) +sal_uIntPtr SvNumberformat::ImpGGT(sal_uIntPtr x, sal_uIntPtr y) { if (y == 0) return x; else { - ULONG z = x%y; + sal_uIntPtr z = x%y; while (z) { x = y; @@ -1960,13 +1960,13 @@ ULONG SvNumberformat::ImpGGT(ULONG x, ULONG y) } } -ULONG SvNumberformat::ImpGGTRound(ULONG x, ULONG y) +sal_uIntPtr SvNumberformat::ImpGGTRound(sal_uIntPtr x, sal_uIntPtr y) { if (y == 0) return x; else { - ULONG z = x%y; + sal_uIntPtr z = x%y; while ((double)z/(double)y > D_EPS) { x = y; @@ -2042,11 +2042,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) @@ -2055,14 +2055,14 @@ BOOL SvNumberformat::GetOutputString(double fNumber, OutString = rScan.GetTrueString(); else OutString = rScan.GetFalseString(); - return FALSE; + return sal_False; } if (eType & NUMBERFORMAT_TEXT && bStandard) { 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 @@ -2100,26 +2100,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; @@ -2136,20 +2136,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].GetnAnz(); + const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); 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]) { @@ -2158,7 +2158,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: @@ -2196,13 +2196,13 @@ BOOL SvNumberformat::GetOutputString(double fNumber, case NUMBERFORMAT_FRACTION: { String sStr, sFrac, sDiv; // Strings, Wert fuer - ULONG nFrac, nDiv; // Vorkommaanteil + sal_uIntPtr 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 @@ -2211,30 +2211,30 @@ BOOL SvNumberformat::GetOutputString(double fNumber, // zu gross { OutString = rScan.GetErrorString(); - return FALSE; + return sal_False; } if (rInfo.nCntExp == 0) { DBG_ERROR("SvNumberformat:: Bruch, nCntExp == 0"); - return FALSE; + return sal_False; } - ULONG nBasis = ((ULONG)floor( // 9, 99, 999 ,... + sal_uIntPtr nBasis = ((sal_uIntPtr)floor( // 9, 99, 999 ,... pow(10.0,rInfo.nCntExp))) - 1; - ULONG x0, y0, x1, y1; + sal_uIntPtr 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_uIntPtr) floor(fNumber*nBasis); // z.B. 2/9 <= x < 3/9 if (x0 == 0) // => x0 = 2 { y0 = 1; @@ -2260,12 +2260,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_uIntPtr nGgt = ImpGGT(y0, x0); // x0/y0 kuerzen x0 /= nGgt; y0 /= nGgt; // Einschachteln: - ULONG x2 = 0; - ULONG y2 = 0; - BOOL bStop = FALSE; + sal_uIntPtr x2 = 0; + sal_uIntPtr y2 = 0; + sal_Bool bStop = sal_False; while (!bStop) { #ifdef GCC @@ -2289,20 +2289,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; @@ -2313,8 +2313,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_uIntPtr x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl + sal_uIntPtr y2 = ((y0+nBasis)/y1)*y1 - y0; // GetNextFareyNumber(nBasis, x0, x1, y0, y1, x2, y2); x0 = x1; y0 = y1; @@ -2343,14 +2343,14 @@ BOOL SvNumberformat::GetOutputString(double fNumber, } else // grosse Nenner { // 0,1234->123/1000 - ULONG nGgt; + sal_uIntPtr nGgt; /* nDiv = nBasis+1; - nFrac = ((ULONG)floor(0.5 + fNumber * + nFrac = ((sal_uIntPtr)floor(0.5 + fNumber * pow(10.0,rInfo.nCntExp))); */ nDiv = 10000000; - nFrac = ((ULONG)floor(0.5 + fNumber * 10000000.0)); + nFrac = ((sal_uIntPtr)floor(0.5 + fNumber * 10000000.0)); nGgt = ImpGGT(nDiv, nFrac); if (nGgt > 1) { @@ -2369,7 +2369,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if (nDiv > nBasis) { nDiv = nBasis; - nFrac = ((ULONG)floor(0.5 + fNumber * + nFrac = ((sal_uIntPtr)floor(0.5 + fNumber * pow(10.0,rInfo.nCntExp))); nGgt = ImpGGTRound(nDiv, nFrac); if (nGgt > 1) @@ -2386,9 +2386,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_uIntPtr) floor(fNum1); sStr.Erase(); } else if (fNum == 0.0 && nFrac != 0) @@ -2411,10 +2411,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) @@ -2424,7 +2424,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = FALSE; + bCont = sal_False; } // weiter Zaehler: if ( !bCont ) @@ -2438,7 +2438,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = FALSE; + bCont = sal_False; } } // weiter Hauptzahl @@ -2459,11 +2459,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, @@ -2503,7 +2503,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); @@ -2513,7 +2513,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]; @@ -2525,7 +2525,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = FALSE; + bCont = sal_False; } // weiter Hauptzahl: if ( !bCont ) @@ -2548,20 +2548,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 @@ -2569,22 +2569,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 @@ -2592,14 +2592,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_uIntPtr nSeconds = (sal_uIntPtr)floor( fTime ); String sSecStr( ::rtl::math::doubleToUString( fTime-nSeconds, rtl_math_StringFormat_F, int(nCntPost), '.')); @@ -2618,7 +2618,7 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, xub_StrLen nSecPos = 0; // Zum Ziffernweisen // abarbeiten - ULONG nHour, nMin, nSec; + sal_uIntPtr nHour, nMin, nSec; if (!rInfo.bThousand) // kein [] Format { nHour = (nSeconds/3600) % 24; @@ -2667,8 +2667,8 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, nHour -= 12; } } - const USHORT nAnz = NumFor[nIx].GetnAnz(); - for (USHORT i = 0; i < nAnz; i++) + const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); + for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) { @@ -2677,7 +2677,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: @@ -2711,7 +2711,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( @@ -2757,29 +2757,29 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, } -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.GetnAnz(); - USHORT i; + const sal_uInt16 nAnz = rNumFor.GetnAnz(); + 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; } @@ -2828,7 +2828,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(); @@ -2848,19 +2848,19 @@ 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.GetnAnz(); - for ( USHORT i = 0; i < nAnz; i++ ) + const sal_uInt16 nAnz = rNumFor.GetnAnz(); + for ( sal_uInt16 i = 0; i < nAnz; i++ ) { if ( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_CALENDAR ) { @@ -2872,10 +2872,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; } @@ -2904,27 +2904,27 @@ void SvNumberformat::ImpAppendEraG( String& OutString, } -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].GetnAnz(); + const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); 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]) { @@ -2943,7 +2943,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: @@ -3087,29 +3087,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; @@ -3124,14 +3124,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_uIntPtr nSeconds = (sal_uIntPtr)floor( fTime ); String sSecStr( ::rtl::math::doubleToUString( fTime-nSeconds, rtl_math_StringFormat_F, int(nCntPost), '.')); sSecStr.EraseLeadingChars('0'); @@ -3149,7 +3149,7 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber, xub_StrLen nSecPos = 0; // Zum Ziffernweisen // abarbeiten - ULONG nHour, nMin, nSec; + sal_uIntPtr nHour, nMin, nSec; if (!rInfo.bThousand) // [] Format { nHour = (nSeconds/3600) % 24; @@ -3196,8 +3196,8 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber, nHour -= 12; } } - const USHORT nAnz = NumFor[nIx].GetnAnz(); - for (USHORT i = 0; i < nAnz; i++) + const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); + for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) { @@ -3216,7 +3216,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: @@ -3409,23 +3409,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 '-' } @@ -3437,17 +3437,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) @@ -3491,12 +3491,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 @@ -3506,8 +3506,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) @@ -3519,7 +3519,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: @@ -3544,21 +3544,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); @@ -3600,27 +3600,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: @@ -3639,7 +3639,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: @@ -3759,7 +3759,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 { @@ -3781,18 +3781,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: @@ -3803,7 +3803,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: @@ -3871,10 +3871,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.) @@ -3886,13 +3886,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) @@ -3909,9 +3909,9 @@ void SvNumberformat::GetNumForInfo( USHORT nNumFor, short& rScannedType, else { nAnzLeading = 0; - BOOL bStop = FALSE; - USHORT i = 0; - const USHORT nAnz = NumFor[nNumFor].GetnAnz(); + sal_Bool bStop = sal_False; + sal_uInt16 i = 0; + const sal_uInt16 nAnz = NumFor[nNumFor].GetnAnz(); while (!bStop && i < nAnz) { short nType = rInfo.nTypeArray[i]; @@ -3924,18 +3924,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].GetnAnz(); + sal_uInt16 nAnz = NumFor[nNumFor].GetnAnz(); if ( !nAnz ) return NULL; if ( nPos == 0xFFFF ) @@ -3973,12 +3973,12 @@ const String* SvNumberformat::GetNumForString( USHORT nNumFor, USHORT 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].GetnAnz(); + sal_uInt16 nAnz = NumFor[nNumFor].GetnAnz(); if ( !nAnz ) return 0; if ( nPos == 0xFFFF ) @@ -4015,15 +4015,15 @@ short SvNumberformat::GetNumForType( USHORT nNumFor, USHORT 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; } @@ -4032,8 +4032,8 @@ DateFormat SvNumberformat::GetDateOrder() const if ( (eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE ) { short const * const pType = NumFor[0].Info().nTypeArray; - USHORT nAnz = NumFor[0].GetnAnz(); - for ( USHORT j=0; j 3 ) return NULL; @@ -4165,10 +4165,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].GetnAnz() == 0 && eOp1 == NUMBERFORMAT_OP_NO ); // with 2 subformats [>=0];[<0] is implied if no condition specified @@ -4180,26 +4180,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].GetnAnz() == 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].GetnAnz() == 0 && NumFor[1].GetnAnz() > 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 @@ -4251,13 +4251,13 @@ String SvNumberformat::GetMappedFormatstring( aPrefix += 't'; // must be lowercase, otherwise taken as literal } - USHORT nAnz = NumFor[n].GetnAnz(); + sal_uInt16 nAnz = NumFor[n].GetnAnz(); if ( nSem && (nAnz || aPrefix.Len()) ) { for ( ; nSem; --nSem ) aStr += ';'; for ( ; nSub <= n; ++nSub ) - bDefault[nSub] = FALSE; + bDefault[nSub] = sal_False; } if ( aPrefix.Len() ) @@ -4267,7 +4267,7 @@ String SvNumberformat::GetMappedFormatstring( { const short* pType = NumFor[n].Info().nTypeArray; const String* pStr = NumFor[n].Info().sStrArray; - for ( USHORT j=0; j( p - rStr.GetBuffer()); } break; } if ( bEscaped && *p != '\\' ) - bEscaped = FALSE; + bEscaped = sal_False; ++p; } if ( bFound ) @@ -4508,31 +4508,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++; @@ -4567,12 +4567,12 @@ xub_StrLen SvNumberformat::GetQuoteEnd( const String& rStr, xub_StrLen nPos, } -USHORT SvNumberformat::ImpGetNumForStringElementCount( USHORT nNumFor ) const +sal_uInt16 SvNumberformat::ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const { - USHORT nCnt = 0; - USHORT nAnz = NumFor[nNumFor].GetnAnz(); + sal_uInt16 nCnt = 0; + sal_uInt16 nAnz = NumFor[nNumFor].GetnAnz(); short const * const pType = NumFor[nNumFor].Info().nTypeArray; - for ( USHORT j=0; jsKeyword[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 : @@ -156,7 +156,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: @@ -172,7 +172,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; } @@ -181,7 +181,7 @@ void ImpSvNumberformatScan::InitKeywords() const if ( !bKeywordsNeedInit ) return ; ((ImpSvNumberformatScan*)this)->SetDependentKeywords(); - bKeywordsNeedInit = FALSE; + bKeywordsNeedInit = sal_False; } @@ -457,7 +457,7 @@ void ImpSvNumberformatScan::SetDependentKeywords() } -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); @@ -515,7 +515,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); } } } @@ -546,7 +546,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; @@ -750,7 +750,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 && @@ -760,7 +760,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 ) { @@ -840,7 +840,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, } else { - BOOL bDontStop = FALSE; + sal_Bool bDontStop = sal_False; switch (cToken) { case '/': // AM/PM, A/P @@ -856,7 +856,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; } } } @@ -925,7 +925,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; @@ -938,7 +938,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString) if (bStar) return nPos; // Fehler: doppelter '*' else - bStar = TRUE; + bStar = sal_True; } nAnzStrings++; } @@ -946,7 +946,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 @@ -958,7 +958,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) @@ -972,7 +972,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) @@ -986,7 +986,7 @@ USHORT ImpSvNumberformatScan::NextKeyword(USHORT i) return res; } -short ImpSvNumberformatScan::PreviousType( USHORT i ) +short ImpSvNumberformatScan::PreviousType( sal_uInt16 i ) { if ( i > 0 && i < nAnzStrings ) { @@ -999,7 +999,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) @@ -1016,7 +1016,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) @@ -1034,28 +1034,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; } @@ -1074,25 +1074,25 @@ 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)); @@ -1105,9 +1105,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); @@ -1131,8 +1131,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 @@ -1199,7 +1199,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 @@ -1222,18 +1222,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 @@ -1251,7 +1251,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; } @@ -1388,7 +1388,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(); @@ -1409,7 +1409,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) } -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; @@ -1431,8 +1431,8 @@ bool ImpSvNumberformatScan::InsertSymbol( USHORT & nPos, svt::NfSymbolType eType } -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 && @@ -1510,10 +1510,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) @@ -1595,7 +1595,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; @@ -1611,7 +1611,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; @@ -1736,7 +1736,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) nPos = nPos + sStrArray[i].Len(); if (!bThousand) // only once { - bThousand = TRUE; + bThousand = sal_True; cThousandFill = sStrArray[i+1].GetChar(0); } // Eat it, will be reinserted at proper @@ -1751,7 +1751,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(); @@ -1763,7 +1763,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; } @@ -1795,7 +1795,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( bFirst ) { - bFirst = FALSE; + bFirst = sal_False; rStr = rSepF; nTypeArray[i] = NF_SYMBOLTYPE_THSEP; } @@ -1872,7 +1872,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; @@ -1890,7 +1890,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; @@ -1927,7 +1927,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; @@ -1965,7 +1965,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) != ']' ) @@ -1981,7 +1981,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; } @@ -2062,7 +2062,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) } if (bThousand) // Expansion of grouping separators { - USHORT nMaxPos; + sal_uInt16 nMaxPos; if (bFrac) { if (bBlank) @@ -2239,7 +2239,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++; @@ -2267,7 +2267,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 @@ -2300,7 +2300,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(); @@ -2333,7 +2333,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++; @@ -2370,7 +2370,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]) @@ -2408,7 +2408,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++; @@ -2445,7 +2445,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(); @@ -2473,8 +2473,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++; @@ -2486,7 +2486,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++; @@ -2517,7 +2517,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++; @@ -2570,7 +2570,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 ) @@ -2615,7 +2615,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 && @@ -2783,7 +2783,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 d623a3f50026..0e82021acb3c 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -42,7 +42,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 { @@ -52,15 +52,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(); } @@ -72,7 +72,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() ) @@ -123,18 +123,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. @@ -143,9 +143,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 @@ -164,42 +164,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 @@ -208,7 +208,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; @@ -217,32 +217,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, @@ -252,14 +252,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/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx index 236f57824da2..d165d98fa684 100644 --- a/svl/source/svdde/ddecli.cxx +++ b/svl/source/svdde/ddecli.cxx @@ -86,7 +86,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 ) @@ -95,9 +95,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; @@ -108,11 +108,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 ) @@ -222,7 +222,7 @@ DdeConnection::~DdeConnection() // --- DdeConnection::IsConnected() -------------------------------- -BOOL DdeConnection::IsConnected() +sal_Bool DdeConnection::IsConnected() { CONVINFO c; #ifdef OS2 @@ -231,13 +231,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 ); } } @@ -280,7 +280,7 @@ DdeTransaction::DdeTransaction( DdeConnection& d, const String& rItemName, nTime = n; nId = 0; nType = 0; - bBusy = FALSE; + bBusy = sal_False; rDde.aTransactions.Insert( this ); } @@ -306,7 +306,7 @@ void DdeTransaction::Execute() HSZ hItem = *pName; void* pData = (void*)(const void *)aDdeData; DWORD nData = (DWORD)(long)aDdeData; - ULONG nIntFmt = aDdeData.pImp->nFmt; + sal_uIntPtr nIntFmt = aDdeData.pImp->nFmt; UINT nExtFmt = DdeData::GetExternalFormat( nIntFmt ); DdeInstData* pInst = ImpGetInstData(); @@ -342,7 +342,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, @@ -373,7 +373,7 @@ void __EXPORT DdeTransaction::Data( const DdeData* p ) // --- DdeTransaction::Done() -------------------------------------- -void __EXPORT DdeTransaction::Done( BOOL bDataValid ) +void __EXPORT DdeTransaction::Done( sal_Bool bDataValid ) { aDone.Call( (void*)bDataValid ); } @@ -389,7 +389,7 @@ DdeLink::DdeLink( DdeConnection& d, const String& aItemName, long n ) : DdeLink::~DdeLink() { - nType = (USHORT)XTYP_ADVSTOP; + nType = (sal_uInt16)XTYP_ADVSTOP; nTime = 0; } @@ -427,7 +427,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_uIntPtr 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 ba67d451be34..4ee7c7298242 100644 --- a/svl/source/svdde/ddedata.cxx +++ b/svl/source/svdde/ddedata.cxx @@ -58,7 +58,7 @@ DdeData::DdeData() // --- DdeData::DdeData() ------------------------------------------ -DdeData::DdeData( const void* p, long n, ULONG f ) +DdeData::DdeData( const void* p, long n, sal_uIntPtr f ) { pImp = new DdeDataImp; pImp->hData = NULL; @@ -109,12 +109,12 @@ void DdeData::Lock() // --- DdeData::GetFormat() ---------------------------------------- -ULONG DdeData::GetFormat() const +sal_uIntPtr DdeData::GetFormat() const { return pImp->nFmt; } -void DdeData::SetFormat( ULONG nFmt ) +void DdeData::SetFormat( sal_uIntPtr nFmt ) { pImp->nFmt = nFmt; } @@ -148,7 +148,7 @@ DdeData& DdeData::operator = ( const DdeData& rData ) return *this; } -ULONG DdeData::GetExternalFormat( ULONG nFmt ) +sal_uIntPtr DdeData::GetExternalFormat( sal_uIntPtr nFmt ) { switch( nFmt ) { @@ -177,7 +177,7 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt ) if( aName.Len() ) { HATOMTBL hSysTable = WinQuerySystemAtomTable(); - nFmt = (ULONG)WinAddAtom( hSysTable, (PSZ)aName.GetBuffer() ); + nFmt = (sal_uIntPtr)WinAddAtom( hSysTable, (PSZ)aName.GetBuffer() ); } #endif #endif @@ -186,7 +186,7 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt ) return nFmt; } -ULONG DdeData::GetInternalFormat( ULONG nFmt ) +sal_uIntPtr DdeData::GetInternalFormat( sal_uIntPtr nFmt ) { switch( nFmt ) { diff --git a/svl/source/svdde/ddedll.cxx b/svl/source/svdde/ddedll.cxx index a71662dd5e63..2394c9947465 100644 --- a/svl/source/svdde/ddedll.cxx +++ b/svl/source/svdde/ddedll.cxx @@ -48,7 +48,7 @@ extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) hDLLInst = hDLL; - return TRUE; + return sal_True; } /*************************************************************************** diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx index 708b2736f9cf..62f41a307efc 100644 --- a/svl/source/svdde/ddeimp.hxx +++ b/svl/source/svdde/ddeimp.hxx @@ -32,11 +32,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_uIntPtr +#define LPBYTE sal_uInt8* +#define LPWORD sal_uInt16* +#define LPDWORD sal_uIntPtr* #define LPCTSTR PCSZ #else @@ -49,10 +49,10 @@ /* extern "C" { -#define BOOL WIN_BOOL -#define BYTE WIN_BYTE -#undef BOOL -#undef BYTE +#define sal_Bool WIN_BOOL +#define sal_uInt8 WIN_BYTE +#undef sal_Bool +#undef sal_uInt8 }; */ @@ -143,7 +143,7 @@ struct DdeDataImp HDDEDATA hData; LPBYTE pData; long nData; - ULONG nFmt; + sal_uIntPtr nFmt; }; class DdeConnections; @@ -151,15 +151,15 @@ class DdeServices; struct DdeInstData { - USHORT nRefCount; + sal_uInt16 nRefCount; DdeConnections* pConnections; // Server long hCurConvSvr; - ULONG hDdeInstSvr; + sal_uIntPtr hDdeInstSvr; short nInstanceSvr; DdeServices* pServicesSvr; // Client - ULONG hDdeInstCli; + sal_uIntPtr hDdeInstCli; short nInstanceCli; }; diff --git a/svl/source/svdde/ddeml1.cxx b/svl/source/svdde/ddeml1.cxx index dd9cc2abdaa7..421fe6fd214d 100644 --- a/svl/source/svdde/ddeml1.cxx +++ b/svl/source/svdde/ddeml1.cxx @@ -54,10 +54,10 @@ #endif // static -inline BOOL ImpDdeMgr::MyWinDdePostMsg( HWND hWndTo, HWND hWndFrom, - USHORT nMsg, PDDESTRUCT pData, ULONG nFlags ) +inline sal_Bool ImpDdeMgr::MyWinDdePostMsg( HWND hWndTo, HWND hWndFrom, + sal_uInt16 nMsg, PDDESTRUCT pData, sal_uIntPtr nFlags ) { - BOOL bSuccess = WinDdePostMsg( hWndTo,hWndFrom,nMsg,pData,nFlags); + sal_Bool bSuccess = WinDdePostMsg( hWndTo,hWndFrom,nMsg,pData,nFlags); if( !bSuccess ) { WRITELOG("WinDdePostMsg:Failed!") @@ -74,13 +74,13 @@ inline BOOL ImpDdeMgr::MyWinDdePostMsg( HWND hWndTo, HWND hWndFrom, // ImpDdeMgr // ********************************************************************* -USHORT ImpDdeMgr::nLastErrInstance = 0; +sal_uInt16 ImpDdeMgr::nLastErrInstance = 0; // // Conversation-WndProc // Steuert Transaktionen eines Conversationhandles // -MRESULT EXPENTRY ConvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2) +MRESULT EXPENTRY ConvWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2) { #if defined(DBG_UTIL) && defined(OV_DEBUG) if( nMsg >= WM_DDE_FIRST && nMsg <= WM_DDE_LAST) @@ -96,7 +96,7 @@ MRESULT EXPENTRY ConvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2) // Server-WndProc // DDE-Server-Window der App // -MRESULT EXPENTRY ServerWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2) +MRESULT EXPENTRY ServerWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2) { #if defined(DBG_UTIL) && defined(OV_DEBUG) if( nMsg >= WM_DDE_FIRST && nMsg <= WM_DDE_LAST) @@ -109,9 +109,9 @@ MRESULT EXPENTRY ServerWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2) } -inline HDDEDATA ImpDdeMgr::Callback( USHORT nTransactionType, - USHORT nClipboardFormat, HCONV hConversationHandle, HSZ hsz1, - HSZ hsz2, HDDEDATA hData, ULONG nData1, ULONG nData2 ) +inline HDDEDATA ImpDdeMgr::Callback( sal_uInt16 nTransactionType, + sal_uInt16 nClipboardFormat, HCONV hConversationHandle, HSZ hsz1, + HSZ hsz2, HDDEDATA hData, sal_uIntPtr nData1, sal_uIntPtr nData2 ) { HDDEDATA hRet = (HDDEDATA)0; if( pCallback ) @@ -132,8 +132,8 @@ ImpDdeMgr::ImpDdeMgr() pAppTable = 0; pConvTable = 0; pTransTable = 0; - bServFilterOn = TRUE; - bInSyncTrans = FALSE; + bServFilterOn = sal_True; + bInSyncTrans = sal_False; CreateServerWnd(); pData = InitAll(); @@ -155,11 +155,11 @@ ImpDdeMgr::~ImpDdeMgr() } -BOOL ImpDdeMgr::IsSameInstance( HWND hWnd ) +sal_Bool ImpDdeMgr::IsSameInstance( HWND hWnd ) { TID tid; PID pid; WinQueryWindowProcess( hWnd, &pid, &tid ); - return (BOOL)(pid == pidThis); + return (sal_Bool)(pid == pidThis); } HSZ ImpDdeMgr::GetAppName( HWND hWnd ) @@ -178,7 +178,7 @@ ImpDdeMgr* ImpDdeMgr::GetImpDdeMgrInstance( HWND hWnd ) TID tid; PID pidApp; WinQueryWindowProcess( hWnd, &pidApp, &tid ); HWND* pApp = ImpDdeMgr::GetAppTable( pData ); - USHORT nCurApp = 0; + sal_uInt16 nCurApp = 0; while( nCurApp < pData->nMaxAppCount ) { HWND hCurWin = *pApp; @@ -208,7 +208,7 @@ void ImpDdeMgr::CleanUp() ImpService* pPtr = pServices; if( pPtr ) { - for( USHORT nIdx = 0; nIdx < nServiceCount; nIdx++, pPtr++ ) + for( sal_uInt16 nIdx = 0; nIdx < nServiceCount; nIdx++, pPtr++ ) { HSZ hStr = pPtr->hBaseServName; if( hStr ) @@ -221,7 +221,7 @@ void ImpDdeMgr::CleanUp() delete pServices; pServices = 0; } - bServFilterOn = TRUE; // default setting DDEML + bServFilterOn = sal_True; // default setting DDEML UnregisterDDEMLApp(); } @@ -229,7 +229,7 @@ void ImpDdeMgr::RegisterDDEMLApp() { HWND* pPtr = pAppTable; HWND hCur; - USHORT nPos = 0; + sal_uInt16 nPos = 0; while( nPos < pData->nMaxAppCount ) { hCur = *pPtr; @@ -247,7 +247,7 @@ void ImpDdeMgr::RegisterDDEMLApp() void ImpDdeMgr::UnregisterDDEMLApp() { HWND* pPtr = pAppTable; - USHORT nPos = 0; + sal_uInt16 nPos = 0; while( nPos < pData->nMaxAppCount ) { if (*pPtr == hWndServer ) @@ -269,9 +269,9 @@ ImpDdeMgrData* ImpDdeMgr::AccessMgrData() return pData; } -USHORT ImpDdeMgr::DdeGetLastError() +sal_uInt16 ImpDdeMgr::DdeGetLastError() { - USHORT nErr; + sal_uInt16 nErr; if ( !pData ) nErr = DMLERR_DLL_NOT_INITIALIZED; else if ( nLastErrInstance ) @@ -286,7 +286,7 @@ USHORT ImpDdeMgr::DdeGetLastError() -USHORT ImpDdeMgr::DdeInitialize( PFNCALLBACK pCallbackProc, ULONG nTransactionFilter ) +sal_uInt16 ImpDdeMgr::DdeInitialize( PFNCALLBACK pCallbackProc, sal_uIntPtr nTransactionFilter ) { if ( !nLastErrInstance ) { @@ -327,7 +327,7 @@ HCONV ImpDdeMgr::DdeConnectImp( HSZ hszService,HSZ hszTopic,CONVCONTEXT* pCC) if( !pCC ) pCC = &aDefaultContext; - ULONG nBufLen; + sal_uIntPtr nBufLen; PSZ pService = AllocAtomName( (ATOM)hszService, nBufLen ); PSZ pTopic = AllocAtomName( (ATOM)hszTopic, nBufLen ); #if 0 && defined(OV_DEBUG) @@ -402,7 +402,7 @@ HCONV ImpDdeMgr::DdeConnectImp( HSZ hszService,HSZ hszTopic,CONVCONTEXT* pCC) HCONV ImpDdeMgr::DdeConnect( HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC) { ////WRITELOG("DdeConnect:Start") - bListConnect = FALSE; + bListConnect = sal_False; HCONV hResult = DdeConnectImp( hszService, hszTopic, pCC ); ////WRITELOG("DdeConnect:End") ////WRITESTATUS("DdeConnect:End") @@ -421,20 +421,20 @@ HCONVLIST ImpDdeMgr::DdeConnectList( HSZ hszService, HSZ hszTopic, hCurListId = hConvList; ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConvList; - if( (USHORT)hConvList >= pData->nMaxConvCount ||pConv->hWndThis==0 ) + pConv += (sal_uInt16)hConvList; + if( (sal_uInt16)hConvList >= pData->nMaxConvCount ||pConv->hWndThis==0 ) { nLastErrInstance = DMLERR_INVALIDPARAMETER; return 0; } GetLastServer(pData, hConvList, hLastConvInList); - nPrevConv = (USHORT)hLastConvInList; + nPrevConv = (sal_uInt16)hLastConvInList; } else hCurListId = (HCONVLIST)WinCreateWindow( HWND_OBJECT, WC_FRAME, CONVLISTNAME, 0,0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0,0,0); - bListConnect = TRUE; + bListConnect = sal_True; DdeConnectImp( hszService, hszTopic, pCC ); #if 0 && defined(OV_DEBUG) WRITELOG("DdeConnectList:ConnectionList:") @@ -442,7 +442,7 @@ HCONVLIST ImpDdeMgr::DdeConnectList( HSZ hszService, HSZ hszTopic, do { hDebug = DdeQueryNextServer( hCurListId, hDebug); - String aStr( (ULONG)hDebug ); + String aStr( (sal_uIntPtr)hDebug ); WRITELOG((char*)(const char*)aStr) } while( hDebug ); #endif @@ -453,7 +453,7 @@ HCONVLIST ImpDdeMgr::DdeConnectList( HSZ hszService, HSZ hszTopic, DDEINIT* ImpDdeMgr::CreateDDEInitData( HWND hWndDestination, HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC ) { - ULONG nLen1 = 0, nLen2 = 0; + sal_uIntPtr nLen1 = 0, nLen2 = 0; HATOMTBL hAtomTable = WinQuerySystemAtomTable(); if( hszService ) @@ -464,7 +464,7 @@ DDEINIT* ImpDdeMgr::CreateDDEInitData( HWND hWndDestination, HSZ hszService, DDEINIT* pBuf = 0; - ULONG nLen = sizeof(DDEINIT) + nLen1+ nLen2 + sizeof(CONVCONTEXT); + sal_uIntPtr nLen = sizeof(DDEINIT) + nLen1+ nLen2 + sizeof(CONVCONTEXT); if( !(MyDosAllocSharedMem((PPVOID)&pBuf, NULL, nLen, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_GIVEABLE | OBJ_ANY, "CreateDDEInitData"))) @@ -525,7 +525,7 @@ ImpHCONV* ImpDdeMgr::GetFirstServer(ImpDdeMgrData* pData, HCONVLIST hConvList, else { // Startposition - pPtr += (USHORT)rhConv; + pPtr += (sal_uInt16)rhConv; hConv = rhConv; pPtr++; hConv++; // auf den naechsten } @@ -567,12 +567,12 @@ ImpHCONV* ImpDdeMgr::GetLastServer(ImpDdeMgrData* pData, HCONVLIST hConvList, } // static -BOOL ImpDdeMgr::CheckConvListId( HCONVLIST hConvListId ) +sal_Bool ImpDdeMgr::CheckConvListId( HCONVLIST hConvListId ) { HAB hAB = WinQueryAnchorBlock( (HWND)hConvListId ); if( hAB ) return WinIsWindow( hAB, (HWND)hConvListId ); - return FALSE; + return sal_False; /* HAB hAB = WinQueryAnchorBlock( (HWND)hConvListId ); if( hAB ) @@ -580,9 +580,9 @@ BOOL ImpDdeMgr::CheckConvListId( HCONVLIST hConvListId ) char aBuf[ 16 ]; WinQueryWindowText( (HWND)hConvListId, sizeof(aBuf), aBuf ); if( strcmp(aBuf, CONVLISTNAME ) == 0 ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; */ } @@ -601,7 +601,7 @@ HCONV ImpDdeMgr::DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev) // Idee: DisconnectAll uebergibt das ServerWindow. Zu jedem HCONV // wird das Creator-Server-Wnd gespeichert. Disconnect braucht // dann nur noch die Window-Handles zu vergleichen -BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv ) +sal_Bool ImpDdeMgr::DdeDisconnect( HCONV hConv ) { WRITELOG("DdeDisconnect:Start") ////WRITESTATUS("DdeDisconnect:Start") @@ -610,14 +610,14 @@ BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv ) if ( !pData ) { ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return FALSE; + return sal_False; } - ImpHCONV* pConv = GetConvTable(pData) + (USHORT)hConv; + ImpHCONV* pConv = GetConvTable(pData) + (sal_uInt16)hConv; - if( (USHORT)hConv >= pData->nMaxConvCount || pConv->hWndThis==0 ) + if( (sal_uInt16)hConv >= pData->nMaxConvCount || pConv->hWndThis==0 ) { nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED; - return FALSE; + return sal_False; } PID pidApp; TID tid; @@ -633,7 +633,7 @@ BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv ) WinQueryWindowProcess( hWndThis, &pidThis, &tid ); WinQueryWindowProcess( hWndPartner, &pidPartner, &tid ); if( pidApp != pidThis && pidApp != pidPartner ) - return TRUE; // gehoert nicht der App -> ueberspringen + return sal_True; // gehoert nicht der App -> ueberspringen HCONV hConvPartner = pConv->hConvPartner; @@ -644,14 +644,14 @@ BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv ) ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( pConv->hWndThis, 0 ); ImpDdeMgr* pThis = pObj->pThis; - pThis->SendUnadvises( hConv, 0, FALSE ); // alle Formate & NICHT loeschen - pThis->SendUnadvises( hConvPartner, 0, FALSE ); // alle Formate & NICHT loeschen + pThis->SendUnadvises( hConv, 0, sal_False ); // alle Formate & NICHT loeschen + pThis->SendUnadvises( hConvPartner, 0, sal_False ); // alle Formate & NICHT loeschen pConv->nStatus |= ST_TERMINATED; HAB hAB = WinQueryAnchorBlock( pConv->hWndThis ); // um die MessageQueue inne Gaenge zu halten - ULONG nTimerId = WinStartTimer( hAB, 0, 0, 50 ); + sal_uIntPtr nTimerId = WinStartTimer( hAB, 0, 0, 50 ); /* Die Partner-App muss ein DDE_TERMINATE posten, auf das @@ -664,7 +664,7 @@ BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv ) (PDDESTRUCT)0,DDEPM_RETRY); QMSG aQueueMsg; - BOOL bContinue = TRUE; + sal_Bool bContinue = sal_True; while( bContinue ) { if( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 )) @@ -673,7 +673,7 @@ BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv ) if( (!WinIsWindow( hAB, hWndPartner)) || (pConv->nStatus & ST_TERMACKREC) ) { - bContinue = FALSE; + bContinue = sal_False; if( pConv->nStatus & ST_TERMACKREC ) { WRITELOG("DdeDisconnect: TermAck received") @@ -685,7 +685,7 @@ BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv ) } } else - bContinue = FALSE; + bContinue = sal_False; } WinStopTimer( hAB, 0, nTimerId ); @@ -700,23 +700,23 @@ BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv ) WRITELOG("DdeDisconnect:End") //WRITESTATUS("DdeDisconnect:End") - return TRUE; + return sal_True; } // static -BOOL ImpDdeMgr::DdeDisconnectList( HCONVLIST hConvList ) +sal_Bool ImpDdeMgr::DdeDisconnectList( HCONVLIST hConvList ) { if( !CheckConvListId( hConvList ) ) { ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER; - return FALSE; + return sal_False; } ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData(); if ( !pData ) { ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return FALSE; + return sal_False; } HCONV hConv = 0; GetFirstServer( pData, hConvList, hConv ); @@ -726,7 +726,7 @@ BOOL ImpDdeMgr::DdeDisconnectList( HCONVLIST hConvList ) GetFirstServer( pData, hConvList, hConv ); } WinDestroyWindow( (HWND)hConvList ); - return TRUE; + return sal_True; } @@ -744,7 +744,7 @@ HCONV ImpDdeMgr::DdeReconnect(HCONV hConv) } // static -USHORT ImpDdeMgr::DdeQueryConvInfo(HCONV hConv, ULONG nTransId, CONVINFO* pCI) +sal_uInt16 ImpDdeMgr::DdeQueryConvInfo(HCONV hConv, sal_uIntPtr nTransId, CONVINFO* pCI) { if( !pCI || pCI->nSize == 0) return 0; @@ -769,14 +769,14 @@ USHORT ImpDdeMgr::DdeQueryConvInfo(HCONV hConv, ULONG nTransId, CONVINFO* pCI) pTrans = 0; ImpHCONV* pConv = ImpDdeMgr::GetConvTable( pData ); - pConv += (ULONG)hConv; + pConv += (sal_uIntPtr)hConv; if( hConv >= pData->nMaxConvCount || pConv->hWndThis == 0 ) { ImpDdeMgr::nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED; return 0; } - USHORT nSize = pCI->nSize; + sal_uInt16 nSize = pCI->nSize; if( nSize > sizeof(CONVINFO) ) nSize = sizeof(CONVINFO); CONVINFO aTempInfo; @@ -804,13 +804,13 @@ USHORT ImpDdeMgr::DdeQueryConvInfo(HCONV hConv, ULONG nTransId, CONVINFO* pCI) } // static -BOOL ImpDdeMgr::DdeSetUserHandle(HCONV hConv, ULONG nTransId, ULONG hUser) +sal_Bool ImpDdeMgr::DdeSetUserHandle(HCONV hConv, sal_uIntPtr nTransId, sal_uIntPtr hUser) { ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData(); if ( !pData ) { ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return FALSE; + return sal_False; } Transaction* pTrans = GetTransTable( pData ); pTrans += nTransId; @@ -818,53 +818,53 @@ BOOL ImpDdeMgr::DdeSetUserHandle(HCONV hConv, ULONG nTransId, ULONG hUser) pTrans->hConvOwner != hConv ) { ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER; - return FALSE; + return sal_False; } if( !pTrans->hConvOwner) { ImpDdeMgr::nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID; - return FALSE; + return sal_False; } pTrans->nUser = hUser; - return TRUE; + return sal_True; } -BOOL ImpDdeMgr::DdeAbandonTransaction( HCONV hConv, ULONG nTransId ) +sal_Bool ImpDdeMgr::DdeAbandonTransaction( HCONV hConv, sal_uIntPtr nTransId ) { ////WRITELOG("DdeAbandonTransaction:Start") if( !pData ) { nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return FALSE; + return sal_False; } ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; if( nTransId < 1 || nTransId >= pData->nMaxTransCount || hConv < 1 || hConv >= pData->nMaxConvCount || !pConv->hWndThis) { nLastErrInstance = DMLERR_INVALIDPARAMETER; - return FALSE; + return sal_False; } if( !hConv ) { DBG_ASSERT(0,"DdeAbandonTransaction:NULL-hConv not supported"); nLastErrInstance = DMLERR_INVALIDPARAMETER; - return FALSE; + return sal_False; } Transaction* pTrans = pTransTable; - pTrans += (USHORT)nTransId; + pTrans += (sal_uInt16)nTransId; if( pTrans->hConvOwner != hConv ) { nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID; - return FALSE; + return sal_False; } if( bInSyncTrans && nTransId == nSyncTransId ) { - bSyncAbandonTrans = TRUE; - return TRUE; + bSyncAbandonTrans = sal_True; + return sal_True; } - USHORT nTempType = pTrans->nType; + sal_uInt16 nTempType = pTrans->nType; nTempType &= (~XTYPF_MASK); if( nTempType == (XTYP_ADVREQ & ~(XTYPF_NOBLOCK))) { @@ -897,7 +897,7 @@ BOOL ImpDdeMgr::DdeAbandonTransaction( HCONV hConv, ULONG nTransId ) WM_DDE_UNADVISE, pOutDDEData, DDEPM_RETRY ) ) { WRITELOG("DdeAbandTrans:PostMsg Failed") - return FALSE; + return sal_False; } #ifdef SO_DDE_ABANDON_TRANSACTION_WAIT_ACK WaitTransState( pTrans, nTransId, XST_UNADVACKRCVD, 0 ); @@ -911,40 +911,40 @@ BOOL ImpDdeMgr::DdeAbandonTransaction( HCONV hConv, ULONG nTransId ) FreeTransaction( pData, nTransId ); } WRITELOG("DdeAbandonTransaction:End") - return TRUE; + return sal_True; } // wird von einem Server aufgerufen, wenn sich die Daten des // Topic/Item-Paars geaendert haben. Diese Funktion fordert // dann den Server auf, die Daten zu rendern (bei Hotlinks) und // benachrichtigt die Clients -BOOL ImpDdeMgr::DdePostAdvise( HSZ hszTopic, HSZ hszItem) +sal_Bool ImpDdeMgr::DdePostAdvise( HSZ hszTopic, HSZ hszItem) { ////WRITELOG("DdePostAdvise:Start") ////WRITESTATUS("DdePostAdvise:Start") #if 0 && defined( OV_DEBUG ) String aDebStr("DdePostAdvise:Item "); - aDebStr += (ULONG)hszItem; + aDebStr += (sal_uIntPtr)hszItem; WRITELOG((char*)(const char*)aDebStr) #endif Transaction* pTrans = pTransTable; pTrans++; - USHORT nCurTrans = 1; - USHORT nUsedTransactions = pData->nCurTransCount; + sal_uInt16 nCurTrans = 1; + sal_uInt16 nUsedTransactions = pData->nCurTransCount; while( nUsedTransactions && nCurTrans < pData->nMaxTransCount ) { HCONV hOwner = pTrans->hConvOwner; if( hOwner ) { nUsedTransactions--; - USHORT nTempType = pTrans->nType; + sal_uInt16 nTempType = pTrans->nType; nTempType &= (~XTYPF_MASK); if( nTempType == (XTYP_ADVREQ & (~XTYPF_NOBLOCK) ) ) { ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hOwner; + pConv += (sal_uInt16)hOwner; if(hszItem == pTrans->hszItem && pConv->hszTopic == hszTopic) { if( pConv->hConvPartner ) @@ -953,15 +953,15 @@ BOOL ImpDdeMgr::DdePostAdvise( HSZ hszTopic, HSZ hszItem) // -> auf Server-HCONV umschalten hOwner = pConv->hConvPartner; pConv = pConvTable; - pConv += (USHORT)hOwner; + pConv += (sal_uInt16)hOwner; } HWND hWndClient = pConv->hWndPartner; HWND hWndServer = pConv->hWndThis; #if 0 && defined( OV_DEBUG ) String aDebStr("DdePostAdvise: Server:"); - aDebStr += (ULONG)hWndServer; + aDebStr += (sal_uIntPtr)hWndServer; aDebStr += " Client:"; - aDebStr += (ULONG)hWndClient; + aDebStr += (sal_uIntPtr)hWndClient; WRITELOG((char*)(const char*)aDebStr) #endif DDESTRUCT* pOutDDEData; @@ -984,7 +984,7 @@ BOOL ImpDdeMgr::DdePostAdvise( HSZ hszTopic, HSZ hszItem) { // todo: FACK_REQ in Out-Data setzen, wenn pTrans->nType & XTYPF_ACKREQ ////WRITELOG("DdePostAdvise:Sending data/notification") - BOOL bSuccess = MyWinDdePostMsg( hWndClient, + sal_Bool bSuccess = MyWinDdePostMsg( hWndClient, hWndServer,WM_DDE_DATA, pOutDDEData, DDEPM_RETRY); if( bSuccess ) { @@ -1014,12 +1014,12 @@ BOOL ImpDdeMgr::DdePostAdvise( HSZ hszTopic, HSZ hszItem) pTrans++; } ////WRITELOG("DdePostAdvise:End") - return TRUE; + return sal_True; } -BOOL ImpDdeMgr::DdeEnableCallback( HCONV hConv, USHORT wCmd) +sal_Bool ImpDdeMgr::DdeEnableCallback( HCONV hConv, sal_uInt16 wCmd) { - return FALSE; + return sal_False; } // Rueckgabe: 0==Service nicht registriert; sonst Pointer auf Service-Eintrag @@ -1028,7 +1028,7 @@ ImpService* ImpDdeMgr::GetService( HSZ hszService ) ImpService* pPtr = pServices; if( !pPtr || !hszService ) return 0; - for( ULONG nIdx = 0; nIdx < nServiceCount; nIdx++, pPtr++ ) + for( sal_uIntPtr nIdx = 0; nIdx < nServiceCount; nIdx++, pPtr++ ) { if(( hszService == pPtr->hBaseServName ) || ( hszService == pPtr->hInstServName ) ) @@ -1049,7 +1049,7 @@ ImpService* ImpDdeMgr::PutService( HSZ hszService ) nServiceCount = DDEMLSERVICETABLE_INISIZE; } ImpService* pPtr = pServices; - USHORT nCurPos = 0; + sal_uInt16 nCurPos = 0; while( pPtr ) { if( pPtr->hBaseServName == 0 ) @@ -1079,11 +1079,11 @@ ImpService* ImpDdeMgr::PutService( HSZ hszService ) DdeKeepStringHandle( hszService ); - USHORT nStrLen = (USHORT)DdeQueryString( hszService, 0, 0, 0); + sal_uInt16 nStrLen = (sal_uInt16)DdeQueryString( hszService, 0, 0, 0); char* pBuf = new char[ nStrLen + 1 ]; DdeQueryString(hszService, pBuf, nStrLen, 850 /* CodePage*/ ); pBuf[ nStrLen ] = 0; - String aStr( (ULONG)hWndServer ); + String aStr( (sal_uIntPtr)hWndServer ); aStr += pBuf; HSZ hszInstServ = DdeCreateStringHandle( (PSZ)(const char*)pBuf, 850 ); delete [] pBuf; @@ -1093,21 +1093,21 @@ ImpService* ImpDdeMgr::PutService( HSZ hszService ) return pPtr; } -void ImpDdeMgr::BroadcastService( ImpService* pService, BOOL bRegistered ) +void ImpDdeMgr::BroadcastService( ImpService* pService, sal_Bool bRegistered ) { DBG_ASSERT(pService,"DDE:No Service"); if( !pService ) return; MPARAM aMp1 = (MPARAM)(pService->hBaseServName); MPARAM aMp2 = (MPARAM)(pService->hInstServName); - ULONG nMsg; + sal_uIntPtr nMsg; if( bRegistered ) nMsg = WM_DDEML_REGISTER; else nMsg = WM_DDEML_UNREGISTER; HWND* pPtr = pAppTable; - for( USHORT nPos = 0; nPos < pData->nMaxAppCount; nPos++, pPtr++ ) + for( sal_uInt16 nPos = 0; nPos < pData->nMaxAppCount; nPos++, pPtr++ ) { HWND hWndCurWin = *pPtr; if ( hWndCurWin && hWndCurWin != hWndServer ) @@ -1115,29 +1115,29 @@ void ImpDdeMgr::BroadcastService( ImpService* pService, BOOL bRegistered ) } } -HDDEDATA ImpDdeMgr::DdeNameService( HSZ hszService, USHORT afCmd ) +HDDEDATA ImpDdeMgr::DdeNameService( HSZ hszService, sal_uInt16 afCmd ) { HDDEDATA hRet = (HDDEDATA)1; if( afCmd & DNS_FILTERON ) - bServFilterOn = TRUE; + bServFilterOn = sal_True; else if( afCmd & DNS_FILTEROFF ) - bServFilterOn = FALSE; + bServFilterOn = sal_False; ImpService* pService = GetService( hszService ); - BOOL bRegister = (BOOL)(afCmd & DNS_REGISTER); + sal_Bool bRegister = (sal_Bool)(afCmd & DNS_REGISTER); if( bRegister ) { if( !pService ) { pService = PutService( hszService ); - BroadcastService( pService, TRUE ); + BroadcastService( pService, sal_True ); } } else { if( pService ) { - BroadcastService( pService, FALSE ); + BroadcastService( pService, sal_False ); DdeFreeStringHandle( pService->hBaseServName ); pService->hBaseServName = 0; DdeFreeStringHandle( pService->hInstServName ); @@ -1150,9 +1150,9 @@ HDDEDATA ImpDdeMgr::DdeNameService( HSZ hszService, USHORT afCmd ) // static -HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, - HCONV hConv, HSZ hszItem, USHORT nFormat, USHORT nType, - ULONG nTimeout, ULONG* pResult) +HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, sal_uIntPtr cbData, + HCONV hConv, HSZ hszItem, sal_uInt16 nFormat, sal_uInt16 nType, + sal_uIntPtr nTimeout, sal_uIntPtr* pResult) { //WRITELOG("DdeClientTransaction:Start") @@ -1176,21 +1176,21 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, return (HDDEDATA)0; } - BOOL bIsDdeHandle = (BOOL)(pDdeData && cbData==0xffffffff); - BOOL bAppOwnsHandle = (BOOL)( bIsDdeHandle && + sal_Bool bIsDdeHandle = (sal_Bool)(pDdeData && cbData==0xffffffff); + sal_Bool bAppOwnsHandle = (sal_Bool)( bIsDdeHandle && (((DDESTRUCT*)pDdeData)->fsStatus & IMP_HDATAAPPOWNED) ); - BOOL bNoData = (BOOL)(nType & XTYPF_NODATA)!=0; - BOOL bAckReq = (BOOL)(nType & XTYPF_ACKREQ)!=0; - USHORT nTypeFlags = nType & XTYPF_MASK; + sal_Bool bNoData = (sal_Bool)(nType & XTYPF_NODATA)!=0; + sal_Bool bAckReq = (sal_Bool)(nType & XTYPF_ACKREQ)!=0; + sal_uInt16 nTypeFlags = nType & XTYPF_MASK; nType &= (~XTYPF_MASK); - BOOL bSync = (BOOL)( nTimeout != TIMEOUT_ASYNC ) != 0; + sal_Bool bSync = (sal_Bool)( nTimeout != TIMEOUT_ASYNC ) != 0; if( nType == XTYP_ADVSTART ) - bSync = TRUE; + bSync = sal_True; // Mapping transaction -> OS/2-Message - USHORT nTimeoutErr, nMsg; + sal_uInt16 nTimeoutErr, nMsg; switch ( nType ) { case XTYP_ADVSTART: @@ -1232,7 +1232,7 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, default: nMsg = 0; } - if(!hConv || (USHORT)hConv>= pData->nMaxConvCount || !nType || !nMsg || + if(!hConv || (sal_uInt16)hConv>= pData->nMaxConvCount || !nType || !nMsg || (nType != XTYP_EXECUTE && (!hszItem || !nFormat)) ) { WRITELOG("DdeClientTransaction:Invalid parameter") @@ -1244,7 +1244,7 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, // ueber den Conversation handle das ImpDdeMgr-Objekt holen ImpHCONV* pConv = GetConvTable( pData ); - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( pConv->hWndThis, 0 ); ImpDdeMgr* pThis = pObj->pThis; @@ -1260,14 +1260,14 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, Transaction* pTrans; - BOOL bReqOnAdvLoop = FALSE; - ULONG nTransId = GetTransaction( pData, hConv, hszItem, nFormat ); + sal_Bool bReqOnAdvLoop = sal_False; + sal_uIntPtr nTransId = GetTransaction( pData, hConv, hszItem, nFormat ); if( nTransId ) { // WRITELOG("DdeClientTransaction:Transaction found") pTrans = GetTransTable( pData ); - pTrans += (USHORT)nTransId; - USHORT nTransType = pTrans->nType; + pTrans += (sal_uInt16)nTransId; + sal_uInt16 nTransType = pTrans->nType; nTransType &= (~XTYPF_MASK); if( (nType != XTYP_REQUEST && nTransType == nType) || // wird Advise-Loop schon zum requesten missbraucht ? @@ -1300,12 +1300,12 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, pTrans->nType |= XTYPF_ACKREQ; if( pResult ) *pResult = nTransId; - return (HDDEDATA)TRUE; + return (HDDEDATA)sal_True; case XTYP_REQUEST: // WRITELOG("DdeClientTransaction:Using adv trans for req") // nConvst wird unten auf XST_WAITING_REQDATA gesetzt - bReqOnAdvLoop = TRUE; + bReqOnAdvLoop = sal_True; break; default: @@ -1313,7 +1313,7 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER; if( bIsDdeHandle && !bAppOwnsHandle ) DdeFreeDataHandle( (HDDEDATA)pDdeData ); - return (HDDEDATA)FALSE; + return (HDDEDATA)sal_False; } } } @@ -1324,7 +1324,7 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, } pTrans = GetTransTable( pData ); - pTrans += (USHORT)nTransId; + pTrans += (sal_uInt16)nTransId; pTrans->nConvst = XST_WAITING_ACK; if( nType == XTYP_REQUEST ) pTrans->nConvst = XST_WAITING_REQDATA; @@ -1374,9 +1374,9 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, // WRITELOG("DdeClientTransaction:Starting sync. trans.") pThis->hSyncResponseData = (HDDEDATA)0; pThis->nSyncResponseMsg = 0; - pThis->bInSyncTrans = TRUE; + pThis->bInSyncTrans = sal_True; pThis->nSyncTransId = nTransId; - pThis->bSyncAbandonTrans = FALSE; + pThis->bSyncAbandonTrans = sal_False; if ( !MyWinDdePostMsg( hWndServer, hWndClient, nMsg, pOutDDEData, DDEPM_RETRY) ) @@ -1390,18 +1390,18 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, DBG_ASSERT(pTrans->nType==XTYP_ADVREQ,"DDE:Error!") pTrans->nConvst = 0; } - return FALSE; + return sal_False; } HAB hAB = WinQueryAnchorBlock( hWndClient ); - ULONG nDummyTimer = WinStartTimer( hAB, 0, 0, 50 ); - ULONG nTimeoutId = TID_USERMAX - nTransId; + sal_uIntPtr nDummyTimer = WinStartTimer( hAB, 0, 0, 50 ); + sal_uIntPtr nTimeoutId = TID_USERMAX - nTransId; WinStartTimer( hAB, hWndClient, nTimeoutId, nTimeout ); QMSG aQueueMsg; - BOOL bLoop = TRUE; + sal_Bool bLoop = sal_True; while( bLoop ) { if( pThis->nSyncResponseMsg ) - bLoop = FALSE; + bLoop = sal_False; else { if( WinGetMsg(hAB,&aQueueMsg,0,0,0 )) @@ -1409,7 +1409,7 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, WinDispatchMsg( hAB, &aQueueMsg ); } else - bLoop = FALSE; + bLoop = sal_False; } } @@ -1431,7 +1431,7 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, nMsg = pThis->nSyncResponseMsg; pThis->hSyncResponseData= 0; pThis->nSyncResponseMsg = 0; - pThis->bInSyncTrans = FALSE; + pThis->bInSyncTrans = sal_False; pThis->nSyncTransId = 0; if( !pDDEInData && nMsg != WM_TIMER ) { @@ -1452,7 +1452,7 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, case WM_DDE_ACK: { // WRITELOG("DdeClientTransaction:Ack received") - BOOL bPositive = (BOOL)(pDDEInData->fsStatus & DDE_FACK); + sal_Bool bPositive = (sal_Bool)(pDDEInData->fsStatus & DDE_FACK); MyDosFreeMem( pDDEInData,"DdeClientTransaction" ); pDDEInData = (HDDEDATA)bPositive; if( nType == XTYP_ADVSTART && pDDEInData ) @@ -1509,8 +1509,8 @@ HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData, MyDosFreeMem( pDDEInData,"DdeClientTransaction" ); pDDEInData = 0; } - pThis->bSyncAbandonTrans = FALSE; - pThis->bInSyncTrans = FALSE; + pThis->bSyncAbandonTrans = sal_False; + pThis->bInSyncTrans = sal_False; if( pThis->bSyncAbandonTrans && bReqOnAdvLoop ) pThis->DdeAbandonTransaction( hConv, nTransId ); } @@ -1584,10 +1584,10 @@ MRESULT ImpDdeMgr::DdeTimeout( ImpWndProcParams* pParams ) ////WRITELOG("DdeTimeout:Trans already processed->ignoring timeout") return (MRESULT)1; } - ULONG nTimerId = (ULONG)pParams->nPar1; - ULONG nTransId = TID_USERMAX - nTimerId; + sal_uIntPtr nTimerId = (sal_uIntPtr)pParams->nPar1; + sal_uIntPtr nTransId = TID_USERMAX - nTimerId; Transaction* pTrans = pTransTable; - pTrans += (USHORT)nTransId; + pTrans += (sal_uInt16)nTransId; if( nTransId < 1 || nTransId >= pData->nMaxTransCount || pTrans->hConvOwner == 0 ) { @@ -1596,7 +1596,7 @@ MRESULT ImpDdeMgr::DdeTimeout( ImpWndProcParams* pParams ) } if( bInSyncTrans && nTransId == nSyncTransId ) { - USHORT nTempType = pTrans->nType; + sal_uInt16 nTempType = pTrans->nType; nTempType &= (~XTYPF_MASK); // advise-loops koennen nur innerhalb synchroner // requests timeouts bekommen. die transaktion wird @@ -1632,10 +1632,10 @@ MRESULT ImpDdeMgr::DdeTerminate( ImpWndProcParams* pParams ) HCONV hConv = GetConvHandle( pData, hWndThis, hWndPartner ); #if 0 && defined( OV_DEBUG ) String strDebug("DdeTerminate:ConvHandle="); - strDebug += (USHORT)hConv; + strDebug += (sal_uInt16)hConv; WRITELOG((char*)(const char*)strDebug) #endif - ImpHCONV* pConv = pConvTable + (USHORT)hConv; + ImpHCONV* pConv = pConvTable + (sal_uInt16)hConv; if( hConv ) { // warten wir auf ein DDE_TERMINATE Acknowledge ? @@ -1655,14 +1655,14 @@ MRESULT ImpDdeMgr::DdeTerminate( ImpWndProcParams* pParams ) // Es muessen alle Trans geloescht werden, die als Owner den // Client oder den Server haben! // if( !(pConv->nStatus & ST_CLIENT ) ) - SendUnadvises( hConv, 0, FALSE ); // alle Formate & nicht loeschen - SendUnadvises( pConv->hConvPartner, 0, FALSE ); + SendUnadvises( hConv, 0, sal_False ); // alle Formate & nicht loeschen + SendUnadvises( pConv->hConvPartner, 0, sal_False ); // wir werden von draussen gekillt if ( !(nTransactFilter & CBF_SKIP_DISCONNECTS) ) { Callback( XTYP_DISCONNECT, 0, hConv, 0, 0, 0, - 0, (ULONG)IsSameInstance(hWndPartner)); + 0, (sal_uIntPtr)IsSameInstance(hWndPartner)); } // kann unsere Partner-App DDEML ? @@ -1692,7 +1692,7 @@ MRESULT ImpDdeMgr::DdeTerminate( ImpWndProcParams* pParams ) // hWndThis nicht loeschen, da wir den Handle noch fuer // das Acknowledge brauchen ////WRITELOG("DdeTerminate:Freeing conversation") - FreeConvHandle( pData, hConv, FALSE ); + FreeConvHandle( pData, hConv, sal_False ); } ////WRITELOG("DdeTerminate:Acknowledging DDE_TERMINATE") @@ -1725,7 +1725,7 @@ MRESULT ImpDdeMgr::DdeTerminate( ImpWndProcParams* pParams ) Client: GetConvHandle( HWNDClient, HWNDSender ) */ -MRESULT ImpDdeMgr::ConvWndProc( HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2 ) +MRESULT ImpDdeMgr::ConvWndProc( HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2 ) { ImpWndProcParams aParams; @@ -1740,7 +1740,7 @@ MRESULT ImpDdeMgr::ConvWndProc( HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2 ) #ifdef DBG_UTIL case WM_DDE_INITIATE : DBG_ASSERT(0,"dde:unexpected msg"); - nRet = (MRESULT)TRUE; + nRet = (MRESULT)sal_True; break; #endif @@ -1758,7 +1758,7 @@ MRESULT ImpDdeMgr::ConvWndProc( HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2 ) return nRet; } -MRESULT ImpDdeMgr::SrvWndProc( HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2 ) +MRESULT ImpDdeMgr::SrvWndProc( HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2 ) { MRESULT nRet = (MRESULT)0; @@ -1779,7 +1779,7 @@ MRESULT ImpDdeMgr::SrvWndProc( HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2 ) case WM_DDE_DATA : case WM_DDE_INITIATEACK : DBG_ASSERT(0,"dde:unexpected msg"); - nRet = (MRESULT)TRUE; + nRet = (MRESULT)sal_True; break; #endif @@ -1811,9 +1811,9 @@ MRESULT ImpDdeMgr::DdeAck( ImpWndProcParams* pParams ) DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); if( pInDDEData ) { - BOOL bPositive = (BOOL)(pInDDEData->fsStatus & DDE_FACK ) != 0; - BOOL bBusy = bPositive ? FALSE : (BOOL)(pInDDEData->fsStatus & DDE_FBUSY ) != 0; - BOOL bNotProcessed = (BOOL)(pInDDEData->fsStatus & DDE_NOTPROCESSED ) != 0; + sal_Bool bPositive = (sal_Bool)(pInDDEData->fsStatus & DDE_FACK ) != 0; + sal_Bool bBusy = bPositive ? sal_False : (sal_Bool)(pInDDEData->fsStatus & DDE_FBUSY ) != 0; + sal_Bool bNotProcessed = (sal_Bool)(pInDDEData->fsStatus & DDE_NOTPROCESSED ) != 0; #if 0 && defined( OV_DEBUG ) String aDebStr("DdeAck:Received "); if( bPositive ) @@ -1842,7 +1842,7 @@ MRESULT ImpDdeMgr::DdeAck( ImpWndProcParams* pParams ) WRITELOG("DdeAck:HCONV not found") } #endif - ULONG nTransId=GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); + sal_uIntPtr nTransId=GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); if( !nTransId ) { WRITELOG("DdeAck:Transaction not found") @@ -1850,7 +1850,7 @@ MRESULT ImpDdeMgr::DdeAck( ImpWndProcParams* pParams ) return (MRESULT)0; } - BOOL bThisIsSync = (BOOL)( bInSyncTrans && nTransId == nSyncTransId ); + sal_Bool bThisIsSync = (sal_Bool)( bInSyncTrans && nTransId == nSyncTransId ); #if 0 && defined( OV_DEBUG ) if( bThisIsSync) WRITELOG("DdeAck: sync transaction") @@ -1859,9 +1859,9 @@ MRESULT ImpDdeMgr::DdeAck( ImpWndProcParams* pParams ) #endif // pruefen, ob die Transaktion abgeschlossen ist. Transaction* pTrans = pTransTable; - pTrans += (USHORT)nTransId; + pTrans += (sal_uInt16)nTransId; ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; if( pTrans->nConvst == XST_UNADVSENT ) { @@ -1880,11 +1880,11 @@ MRESULT ImpDdeMgr::DdeAck( ImpWndProcParams* pParams ) return (MRESULT)0; } - USHORT nType = pTrans->nType; + sal_uInt16 nType = pTrans->nType; nType &= (~XTYPF_MASK); // beginn einer advise-loop oder request auf advise-loop ? // wenn ja: transaktion nicht loeschen - BOOL bFinished = (BOOL)(nType != XTYP_ADVSTART && + sal_Bool bFinished = (sal_Bool)(nType != XTYP_ADVSTART && nType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK)) ); if( bFinished ) { @@ -1914,14 +1914,14 @@ MRESULT ImpDdeMgr::DdeAck( ImpWndProcParams* pParams ) } -USHORT ImpDdeMgr::SendUnadvises(HCONV hConvServer,USHORT nFormat,BOOL bFree) +sal_uInt16 ImpDdeMgr::SendUnadvises(HCONV hConvServer,sal_uInt16 nFormat,sal_Bool bFree) { - USHORT nTransFound = 0; - BOOL bCallApp = (BOOL)(!(nTransactFilter & CBF_FAIL_ADVISES)); + sal_uInt16 nTransFound = 0; + sal_Bool bCallApp = (sal_Bool)(!(nTransactFilter & CBF_FAIL_ADVISES)); #if 0 && defined( OV_DEBUG ) String aStr("Unadvising transactions for HCONV="); - aStr += (ULONG)hConvServer; - aStr += " CallApp:"; aStr += (USHORT)bCallApp; + aStr += (sal_uIntPtr)hConvServer; + aStr += " CallApp:"; aStr += (sal_uInt16)bCallApp; WRITELOG((char*)aStr.GetStr()) #endif @@ -1932,13 +1932,13 @@ USHORT ImpDdeMgr::SendUnadvises(HCONV hConvServer,USHORT nFormat,BOOL bFree) return 0; ImpHCONV* pConvSrv = pConvTable; - pConvSrv += (USHORT)hConvServer; + pConvSrv += (sal_uInt16)hConvServer; HSZ hszTopic = pConvSrv->hszTopic; Transaction* pTrans = pTransTable; pTrans++; - USHORT nCurTransId = 1; - USHORT nCurTransactions = pData->nCurTransCount; + sal_uInt16 nCurTransId = 1; + sal_uInt16 nCurTransactions = pData->nCurTransCount; while( nCurTransactions && nCurTransId < pData->nMaxTransCount ) { if( pTrans->hConvOwner ) @@ -1956,7 +1956,7 @@ USHORT ImpDdeMgr::SendUnadvises(HCONV hConvServer,USHORT nFormat,BOOL bFree) hszTopic, pTrans->hszItem, 0,0,0 ); } if( bFree ) - FreeTransaction( pData, (ULONG)nCurTransId ); + FreeTransaction( pData, (sal_uIntPtr)nCurTransId ); } } nCurTransId++; @@ -1967,7 +1967,7 @@ USHORT ImpDdeMgr::SendUnadvises(HCONV hConvServer,USHORT nFormat,BOOL bFree) -HCONV ImpDdeMgr::CheckIncoming( ImpWndProcParams* pParams, ULONG nTransMask, +HCONV ImpDdeMgr::CheckIncoming( ImpWndProcParams* pParams, sal_uIntPtr nTransMask, HSZ& rhszItem ) { // ////WRITELOG("CheckIncoming") @@ -1982,7 +1982,7 @@ HCONV ImpDdeMgr::CheckIncoming( ImpWndProcParams* pParams, ULONG nTransMask, HWND hWndThis = pParams->hWndReceiver; HWND hWndClient = (HWND)pParams->nPar1; - BOOL bReject = (BOOL)(nTransactFilter & nTransMask); + sal_Bool bReject = (sal_Bool)(nTransactFilter & nTransMask); HCONV hConv; if( !bReject ) hConv = GetConvHandle( pData, hWndThis, hWndClient ); @@ -2016,17 +2016,17 @@ MRESULT ImpDdeMgr::DdeAdvise( ImpWndProcParams* pParams ) Transaction* pTrans = pTransTable; ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; // existiert schon ein Link auf Topic/Item/Format-Vektor ? - ULONG nTransId=GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); + sal_uIntPtr nTransId=GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); if( nTransId ) { ////WRITELOG("DdeAdvise:Transaction already exists") - pTrans += (USHORT)nTransId; + pTrans += (sal_uInt16)nTransId; // ist es eine AdviseLoop ? - USHORT nTempType = pTrans->nType; + sal_uInt16 nTempType = pTrans->nType; nTempType &= (~XTYPF_MASK); if( nTempType == XTYP_ADVREQ ) { @@ -2063,7 +2063,7 @@ MRESULT ImpDdeMgr::DdeAdvise( ImpWndProcParams* pParams ) if( nTransId ) { pTrans = pTransTable; - pTrans += (USHORT)nTransId; + pTrans += (sal_uInt16)nTransId; if( pInDDEData->fsStatus & DDE_FNODATA ) pTrans->nType |= XTYPF_NODATA; if( pInDDEData->fsStatus & DDE_FACKREQ ) @@ -2114,24 +2114,24 @@ MRESULT ImpDdeMgr::DdeData( ImpWndProcParams* pParams ) #if 0 && defined( OV_DEBUG ) { String aStr("DdeData Address:"); - aStr += (ULONG)pInDDEData; + aStr += (sal_uIntPtr)pInDDEData; WRITELOG((char*)aStr.GetStr()) } #endif - BOOL bSendAck; + sal_Bool bSendAck; if( pInDDEData && (pInDDEData->fsStatus & DDE_FACKREQ )) { WRITELOG("DdeData: Ackn requested") - bSendAck = TRUE; + bSendAck = sal_True; } else { WRITELOG("DdeData: Ackn not requested") - bSendAck = FALSE; + bSendAck = sal_False; } - ULONG nTransId = GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); + sal_uIntPtr nTransId = GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); if( !nTransId ) { WRITELOG("DdeData:Transaction not found") @@ -2156,11 +2156,11 @@ MRESULT ImpDdeMgr::DdeData( ImpWndProcParams* pParams ) } #endif - BOOL bThisIsSync = (BOOL)( bInSyncTrans && nTransId == nSyncTransId ); + sal_Bool bThisIsSync = (sal_Bool)( bInSyncTrans && nTransId == nSyncTransId ); // pruefen, ob die Transaktion abgeschlossen ist. Transaction* pTrans = pTransTable; - pTrans += (USHORT)nTransId; + pTrans += (sal_uInt16)nTransId; if( pTrans->nConvst == XST_WAITING_ACK ) { @@ -2182,11 +2182,11 @@ MRESULT ImpDdeMgr::DdeData( ImpWndProcParams* pParams ) } ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; - USHORT nType = pTrans->nType; + sal_uInt16 nType = pTrans->nType; nType &= (~XTYPF_MASK); - BOOL bNotAdviseLoop = (BOOL)(nType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK))); + sal_Bool bNotAdviseLoop = (sal_Bool)(nType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK))); if( !bThisIsSync ) { // WRITELOG("DdeData:Is async transaction") @@ -2244,15 +2244,15 @@ MRESULT ImpDdeMgr::DdeExecute( ImpWndProcParams* pParams ) DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); HSZ hszItem; HCONV hConv = CheckIncoming(pParams, 0, hszItem); - BOOL bSuccess = FALSE; + sal_Bool bSuccess = sal_False; ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; if ( hConv && !(nTransactFilter & CBF_FAIL_EXECUTES) && pInDDEData ) { if ( Callback( XTYP_EXECUTE, pInDDEData->usFormat, hConv, pConv->hszTopic, hszItem, pInDDEData, 0, 0 ) == (DDESTRUCT*)DDE_FACK ) - bSuccess = TRUE; + bSuccess = sal_True; } else { @@ -2272,7 +2272,7 @@ MRESULT ImpDdeMgr::DdeExecute( ImpWndProcParams* pParams ) } HCONV ImpDdeMgr::ConnectWithClient( HWND hWndClient, - HSZ hszPartner, HSZ hszService, HSZ hszTopic, BOOL bSameInst, + HSZ hszPartner, HSZ hszService, HSZ hszTopic, sal_Bool bSameInst, DDEINIT* pDDEData, CONVCONTEXT* pCC ) { ////WRITELOG("ConnectWithClient:Start") @@ -2282,10 +2282,10 @@ HCONV ImpDdeMgr::ConnectWithClient( HWND hWndClient, hszPartner, hszService, hszTopic ); if(!hConv ) return 0; - BOOL bFreeDdeData = FALSE; + sal_Bool bFreeDdeData = sal_False; if( !pDDEData ) { - bFreeDdeData = TRUE; + bFreeDdeData = sal_True; pDDEData = CreateDDEInitData( hWndClient,hszService,hszTopic, pCC ); PID pid; TID tid; WinQueryWindowProcess( hWndClient, &pid, &tid ); @@ -2308,7 +2308,7 @@ HCONV ImpDdeMgr::ConnectWithClient( HWND hWndClient, if( !(nTransactFilter & CBF_SKIP_CONNECT_CONFIRMS) ) { Callback( XTYP_CONNECT_CONFIRM, 0, hConv, hszTopic, hszService, - 0, 0, (ULONG)bSameInst ); + 0, 0, (sal_uIntPtr)bSameInst ); } if( bFreeDdeData ) @@ -2317,7 +2317,7 @@ HCONV ImpDdeMgr::ConnectWithClient( HWND hWndClient, } // HCONV der PartnerApp suchen & bei uns eintragen ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; pConv->hConvPartner = GetConvHandle( pData, hWndClient, hWndSrv ); #if 0 && defined(OV_DEBUG) if( !pConv->hConvPartner ) @@ -2335,8 +2335,8 @@ MRESULT ImpDdeMgr::DdeInitiate( ImpWndProcParams* pParams ) { ////WRITELOG("DdeInitiate:Received") HWND hWndClient = (HWND)(pParams->nPar1); -// BOOL bSameInst = IsSameInstance( hWndClient ); - BOOL bSameInst = (BOOL)(hWndClient==hWndServer); +// sal_Bool bSameInst = IsSameInstance( hWndClient ); + sal_Bool bSameInst = (sal_Bool)(hWndClient==hWndServer); DDEINIT* pDDEData = (DDEINIT*)pParams->nPar2; if ( ( nTransactFilter & (CBF_FAIL_CONNECTIONS | APPCMD_CLIENTONLY)) || @@ -2344,7 +2344,7 @@ MRESULT ImpDdeMgr::DdeInitiate( ImpWndProcParams* pParams ) ) { MyDosFreeMem( pDDEData,"DdeInitiate" ); - return (MRESULT)FALSE; // narda + return (MRESULT)sal_False; // narda } HSZ hszService = (HSZ)0; @@ -2370,7 +2370,7 @@ MRESULT ImpDdeMgr::DdeInitiate( ImpWndProcParams* pParams ) if( hszService && hszTopic ) { if( IsConvHandleAvailable(pData) && Callback( XTYP_CONNECT, - 0, 0, hszTopic,hszService, 0, 0, (ULONG)bSameInst)) + 0, 0, hszTopic,hszService, 0, 0, (sal_uIntPtr)bSameInst)) { // App erlaubt Verbindung mit Client ConnectWithClient( hWndClient, hszPartner, @@ -2384,7 +2384,7 @@ MRESULT ImpDdeMgr::DdeInitiate( ImpWndProcParams* pParams ) // vom Server eine Liste aller Service/Topic-Paare anfordern CONVCONTEXT* pCC=(CONVCONTEXT*)(pDDEData+pDDEData->offConvContext); DDESTRUCT* hList = Callback( XTYP_WILDCONNECT, 0, (HCONV)0, - hszTopic,hszService, (HDDEDATA)0, (ULONG)pCC, (ULONG)bSameInst ); + hszTopic,hszService, (HDDEDATA)0, (sal_uIntPtr)pCC, (sal_uIntPtr)bSameInst ); if( hList ) { HSZPAIR* pPairs = (HSZPAIR*)((char*)hList+hList->offabData); @@ -2411,7 +2411,7 @@ MRESULT ImpDdeMgr::DdeInitiate( ImpWndProcParams* pParams ) DdeFreeStringHandle( hszPartner ); MyDosFreeMem( pDDEData,"DdeInitiate" ); ////WRITELOG("DdeInitiate:End") - return (MRESULT)TRUE; + return (MRESULT)sal_True; } MRESULT ImpDdeMgr::DdeInitiateAck( ImpWndProcParams* pParams ) @@ -2424,7 +2424,7 @@ MRESULT ImpDdeMgr::DdeInitiateAck( ImpWndProcParams* pParams ) ////WRITELOG("DdeInitiateAck:Already connected") MyDosFreeMem( pDDEData,"DdeInitiateAck" ); WinPostMsg( hWndServer, WM_DDE_TERMINATE, (MPARAM)hWndServer, 0 ); - return (MRESULT)FALSE; + return (MRESULT)sal_False; } HWND hWndThis = pParams->hWndReceiver; @@ -2440,7 +2440,7 @@ MRESULT ImpDdeMgr::DdeInitiateAck( ImpWndProcParams* pParams ) hszPartnerApp, hszService, hszTopic, 0 ); ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hCurConv; + pConv += (sal_uInt16)hCurConv; // HCONV der PartnerApp suchen & bei uns eintragen pConv->hConvPartner = GetConvHandle( pData, hWndSrv, hWndThis ); @@ -2459,9 +2459,9 @@ MRESULT ImpDdeMgr::DdeInitiateAck( ImpWndProcParams* pParams ) { pConv = pConvTable; pConv += nPrevConv; - pConv->nNextHCONV = (USHORT)hCurConv; + pConv->nNextHCONV = (sal_uInt16)hCurConv; } - nPrevConv = (USHORT)hCurConv; + nPrevConv = (sal_uInt16)hCurConv; } DdeFreeStringHandle( hszService ); @@ -2470,7 +2470,7 @@ MRESULT ImpDdeMgr::DdeInitiateAck( ImpWndProcParams* pParams ) MyDosFreeMem( pDDEData,"DdeInitiateAck" ); ////WRITESTATUS("After DdeInitiateAck") ////WRITELOG("DdeInitiateAck:End") - return (MRESULT)TRUE; + return (MRESULT)sal_True; } MRESULT ImpDdeMgr::DdePoke( ImpWndProcParams* pParams ) @@ -2479,15 +2479,15 @@ MRESULT ImpDdeMgr::DdePoke( ImpWndProcParams* pParams ) HSZ hszItem = 0; DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); HCONV hConv = CheckIncoming( pParams, CBF_FAIL_REQUESTS, hszItem ); - BOOL bSuccess =FALSE; + sal_Bool bSuccess =sal_False; ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; if ( hConv && !(nTransactFilter & CBF_FAIL_POKES) && pInDDEData ) { if( Callback( XTYP_POKE, pInDDEData->usFormat, hConv, pConv->hszTopic, hszItem, pInDDEData, 0, 0 ) == (DDESTRUCT*)DDE_FACK ) - bSuccess = TRUE; + bSuccess = sal_True; } #if 0 && defined( OV_DEBUG ) else @@ -2523,7 +2523,7 @@ MRESULT ImpDdeMgr::DdeRequest( ImpWndProcParams* pParams ) if( hConv ) { ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; DDESTRUCT* pOutDDEData = Callback( XTYP_REQUEST, pInDDEData->usFormat, hConv, pConv->hszTopic, hszItem, (HDDEDATA)0, 0, 0 ); @@ -2563,26 +2563,26 @@ MRESULT ImpDdeMgr::DdeUnadvise( ImpWndProcParams* pParams ) DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); HWND hWndThis = pParams->hWndReceiver; HWND hWndClient = (HWND)pParams->nPar1; - USHORT nClosedTransactions = 0; + sal_uInt16 nClosedTransactions = 0; if( hConv ) { - USHORT nFormat = pInDDEData->usFormat; + sal_uInt16 nFormat = pInDDEData->usFormat; // alle Transaktionen des HCONVs loeschen ? if( !hszItem ) { // App benachrichtigen & Transaktionen loeschen - nClosedTransactions = SendUnadvises( hConv, nFormat, TRUE ); + nClosedTransactions = SendUnadvises( hConv, nFormat, sal_True ); } else { - ULONG nTransId = GetTransaction(pData, hConv, hszItem, nFormat); + sal_uIntPtr nTransId = GetTransaction(pData, hConv, hszItem, nFormat); if( nTransId ) { ////WRITELOG("DdeUnadvise:Transaction found") Transaction* pTrans = pTransTable; - pTrans += (USHORT)nTransId; + pTrans += (sal_uInt16)nTransId; ImpHCONV* pConv = pConvTable; - pConv += (USHORT)hConv; + pConv += (sal_uInt16)hConv; nClosedTransactions = 1; if( !(nTransactFilter & CBF_FAIL_ADVISES) ) Callback( XTYP_ADVSTOP, nFormat, hConv, @@ -2615,14 +2615,14 @@ MRESULT ImpDdeMgr::DdeUnadvise( ImpWndProcParams* pParams ) return (MRESULT)0; } -BOOL ImpDdeMgr::WaitTransState( Transaction* pTrans, ULONG nTransId, - USHORT nNewState, ULONG nTimeout ) +sal_Bool ImpDdeMgr::WaitTransState( Transaction* pTrans, sal_uIntPtr nTransId, + sal_uInt16 nNewState, sal_uIntPtr nTimeout ) { ////WRITELOG("WaitTransState:Start") ImpHCONV* pConv = pConvTable; pConv += pTrans->hConvOwner; HAB hAB = WinQueryAnchorBlock( pConv->hWndThis ); - ULONG nTimerId = WinStartTimer( hAB, 0, 0, 50 ); + sal_uIntPtr nTimerId = WinStartTimer( hAB, 0, 0, 50 ); QMSG aQueueMsg; // while( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 ) && @@ -2632,7 +2632,7 @@ BOOL ImpDdeMgr::WaitTransState( Transaction* pTrans, ULONG nTransId, // WinDispatchMsg( hAB, &aQueueMsg ); // } - BOOL bContinue = TRUE; + sal_Bool bContinue = sal_True; while( bContinue ) { if( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 )) @@ -2641,16 +2641,16 @@ BOOL ImpDdeMgr::WaitTransState( Transaction* pTrans, ULONG nTransId, if( (!WinIsWindow( hAB, pConv->hWndPartner)) || (pTrans->nConvst == nNewState) ) { - bContinue = FALSE; + bContinue = sal_False; } } else - bContinue = FALSE; + bContinue = sal_False; } WinStopTimer( hAB, 0, nTimerId ); ////WRITELOG("WaitTransState:End") - return TRUE; + return sal_True; } diff --git a/svl/source/svdde/ddeml2.cxx b/svl/source/svdde/ddeml2.cxx index 7de4602d12ff..6bcb4f7fcf27 100644 --- a/svl/source/svdde/ddeml2.cxx +++ b/svl/source/svdde/ddeml2.cxx @@ -50,10 +50,10 @@ // AllocAtomName // -PSZ ImpDdeMgr::AllocAtomName( ATOM hString, ULONG& rBufLen ) +PSZ ImpDdeMgr::AllocAtomName( ATOM hString, sal_uIntPtr& rBufLen ) { HATOMTBL hAtomTable = WinQuerySystemAtomTable(); - ULONG nLen = WinQueryAtomLength( hAtomTable, hString ); + sal_uIntPtr nLen = WinQueryAtomLength( hAtomTable, hString ); nLen++; PSZ pBuf = 0; if ( !MyDosAllocMem( (PPVOID)&pBuf, nLen, PAG_READ|PAG_WRITE|PAG_COMMIT | OBJ_ANY,"Atom" ) ) @@ -70,10 +70,10 @@ PSZ ImpDdeMgr::AllocAtomName( ATOM hString, ULONG& rBufLen ) // PDDESTRUCT ImpDdeMgr::MakeDDEObject( HWND hwnd, ATOM hItemName, - USHORT fsStatus, USHORT usFormat, PVOID pabData, ULONG usDataLen ) + sal_uInt16 fsStatus, sal_uInt16 usFormat, PVOID pabData, sal_uIntPtr usDataLen ) { PDDESTRUCT pddes = 0; - ULONG usItemLen; + sal_uIntPtr usItemLen; PULONG pulSharedObj; //WRITELOG("MakeDDEObject: Start") @@ -83,7 +83,7 @@ PDDESTRUCT ImpDdeMgr::MakeDDEObject( HWND hwnd, ATOM hItemName, else usItemLen = 1; - ULONG nTotalSize = sizeof(DDESTRUCT) + usItemLen + usDataLen; + sal_uIntPtr nTotalSize = sizeof(DDESTRUCT) + usItemLen + usDataLen; if( !(MyDosAllocSharedMem((PPVOID)&pulSharedObj, NULL, nTotalSize, @@ -92,7 +92,7 @@ PDDESTRUCT ImpDdeMgr::MakeDDEObject( HWND hwnd, ATOM hItemName, { pddes = (PDDESTRUCT) pulSharedObj; // siehe "Glenn Puchtel, DDE for OS/2" p.60 - pddes->cbData = (ULONG)usDataLen; + pddes->cbData = (sal_uIntPtr)usDataLen; pddes->fsStatus = fsStatus; pddes->usFormat = usFormat; pddes->offszItemName = sizeof( DDESTRUCT ); @@ -122,10 +122,10 @@ PDDESTRUCT ImpDdeMgr::MakeDDEObject( HWND hwnd, ATOM hItemName, // APIRET ImpDdeMgr::AllocNamedSharedMem( PPVOID ppBaseAddress, PSZ pName, - ULONG nElementSize, ULONG nElementCount ) + sal_uIntPtr nElementSize, sal_uIntPtr nElementCount ) { - ULONG nObjSize = (ULONG)(nElementSize * nElementCount ); - nObjSize += sizeof( ULONG ); // fuer ElementCount am Anfang des Blocks + sal_uIntPtr nObjSize = (sal_uIntPtr)(nElementSize * nElementCount ); + nObjSize += sizeof( sal_uIntPtr ); // fuer ElementCount am Anfang des Blocks *ppBaseAddress = 0; APIRET nRet = MyDosAllocSharedMem( ppBaseAddress, pName, nObjSize, @@ -134,7 +134,7 @@ APIRET ImpDdeMgr::AllocNamedSharedMem( PPVOID ppBaseAddress, PSZ pName, if ( !nRet ) { memset( *ppBaseAddress, 0, nObjSize ); - ULONG* pULONG = (ULONG*)*ppBaseAddress; + sal_uIntPtr* pULONG = (sal_uIntPtr*)*ppBaseAddress; *pULONG = nObjSize; } return nRet; @@ -144,7 +144,7 @@ void ImpDdeMgr::CreateServerWnd() { hWndServer = WinCreateWindow( HWND_DESKTOP, WC_FRAME, "DDEServer", 0, 0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0, 0, 0 ); - WinSetWindowULong( hWndServer, 0, (ULONG)this ); + WinSetWindowULong( hWndServer, 0, (sal_uIntPtr)this ); WinSubclassWindow( hWndServer, ::ServerWndProc ); TID tidDummy; WinQueryWindowProcess( hWndServer, &pidThis, &tidDummy ); @@ -165,11 +165,11 @@ HWND ImpDdeMgr::CreateConversationWnd() ImpConvWndData* pWndData = new ImpConvWndData; pWndData->pThis = this; pWndData->nRefCount = 0; - WinSetWindowULong( hWnd, 0, (ULONG)pWndData ); + WinSetWindowULong( hWnd, 0, (sal_uIntPtr)pWndData ); WinSubclassWindow( hWnd, ::ConvWndProc ); #if 0 && defined( OV_DEBUG ) String aStr("ConvWnd created:"); - aStr += (ULONG)hWnd; + aStr += (sal_uIntPtr)hWnd; WRITELOG((char*)aStr.GetStr()) #endif } @@ -189,13 +189,13 @@ void ImpDdeMgr::DestroyConversationWnd( HWND hWnd ) if( pObj->nRefCount == 0 // auch Windows mit Refcount vonm loeschen, da dieser in initial // auf 0 gesetzt wird - || pObj->nRefCount == (USHORT)-1 ) + || pObj->nRefCount == (sal_uInt16)-1 ) { delete pObj; WinDestroyWindow( hWnd ); #if 0 && defined( OV_DEBUG ) String aStr("ConvWnd destroyed:"); - aStr += (ULONG)hWnd; + aStr += (sal_uIntPtr)hWnd; WRITELOG((char*)aStr.GetStr()) #endif } @@ -204,7 +204,7 @@ void ImpDdeMgr::DestroyConversationWnd( HWND hWnd ) #if 0 && defined( OV_DEBUG ) String aStr("ConvWnd not destroyed (Refcount="); aStr += pObj->nRefCount; - aStr += ") "; aStr += (ULONG)hWnd; + aStr += ") "; aStr += (sal_uIntPtr)hWnd; WRITELOG((char*)aStr.GetStr()) #endif } @@ -218,7 +218,7 @@ void ImpDdeMgr::DestroyConversationWnd( HWND hWnd ) } // static -USHORT ImpDdeMgr::GetConversationWndRefCount( HWND hWnd ) +sal_uInt16 ImpDdeMgr::GetConversationWndRefCount( HWND hWnd ) { ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 ); DBG_ASSERT(pObj,"Dde:ConvWnd has no data"); @@ -228,11 +228,11 @@ USHORT ImpDdeMgr::GetConversationWndRefCount( HWND hWnd ) } // static -USHORT ImpDdeMgr::IncConversationWndRefCount( HWND hWnd ) +sal_uInt16 ImpDdeMgr::IncConversationWndRefCount( HWND hWnd ) { #if 0 && defined( OV_DEBUG ) String aStr("IncConversationWndRefCount "); - aStr += (ULONG)hWnd; + aStr += (sal_uIntPtr)hWnd; WRITELOG((char*)aStr.GetStr()) #endif ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 ); @@ -255,7 +255,7 @@ ImpDdeMgrData* ImpDdeMgr::InitAll() if ( nRet == 2 ) // ERROR_FILE_NOT_FOUND ) { // DDECONVERSATIONCOUNT=4096 - USHORT nConvTransCount = 128; + sal_uInt16 nConvTransCount = 128; PSZ pResult; nRet = DosScanEnv( "SOMAXDDECONN", (const char**)&pResult ); if( !nRet ) @@ -264,9 +264,9 @@ ImpDdeMgrData* ImpDdeMgr::InitAll() nTemp = atoi( pResult ); nTemp++; // der nullte Eintrag wird nicht benutzt if( nTemp > 128 ) - nConvTransCount = (USHORT)nTemp; + nConvTransCount = (sal_uInt16)nTemp; } - ULONG nSize = sizeof(ImpDdeMgrData); + sal_uIntPtr nSize = sizeof(ImpDdeMgrData); nSize += sizeof(ImpHCONV) * nConvTransCount; nSize += sizeof(Transaction) * nConvTransCount; nSize += sizeof(HWND) * DDEMLAPPCOUNT; @@ -276,8 +276,8 @@ ImpDdeMgrData* ImpDdeMgr::InitAll() if ( !nRet ) { pBase->nTotalSize = nSize; - ULONG nAppTable = (ULONG)&(pBase->aAppTable); - ULONG nCharBase = (ULONG)pBase; + sal_uIntPtr nAppTable = (sal_uIntPtr)&(pBase->aAppTable); + sal_uIntPtr nCharBase = (sal_uIntPtr)pBase; pBase->nOffsAppTable = nAppTable - nCharBase; pBase->nOffsConvTable = pBase->nOffsAppTable; pBase->nOffsConvTable += sizeof(HWND) * DDEMLAPPCOUNT; @@ -318,10 +318,10 @@ HCONV ImpDdeMgr::CreateConvHandle( ImpDdeMgrData* pData, return (HCONV)0; ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pData ); - USHORT nCount = pData->nMaxConvCount; + sal_uInt16 nCount = pData->nMaxConvCount; pPtr++; nCount--; // ersten Handle (NULLHANDLE) ueberspringen - USHORT nIdx = 1; + sal_uInt16 nIdx = 1; DBG_ASSERT(pPtr,"No ConvTable"); if( !pPtr ) return (HCONV)0; @@ -346,7 +346,7 @@ HCONV ImpDdeMgr::CreateConvHandle( ImpDdeMgrData* pData, pPtr->hWndPartner = hWndPartner; pPtr->pidOwner = pidOwner; pPtr->hConvPartner = (HCONV)0; - pPtr->nPrevHCONV = (USHORT)hPrevHCONV; + pPtr->nPrevHCONV = (sal_uInt16)hPrevHCONV; pPtr->nNextHCONV = 0; pPtr->nStatus = ST_CONNECTED; @@ -357,13 +357,13 @@ HCONV ImpDdeMgr::CreateConvHandle( ImpDdeMgrData* pData, // static void ImpDdeMgr::FreeConvHandle( ImpDdeMgrData* pBase, HCONV hConv, - BOOL bDestroyHWndThis ) + sal_Bool bDestroyHWndThis ) { DBG_ASSERT(pBase,"DDE:No data"); #if 0 && defined( OV_DEBUG ) String aStr("FreeConvHandle: Start "); - aStr += (ULONG)hConv; - aStr += " Destroy: "; aStr += (USHORT)bDestroyHWndThis; + aStr += (sal_uIntPtr)hConv; + aStr += " Destroy: "; aStr += (sal_uInt16)bDestroyHWndThis; WRITELOG((char*)aStr.GetStr()); WRITESTATUS("FreeConvHandle: Start"); #endif @@ -376,12 +376,12 @@ void ImpDdeMgr::FreeConvHandle( ImpDdeMgrData* pBase, HCONV hConv, if( hConv && hConv < pBase->nMaxConvCount ) { ImpHCONV* pTable = ImpDdeMgr::GetConvTable( pBase ); - ImpHCONV* pPtr = pTable + (USHORT)hConv; + ImpHCONV* pPtr = pTable + (sal_uInt16)hConv; if( pPtr->nStatus & ST_INLIST ) { // Verkettung umsetzen - USHORT nPrev = pPtr->nPrevHCONV; - USHORT nNext = pPtr->nNextHCONV; + sal_uInt16 nPrev = pPtr->nPrevHCONV; + sal_uInt16 nNext = pPtr->nNextHCONV; if( nPrev ) { pPtr = pTable + nPrev; @@ -392,7 +392,7 @@ void ImpDdeMgr::FreeConvHandle( ImpDdeMgrData* pBase, HCONV hConv, pPtr = pTable + nNext; pPtr->nPrevHCONV = nPrev; } - pPtr = pTable + (USHORT)hConv; + pPtr = pTable + (sal_uInt16)hConv; } DdeFreeStringHandle( pPtr->hszPartner ); @@ -422,16 +422,16 @@ HCONV ImpDdeMgr::IsConvHandleAvailable( ImpDdeMgrData* pBase ) return 0; ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pBase ); - USHORT nCurPos = pBase->nMaxConvCount - 1; + sal_uInt16 nCurPos = pBase->nMaxConvCount - 1; pPtr += nCurPos; // von hinten aufrollen while( nCurPos >= 1 ) { if( pPtr->hWndThis == 0 ) - return TRUE; + return sal_True; pPtr--; nCurPos--; } - return FALSE; + return sal_False; } // static @@ -442,9 +442,9 @@ HCONV ImpDdeMgr::GetConvHandle( ImpDdeMgrData* pBase, HWND hWndThis, if( !pBase ) return 0; ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pBase ); - USHORT nCurPos = 1; + sal_uInt16 nCurPos = 1; pPtr++; // ersten Handle ueberspringen - USHORT nCurConvCount = pBase->nCurConvCount; + sal_uInt16 nCurConvCount = pBase->nCurConvCount; while( nCurConvCount && nCurPos < pBase->nMaxConvCount ) { if( pPtr->hWndThis ) @@ -464,8 +464,8 @@ HCONV ImpDdeMgr::GetConvHandle( ImpDdeMgrData* pBase, HWND hWndThis, // static -ULONG ImpDdeMgr::CreateTransaction( ImpDdeMgrData* pBase, HCONV hOwner, - HSZ hszItem, USHORT nFormat, USHORT nTransactionType ) +sal_uIntPtr ImpDdeMgr::CreateTransaction( ImpDdeMgrData* pBase, HCONV hOwner, + HSZ hszItem, sal_uInt16 nFormat, sal_uInt16 nTransactionType ) { DBG_ASSERT(pBase,"DDE:No Data"); DBG_ASSERT(hOwner!=0,"DDE:No Owner"); @@ -474,7 +474,7 @@ ULONG ImpDdeMgr::CreateTransaction( ImpDdeMgrData* pBase, HCONV hOwner, { Transaction* pPtr = ImpDdeMgr::GetTransTable( pBase ); DBG_ASSERT(pPtr->hConvOwner==0,"DDE:Data corrupted"); - USHORT nId = 1; + sal_uInt16 nId = 1; pPtr++; while( nId < pBase->nMaxTransCount ) { @@ -487,7 +487,7 @@ ULONG ImpDdeMgr::CreateTransaction( ImpDdeMgrData* pBase, HCONV hOwner, pPtr->nConvst = XST_CONNECTED; pPtr->nFormat = nFormat; pBase->nCurTransCount++; - return (ULONG)nId; + return (sal_uIntPtr)nId; } nId++; pPtr++; @@ -497,7 +497,7 @@ ULONG ImpDdeMgr::CreateTransaction( ImpDdeMgrData* pBase, HCONV hOwner, } // static -void ImpDdeMgr::FreeTransaction( ImpDdeMgrData* pBase, ULONG nTransId ) +void ImpDdeMgr::FreeTransaction( ImpDdeMgrData* pBase, sal_uIntPtr nTransId ) { DBG_ASSERT(pBase,"DDE:No Data"); if( !pBase ) @@ -521,8 +521,8 @@ void ImpDdeMgr::FreeTransaction( ImpDdeMgrData* pBase, ULONG nTransId ) } // static -ULONG ImpDdeMgr::GetTransaction( ImpDdeMgrData* pBase, - HCONV hOwner, HSZ hszItem, USHORT nFormat ) +sal_uIntPtr ImpDdeMgr::GetTransaction( ImpDdeMgrData* pBase, + HCONV hOwner, HSZ hszItem, sal_uInt16 nFormat ) { DBG_ASSERT(pBase,"DDE:No Data"); if( !pBase || !hOwner ) @@ -535,11 +535,11 @@ ULONG ImpDdeMgr::GetTransaction( ImpDdeMgrData* pBase, pTrans++; // NULLHANDLE ueberspringen ImpHCONV* pConv = ImpDdeMgr::GetConvTable( pBase ); - pConv += (USHORT)hOwner; + pConv += (sal_uInt16)hOwner; HCONV hConvPartner = pConv->hConvPartner; - USHORT nCurTransCount = pBase->nCurTransCount; - for( USHORT nTrans=1; nTrans< pBase->nMaxTransCount; nTrans++, pTrans++ ) + sal_uInt16 nCurTransCount = pBase->nCurTransCount; + for( sal_uInt16 nTrans=1; nTrans< pBase->nMaxTransCount; nTrans++, pTrans++ ) { if( pTrans->hConvOwner ) { @@ -549,7 +549,7 @@ ULONG ImpDdeMgr::GetTransaction( ImpDdeMgrData* pBase, pTrans->hszItem == hszItem ) { // gefunden! - return (ULONG)nTrans; + return (sal_uIntPtr)nTrans; } nCurTransCount--; if( !nCurTransCount ) @@ -577,7 +577,7 @@ HSZ ImpDdeMgr::DdeCreateStringHandle( PSZ pszString, int iCodePage) } // static -ULONG ImpDdeMgr::DdeQueryString( HSZ hszStr, PSZ pszStr, ULONG cchMax, int iCodePage) +sal_uIntPtr ImpDdeMgr::DdeQueryString( HSZ hszStr, PSZ pszStr, sal_uIntPtr cchMax, int iCodePage) { HATOMTBL hAtomTable = WinQuerySystemAtomTable(); if ( !pszStr ) @@ -590,32 +590,32 @@ ULONG ImpDdeMgr::DdeQueryString( HSZ hszStr, PSZ pszStr, ULONG cchMax, int iCode } // static -BOOL ImpDdeMgr::DdeFreeStringHandle( HSZ hsz ) +sal_Bool ImpDdeMgr::DdeFreeStringHandle( HSZ hsz ) { if( !hsz ) - return FALSE; + return sal_False; ATOM aResult = WinDeleteAtom( WinQuerySystemAtomTable(),(ATOM)hsz ); - return (BOOL)(aResult==0); + return (sal_Bool)(aResult==0); } // static -BOOL ImpDdeMgr::DdeKeepStringHandle( HSZ hsz ) +sal_Bool ImpDdeMgr::DdeKeepStringHandle( HSZ hsz ) { if( !hsz ) - return TRUE; + return sal_True; HATOMTBL hAtomTable = WinQuerySystemAtomTable(); #ifdef DBG_UTIL - ULONG nUsageCount=WinQueryAtomUsage(hAtomTable,(ATOM)hsz); + sal_uIntPtr nUsageCount=WinQueryAtomUsage(hAtomTable,(ATOM)hsz); #endif - ULONG nAtom = 0xFFFF0000; - ULONG nPar = (ULONG)hsz; + sal_uIntPtr nAtom = 0xFFFF0000; + sal_uIntPtr nPar = (sal_uIntPtr)hsz; nAtom |= nPar; ATOM aAtom = WinAddAtom( hAtomTable, (PSZ)nAtom ); #ifdef DBG_UTIL if ( aAtom ) DBG_ASSERT(WinQueryAtomUsage(hAtomTable,(ATOM)hsz)==nUsageCount+1,"Keep failed"); #endif - return (BOOL)(aAtom!=0); + return (sal_Bool)(aAtom!=0); } @@ -629,12 +629,12 @@ int ImpDdeMgr::DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) return 1; } -HDDEDATA ImpDdeMgr::DdeCreateDataHandle( void* pSrc, ULONG cb, - ULONG cbOff, HSZ hszItem, USHORT wFmt, USHORT afCmd) +HDDEDATA ImpDdeMgr::DdeCreateDataHandle( void* pSrc, sal_uIntPtr cb, + sal_uIntPtr cbOff, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 afCmd) { char* pData = (char*)pSrc; pData += cbOff; - USHORT nStatus; + sal_uInt16 nStatus; if( afCmd & HDATA_APPOWNED ) nStatus = IMP_HDATAAPPOWNED; else @@ -647,15 +647,15 @@ HDDEDATA ImpDdeMgr::DdeCreateDataHandle( void* pSrc, ULONG cb, } // static -BYTE* ImpDdeMgr::DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize) +sal_uInt8* ImpDdeMgr::DdeAccessData(HDDEDATA hData, sal_uIntPtr* pcbDataSize) { - BYTE* pRet = 0; + sal_uInt8* pRet = 0; *pcbDataSize = 0; if ( hData ) { - pRet = (BYTE*)hData; + pRet = (sal_uInt8*)hData; pRet += hData->offabData; - ULONG nLen = hData->cbData; + sal_uIntPtr nLen = hData->cbData; // nLen -= hData->offabData; *pcbDataSize = nLen; } @@ -665,48 +665,48 @@ BYTE* ImpDdeMgr::DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize) } // static -BOOL ImpDdeMgr::DdeUnaccessData(HDDEDATA hData) +sal_Bool ImpDdeMgr::DdeUnaccessData(HDDEDATA hData) { - return TRUE; // nothing to do for us + return sal_True; // nothing to do for us } // static -BOOL ImpDdeMgr::DdeFreeDataHandle(HDDEDATA hData) +sal_Bool ImpDdeMgr::DdeFreeDataHandle(HDDEDATA hData) { DdeUnaccessData( hData ); MyDosFreeMem( (PSZ)hData, "DdeFreeDataHandle" ); - return TRUE; + return sal_True; } // static -HDDEDATA ImpDdeMgr::DdeAddData(HDDEDATA hData,void* pSrc,ULONG cb,ULONG cbOff) +HDDEDATA ImpDdeMgr::DdeAddData(HDDEDATA hData,void* pSrc,sal_uIntPtr cb,sal_uIntPtr cbOff) { return (HDDEDATA)0; } // static -ULONG ImpDdeMgr::DdeGetData(HDDEDATA hData,void* pDst,ULONG cbMax,ULONG cbOff) +sal_uIntPtr ImpDdeMgr::DdeGetData(HDDEDATA hData,void* pDst,sal_uIntPtr cbMax,sal_uIntPtr cbOff) { return 0; } -BOOL ImpDdeMgr::DisconnectAll() +sal_Bool ImpDdeMgr::DisconnectAll() { //WRITESTATUS("Before DisconnectAll()") - USHORT nCurConvCount = pData->nCurConvCount; + sal_uInt16 nCurConvCount = pData->nCurConvCount; if( !nCurConvCount ) - return TRUE; + return sal_True; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; ImpHCONV* pPtr = pConvTable; pPtr++; - for( USHORT nPos=1; nPos < pData->nMaxConvCount; nPos++, pPtr++ ) + for( sal_uInt16 nPos=1; nPos < pData->nMaxConvCount; nPos++, pPtr++ ) { if( pPtr->hWndThis ) { if( !DdeDisconnect( (HCONV)nPos ) ) - bRet = FALSE; + bRet = sal_False; nCurConvCount--; if( !nCurConvCount ) break; @@ -720,22 +720,22 @@ BOOL ImpDdeMgr::DisconnectAll() void ImpDdeMgr::FreeTransactions( ImpDdeMgrData* pData,HWND hWndThis, HWND hWndPartner ) { - USHORT nCurTransCount = pData->nCurTransCount; + sal_uInt16 nCurTransCount = pData->nCurTransCount; if( !nCurTransCount ) return; Transaction* pTrans = GetTransTable( pData ); ImpHCONV* pConvTable = GetConvTable( pData ); pTrans++; - for( USHORT nPos=1; nPos < pData->nMaxTransCount; nPos++, pTrans++ ) + for( sal_uInt16 nPos=1; nPos < pData->nMaxTransCount; nPos++, pTrans++ ) { if( pTrans->hConvOwner ) { - ImpHCONV* pConv = pConvTable + (USHORT)(pTrans->hConvOwner); + ImpHCONV* pConv = pConvTable + (sal_uInt16)(pTrans->hConvOwner); if((pConv->hWndThis==hWndThis&& pConv->hWndPartner==hWndPartner)|| (pConv->hWndThis==hWndPartner && pConv->hWndPartner==hWndThis)) { - FreeTransaction( pData, (ULONG)nPos ); + FreeTransaction( pData, (sal_uIntPtr)nPos ); } nCurTransCount--; if( !nCurTransCount ) @@ -747,18 +747,18 @@ void ImpDdeMgr::FreeTransactions( ImpDdeMgrData* pData,HWND hWndThis, // static void ImpDdeMgr::FreeTransactions( ImpDdeMgrData* pData, HCONV hConvOwner ) { - USHORT nCurTransCount = pData->nCurTransCount; + sal_uInt16 nCurTransCount = pData->nCurTransCount; if( !nCurTransCount ) return; Transaction* pTrans = GetTransTable( pData ); // ImpHCONV* pConvTable = GetConvTable( pData ); pTrans++; - for( USHORT nPos=1; nPos < pData->nMaxTransCount; nPos++, pTrans++ ) + for( sal_uInt16 nPos=1; nPos < pData->nMaxTransCount; nPos++, pTrans++ ) { if( pTrans->hConvOwner == hConvOwner ) { - FreeTransaction( pData, (ULONG)nPos ); + FreeTransaction( pData, (sal_uIntPtr)nPos ); nCurTransCount--; if( !nCurTransCount ) return; @@ -770,13 +770,13 @@ void ImpDdeMgr::FreeTransactions( ImpDdeMgrData* pData, HCONV hConvOwner ) void ImpDdeMgr::FreeConversations( ImpDdeMgrData* pData, HWND hWndThis, HWND hWndPartner ) { - USHORT nCurCount = pData->nCurConvCount; + sal_uInt16 nCurCount = pData->nCurConvCount; if( !nCurCount ) return; ImpHCONV* pPtr = GetConvTable( pData ); pPtr++; - for( USHORT nPos=1; nPos < pData->nMaxConvCount; nPos++, pPtr++ ) + for( sal_uInt16 nPos=1; nPos < pData->nMaxConvCount; nPos++, pPtr++ ) { if( pPtr->hWndThis ) { @@ -790,25 +790,25 @@ void ImpDdeMgr::FreeConversations( ImpDdeMgrData* pData, HWND hWndThis, } -BOOL ImpDdeMgr::OwnsConversationHandles() +sal_Bool ImpDdeMgr::OwnsConversationHandles() { //WRITESTATUS("OwnsConversationHandles()"); #if 0 && defined( OV_DEBUG ) String aStr("OwnsConversationHandles Server:"); - aStr += (ULONG)hWndServer; + aStr += (sal_uIntPtr)hWndServer; WRITELOG((char*)aStr.GetStr()) #endif ImpHCONV* pPtr = GetConvTable( pData ); - for( USHORT nCur = 1; nCur < pData->nMaxConvCount; nCur++, pPtr++ ) + for( sal_uInt16 nCur = 1; nCur < pData->nMaxConvCount; nCur++, pPtr++ ) { if( pPtr->hWndThis && pPtr->pidOwner == pidThis ) { - //WRITELOG("OwnsConversationHandles: TRUE"); - return TRUE; + //WRITELOG("OwnsConversationHandles: sal_True"); + return sal_True; } } - // WRITELOG("OwnsConversationHandles: FALSE"); - return FALSE; + // WRITELOG("OwnsConversationHandles: sal_False"); + return sal_False; } @@ -817,8 +817,8 @@ BOOL ImpDdeMgr::OwnsConversationHandles() // ********************************************************************* // ********************************************************************* -USHORT DdeInitialize(ULONG* pidInst, PFNCALLBACK pfnCallback, - ULONG afCmd, ULONG ulRes) +sal_uInt16 DdeInitialize(sal_uIntPtr* pidInst, PFNCALLBACK pfnCallback, + sal_uIntPtr afCmd, sal_uIntPtr ulRes) { if( (*pidInst)!=0 ) { @@ -828,28 +828,28 @@ USHORT DdeInitialize(ULONG* pidInst, PFNCALLBACK pfnCallback, } ImpDdeMgr* pMgr = new ImpDdeMgr; - *pidInst = (ULONG)pMgr; + *pidInst = (sal_uIntPtr)pMgr; return pMgr->DdeInitialize( pfnCallback, afCmd ); } -BOOL DdeUninitialize(ULONG idInst) +sal_Bool DdeUninitialize(sal_uIntPtr idInst) { if( !idInst ) - return FALSE; + return sal_False; ImpDdeMgr* pMgr = (ImpDdeMgr*)idInst; // nur loeschen, wenn wir nicht mehr benutzt werden! if( !pMgr->OwnsConversationHandles() ) { - WRITELOG("DdeUninitialize: TRUE"); + WRITELOG("DdeUninitialize: sal_True"); delete pMgr; - return TRUE; + return sal_True; } - WRITELOG("DdeUninitialize: FALSE"); - return FALSE; + WRITELOG("DdeUninitialize: sal_False"); + return sal_False; } -HCONVLIST DdeConnectList(ULONG idInst, HSZ hszService, HSZ hszTopic, +HCONVLIST DdeConnectList(sal_uIntPtr idInst, HSZ hszService, HSZ hszTopic, HCONVLIST hConvList, CONVCONTEXT* pCC) { if( !idInst ) @@ -863,12 +863,12 @@ HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev) return ImpDdeMgr::DdeQueryNextServer( hConvList, hConvPrev ); } -BOOL DdeDisconnectList(HCONVLIST hConvList) +sal_Bool DdeDisconnectList(HCONVLIST hConvList) { return ImpDdeMgr::DdeDisconnectList( hConvList ); } -HCONV DdeConnect(ULONG idInst, HSZ hszService, HSZ hszTopic, +HCONV DdeConnect(sal_uIntPtr idInst, HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC) { if( !idInst ) @@ -876,7 +876,7 @@ HCONV DdeConnect(ULONG idInst, HSZ hszService, HSZ hszTopic, return ((ImpDdeMgr*)idInst)->DdeConnect( hszService, hszTopic, pCC ); } -BOOL DdeDisconnect(HCONV hConv) +sal_Bool DdeDisconnect(HCONV hConv) { return ImpDdeMgr::DdeDisconnect( hConv ); } @@ -887,47 +887,47 @@ HCONV DdeReconnect(HCONV hConv) } -USHORT DdeQueryConvInfo(HCONV hConv, ULONG idTransact, CONVINFO* pCI ) +sal_uInt16 DdeQueryConvInfo(HCONV hConv, sal_uIntPtr idTransact, CONVINFO* pCI ) { return ImpDdeMgr::DdeQueryConvInfo( hConv, idTransact, pCI ); } -BOOL DdeSetUserHandle(HCONV hConv, ULONG id, ULONG hUser) +sal_Bool DdeSetUserHandle(HCONV hConv, sal_uIntPtr id, sal_uIntPtr hUser) { return ImpDdeMgr::DdeSetUserHandle( hConv, id, hUser ); } -BOOL DdeAbandonTransaction(ULONG idInst, HCONV hConv, ULONG idTransaction) +sal_Bool DdeAbandonTransaction(sal_uIntPtr idInst, HCONV hConv, sal_uIntPtr idTransaction) { if( !idInst ) - return FALSE; + return sal_False; return ((ImpDdeMgr*)idInst)->DdeAbandonTransaction(hConv,idTransaction); } -BOOL DdePostAdvise(ULONG idInst, HSZ hszTopic, HSZ hszItem) +sal_Bool DdePostAdvise(sal_uIntPtr idInst, HSZ hszTopic, HSZ hszItem) { if( !idInst ) - return FALSE; + return sal_False; return ((ImpDdeMgr*)idInst)->DdePostAdvise( hszTopic, hszItem ); } -BOOL DdeEnableCallback(ULONG idInst, HCONV hConv, USHORT wCmd) +sal_Bool DdeEnableCallback(sal_uIntPtr idInst, HCONV hConv, sal_uInt16 wCmd) { if( !idInst ) - return FALSE; + return sal_False; return ((ImpDdeMgr*)idInst)->DdeEnableCallback( hConv, wCmd ); } -HDDEDATA DdeClientTransaction(void* pData, ULONG cbData, - HCONV hConv, HSZ hszItem, USHORT wFmt, USHORT wType, - ULONG dwTimeout, ULONG* pdwResult) +HDDEDATA DdeClientTransaction(void* pData, sal_uIntPtr cbData, + HCONV hConv, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 wType, + sal_uIntPtr dwTimeout, sal_uIntPtr* pdwResult) { return ImpDdeMgr::DdeClientTransaction( pData, cbData, hConv, hszItem, wFmt, wType, dwTimeout, pdwResult ); } -HDDEDATA DdeCreateDataHandle(ULONG idInst, void* pSrc, ULONG cb, - ULONG cbOff, HSZ hszItem, USHORT wFmt, USHORT afCmd) +HDDEDATA DdeCreateDataHandle(sal_uIntPtr idInst, void* pSrc, sal_uIntPtr cb, + sal_uIntPtr cbOff, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 afCmd) { if( !idInst ) return 0; @@ -935,64 +935,64 @@ HDDEDATA DdeCreateDataHandle(ULONG idInst, void* pSrc, ULONG cb, cbOff, hszItem, wFmt, afCmd ); } -HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, ULONG cb, ULONG cbOff) +HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, sal_uIntPtr cb, sal_uIntPtr cbOff) { return ImpDdeMgr::DdeAddData( hData, pSrc, cb, cbOff ); } -ULONG DdeGetData(HDDEDATA hData, void* pDst, ULONG cbMax, ULONG cbOff) +sal_uIntPtr DdeGetData(HDDEDATA hData, void* pDst, sal_uIntPtr cbMax, sal_uIntPtr cbOff) { return ImpDdeMgr::DdeGetData( hData, pDst, cbMax, cbOff ); } -BYTE* DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize) +sal_uInt8* DdeAccessData(HDDEDATA hData, sal_uIntPtr* pcbDataSize) { return ImpDdeMgr::DdeAccessData( hData, pcbDataSize ); } -BOOL DdeUnaccessData(HDDEDATA hData) +sal_Bool DdeUnaccessData(HDDEDATA hData) { return ImpDdeMgr::DdeUnaccessData( hData ); } -BOOL DdeFreeDataHandle(HDDEDATA hData) +sal_Bool DdeFreeDataHandle(HDDEDATA hData) { return ImpDdeMgr::DdeFreeDataHandle( hData ); } -USHORT DdeGetLastError(ULONG idInst) +sal_uInt16 DdeGetLastError(sal_uIntPtr idInst) { if( !idInst ) return DMLERR_DLL_NOT_INITIALIZED; return ((ImpDdeMgr*)idInst)->DdeGetLastError(); } -HSZ DdeCreateStringHandle(ULONG idInst, PSZ pszString,int iCodePage ) +HSZ DdeCreateStringHandle(sal_uIntPtr idInst, PSZ pszString,int iCodePage ) { if( !idInst ) return 0; return ((ImpDdeMgr*)idInst)->DdeCreateStringHandle(pszString,iCodePage); } -ULONG DdeQueryString( ULONG idInst, HSZ hsz, PSZ pBuf, - ULONG cchMax, int iCodePage ) +sal_uIntPtr DdeQueryString( sal_uIntPtr idInst, HSZ hsz, PSZ pBuf, + sal_uIntPtr cchMax, int iCodePage ) { if( !idInst ) return 0; return ((ImpDdeMgr*)idInst)->DdeQueryString( hsz,pBuf,cchMax,iCodePage); } -BOOL DdeFreeStringHandle( ULONG idInst, HSZ hsz) +sal_Bool DdeFreeStringHandle( sal_uIntPtr idInst, HSZ hsz) { if( !idInst ) - return FALSE; + return sal_False; return ((ImpDdeMgr*)idInst)->DdeFreeStringHandle( hsz ); } -BOOL DdeKeepStringHandle( ULONG idInst, HSZ hsz ) +sal_Bool DdeKeepStringHandle( sal_uIntPtr idInst, HSZ hsz ) { if( !idInst ) - return FALSE; + return sal_False; return ((ImpDdeMgr*)idInst)->DdeKeepStringHandle( hsz ); } @@ -1001,7 +1001,7 @@ int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) return ImpDdeMgr::DdeCmpStringHandles( hsz1, hsz2 ); } -HDDEDATA DdeNameService( ULONG idInst, HSZ hsz1, HSZ hszRes, USHORT afCmd ) +HDDEDATA DdeNameService( sal_uIntPtr idInst, HSZ hsz1, HSZ hszRes, sal_uInt16 afCmd ) { if( !idInst ) return 0; diff --git a/svl/source/svdde/ddemldeb.cxx b/svl/source/svdde/ddemldeb.cxx index f921e93d2e9c..84b9ca555546 100644 --- a/svl/source/svdde/ddemldeb.cxx +++ b/svl/source/svdde/ddemldeb.cxx @@ -42,7 +42,7 @@ void ImpAddHSZ( HSZ hszString, String& rStr ) ImpDdeMgr::DdeQueryString( hszString,aBuf,sizeof(aBuf),850); rStr += " (\""; rStr += aBuf; rStr += "\","; HATOMTBL hAtomTable = WinQuerySystemAtomTable(); - ULONG nRefCount = 0; + sal_uIntPtr nRefCount = 0; if( hszString ) nRefCount = WinQueryAtomUsage(hAtomTable, (ATOM)hszString ); rStr += nRefCount; rStr += ')'; @@ -52,7 +52,7 @@ void ImpAddHSZ( HSZ hszString, String& rStr ) void ImpWriteDdeStatus(char* aFilename, char* pAppContext) { char aBuf[ 128 ]; - USHORT nCtr; + sal_uInt16 nCtr; HWND* pAppPtr; ImpHCONV* pConvPtr; Transaction* pTransPtr; @@ -94,7 +94,7 @@ void ImpWriteDdeStatus(char* aFilename, char* pAppContext) if( *pAppPtr ) { aLine = "App."; aLine += nCtr; aLine += " HWND:"; - aLine += (ULONG)*pAppPtr; aStrm.WriteLine(aLine); + aLine += (sal_uIntPtr)*pAppPtr; aStrm.WriteLine(aLine); } } @@ -102,7 +102,7 @@ void ImpWriteDdeStatus(char* aFilename, char* pAppContext) aStrm.WriteLine("-------------- Conversation handles ----------------"); aStrm << endl; - USHORT nCurCount = pData->nCurConvCount; + sal_uInt16 nCurCount = pData->nCurConvCount; if( nCurCount ) { @@ -112,15 +112,15 @@ void ImpWriteDdeStatus(char* aFilename, char* pAppContext) if( pConvPtr->hWndThis ) { aLine = "HCONV:"; aLine += nCtr; - aLine += " HCONVpartner: "; aLine += (USHORT)pConvPtr->hConvPartner; + aLine += " HCONVpartner: "; aLine += (sal_uInt16)pConvPtr->hConvPartner; if( !pConvPtr->hConvPartner ) aLine += "(Non-DDEML-App)"; - aLine += " hszPartner: "; aLine += (USHORT)pConvPtr->hszPartner; + aLine += " hszPartner: "; aLine += (sal_uInt16)pConvPtr->hszPartner; ImpAddHSZ( pConvPtr->hszPartner, aLine ); aStrm.WriteLine( aLine ); - aLine = "hszService: "; aLine += (USHORT)pConvPtr->hszServiceReq; + aLine = "hszService: "; aLine += (sal_uInt16)pConvPtr->hszServiceReq; ImpAddHSZ( pConvPtr->hszServiceReq, aLine ); - aLine += " hszTopic: "; aLine += (USHORT)pConvPtr->hszTopic; + aLine += " hszTopic: "; aLine += (sal_uInt16)pConvPtr->hszTopic; ImpAddHSZ( pConvPtr->hszTopic, aLine ); aStrm.WriteLine( aLine ); @@ -129,14 +129,14 @@ void ImpWriteDdeStatus(char* aFilename, char* pAppContext) if( pConvPtr->nStatus & ST_INLIST ) aLine += " (Inlist)"; aStrm.WriteLine(aLine); - aLine = "pidOwner: "; aLine += (ULONG)pConvPtr->pidOwner; + aLine = "pidOwner: "; aLine += (sal_uIntPtr)pConvPtr->pidOwner; aStrm.WriteLine( aLine ); - aLine = "hWndThis: "; aLine += (ULONG)pConvPtr->hWndThis; + aLine = "hWndThis: "; aLine += (sal_uIntPtr)pConvPtr->hWndThis; aStrm.WriteLine( aLine ); - aLine = "hWndPartner: "; aLine += (ULONG)pConvPtr->hWndPartner; + aLine = "hWndPartner: "; aLine += (sal_uIntPtr)pConvPtr->hWndPartner; aStrm.WriteLine( aLine ); - aLine = "hConvList: "; aLine += (ULONG)pConvPtr->hConvList; + aLine = "hConvList: "; aLine += (sal_uIntPtr)pConvPtr->hConvList; aLine += " Prev: "; aLine += pConvPtr->nPrevHCONV; aLine += " Next: "; aLine += pConvPtr->nNextHCONV; aStrm.WriteLine( aLine ); @@ -161,9 +161,9 @@ void ImpWriteDdeStatus(char* aFilename, char* pAppContext) if( pTransPtr->hConvOwner ) { aLine = "TransactionId:"; aLine += nCtr; - aLine += " hConvOwner: "; aLine += (USHORT)pTransPtr->hConvOwner; + aLine += " hConvOwner: "; aLine += (sal_uInt16)pTransPtr->hConvOwner; aStrm.WriteLine( aLine ); - aLine = "Item: "; aLine += (USHORT)pTransPtr->hszItem; + aLine = "Item: "; aLine += (sal_uInt16)pTransPtr->hszItem; ImpAddHSZ( pTransPtr->hszItem, aLine ); aLine += " Format: "; aLine += pTransPtr->nFormat; aStrm.WriteLine( aLine ); @@ -187,7 +187,7 @@ void ImpWriteDdeStatus(char* aFilename, char* pAppContext) void ImpWriteDdeData(char* aFilename, DDESTRUCT* pData) { char aBuf[ 128 ]; - USHORT nCtr; + sal_uInt16 nCtr; SvFileStream aStrm(aFilename, STREAM_READWRITE ); aStrm.Seek( STREAM_SEEK_TO_END ); String aLine; @@ -199,7 +199,7 @@ void ImpWriteDdeData(char* aFilename, DDESTRUCT* pData) aStrm.WriteLine( aLine ); aLine = "offabData:"; aLine += pData->offabData; aStrm.WriteLine(aLine); char* pBuf = (char*)pData+pData->offabData; - USHORT nLen = pData->cbData; // - pData->offabData; + sal_uInt16 nLen = pData->cbData; // - pData->offabData; while( nLen ) { aStrm << *pBuf; @@ -236,7 +236,7 @@ APIRET MyDosAllocSharedMem(void** ppBaseAddress, char* pszName, unsigned long ul aStr += ": "; aStr += ulObjectSize; aStr += " ("; - aStr += (ULONG)*((char**)ppBaseAddress); + aStr += (sal_uIntPtr)*((char**)ppBaseAddress); aStr += ')'; ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr() ); #endif @@ -253,7 +253,7 @@ APIRET MyDosAllocMem(void** ppBaseAddress, unsigned long ulObjectSize, aStr += ": "; aStr += ulObjectSize; aStr += " ("; - aStr += (ULONG)*((char**)ppBaseAddress); + aStr += (sal_uIntPtr)*((char**)ppBaseAddress); aStr += ')'; ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr() ); #endif @@ -268,7 +268,7 @@ APIRET MyDosFreeMem( void* pBaseAddress, char* pContextStr ) String aStr("DosFreeMem:"); aStr += pContextStr; aStr += ": "; - aStr += (ULONG)pBaseAddress; + aStr += (sal_uIntPtr)pBaseAddress; ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr()); #endif return nRet; diff --git a/svl/source/svdde/ddemlimp.hxx b/svl/source/svdde/ddemlimp.hxx index 28c4bf248bbe..a145bc489f0f 100644 --- a/svl/source/svdde/ddemlimp.hxx +++ b/svl/source/svdde/ddemlimp.hxx @@ -89,7 +89,7 @@ struct ImpHCONV HSZ hszPartner; // Name of partner application HSZ hszServiceReq; // Service name HSZ hszTopic; // Topic name - USHORT nStatus; // ST_* of conversation + sal_uInt16 nStatus; // ST_* of conversation HCONVLIST hConvList; // ConvListId , wenn in ConvList CONVCONTEXT aConvContext; // Conversation context @@ -98,15 +98,15 @@ struct ImpHCONV HWND hWndPartner; PID pidOwner; // PID des DdeManagers, der // den Conv-Handle erzeugt hat. - USHORT nPrevHCONV; // 0 == no previous hConv or not in list - USHORT nNextHCONV; // 0 == no next hconv or not in list + sal_uInt16 nPrevHCONV; // 0 == no previous hConv or not in list + sal_uInt16 nNextHCONV; // 0 == no next hconv or not in list }; struct Transaction { HSZ hszItem; // Item name - USHORT nFormat; // Data format - USHORT nType; // Transaction type (XTYP_*) + sal_uInt16 nFormat; // Data format + sal_uInt16 nType; // Transaction type (XTYP_*) // XTYP_ADVREQ [|XTYPF_NODATA] == Advise-Loop // [|XTYPF_ACKREQ] // XTYP_EXECUTE == laufendes Execute @@ -114,13 +114,13 @@ struct Transaction // XTYP_POKE // XTYP_ADVSTOP // XTYP_ADVSTART - USHORT nConvst; // Conversation state (XST_*) + sal_uInt16 nConvst; // Conversation state (XST_*) // 0 == idle // XST_REQSENT (fuer XTYP_ADVREQ) // XST_TIMEOUT (fuer alle Typen!) // XST_WAITING (alle ausser XTYP_ADVREQ) - USHORT nLastError; // last err in transaction - ULONG nUser; // Userhandle + sal_uInt16 nLastError; // last err in transaction + sal_uIntPtr nUser; // Userhandle // private HCONV hConvOwner; // 0 == Transaction not used }; @@ -145,24 +145,24 @@ class ImpDdeMgr; struct ImpConvWndData { ImpDdeMgr* pThis; - USHORT nRefCount; // Zahl Conversations auf diesem Window + sal_uInt16 nRefCount; // Zahl Conversations auf diesem Window }; // systemglobale Daten der Library (liegen in named shared memory) struct ImpDdeMgrData { - ULONG nTotalSize; - ULONG nOffsAppTable; - ULONG nOffsConvTable; - ULONG nOffsTransTable; - USHORT nMaxAppCount; - USHORT nMaxConvCount; - USHORT nMaxTransCount; - USHORT nLastErr; - USHORT nReserved; - USHORT nCurTransCount; - USHORT nCurConvCount; + sal_uIntPtr nTotalSize; + sal_uIntPtr nOffsAppTable; + sal_uIntPtr nOffsConvTable; + sal_uIntPtr nOffsTransTable; + sal_uInt16 nMaxAppCount; + sal_uInt16 nMaxConvCount; + sal_uInt16 nMaxTransCount; + sal_uInt16 nLastErr; + sal_uInt16 nReserved; + sal_uInt16 nCurTransCount; + sal_uInt16 nCurConvCount; HWND aAppTable[ 1 ]; // fuer Broadcast-Messages ImpHCONV aConvTable[ 1 ]; Transaction aTransTable[ 1 ]; @@ -172,25 +172,25 @@ struct ImpDdeMgrData class ImpDdeMgr { - friend MRESULT EXPENTRY ConvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2); - friend MRESULT EXPENTRY ServerWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2); + friend MRESULT EXPENTRY ConvWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2); + friend MRESULT EXPENTRY ServerWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2); friend void ImpWriteDdeStatus(char*,char*); friend void ImpAddHSZ( HSZ, String& ); - static PSZ AllocAtomName( ATOM hString, ULONG& rBufLen ); + static PSZ AllocAtomName( ATOM hString, sal_uIntPtr& rBufLen ); static PDDESTRUCT MakeDDEObject( HWND hwnd, ATOM hItemName, - USHORT fsStatus, USHORT usFormat, PVOID pabData, ULONG usDataLen ); + sal_uInt16 fsStatus, sal_uInt16 usFormat, PVOID pabData, sal_uIntPtr usDataLen ); static APIRET AllocNamedSharedMem( PPVOID ppBaseAddress, PSZ pName, - ULONG nElementSize, ULONG nElementCount ); + sal_uIntPtr nElementSize, sal_uIntPtr nElementCount ); HWND hWndServer; PID pidThis; PFNCALLBACK pCallback; - ULONG nTransactFilter; + sal_uIntPtr nTransactFilter; CONVCONTEXT aDefaultContext; ImpDdeMgrData* pData; ImpService* pServices; - USHORT nServiceCount; + sal_uInt16 nServiceCount; ImpHCONV* pConvTable; // liegt in pData (nicht deleten!) Transaction* pTransTable; // liegt in pData (nicht deleten!) @@ -208,47 +208,47 @@ class ImpDdeMgr // Fktn. duerfen nur fuer HCONVs aufgerufen werden, die // in der eigenen Applikation erzeugt wurden static void DestroyConversationWnd( HWND hWndConv ); - static USHORT GetConversationWndRefCount( HWND hWndConv ); - static USHORT IncConversationWndRefCount( HWND hWndConv ); + static sal_uInt16 GetConversationWndRefCount( HWND hWndConv ); + static sal_uInt16 IncConversationWndRefCount( HWND hWndConv ); - MRESULT SrvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2); - MRESULT ConvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2); + MRESULT SrvWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2); + MRESULT ConvWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2); void RegisterDDEMLApp(); void UnregisterDDEMLApp(); void CleanUp(); ImpDdeMgrData* InitAll(); - static BOOL MyWinDdePostMsg( HWND, HWND, USHORT, PDDESTRUCT, ULONG ); + static sal_Bool MyWinDdePostMsg( HWND, HWND, sal_uInt16, PDDESTRUCT, sal_uIntPtr ); void MyInitiateDde( HWND hWndServer, HWND hWndClient, HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC ); DDEINIT* CreateDDEInitData( HWND hWndDest, HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC ); // wenn pDDEData==0, muss pCC gesetzt sein HCONV ConnectWithClient( HWND hWndClient, HSZ hszPartner, - HSZ hszService, HSZ hszTopic, BOOL bSameInst, + HSZ hszService, HSZ hszTopic, sal_Bool bSameInst, DDEINIT* pDDEData, CONVCONTEXT* pCC = 0); - HCONV CheckIncoming( ImpWndProcParams*, ULONG nTransMask, + HCONV CheckIncoming( ImpWndProcParams*, sal_uIntPtr nTransMask, HSZ& rhszItem ); // fuer Serverbetrieb. Ruft Callback-Fkt fuer alle offenen Advises // auf, deren Owner der uebergebene HCONV ist. - // bFreeTransactions==TRUE: loescht die Transaktionen + // bFreeTransactions==sal_True: loescht die Transaktionen // gibt Anzahl der getrennten Transaktionen zurueck - USHORT SendUnadvises( HCONV hConv, - USHORT nFormat, // 0==alle - BOOL bFreeTransactions ); + sal_uInt16 SendUnadvises( HCONV hConv, + sal_uInt16 nFormat, // 0==alle + sal_Bool bFreeTransactions ); - BOOL WaitTransState( - Transaction* pTrans, ULONG nTransId, - USHORT nNewState, - ULONG nTimeout ); + sal_Bool WaitTransState( + Transaction* pTrans, sal_uIntPtr nTransId, + sal_uInt16 nNewState, + sal_uIntPtr nTimeout ); // DDEML ruft Callback mit XTYP_CONNECT-Transaction nur auf, // wenn die App den angeforderten Service registriert hat - // Standardeinstellung: TRUE - BOOL bServFilterOn; + // Standardeinstellung: sal_True + sal_Bool bServFilterOn; // Fehlercode muss noch systemglobal werden (Atom o. ae.) - static USHORT nLastErrInstance; // wenn 0, dann gilt globaler Fehlercode + static sal_uInt16 nLastErrInstance; // wenn 0, dann gilt globaler Fehlercode static ImpDdeMgrData* AccessMgrData(); @@ -262,17 +262,17 @@ class ImpDdeMgr static HCONV GetConvHandle( ImpDdeMgrData* pBase, HWND hWndThis, HWND hWndPartner ); static void FreeConvHandle( ImpDdeMgrData*, HCONV, - BOOL bDestroyHWndThis = TRUE ); + sal_Bool bDestroyHWndThis = sal_True ); - static ULONG CreateTransaction( ImpDdeMgrData* pBase, - HCONV hOwner, HSZ hszItem, USHORT nFormat, - USHORT nTransactionType ); - static ULONG GetTransaction( ImpDdeMgrData* pBase, - HCONV hOwner, HSZ hszItem, USHORT nFormat ); + static sal_uIntPtr CreateTransaction( ImpDdeMgrData* pBase, + HCONV hOwner, HSZ hszItem, sal_uInt16 nFormat, + sal_uInt16 nTransactionType ); + static sal_uIntPtr GetTransaction( ImpDdeMgrData* pBase, + HCONV hOwner, HSZ hszItem, sal_uInt16 nFormat ); - static void FreeTransaction( ImpDdeMgrData*, ULONG nTransId ); + static void FreeTransaction( ImpDdeMgrData*, sal_uIntPtr nTransId ); - BOOL DisconnectAll(); + sal_Bool DisconnectAll(); // Transaktionen muessen _vor_ den Konversationen geloescht werden! static void FreeTransactions( ImpDdeMgrData*, HWND hWndThis, HWND hWndPartner ); @@ -283,14 +283,14 @@ class ImpDdeMgr ImpService* GetService( HSZ hszService ); ImpService* PutService( HSZ hszService ); - void BroadcastService( ImpService*, BOOL bRegistered ); + void BroadcastService( ImpService*, sal_Bool bRegistered ); // rh: Startposition(!) & gefundener Handle static ImpHCONV* GetFirstServer( ImpDdeMgrData*, HCONVLIST, HCONV& rh); static ImpHCONV* GetLastServer( ImpDdeMgrData*, HCONVLIST, HCONV& ); - static BOOL CheckConvListId( HCONVLIST hConvListId ); + static sal_Bool CheckConvListId( HCONVLIST hConvListId ); - BOOL IsSameInstance( HWND hWnd ); + sal_Bool IsSameInstance( HWND hWnd ); HSZ GetAppName( HWND hWnd ); @@ -310,76 +310,76 @@ class ImpDdeMgr MRESULT DdeTimeout( ImpWndProcParams* pParams ); HDDEDATA Callback( - USHORT nTransactionType, - USHORT nClipboardFormat, + sal_uInt16 nTransactionType, + sal_uInt16 nClipboardFormat, HCONV hConversationHandle, HSZ hsz1, HSZ hsz2, HDDEDATA hData, - ULONG nData1, - ULONG nData2 ); + sal_uIntPtr nData1, + sal_uIntPtr nData2 ); HCONV DdeConnectImp( HSZ hszService,HSZ hszTopic,CONVCONTEXT* pCC); // connection data HCONV hCurConv; // wird im DdeInitiateAck gesetzt HCONVLIST hCurListId; // fuer DdeConnectList - USHORT nPrevConv; // .... "" .... - BOOL bListConnect; + sal_uInt16 nPrevConv; // .... "" .... + sal_Bool bListConnect; // synchr. transaction data - BOOL bInSyncTrans; - ULONG nSyncTransId; + sal_Bool bInSyncTrans; + sal_uIntPtr nSyncTransId; HDDEDATA hSyncResponseData; - ULONG nSyncResponseMsg; // WM_DDE_ACK, WM_DDE_DATA, WM_TIMER - // TRUE==nach Ende der synchronen Transaktion eine evtl. benutzte + sal_uIntPtr nSyncResponseMsg; // WM_DDE_ACK, WM_DDE_DATA, WM_TIMER + // sal_True==nach Ende der synchronen Transaktion eine evtl. benutzte // asynchrone Transaktion beenden (typisch synchroner Request auf // Advise-Loop) - BOOL bSyncAbandonTrans; + sal_Bool bSyncAbandonTrans; public: ImpDdeMgr(); ~ImpDdeMgr(); - USHORT DdeInitialize( PFNCALLBACK pCallbackProc, ULONG nTransactionFilter ); - USHORT DdeGetLastError(); + sal_uInt16 DdeInitialize( PFNCALLBACK pCallbackProc, sal_uIntPtr nTransactionFilter ); + sal_uInt16 DdeGetLastError(); HCONV DdeConnect( HSZ hszService, HSZ hszTopic, CONVCONTEXT* ); HCONVLIST DdeConnectList( HSZ hszService, HSZ hszTopic, HCONVLIST hConvList, CONVCONTEXT* ); - static BOOL DdeDisconnect( HCONV hConv ); - static BOOL DdeDisconnectList( HCONVLIST hConvList ); + static sal_Bool DdeDisconnect( HCONV hConv ); + static sal_Bool DdeDisconnectList( HCONVLIST hConvList ); static HCONV DdeReconnect(HCONV hConv); static HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev); - static USHORT DdeQueryConvInfo(HCONV hConv, ULONG idTrans,CONVINFO* pCI); - static BOOL DdeSetUserHandle(HCONV hConv, ULONG id, ULONG hUser); - BOOL DdeAbandonTransaction( HCONV hConv, ULONG idTransaction); + static sal_uInt16 DdeQueryConvInfo(HCONV hConv, sal_uIntPtr idTrans,CONVINFO* pCI); + static sal_Bool DdeSetUserHandle(HCONV hConv, sal_uIntPtr id, sal_uIntPtr hUser); + sal_Bool DdeAbandonTransaction( HCONV hConv, sal_uIntPtr idTransaction); - BOOL DdePostAdvise( HSZ hszTopic, HSZ hszItem); - BOOL DdeEnableCallback( HCONV hConv, USHORT wCmd); + sal_Bool DdePostAdvise( HSZ hszTopic, HSZ hszItem); + sal_Bool DdeEnableCallback( HCONV hConv, sal_uInt16 wCmd); - HDDEDATA DdeNameService( HSZ hszService, USHORT afCmd); + HDDEDATA DdeNameService( HSZ hszService, sal_uInt16 afCmd); - static HDDEDATA DdeClientTransaction(void* pData, ULONG cbData, - HCONV hConv, HSZ hszItem, USHORT wFmt, USHORT wType, - ULONG dwTimeout, ULONG* pdwResult); + static HDDEDATA DdeClientTransaction(void* pData, sal_uIntPtr cbData, + HCONV hConv, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 wType, + sal_uIntPtr dwTimeout, sal_uIntPtr* pdwResult); // Data handles - HDDEDATA DdeCreateDataHandle( void* pSrc, ULONG cb, ULONG cbOff, - HSZ hszItem, USHORT wFmt, USHORT afCmd); - static BYTE* DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize); - static BOOL DdeUnaccessData(HDDEDATA hData); - static BOOL DdeFreeDataHandle(HDDEDATA hData); - static HDDEDATA DdeAddData(HDDEDATA hData,void* pSrc,ULONG cb,ULONG cbOff); - static ULONG DdeGetData(HDDEDATA hData,void* pDst,ULONG cbMax,ULONG cbOff); + HDDEDATA DdeCreateDataHandle( void* pSrc, sal_uIntPtr cb, sal_uIntPtr cbOff, + HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 afCmd); + static sal_uInt8* DdeAccessData(HDDEDATA hData, sal_uIntPtr* pcbDataSize); + static sal_Bool DdeUnaccessData(HDDEDATA hData); + static sal_Bool DdeFreeDataHandle(HDDEDATA hData); + static HDDEDATA DdeAddData(HDDEDATA hData,void* pSrc,sal_uIntPtr cb,sal_uIntPtr cbOff); + static sal_uIntPtr DdeGetData(HDDEDATA hData,void* pDst,sal_uIntPtr cbMax,sal_uIntPtr cbOff); // String handles static HSZ DdeCreateStringHandle( PSZ pStr, int iCodePage); - static ULONG DdeQueryString(HSZ hsz,PSZ pStr,ULONG cchMax,int iCPage); - static BOOL DdeFreeStringHandle( HSZ hsz ); - static BOOL DdeKeepStringHandle( HSZ hsz ); + static sal_uIntPtr DdeQueryString(HSZ hsz,PSZ pStr,sal_uIntPtr cchMax,int iCPage); + static sal_Bool DdeFreeStringHandle( HSZ hsz ); + static sal_Bool DdeKeepStringHandle( HSZ hsz ); static int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2); // mit dieser Funktion kann geprueft werden, ob eine @@ -388,9 +388,9 @@ public: // pro Applikation (wg. synchroner Transaktionen) static ImpDdeMgr* GetImpDdeMgrInstance( HWND hWnd ); - // gibt TRUE zurueck, wenn mind. ein lebender HCONV + // gibt sal_True zurueck, wenn mind. ein lebender HCONV // von diesem DdeMgr erzeugt wurde - BOOL OwnsConversationHandles(); + sal_Bool OwnsConversationHandles(); }; // static @@ -398,7 +398,7 @@ inline ImpHCONV* ImpDdeMgr::GetConvTable( ImpDdeMgrData* pData ) { ImpHCONV* pRet; if( pData ) - pRet = (ImpHCONV*)((ULONG)(pData) + pData->nOffsConvTable); + pRet = (ImpHCONV*)((sal_uIntPtr)(pData) + pData->nOffsConvTable); else pRet = 0; return pRet; @@ -409,7 +409,7 @@ inline Transaction* ImpDdeMgr::GetTransTable( ImpDdeMgrData* pData ) { Transaction* pRet; if( pData ) - pRet = (Transaction*)((ULONG)(pData) + pData->nOffsTransTable); + pRet = (Transaction*)((sal_uIntPtr)(pData) + pData->nOffsTransTable); else pRet = 0; return pRet; @@ -420,7 +420,7 @@ inline HWND* ImpDdeMgr::GetAppTable( ImpDdeMgrData* pData ) { HWND* pRet; if( pData ) - pRet = (HWND*)((ULONG)(pData) + pData->nOffsAppTable); + pRet = (HWND*)((sal_uIntPtr)(pData) + pData->nOffsAppTable); else pRet = 0; return pRet; diff --git a/svl/source/svdde/ddemlos2.h b/svl/source/svdde/ddemlos2.h index bdd31e470bcd..0d8fec8cef8b 100644 --- a/svl/source/svdde/ddemlos2.h +++ b/svl/source/svdde/ddemlos2.h @@ -42,25 +42,25 @@ typedef LHANDLE HSTR; #endif -typedef ULONG HCONVLIST; -typedef ULONG HCONV; +typedef sal_uIntPtr HCONVLIST; +typedef sal_uIntPtr HCONV; typedef ATOM HSZ; typedef DDESTRUCT* HDDEDATA; struct CONVINFO { - USHORT nSize; // sizeof(CONVINFO) - ULONG nUser; // Userhandle + sal_uInt16 nSize; // sizeof(CONVINFO) + sal_uIntPtr 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 + sal_uInt16 nFormat; // Datenformat der akt. Transaktion + sal_uInt16 nType; // Typ der akt. Transaktion (XTYP_*) + sal_uInt16 nStatus; // ST_* der Konversation + sal_uInt16 nConvst; // XST_* der akt. Transaktion + sal_uInt16 nLastError; // letzter Fehler der Transaktion HCONVLIST hConvList; // ConvListId , wenn in ConvList CONVCONTEXT aConvCtxt; // conversation context }; @@ -186,16 +186,16 @@ typedef HSZPAIR *PHSZPAIR; /****** API entry points ******/ -typedef HDDEDATA CALLBACK FNCALLBACK(USHORT wType, USHORT wFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hData, ULONG dwData1, ULONG dwData2); +typedef HDDEDATA CALLBACK FNCALLBACK(sal_uInt16 wType, sal_uInt16 wFmt, HCONV hConv, + HSZ hsz1, HSZ hsz2, HDDEDATA hData, sal_uIntPtr dwData1, sal_uIntPtr dwData2); typedef FNCALLBACK* PFNCALLBACK; #define CBR_BLOCK 0xffffffffL /* DLL registration functions */ -USHORT DdeInitialize(ULONG* pidInst, PFNCALLBACK pfnCallback, - ULONG afCmd, ULONG ulRes); +sal_uInt16 DdeInitialize(sal_uIntPtr* pidInst, PFNCALLBACK pfnCallback, + sal_uIntPtr afCmd, sal_uIntPtr ulRes); /* * Callback filter flags for use with standard apps. @@ -229,39 +229,39 @@ USHORT DdeInitialize(ULONG* pidInst, PFNCALLBACK pfnCallback, #define APPCLASS_MASK 0x0000000FL -BOOL DdeUninitialize(ULONG idInst); +sal_Bool DdeUninitialize(sal_uIntPtr idInst); /* conversation enumeration functions */ -HCONVLIST DdeConnectList(ULONG idInst, HSZ hszService, HSZ hszTopic, +HCONVLIST DdeConnectList(sal_uIntPtr idInst, HSZ hszService, HSZ hszTopic, HCONVLIST hConvList, CONVCONTEXT* pCC); HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev); -BOOL DdeDisconnectList(HCONVLIST hConvList); +sal_Bool DdeDisconnectList(HCONVLIST hConvList); /* conversation control functions */ -HCONV DdeConnect(ULONG idInst, HSZ hszService, HSZ hszTopic, +HCONV DdeConnect(sal_uIntPtr idInst, HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC); -BOOL DdeDisconnect(HCONV hConv); +sal_Bool DdeDisconnect(HCONV hConv); HCONV DdeReconnect(HCONV hConv); -USHORT DdeQueryConvInfo(HCONV hConv, ULONG idTransaction, CONVINFO* pConvInfo); -BOOL DdeSetUserHandle(HCONV hConv, ULONG id, ULONG hUser); +sal_uInt16 DdeQueryConvInfo(HCONV hConv, sal_uIntPtr idTransaction, CONVINFO* pConvInfo); +sal_Bool DdeSetUserHandle(HCONV hConv, sal_uIntPtr id, sal_uIntPtr hUser); -BOOL DdeAbandonTransaction(ULONG idInst, HCONV hConv, ULONG idTransaction); +sal_Bool DdeAbandonTransaction(sal_uIntPtr idInst, HCONV hConv, sal_uIntPtr idTransaction); /* app server interface functions */ -BOOL DdePostAdvise(ULONG idInst, HSZ hszTopic, HSZ hszItem); -BOOL DdeEnableCallback(ULONG idInst, HCONV hConv, USHORT wCmd); +sal_Bool DdePostAdvise(sal_uIntPtr idInst, HSZ hszTopic, HSZ hszItem); +sal_Bool DdeEnableCallback(sal_uIntPtr idInst, HCONV hConv, sal_uInt16 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); +HDDEDATA DdeNameService(sal_uIntPtr idInst, HSZ hsz1, HSZ hsz2, sal_uInt16 afCmd); #define DNS_REGISTER 0x0001 #define DNS_UNREGISTER 0x0002 @@ -270,23 +270,23 @@ HDDEDATA DdeNameService(ULONG idInst, HSZ hsz1, HSZ hsz2, USHORT afCmd); /* app client interface functions */ -HDDEDATA DdeClientTransaction(void* pData, ULONG cbData, - HCONV hConv, HSZ hszItem, USHORT wFmt, USHORT wType, - ULONG dwTimeout, ULONG* pdwResult); +HDDEDATA DdeClientTransaction(void* pData, sal_uIntPtr cbData, + HCONV hConv, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 wType, + sal_uIntPtr dwTimeout, sal_uIntPtr* 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); +HDDEDATA DdeCreateDataHandle(sal_uIntPtr idInst, void* pSrc, sal_uIntPtr cb, + sal_uIntPtr cbOff, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 afCmd); +// HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, sal_uIntPtr cb, sal_uIntPtr cbOff); +sal_uIntPtr DdeGetData(HDDEDATA hData, void* pDst, sal_uIntPtr cbMax, sal_uIntPtr cbOff); +sal_uInt8* DdeAccessData(HDDEDATA hData, sal_uIntPtr* pcbDataSize); +sal_Bool DdeUnaccessData(HDDEDATA hData); +sal_Bool DdeFreeDataHandle(HDDEDATA hData); #define HDATA_APPOWNED 0x0001 -USHORT DdeGetLastError(ULONG idInst); +sal_uInt16 DdeGetLastError(sal_uIntPtr idInst); #define DMLERR_NO_ERROR 0 /* must be 0 */ @@ -313,11 +313,11 @@ USHORT DdeGetLastError(ULONG idInst); #define DMLERR_LAST 0x4011 -HSZ DdeCreateStringHandle(ULONG idInst, PSZ pStr, int iCodePage); -ULONG DdeQueryString(ULONG idInst, HSZ hsz, PSZ pStr, ULONG cchMax, +HSZ DdeCreateStringHandle(sal_uIntPtr idInst, PSZ pStr, int iCodePage); +sal_uIntPtr DdeQueryString(sal_uIntPtr idInst, HSZ hsz, PSZ pStr, sal_uIntPtr cchMax, int iCodePage); -BOOL DdeFreeStringHandle(ULONG idInst, HSZ hsz); -BOOL DdeKeepStringHandle(ULONG idInst, HSZ hsz); +sal_Bool DdeFreeStringHandle(sal_uIntPtr idInst, HSZ hsz); +sal_Bool DdeKeepStringHandle(sal_uIntPtr idInst, HSZ hsz); int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2); diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index c361f259d610..25d1cf380c03 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -48,10 +48,10 @@ enum DdeItemType struct DdeItemImpData { - ULONG nHCnv; - USHORT nCnt; + sal_uIntPtr nHCnv; + sal_uInt16 nCnt; - DdeItemImpData( ULONG nH ) : nHCnv( nH ), nCnt( 1 ) {} + DdeItemImpData( sal_uIntPtr nH ) : nHCnv( nH ), nCnt( 1 ) {} }; SV_DECL_VARARR( DdeItemImp, DdeItemImpData, 1, 1 ) @@ -106,7 +106,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 )); @@ -159,7 +159,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 )); @@ -240,7 +240,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 ); @@ -256,7 +256,7 @@ found: else pTopic->aItem.Erase(); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; pInst->hCurConvSvr = (long)hConv; switch( nCode ) { @@ -345,14 +345,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: { @@ -400,7 +400,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"); @@ -433,7 +433,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 @@ -569,7 +569,7 @@ void DdeService::RemoveTopic( const DdeTopic& rTopic ) aTopics.Remove( t ); // JP 27.07.95: und alle Conversions loeschen !!! // (sonst wird auf geloeschten Topics gearbeitet!!) - for( ULONG n = pConv->Count(); n; ) + for( sal_uIntPtr n = pConv->Count(); n; ) { Conversation* pC = pConv->GetObject( --n ); if( pC->pTopic == &rTopic ) @@ -585,21 +585,21 @@ void DdeService::RemoveTopic( const DdeTopic& rTopic ) // --- DdeService::HasCbFormat() ----------------------------------- -BOOL DdeService::HasCbFormat( USHORT nFmt ) +sal_Bool DdeService::HasCbFormat( sal_uInt16 nFmt ) { - return BOOL( aFormats.GetPos( nFmt ) != LIST_ENTRY_NOTFOUND ); + return sal_Bool( aFormats.GetPos( nFmt ) != LIST_ENTRY_NOTFOUND ); } // --- DdeService::HasFormat() ------------------------------------- -BOOL DdeService::HasFormat( ULONG nFmt ) +sal_Bool DdeService::HasFormat( sal_uIntPtr 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_uIntPtr nFmt ) { nFmt = DdeData::GetExternalFormat( nFmt ); aFormats.Remove( nFmt ); @@ -608,7 +608,7 @@ void DdeService::AddFormat( ULONG nFmt ) // --- DdeService::RemoveFormat() ---------------------------------- -void DdeService::RemoveFormat( ULONG nFmt ) +void DdeService::RemoveFormat( sal_uIntPtr nFmt ) { aFormats.Remove( DdeData::GetExternalFormat( nFmt ) ); } @@ -645,9 +645,9 @@ const String& DdeTopic::GetName() const // --- DdeTopic::IsSystemTopic() ----------------------------------- -BOOL DdeTopic::IsSystemTopic() +sal_Bool DdeTopic::IsSystemTopic() { - return BOOL (GetName() == reinterpret_cast(SZDDESYS_TOPIC)); + return sal_Bool (GetName() == reinterpret_cast(SZDDESYS_TOPIC)); } // --- DdeTopic::AddItem() ----------------------------------------- @@ -741,7 +741,7 @@ void __EXPORT DdeTopic::_Disconnect( long nId ) // --- DdeTopic::Get() --------------------------------------------- -DdeData* __EXPORT DdeTopic::Get( ULONG nFmt ) +DdeData* __EXPORT DdeTopic::Get( sal_uIntPtr nFmt ) { if ( aGetLink.IsSet() ) return (DdeData*)aGetLink.Call( (void*)nFmt ); @@ -751,22 +751,22 @@ DdeData* __EXPORT DdeTopic::Get( ULONG nFmt ) // --- DdeTopic::Put() --------------------------------------------- -BOOL __EXPORT DdeTopic::Put( const DdeData* r ) +sal_Bool __EXPORT 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 __EXPORT DdeTopic::Execute( const String* r ) +sal_Bool __EXPORT 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() --------------------------------------- @@ -780,16 +780,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() ------------------------------------------ @@ -859,17 +859,17 @@ void DdeItem::NotifyClient() // --- DdeItem::IncMonitor() ------------------------------------------ -void DdeItem::IncMonitor( ULONG nHCnv ) +void DdeItem::IncMonitor( sal_uIntPtr 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; @@ -882,12 +882,12 @@ void DdeItem::IncMonitor( ULONG nHCnv ) // --- DdeItem::DecMonitor() ------------------------------------------ -void DdeItem::DecMonitor( ULONG nHCnv ) +void DdeItem::DecMonitor( sal_uIntPtr 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 ) @@ -898,7 +898,7 @@ void DdeItem::DecMonitor( ULONG nHCnv ) { delete pImpData, pImpData = 0; if( DDEGETPUTITEM == nType ) - ((DdeGetPutItem*)this)->AdviseLoop( FALSE ); + ((DdeGetPutItem*)this)->AdviseLoop( sal_False ); } } return ; @@ -912,7 +912,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; } @@ -944,21 +944,21 @@ DdeGetPutItem::DdeGetPutItem( const DdeItem& rItem ) // --- DdeGetPutData::Get() ---------------------------------------- -DdeData* DdeGetPutItem::Get( ULONG ) +DdeData* DdeGetPutItem::Get( sal_uIntPtr ) { 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 ) { } @@ -1023,7 +1023,7 @@ String DdeService::Formats() s += '\t'; p = buf; - switch( (USHORT)f ) + switch( (sal_uInt16)f ) { case CF_TEXT: p = reinterpret_cast(String::CreateFromAscii("TEXT").GetBuffer()); @@ -1070,9 +1070,9 @@ String DdeService::Status() // --- DdeService::IsBusy() ---------------------------------------- -BOOL __EXPORT DdeService::IsBusy() +sal_Bool __EXPORT DdeService::IsBusy() { - return FALSE; + return sal_False; } // --- DdeService::GetHelp() ---------------------------------------- @@ -1082,14 +1082,14 @@ String __EXPORT 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& ) @@ -1097,8 +1097,8 @@ String DdeService::SysTopicGet( const String& ) return String(); } -BOOL DdeService::SysTopicExecute( const String* ) +sal_Bool DdeService::SysTopicExecute( const String* ) { - return FALSE; + return sal_False; } diff --git a/svl/source/svsql/converter.cxx b/svl/source/svsql/converter.cxx index ee36914289a3..7b684110a196 100644 --- a/svl/source/svsql/converter.cxx +++ b/svl/source/svsql/converter.cxx @@ -29,12 +29,12 @@ #include "precompiled_svl.hxx" #include "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/undo/undo.cxx b/svl/source/undo/undo.cxx index fa5eca964a8c..5761e62c62cd 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -55,14 +55,14 @@ SfxRepeatTarget::~SfxRepeatTarget() //------------------------------------------------------------------------ -BOOL SfxUndoAction::IsLinked() +sal_Bool SfxUndoAction::IsLinked() { return bLinked; } //------------------------------------------------------------------------ -void SfxUndoAction::SetLinked( BOOL bIsLinked ) +void SfxUndoAction::SetLinked( sal_Bool bIsLinked ) { bLinked = bIsLinked; } @@ -79,15 +79,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; } //------------------------------------------------------------------------ @@ -101,7 +101,7 @@ XubString SfxUndoAction::GetComment() const //------------------------------------------------------------------------ -USHORT SfxUndoAction::GetId() const +sal_uInt16 SfxUndoAction::GetId() const { DBG_CHKTHIS(SfxUndoAction, 0); return 0; @@ -143,15 +143,15 @@ void SfxUndoAction::Repeat(SfxRepeatTarget&) //------------------------------------------------------------------------ -BOOL SfxUndoAction::CanRepeat(SfxRepeatTarget&) const +sal_Bool SfxUndoAction::CanRepeat(SfxRepeatTarget&) const { - return TRUE; + return sal_True; } //======================================================================== -SfxUndoManager::SfxUndoManager( USHORT nMaxUndoActionCount ) +SfxUndoManager::SfxUndoManager( sal_uInt16 nMaxUndoActionCount ) : pFatherUndoArray(0) , mbUndoEnabled( true ) { @@ -178,7 +178,7 @@ void SfxUndoManager::EnableUndo( bool bEnable ) //------------------------------------------------------------------------ -void SfxUndoManager::SetMaxUndoActionCount( USHORT nMaxUndoActionCount ) +void SfxUndoManager::SetMaxUndoActionCount( sal_uInt16 nMaxUndoActionCount ) { // Remove entries from the pActUndoArray when we have to reduce // the number of entries due to a lower nMaxUndoActionCount. @@ -190,7 +190,7 @@ void SfxUndoManager::SetMaxUndoActionCount( USHORT nMaxUndoActionCount ) { while ( nNumToDelete > 0 ) { - USHORT nPos = pActUndoArray->aUndoActions.Count(); + sal_uInt16 nPos = pActUndoArray->aUndoActions.Count(); if ( nPos > pActUndoArray->nCurUndoAction ) { if ( !pActUndoArray->aUndoActions[nPos-1]->IsLinked() ) @@ -222,7 +222,7 @@ void SfxUndoManager::SetMaxUndoActionCount( USHORT nMaxUndoActionCount ) //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetMaxUndoActionCount() const +sal_uInt16 SfxUndoManager::GetMaxUndoActionCount() const { return pActUndoArray->nMaxUndoActions; } @@ -257,12 +257,12 @@ void SfxUndoManager::ClearRedo() //------------------------------------------------------------------------ -void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerge ) +void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerge ) { if( mbUndoEnabled ) { // Redo-Actions loeschen - for ( USHORT nPos = pActUndoArray->aUndoActions.Count(); + for ( sal_uInt16 nPos = pActUndoArray->aUndoActions.Count(); nPos > pActUndoArray->nCurUndoAction; --nPos ) delete pActUndoArray->aUndoActions[nPos-1]; @@ -301,14 +301,14 @@ void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerge ) //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetUndoActionCount() const +sal_uInt16 SfxUndoManager::GetUndoActionCount() const { return pActUndoArray->nCurUndoAction; } //------------------------------------------------------------------------ -XubString SfxUndoManager::GetUndoActionComment( USHORT nNo ) const +XubString SfxUndoManager::GetUndoActionComment( sal_uInt16 nNo ) const { DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment(), illegal id!" ); if( nNo < pActUndoArray->nCurUndoAction ) @@ -324,7 +324,7 @@ XubString SfxUndoManager::GetUndoActionComment( USHORT nNo ) const //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetUndoActionId( USHORT nNo ) const +sal_uInt16 SfxUndoManager::GetUndoActionId( sal_uInt16 nNo ) const { DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" ); if( nNo < pActUndoArray->nCurUndoAction ) @@ -339,7 +339,7 @@ USHORT SfxUndoManager::GetUndoActionId( USHORT nNo ) const //------------------------------------------------------------------------ -SfxUndoAction* SfxUndoManager::GetUndoAction( USHORT nNo ) const +SfxUndoAction* SfxUndoManager::GetUndoAction( sal_uInt16 nNo ) const { DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoAction(), illegal id!" ); if( nNo < pActUndoArray->nCurUndoAction ) @@ -363,7 +363,7 @@ void SfxUndoManager::RemoveLastUndoAction() pActUndoArray->nCurUndoAction--; // delete redo-actions and top action - USHORT nPos; + sal_uInt16 nPos; for ( nPos = pActUndoArray->aUndoActions.Count(); nPos > pActUndoArray->nCurUndoAction; --nPos ) delete pActUndoArray->aUndoActions[nPos-1]; @@ -375,12 +375,12 @@ void SfxUndoManager::RemoveLastUndoAction() //------------------------------------------------------------------------ -BOOL SfxUndoManager::Undo( USHORT ) +sal_Bool SfxUndoManager::Undo( sal_uInt16 ) { bool bUndoWasEnabled = mbUndoEnabled; mbUndoEnabled = false; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; try { @@ -388,7 +388,7 @@ BOOL SfxUndoManager::Undo( USHORT ) if ( pActUndoArray->nCurUndoAction ) { Undo( *pActUndoArray->aUndoActions[ --pActUndoArray->nCurUndoAction ] ); - bRet = TRUE; + bRet = sal_True; } } catch( Exception& e ) @@ -421,40 +421,40 @@ void SfxUndoManager::Undo( SfxUndoAction &rAction ) //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetRedoActionCount() const +sal_uInt16 SfxUndoManager::GetRedoActionCount() const { return pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction; //! } //------------------------------------------------------------------------ -XubString SfxUndoManager::GetRedoActionComment( USHORT nNo ) const +XubString SfxUndoManager::GetRedoActionComment( sal_uInt16 nNo ) const { return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetComment(); //! } //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetRedoActionId( USHORT nNo ) const +sal_uInt16 SfxUndoManager::GetRedoActionId( sal_uInt16 nNo ) const { return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetId(); //! } //------------------------------------------------------------------------ -BOOL SfxUndoManager::Redo( USHORT ) +sal_Bool SfxUndoManager::Redo( sal_uInt16 ) { bool bUndoWasEnabled = mbUndoEnabled; mbUndoEnabled = false; - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; try { if ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction ) { Redo( *pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction++] ); - bRet = TRUE; + bRet = sal_True; } } catch( Exception& e ) @@ -489,14 +489,14 @@ void SfxUndoManager::Redo( SfxUndoAction &rAction ) //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetRepeatActionCount() const +sal_uInt16 SfxUndoManager::GetRepeatActionCount() const { return pActUndoArray->aUndoActions.Count(); } //------------------------------------------------------------------------ -XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo ) const +XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget, sal_uInt16 nNo ) const { return pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 - nNo ] ->GetRepeatComment(rTarget); @@ -504,15 +504,15 @@ XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget, USHO //------------------------------------------------------------------------ -BOOL SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, USHORT /*nFrom*/, USHORT /*nCount*/ ) +sal_Bool SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, sal_uInt16 /*nFrom*/, sal_uInt16 /*nCount*/ ) { if ( pActUndoArray->aUndoActions.Count() ) { Repeat( rTarget, *pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 ] ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } //------------------------------------------------------------------------ @@ -525,28 +525,28 @@ void SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) //------------------------------------------------------------------------ -BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const +sal_Bool SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const { return rAction.CanRepeat(rTarget); } //------------------------------------------------------------------------ -BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo ) const +sal_Bool SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, sal_uInt16 nNo ) const { if ( pActUndoArray->aUndoActions.Count() > nNo ) { - USHORT nActionNo = pActUndoArray->aUndoActions.Count() - 1 - nNo; + sal_uInt16 nActionNo = pActUndoArray->aUndoActions.Count() - 1 - nNo; return pActUndoArray->aUndoActions[nActionNo]->CanRepeat(rTarget); } - return FALSE; + return sal_False; } //------------------------------------------------------------------------ void SfxUndoManager::EnterListAction( - const XubString& rComment, const XubString &rRepeatComment, USHORT nId ) + const XubString& rComment, const XubString &rRepeatComment, sal_uInt16 nId ) /* [Beschreibung] @@ -606,7 +606,7 @@ void SfxUndoManager::LeaveListAction() SfxListUndoAction* pList = dynamic_cast< SfxListUndoAction * >( pTmpAction ); if( pList && pList->GetComment().Len() == 0 ) { - USHORT n; + sal_uInt16 n; for( n = 0; n < pList->aUndoActions.Count(); n++ ) { if( pList->aUndoActions[n]->GetComment().Len() ) @@ -621,7 +621,7 @@ void SfxUndoManager::LeaveListAction() //------------------------------------------------------------------------ -USHORT SfxListUndoAction::GetId() const +sal_uInt16 SfxListUndoAction::GetId() const { return nId; } @@ -654,7 +654,7 @@ SfxListUndoAction::SfxListUndoAction ( const XubString &rComment, const XubString rRepeatComment, - USHORT Id, + sal_uInt16 Id, SfxUndoArray *pFather ) : nId(Id), aComment(rComment), aRepeatComment(rRepeatComment) @@ -667,7 +667,7 @@ SfxListUndoAction::SfxListUndoAction void SfxListUndoAction::Undo() { - for(INT16 i=nCurUndoAction-1;i>=0;i--) + for(sal_Int16 i=nCurUndoAction-1;i>=0;i--) aUndoActions[i]->Undo(); nCurUndoAction=0; } @@ -676,7 +676,7 @@ void SfxListUndoAction::Undo() void SfxListUndoAction::Redo() { - for(USHORT i=nCurUndoAction;iRedo(); nCurUndoAction = aUndoActions.Count(); } @@ -685,23 +685,23 @@ void SfxListUndoAction::Redo() void SfxListUndoAction::Repeat(SfxRepeatTarget&rTarget) { - for(USHORT i=0;iRepeat(rTarget); } //------------------------------------------------------------------------ -BOOL SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const +sal_Bool SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const { - for(USHORT i=0;iCanRepeat(r)) - return FALSE; - return TRUE; + 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 ); } @@ -720,7 +720,7 @@ SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager) pUndoManager = pManager; if ( pManager->GetMaxUndoActionCount() ) { - USHORT nPos = pManager->GetUndoActionCount()-1; + sal_uInt16 nPos = pManager->GetUndoActionCount()-1; pAction = pManager->pActUndoArray->aUndoActions[nPos]; pAction->SetLinked(); } @@ -747,7 +747,7 @@ void SfxLinkUndoAction::Redo() //------------------------------------------------------------------------ -BOOL SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const +sal_Bool SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const { return pAction && pUndoManager->CanRepeat(r,*pAction); } @@ -789,7 +789,7 @@ XubString SfxLinkUndoAction::GetRepeatComment(SfxRepeatTarget&r) const SfxLinkUndoAction::~SfxLinkUndoAction() { if( pAction ) - pAction->SetLinked( FALSE ); + pAction->SetLinked( sal_False ); } @@ -807,7 +807,7 @@ SfxUndoArray::~SfxUndoArray() } -USHORT SfxLinkUndoAction::GetId() const +sal_uInt16 SfxLinkUndoAction::GetId() const { return pAction ? pAction->GetId() : 0; } diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx index 4f92c80e36f2..6acf11144a7c 100644 --- a/svl/unx/source/svdde/ddedummy.cxx +++ b/svl/unx/source/svdde/ddedummy.cxx @@ -42,7 +42,7 @@ DdeData::DdeData( const DdeData& ) { } -DdeData::DdeData( const void*, long, ULONG) +DdeData::DdeData( const void*, long, sal_uIntPtr) { } @@ -50,11 +50,11 @@ DdeData::~DdeData( void ) { } -void DdeData::SetFormat( ULONG ) +void DdeData::SetFormat( sal_uIntPtr ) { } -ULONG DdeData::GetFormat() const +sal_uIntPtr DdeData::GetFormat() const { return 0L; } @@ -111,7 +111,7 @@ void DdeTransaction::Execute(void) { } -void DdeTransaction::Done( BOOL ) +void DdeTransaction::Done( sal_Bool ) { } @@ -168,34 +168,34 @@ void DdeTopic::RemoveItem( const DdeItem& ) { } -DdeData* DdeTopic::Get( ULONG ) +DdeData* DdeTopic::Get( sal_uIntPtr ) { 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 @@ -228,17 +228,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() @@ -246,7 +246,7 @@ String DdeService::GetHelp() return String::EmptyString(); } -void DdeService::AddFormat( ULONG ) +void DdeService::AddFormat( sal_uIntPtr ) { } @@ -258,9 +258,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 @@ -305,17 +305,17 @@ DdeItem( rItem ) { } -DdeData* DdeGetPutItem::Get( ULONG ) +DdeData* DdeGetPutItem::Get( sal_uIntPtr ) { 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/tools/bootstrp/addexes/replace.cxx b/tools/bootstrp/addexes/replace.cxx index 3c451ae54be0..37304ab18870 100644 --- a/tools/bootstrp/addexes/replace.cxx +++ b/tools/bootstrp/addexes/replace.cxx @@ -60,7 +60,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/mkfilt.cxx b/tools/bootstrp/addexes2/mkfilt.cxx index 2d03aaa153e5..9dae100352c3 100644 --- a/tools/bootstrp/addexes2/mkfilt.cxx +++ b/tools/bootstrp/addexes2/mkfilt.cxx @@ -88,16 +88,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; } @@ -159,32 +159,32 @@ void MkFilter::Filter() MkLine *pMkLine = new MkLine(); ByteString *pStr = new ByteString( aLineBuf ); pMkLine->aLine = *pStr; - pMkLine->bOut = FALSE; + pMkLine->bOut = sal_False; pLst->Insert( pMkLine, LIST_APPEND ); } 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->Insert( p_MkLine, LIST_APPEND ); 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->Insert( pMkLine, LIST_APPEND ); @@ -196,21 +196,21 @@ void MkFilter::Filter() fprintf( stderr, "\n" ); // das File wieder ausgegeben - ULONG nLines = pLst->Count(); - for ( ULONG j=0; jCount(); + for ( sal_uIntPtr j=0; jGetObject( j ); if ( pLine->bHier ) { // die List n - Mal abarbeiten - for ( USHORT n=1; n<11; n++) + for ( sal_uInt16 n=1; n<11; n++) { - ULONG nCount = pLine->pPrivateTnrLst->Count(); - for ( ULONG i=0; ipPrivateTnrLst->Count(); + for ( sal_uIntPtr i=0; ipPrivateTnrLst->GetObject(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 index 2ab0cc8dc4a6..85dc982379e7 100644 --- a/tools/bootstrp/command.cxx +++ b/tools/bootstrp/command.cxx @@ -92,7 +92,7 @@ #endif /*****************************************************************************/ -CommandLine::CommandLine(BOOL bWrite) +CommandLine::CommandLine(sal_Bool bWrite) /*****************************************************************************/ : bTmpWrite(bWrite) { @@ -117,7 +117,7 @@ CommandLine::CommandLine(BOOL bWrite) } /*****************************************************************************/ -CommandLine::CommandLine(const char *CommandString, BOOL bWrite) +CommandLine::CommandLine(const char *CommandString, sal_Bool bWrite) /*****************************************************************************/ : bTmpWrite(bWrite) { @@ -143,7 +143,7 @@ CommandLine::CommandLine(const char *CommandString, BOOL bWrite) } /*****************************************************************************/ -CommandLine::CommandLine(const CommandLine& CCommandLine, BOOL bWrite) +CommandLine::CommandLine(const CommandLine& CCommandLine, sal_Bool bWrite) /*****************************************************************************/ : bTmpWrite(bWrite) { @@ -405,9 +405,9 @@ void CCommand::ImplInit() char *pChar; int nVoid = sizeof( size_t * ); nArgc = aCommandLine.GetTokenCount(' '); - ULONG nLen = aCommandLine.Len(); + sal_uIntPtr nLen = aCommandLine.Len(); - ppArgv = (char **) new char[ (ULONG)(nLen + nVoid * (nArgc +2) + nArgc ) ]; + ppArgv = (char **) new char[ (sal_uIntPtr)(nLen + nVoid * (nArgc +2) + nArgc ) ]; pChar = (char *) ppArgv + ( (1+nArgc) * nVoid ); pPtr = (size_t *) ppArgv; for ( xub_StrLen i=0; iCount(); - for ( ULONG n=0; nCount(); + for ( sal_uIntPtr n=0; nGetObject(n); Search( *pStr ); } } -BOOL CppDep::AddSearchPath( const char* aPath ) +sal_Bool CppDep::AddSearchPath( const char* aPath ) { ByteString *pStr = new ByteString( aPath ); pSearchPath->Insert( pStr, LIST_APPEND ); - return FALSE; + return sal_False; } -BOOL CppDep::AddSource( const char* aSource ) +sal_Bool CppDep::AddSource( const char* aSource ) { ByteString *pStr = new ByteString( aSource ); pSources->Insert( pStr, LIST_APPEND ); - 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; @@ -100,7 +100,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 @@ -115,13 +115,13 @@ BOOL CppDep::Search( ByteString aFileName ) if ( aResult !="") if ( (aNewFile = Exists( aResult )) != "" ) { - BOOL bFound = FALSE; - ULONG nCount = pFileList->Count(); - for ( ULONG i=0; iCount(); + for ( sal_uIntPtr i=0; iGetObject(i); if ( *pStr == aNewFile ) - bFound = TRUE; + bFound = sal_True; } #ifdef DEBUG_VERBOSE fprintf( stderr, "not in list : %d %s\n", nPos, aReadLine.GetBuffer() ); @@ -151,8 +151,8 @@ ByteString CppDep::Exists( ByteString aFileName ) fprintf( stderr, "Searching %s \n", aFileName.GetBuffer() ); #endif - ULONG nCount = pSearchPath->Count(); - for ( ULONG n=0; nCount(); + for ( sal_uIntPtr n=0; nGetObject(n); @@ -217,7 +217,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 cdc3ac2e9758..0744a94d8964 100644 --- a/tools/bootstrp/cppdep.hxx +++ b/tools/bootstrp/cppdep.hxx @@ -41,7 +41,7 @@ protected: ByteStringList *pFileList; ByteStringList *pSources; - BOOL Search( ByteString aFileName ); + sal_Bool Search( ByteString aFileName ); ByteString Exists( ByteString aFileName ); ByteString IsIncludeStatement( ByteString aLine ); @@ -52,7 +52,7 @@ 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 ); }; diff --git a/tools/bootstrp/inimgr.cxx b/tools/bootstrp/inimgr.cxx index a0a69f06f7af..0907f8f9e102 100644 --- a/tools/bootstrp/inimgr.cxx +++ b/tools/bootstrp/inimgr.cxx @@ -42,7 +42,7 @@ /****************************************************************************/ IniManager::IniManager( ByteString &rDir, ByteString &rLocalDir ) /****************************************************************************/ - : bUpdate( TRUE ) + : bUpdate( sal_True ) { sLocalPath = ByteString( getenv( "LOCALINI" )); if ( !sLocalPath.Len()) @@ -59,7 +59,7 @@ IniManager::IniManager( ByteString &rDir, ByteString &rLocalDir ) /****************************************************************************/ IniManager::IniManager( ByteString &rDir ) /****************************************************************************/ - : bUpdate( TRUE ) + : bUpdate( sal_True ) { sLocalPath = GetLocalIni(); sGlobalDir = rDir; @@ -73,7 +73,7 @@ IniManager::IniManager( ByteString &rDir ) /****************************************************************************/ IniManager::IniManager() /****************************************************************************/ - : bUpdate( TRUE ) + : bUpdate( sal_True ) { sLocalPath = GetLocalIni(); @@ -169,7 +169,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 != ".." )) @@ -205,6 +205,6 @@ void IniManager::Update() if ( bUpdate ) { ForceUpdate(); - bUpdate = FALSE; + bUpdate = sal_False; } } diff --git a/tools/bootstrp/iserver.cxx b/tools/bootstrp/iserver.cxx index 0b2c1df15203..63b1b333b22f 100644 --- a/tools/bootstrp/iserver.cxx +++ b/tools/bootstrp/iserver.cxx @@ -50,12 +50,12 @@ int _cdecl main( int argc, char *argv[] ) fprintf( stdout, " returns a list of all settings of version \"vcl364\"\n" ); } else { - BOOL bError = FALSE; - BOOL bList = FALSE; + sal_Bool bError = sal_False; + sal_Bool bList = sal_False; ByteString sInfo( "" ); ByteString sDataBase( GetDefStandList()); - BOOL bGetNow = FALSE; + sal_Bool bGetNow = sal_False; int nCount = 1; while (( nCount < argc ) && @@ -68,7 +68,7 @@ int _cdecl main( int argc, char *argv[] ) sInfo = ByteString( argv[nCount] ); nCount++; } - else bError = TRUE; + else bError = sal_True; } else if ( ByteString( argv[nCount] ).ToUpperAscii() == "-D" ) { // requestet info path @@ -77,20 +77,20 @@ int _cdecl main( int argc, char *argv[] ) sDataBase = ByteString( argv[nCount] ); nCount++; } - else bError = TRUE; + else bError = sal_True; } else if ( ByteString( argv[nCount] ).ToUpperAscii() == "-L" ) { // request list of childs nCount++; - bList = TRUE; + bList = sal_True; } else if ( ByteString( argv[nCount] ).ToUpperAscii() == "-N" ) { // request list of childs nCount++; - bGetNow = TRUE; + bGetNow = sal_True; } else { - bError = TRUE; + bError = sal_True; } } @@ -103,7 +103,7 @@ int _cdecl main( int argc, char *argv[] ) return 1; if ( sInfo.Len()) { - GenericInformation *pInfo = pList->GetInfo( sInfo, TRUE ); + GenericInformation *pInfo = pList->GetInfo( sInfo, sal_True ); if ( pInfo ) { ByteString sValue( pInfo->GetValue()); @@ -113,7 +113,7 @@ int _cdecl main( int argc, char *argv[] ) GenericInformationList *pList = pInfo->GetSubList(); if ( pList ) { // show whole list of childs and their values - for( ULONG i = 0; i < pList->Count(); i++ ) { + for( sal_uIntPtr i = 0; i < pList->Count(); i++ ) { GenericInformation *pInfo = pList->GetObject( i ); ByteString sValue( pInfo->GetValue()); fprintf( stdout, " %s %s\n", pInfo->GetBuffer(), sValue.GetBuffer()); @@ -126,11 +126,11 @@ int _cdecl main( int argc, char *argv[] ) } else { // show whole list of childs and their values - for( ULONG i = 0; i < pList->Count(); i++ ) { + for( sal_uIntPtr i = 0; i < pList->Count(); i++ ) { GenericInformation *pInfo = pList->GetObject( i ); if ( bGetNow ) { ByteString sPath( "settings/now" ); - GenericInformation *pSubInfo = pInfo->GetSubInfo( sPath, TRUE ); + GenericInformation *pSubInfo = pInfo->GetSubInfo( sPath, sal_True ); if ( pSubInfo && pSubInfo->GetValue() == "_TRUE" ) fprintf( stdout, "%s\n", pInfo->GetBuffer()); } diff --git a/tools/bootstrp/mkcreate.cxx b/tools/bootstrp/mkcreate.cxx index 398a3a4c4143..adf9dde2ddaa 100644 --- a/tools/bootstrp/mkcreate.cxx +++ b/tools/bootstrp/mkcreate.cxx @@ -59,7 +59,7 @@ char const *LimitedPath[] = { /*****************************************************************************/ SourceDirectory::SourceDirectory( const ByteString &rDirectoryName, - USHORT nOperatingSystem, SourceDirectory *pParentDirectory ) + sal_uInt16 nOperatingSystem, SourceDirectory *pParentDirectory ) /*****************************************************************************/ : ByteString( rDirectoryName ), pParent( pParentDirectory ), @@ -87,7 +87,7 @@ SourceDirectory::~SourceDirectory() /*****************************************************************************/ CodedDependency *SourceDirectory::AddCodedDependency( - const ByteString &rCodedIdentifier, USHORT nOperatingSystems ) + const ByteString &rCodedIdentifier, sal_uInt16 nOperatingSystems ) /*****************************************************************************/ { CodedDependency *pReturn = NULL; @@ -98,7 +98,7 @@ CodedDependency *SourceDirectory::AddCodedDependency( pCodedDependencies->PutString(( ByteString * ) pReturn ); } else { - ULONG nPos = + sal_uIntPtr nPos = pCodedDependencies->IsString( (ByteString *) (& rCodedIdentifier) ); if ( nPos == NOT_THERE ) { pReturn = @@ -116,7 +116,7 @@ CodedDependency *SourceDirectory::AddCodedDependency( /*****************************************************************************/ CodedDependency *SourceDirectory::AddCodedIdentifier( - const ByteString &rCodedIdentifier, USHORT nOperatingSystems ) + const ByteString &rCodedIdentifier, sal_uInt16 nOperatingSystems ) /*****************************************************************************/ { CodedDependency *pReturn = NULL; @@ -127,7 +127,7 @@ CodedDependency *SourceDirectory::AddCodedIdentifier( pCodedIdentifier->PutString(( ByteString * ) pReturn ); } else { - ULONG nPos = + sal_uIntPtr nPos = pCodedIdentifier->IsString( ( ByteString *) (& rCodedIdentifier) ); if ( nPos == NOT_THERE ) { pReturn = @@ -172,22 +172,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; } @@ -223,7 +223,7 @@ SourceDirectory *SourceDirectory::GetSubDirectory( /*****************************************************************************/ SourceDirectory *SourceDirectory::GetDirectory( - const ByteString &rDirectoryName, USHORT nOperatingSystem ) + const ByteString &rDirectoryName, sal_uInt16 nOperatingSystem ) /*****************************************************************************/ { ByteString sDirectoryName( rDirectoryName ); @@ -249,7 +249,7 @@ SourceDirectory *SourceDirectory::GetDirectory( /*****************************************************************************/ SourceDirectory *SourceDirectory::Insert( const ByteString &rDirectoryName, - USHORT nOperatingSystem ) + sal_uInt16 nOperatingSystem ) /*****************************************************************************/ { SourceDirectory *pSubDirectory = NULL; @@ -271,11 +271,11 @@ Dependency *SourceDirectory::ResolvesDependency( if ( !pCodedIdentifier ) return NULL; - ULONG nPos = pCodedIdentifier->IsString( pCodedDependency ); + sal_uIntPtr nPos = pCodedIdentifier->IsString( pCodedDependency ); if ( nPos != NOT_THERE ) { CodedDependency *pIdentifier = ( CodedDependency * ) pCodedIdentifier->GetObject( nPos ); - USHORT nResult = + sal_uInt16 nResult = pIdentifier->GetOperatingSystem() & pCodedDependency->GetOperatingSystem(); Dependency *pReturn = new Dependency( *this, nResult ); @@ -294,7 +294,7 @@ void SourceDirectory::ResolveDependencies() if ( !pSubDirectories ) return; - for ( ULONG i = 0; i < pSubDirectories->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pSubDirectories->Count(); i++ ) { SourceDirectory *pActDirectory = ( SourceDirectory * ) pSubDirectories->GetObject( i ); if ( pActDirectory->pSubDirectories ) @@ -304,10 +304,10 @@ void SourceDirectory::ResolveDependencies() while ( pActDirectory->pCodedDependencies->Count()) { CodedDependency *pCodedDependency = ( CodedDependency * ) - pActDirectory->pCodedDependencies->GetObject(( ULONG ) 0 ); + pActDirectory->pCodedDependencies->GetObject(( sal_uIntPtr ) 0 ); for ( - ULONG k = 0; + sal_uIntPtr k = 0; ( k < pSubDirectories->Count()) && ( pCodedDependency->GetOperatingSystem() != OS_NONE ); k++ @@ -329,7 +329,7 @@ void SourceDirectory::ResolveDependencies() } else delete pCodedDependency; - pActDirectory->pCodedDependencies->Remove(( ULONG ) 0 ); + pActDirectory->pCodedDependencies->Remove(( sal_uIntPtr ) 0 ); } } } @@ -344,7 +344,7 @@ ByteString SourceDirectory::GetTarget() if ( !pDependencies ) return sReturn; - ULONG k = 0; + sal_uIntPtr k = 0; while ( k < pDependencies->Count()) { if ( *this == *pDependencies->GetObject( k )) delete pDependencies->Remove( k ); @@ -358,18 +358,18 @@ ByteString SourceDirectory::GetTarget() return sReturn; } - BOOL bDependsOnPlatform = FALSE; - for ( ULONG i = 0; i < pDependencies->Count(); i++ ) + sal_Bool bDependsOnPlatform = sal_False; + for ( sal_uIntPtr i = 0; i < pDependencies->Count(); i++ ) if ((( Dependency * ) pDependencies->GetObject( i ))-> GetOperatingSystem() != OS_ALL ) - bDependsOnPlatform = TRUE; + bDependsOnPlatform = sal_True; ByteString sTarget( *this ); sTarget.SearchAndReplaceAll( "\\", "$/" ); if ( !bDependsOnPlatform ) { sReturn = sTarget; sReturn += " :"; - for ( ULONG i = 0; i < pDependencies->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pDependencies->Count(); i++ ) { ByteString sDependency( *pDependencies->GetObject( i )); sDependency.SearchAndReplaceAll( "\\", "$/" ); sReturn += " "; @@ -380,19 +380,19 @@ 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 ( ULONG i = 0; i < pDependencies->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pDependencies->Count(); i++ ) { Dependency *pDependency = ( Dependency * ) pDependencies->GetObject( i ); ByteString sDependency( *pDependency ); @@ -401,17 +401,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; } } @@ -439,16 +439,16 @@ ByteString SourceDirectory::GetSubDirsTarget() ByteString sReturn; if ( pSubDirectories ) { - BOOL bDependsOnPlatform = FALSE; - for ( ULONG i = 0; i < pSubDirectories->Count(); i++ ) + sal_Bool bDependsOnPlatform = sal_False; + for ( sal_uIntPtr i = 0; i < pSubDirectories->Count(); i++ ) if ((( SourceDirectory * ) pSubDirectories->GetObject( i ))-> GetOperatingSystems() != OS_ALL ) - bDependsOnPlatform = TRUE; + bDependsOnPlatform = sal_True; if ( !bDependsOnPlatform ) { sReturn = "RC_SUBDIRS = "; - for ( ULONG i = 0; i < pSubDirectories->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pSubDirectories->Count(); i++ ) { ByteString sSubDirectory( *pSubDirectories->GetObject( i )); sSubDirectory.SearchAndReplaceAll( "\\", "$/" ); sReturn += " \\\n\t"; @@ -459,17 +459,17 @@ 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 ( ULONG i = 0; i < pSubDirectories->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pSubDirectories->Count(); i++ ) { SourceDirectory *pDirectory = ( SourceDirectory * ) pSubDirectories->GetObject( i ); ByteString sDirectory( *pDirectory ); @@ -478,17 +478,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 ) { @@ -509,10 +509,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" ) @@ -526,7 +526,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; @@ -550,7 +550,7 @@ SourceDirectory *SourceDirectory::CreateRootDirectory( #endif ByteString sSolarList( _SOLARLIST ); - GenericInformation *pInfo = pVerList->GetInfo( sPath, TRUE ); + GenericInformation *pInfo = pVerList->GetInfo( sPath, sal_True ); if ( pInfo ) { ByteString aIniRoot( GetIniRoot() ); DirEntry aIniEntry( String( aIniRoot, RTL_TEXTENCODING_ASCII_US )); @@ -564,18 +564,18 @@ SourceDirectory *SourceDirectory::CreateRootDirectory( */ ByteString sVersion( rVersion ); - Star aStar( pVerList, sVersion, TRUE, rRoot.GetBuffer()); + Star aStar( pVerList, sVersion, sal_True, rRoot.GetBuffer()); // fprintf( stderr, // "Creating virtual directory tree ...\n" ); 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()); @@ -585,14 +585,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 ( ULONG x = 0; x < pPrjDependencies->Count(); x++ ) + for ( sal_uIntPtr x = 0; x < pPrjDependencies->Count(); x++ ) pProject->AddCodedDependency( *pPrjDependencies->GetObject( 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 ); @@ -602,7 +602,7 @@ SourceDirectory *SourceDirectory::CreateRootDirectory( pSourceRoot->InsertFull( sDirPath, pData->GetOSType()); SByteStringList *pDependencies = pData->GetDependencies(); if ( pDependencies ) { - for ( ULONG k = 0; k < pDependencies->Count(); k++ ) { + for ( sal_uIntPtr k = 0; k < pDependencies->Count(); k++ ) { ByteString sDependency(*pDependencies->GetObject( k )); ByteString sDependExt(sDependency.GetToken( 1, '.' )); sDependExt.ToUpperAscii(); @@ -623,14 +623,14 @@ SourceDirectory *SourceDirectory::CreateRootDirectory( } /*****************************************************************************/ -BOOL SourceDirectory::RemoveDirectoryTreeAndAllDependencies() +sal_Bool SourceDirectory::RemoveDirectoryTreeAndAllDependencies() /*****************************************************************************/ { if ( !pParent ) - return FALSE; + return sal_False; SourceDirectoryList *pParentContent = pParent->pSubDirectories; - ULONG i = 0; + sal_uIntPtr i = 0; while ( i < pParentContent->Count()) { SourceDirectory *pCandidate = ( SourceDirectory * )pParentContent->GetObject( i ); @@ -639,7 +639,7 @@ BOOL SourceDirectory::RemoveDirectoryTreeAndAllDependencies() } else { if ( pCandidate->pDependencies ) { - ULONG nPos = pCandidate->pDependencies->IsString( this ); + sal_uIntPtr nPos = pCandidate->pDependencies->IsString( this ); if ( nPos != NOT_THERE ) delete pCandidate->pDependencies->Remove( nPos ); } @@ -647,15 +647,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()); @@ -663,10 +663,10 @@ BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds ) DirEntry aEntry( aTmpStr ); if ( !aEntry.Exists()) { fprintf( stdout, " ... no directory!n" ); - return FALSE; + return sal_False; } - ULONG j = 0; + sal_uIntPtr j = 0; while( j < pSubDirectories->Count()) { String sSubDirectory( (( SourceDirectory * ) pSubDirectories->GetObject( j ))-> @@ -689,20 +689,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( @@ -866,7 +866,7 @@ BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds ) ); aMakefile.WriteLine( sComment ); - for ( ULONG i = 0; i < pSubDirectories->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pSubDirectories->Count(); i++ ) { ByteString sTarget( (( SourceDirectory * )pSubDirectories->GetObject( i ))-> GetTarget() @@ -908,12 +908,12 @@ BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds ) fprintf( stdout, "\n" ); - BOOL bSuccess = TRUE; + sal_Bool bSuccess = sal_True; if ( bAllChilds ) - for ( ULONG k = 0; k < pSubDirectories->Count(); k++ ) + for ( sal_uIntPtr k = 0; k < pSubDirectories->Count(); k++ ) if ( !(( SourceDirectory * ) pSubDirectories->GetObject( k ))-> - CreateRecursiveMakefile( TRUE )) - bSuccess = FALSE; + CreateRecursiveMakefile( sal_True )) + bSuccess = sal_False; return bSuccess; } @@ -926,7 +926,7 @@ BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds ) SourceDirectoryList::~SourceDirectoryList() /*****************************************************************************/ { - for ( ULONG i = 0; i < Count(); i++ ) + for ( sal_uIntPtr i = 0; i < Count(); i++ ) delete GetObject( i ); } @@ -935,7 +935,7 @@ SourceDirectory *SourceDirectoryList::Search( const ByteString &rDirectoryName ) /*****************************************************************************/ { - ULONG nPos = IsString( ( ByteString * ) (&rDirectoryName) ); + sal_uIntPtr nPos = IsString( ( ByteString * ) (&rDirectoryName) ); if ( nPos != LIST_ENTRY_NOTFOUND ) return ( SourceDirectory * ) GetObject( nPos ); diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx index 4f4d44a33536..bb62313685a2 100644 --- a/tools/bootstrp/prj.cxx +++ b/tools/bootstrp/prj.cxx @@ -111,9 +111,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 ); @@ -122,7 +122,7 @@ ByteString SimpleConfig::GetNextLine() } /*****************************************************************************/ -ByteString SimpleConfig::GetCleanedNextLine( BOOL bReadComments ) +ByteString SimpleConfig::GetCleanedNextLine( sal_Bool bReadComments ) /*****************************************************************************/ { @@ -140,11 +140,11 @@ ByteString SimpleConfig::GetCleanedNextLine( BOOL bReadComments ) aTmpStr = aTmpStr.EraseLeadingChars(); aTmpStr = aTmpStr.EraseTrailingChars(); -// while ( aTmpStr.SearchAndReplace(String(' '),String('\t') ) != (USHORT)-1 ); +// while ( aTmpStr.SearchAndReplace(String(' '),String('\t') ) != (sal_uInt16)-1 ); 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 ); @@ -152,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(' '); @@ -256,7 +256,7 @@ ByteString CommandData::GetCommandTypeString() } /*****************************************************************************/ -CommandData* Prj::GetDirectoryList ( USHORT, USHORT ) +CommandData* Prj::GetDirectoryList ( sal_uInt16, sal_uInt16 ) /*****************************************************************************/ { return (CommandData *)NULL; @@ -267,8 +267,8 @@ CommandData* Prj::GetDirectoryData( ByteString aLogFileName ) /*****************************************************************************/ { CommandData *pData = NULL; - ULONG nObjCount = Count(); - for ( ULONG i=0; iGetLogFile() == aLogFileName ) @@ -283,23 +283,23 @@ CommandData* Prj::GetDirectoryData( ByteString aLogFileName ) /*****************************************************************************/ Prj::Prj() : - bVisited( FALSE ), + bVisited( sal_False ), pPrjInitialDepList(0), pPrjDepList(0), - bHardDependencies( FALSE ), - bSorted( FALSE ) + bHardDependencies( sal_False ), + bSorted( sal_False ) /*****************************************************************************/ { } /*****************************************************************************/ Prj::Prj( ByteString aName ) : - bVisited( FALSE ), + bVisited( sal_False ), aProjectName( aName ), pPrjInitialDepList(0), pPrjDepList(0), - bHardDependencies( FALSE ), - bSorted( FALSE ) + bHardDependencies( sal_False ), + bSorted( sal_False ) /*****************************************************************************/ { } @@ -353,7 +353,7 @@ void Prj::AddDependencies( ByteString aStr ) } /*****************************************************************************/ -SByteStringList* Prj::GetDependencies( BOOL bExpanded ) +SByteStringList* Prj::GetDependencies( sal_Bool bExpanded ) /*****************************************************************************/ { if ( bExpanded ) @@ -365,8 +365,8 @@ SByteStringList* Prj::GetDependencies( BOOL bExpanded ) /*****************************************************************************/ -BOOL Prj::InsertDirectory ( ByteString aDirName, USHORT aWhat, - USHORT aWhatOS, ByteString aLogFileName, +sal_Bool Prj::InsertDirectory ( ByteString aDirName, sal_uInt16 aWhat, + sal_uInt16 aWhatOS, ByteString aLogFileName, const ByteString &rClientRestriction ) /*****************************************************************************/ { @@ -380,7 +380,7 @@ BOOL Prj::InsertDirectory ( ByteString aDirName, USHORT aWhat, Insert( pData ); - return FALSE; + return sal_False; } /*****************************************************************************/ @@ -390,12 +390,12 @@ BOOL Prj::InsertDirectory ( ByteString aDirName, USHORT aWhat, CommandData* Prj::RemoveDirectory ( ByteString aLogFileName ) /*****************************************************************************/ { - ULONG nCountMember = Count(); + sal_uIntPtr nCountMember = Count(); CommandData* pData; CommandData* pDataFound = NULL; SByteStringList* pDataDeps; - for ( USHORT i = 0; i < nCountMember; i++ ) + for ( sal_uInt16 i = 0; i < nCountMember; i++ ) { pData = GetObject( i ); if ( pData->GetLogFile() == aLogFileName ) @@ -406,8 +406,8 @@ CommandData* Prj::RemoveDirectory ( ByteString aLogFileName ) if ( pDataDeps ) { ByteString* pString; - ULONG nDataDepsCount = pDataDeps->Count(); - for ( ULONG j = nDataDepsCount; j > 0; j-- ) + sal_uIntPtr nDataDepsCount = pDataDeps->Count(); + for ( sal_uIntPtr j = nDataDepsCount; j > 0; j-- ) { pString = pDataDeps->GetObject( j - 1 ); if ( pString->GetToken( 0, '.') == aLogFileName ) @@ -434,7 +434,7 @@ Star::Star() } /*****************************************************************************/ -Star::Star(String aFileName, USHORT nMode ) +Star::Star(String aFileName, sal_uInt16 nMode ) /*****************************************************************************/ : nStarMode( nMode ) { @@ -452,7 +452,7 @@ Star::Star( SolarFileList *pSolarFiles ) /*****************************************************************************/ Star::Star( GenericInformationList *pStandLst, ByteString &rVersion, - BOOL bLocal, const char *pSourceRoot ) + sal_Bool bLocal, const char *pSourceRoot ) /*****************************************************************************/ { ByteString sPath( rVersion ); @@ -465,7 +465,7 @@ Star::Star( GenericInformationList *pStandLst, ByteString &rVersion, #else sPath += "/settings/SOLARLIST"; #endif - GenericInformation *pInfo = pStandLst->GetInfo( sPath, TRUE ); + GenericInformation *pInfo = pStandLst->GetInfo( sPath, sal_True ); if( pInfo && pInfo->GetValue().Len()) { ByteString sFile( pInfo->GetValue()); @@ -483,17 +483,17 @@ Star::Star( GenericInformationList *pStandLst, ByteString &rVersion, sPath = rVersion; sPath += "/drives"; - GenericInformation *pInfo2 = pStandLst->GetInfo( sPath, TRUE ); + GenericInformation *pInfo2 = pStandLst->GetInfo( sPath, sal_True ); if ( pInfo2 && pInfo2->GetSubList()) { GenericInformationList *pDrives = pInfo2->GetSubList(); - for ( ULONG i = 0; i < pDrives->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pDrives->Count(); i++ ) { GenericInformation *pDrive = pDrives->GetObject( i ); if ( pDrive ) { DirEntry aEntry; - BOOL bOk = FALSE; + sal_Bool bOk = sal_False; if ( sSrcRoot.Len()) { aEntry = DirEntry( sSrcRoot ); - bOk = TRUE; + bOk = sal_True; } else { #ifdef UNX @@ -502,10 +502,10 @@ Star::Star( GenericInformationList *pStandLst, ByteString &rVersion, if ( pUnixVolume ) { String sRoot( pUnixVolume->GetValue(), RTL_TEXTENCODING_ASCII_US ); aEntry = DirEntry( sRoot ); - bOk = TRUE; + bOk = sal_True; } #else - bOk = TRUE; + bOk = sal_True; String sRoot( *pDrive, RTL_TEXTENCODING_ASCII_US ); sRoot += String::CreateFromAscii( "\\" ); aEntry = DirEntry( sRoot ); @@ -513,12 +513,12 @@ Star::Star( GenericInformationList *pStandLst, ByteString &rVersion, } if ( bOk ) { sPath = "projects"; - GenericInformation *pProjectsKey = pDrive->GetSubInfo( sPath, TRUE ); + GenericInformation *pProjectsKey = pDrive->GetSubInfo( sPath, sal_True ); if ( pProjectsKey ) { if ( !sSrcRoot.Len()) { sPath = rVersion; sPath += "/settings/PATH"; - GenericInformation *pPath = pStandLst->GetInfo( sPath, TRUE ); + GenericInformation *pPath = pStandLst->GetInfo( sPath, sal_True ); if( pPath ) { ByteString sAddPath( pPath->GetValue()); #ifdef UNX @@ -535,7 +535,7 @@ Star::Star( GenericInformationList *pStandLst, ByteString &rVersion, String sPrjDir( String::CreateFromAscii( "prj" )); String sSolarFile( String::CreateFromAscii( "build.lst" )); - for ( ULONG j = 0; j < pProjects->Count(); j++ ) { + for ( sal_uIntPtr j = 0; j < pProjects->Count(); j++ ) { ByteString sProject( *pProjects->GetObject( j )); String ssProject( sProject, RTL_TEXTENCODING_ASCII_US ); @@ -566,18 +566,18 @@ Star::~Star() } /*****************************************************************************/ -BOOL Star::NeedsUpdate() +sal_Bool Star::NeedsUpdate() /*****************************************************************************/ { aMutex.acquire(); - for ( ULONG i = 0; i < aLoadedFilesList.Count(); i++ ) + for ( sal_uIntPtr i = 0; i < aLoadedFilesList.Count(); i++ ) if ( aLoadedFilesList.GetObject( i )->NeedsUpdate()) { aMutex.release(); - return TRUE; + return sal_True; } aMutex.release(); - return FALSE; + return sal_False; } /*****************************************************************************/ @@ -593,16 +593,16 @@ void Star::Read( String &rFileName ) sSourceRoot = aEntry.GetFull(); while( aFileList.Count()) { - StarFile *pFile = new StarFile( *aFileList.GetObject(( ULONG ) 0 )); + StarFile *pFile = new StarFile( *aFileList.GetObject(( sal_uIntPtr ) 0 )); if ( pFile->Exists()) { - SimpleConfig aSolarConfig( *aFileList.GetObject(( ULONG ) 0 )); + SimpleConfig aSolarConfig( *aFileList.GetObject(( sal_uIntPtr ) 0 )); while (( aString = aSolarConfig.GetNext()) != "" ) InsertToken (( char * ) aString.GetBuffer()); } aMutex.acquire(); aLoadedFilesList.Insert( pFile, LIST_APPEND ); aMutex.release(); - aFileList.Remove(( ULONG ) 0 ); + aFileList.Remove(( sal_uIntPtr ) 0 ); } // resolve all dependencies recursive Expand_Impl(); @@ -615,9 +615,9 @@ void Star::Read( SolarFileList *pSolarFiles ) while( pSolarFiles->Count()) { ByteString aString; - StarFile *pFile = new StarFile( *pSolarFiles->GetObject(( ULONG ) 0 )); + StarFile *pFile = new StarFile( *pSolarFiles->GetObject(( sal_uIntPtr ) 0 )); if ( pFile->Exists()) { - SimpleConfig aSolarConfig( *pSolarFiles->GetObject(( ULONG ) 0 )); + SimpleConfig aSolarConfig( *pSolarFiles->GetObject(( sal_uIntPtr ) 0 )); while (( aString = aSolarConfig.GetNext()) != "" ) InsertToken (( char * ) aString.GetBuffer()); } @@ -625,7 +625,7 @@ void Star::Read( SolarFileList *pSolarFiles ) aMutex.acquire(); aLoadedFilesList.Insert( pFile, LIST_APPEND ); aMutex.release(); - delete pSolarFiles->Remove(( ULONG ) 0 ); + delete pSolarFiles->Remove(( sal_uIntPtr ) 0 ); } delete pSolarFiles; @@ -658,7 +658,7 @@ void Star::InsertSolarList( String sProject ) // inserts a new solarlist part of another project String sFileName( CreateFileName( sProject )); - for ( ULONG i = 0; i < aFileList.Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < aFileList.Count(); i++ ) { if (( *aFileList.GetObject( i )) == sFileName ) return; } @@ -677,14 +677,14 @@ void Star::ExpandPrj_Impl( Prj *pPrj, Prj *pDepPrj ) if ( pDepPrj->bVisited ) return; - pDepPrj->bVisited = TRUE; + pDepPrj->bVisited = sal_True; SByteStringList* pPrjLst = pPrj->GetDependencies(); SByteStringList* pDepLst = NULL; ByteString* pDepend; ByteString* pPutStr; Prj *pNextPrj = NULL; - ULONG i, nRetPos; + sal_uIntPtr i, nRetPos; if ( pPrjLst ) { pDepLst = pDepPrj->GetDependencies(); @@ -708,9 +708,9 @@ void Star::ExpandPrj_Impl( Prj *pPrj, Prj *pDepPrj ) void Star::Expand_Impl() /*****************************************************************************/ { - for ( ULONG i = 0; i < Count(); i++ ) { - for ( ULONG j = 0; j < Count(); j++ ) - GetObject( j )->bVisited = FALSE; + for ( sal_uIntPtr i = 0; i < Count(); i++ ) { + for ( sal_uIntPtr j = 0; j < Count(); j++ ) + GetObject( j )->bVisited = sal_False; Prj* pPrj = GetObject( i ); ExpandPrj_Impl( pPrj, pPrj ); @@ -724,9 +724,9 @@ 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; + static sal_Bool bPrjDep = sal_False; + static sal_Bool bHardDep = sal_False; + static sal_uInt16 nCommandType, nOSType; CommandData* pCmdData; static SByteStringList *pStaticDepList; Prj* pPrj; @@ -743,20 +743,20 @@ void Star::InsertToken ( char *yytext ) case 2: if ( !strcmp( yytext, ":" )) { - bPrjDep = TRUE; - bHardDep = FALSE; + bPrjDep = sal_True; + bHardDep = sal_False; i = 9; } else if ( !strcmp( yytext, "::" )) { - bPrjDep = TRUE; - bHardDep = TRUE; + bPrjDep = sal_True; + bHardDep = sal_True; i = 9; } else { - bPrjDep = FALSE; - bHardDep = FALSE; + bPrjDep = sal_False; + bHardDep = sal_False; aWhat = yytext; if ( aWhat == "nmake" ) @@ -764,8 +764,8 @@ void Star::InsertToken ( char *yytext ) else if ( aWhat == "get" ) nCommandType = COMMAND_GET; else { - ULONG nOffset = aWhat.Copy( 3 ).ToInt32(); - nCommandType = sal::static_int_cast< USHORT >( + sal_uIntPtr nOffset = aWhat.Copy( 3 ).ToInt32(); + nCommandType = sal::static_int_cast< sal_uInt16 >( COMMAND_USER_START + nOffset - 1); } } @@ -836,7 +836,7 @@ void Star::InsertToken ( char *yytext ) { // Liste zu Ende i = -1; - bPrjDep= FALSE; + bPrjDep= sal_False; } else { @@ -908,7 +908,7 @@ void Star::InsertToken ( char *yytext ) } /*****************************************************************************/ -BOOL Star::HasProject ( ByteString aProjectName ) +sal_Bool Star::HasProject ( ByteString aProjectName ) /*****************************************************************************/ { Prj *pPrj; @@ -920,9 +920,9 @@ BOOL Star::HasProject ( ByteString aProjectName ) { pPrj = GetObject(i); if ( pPrj->GetProjectName().EqualsIgnoreCaseAscii(aProjectName) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /*****************************************************************************/ @@ -968,14 +968,14 @@ ByteString Star::GetPrjName( DirEntry &aPath ) // /*****************************************************************************/ -StarWriter::StarWriter( String aFileName, BOOL bReadComments, USHORT nMode ) +StarWriter::StarWriter( String aFileName, sal_Bool bReadComments, sal_uInt16 nMode ) /*****************************************************************************/ { Read ( aFileName, bReadComments, nMode ); } /*****************************************************************************/ -StarWriter::StarWriter( SolarFileList *pSolarFiles, BOOL bReadComments ) +StarWriter::StarWriter( SolarFileList *pSolarFiles, sal_Bool bReadComments ) /*****************************************************************************/ { Read( pSolarFiles, bReadComments ); @@ -983,7 +983,7 @@ StarWriter::StarWriter( SolarFileList *pSolarFiles, BOOL bReadComments ) /*****************************************************************************/ StarWriter::StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, - BOOL bLocal, const char *pSourceRoot ) + sal_Bool bLocal, const char *pSourceRoot ) /*****************************************************************************/ { ByteString sPath( rVersion ); @@ -996,7 +996,7 @@ StarWriter::StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, #else sPath += "/settings/SOLARLIST"; #endif - GenericInformation *pInfo = pStandLst->GetInfo( sPath, TRUE ); + GenericInformation *pInfo = pStandLst->GetInfo( sPath, sal_True ); if( pInfo && pInfo->GetValue().Len()) { ByteString sFile( pInfo->GetValue()); @@ -1014,17 +1014,17 @@ StarWriter::StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, sPath = rVersion; sPath += "/drives"; - GenericInformation *pInfo2 = pStandLst->GetInfo( sPath, TRUE ); + GenericInformation *pInfo2 = pStandLst->GetInfo( sPath, sal_True ); if ( pInfo2 && pInfo2->GetSubList()) { GenericInformationList *pDrives = pInfo2->GetSubList(); - for ( ULONG i = 0; i < pDrives->Count(); i++ ) { + for ( sal_uIntPtr i = 0; i < pDrives->Count(); i++ ) { GenericInformation *pDrive = pDrives->GetObject( i ); if ( pDrive ) { DirEntry aEntry; - BOOL bOk = FALSE; + sal_Bool bOk = sal_False; if ( sSrcRoot.Len()) { aEntry = DirEntry( sSrcRoot ); - bOk = TRUE; + bOk = sal_True; } else { #ifdef UNX @@ -1033,10 +1033,10 @@ StarWriter::StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, if ( pUnixVolume ) { String sRoot( pUnixVolume->GetValue(), RTL_TEXTENCODING_ASCII_US ); aEntry = DirEntry( sRoot ); - bOk = TRUE; + bOk = sal_True; } #else - bOk = TRUE; + bOk = sal_True; String sRoot( *pDrive, RTL_TEXTENCODING_ASCII_US ); sRoot += String::CreateFromAscii( "\\" ); aEntry = DirEntry( sRoot ); @@ -1044,12 +1044,12 @@ StarWriter::StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, } if ( bOk ) { sPath = "projects"; - GenericInformation *pProjectsKey = pDrive->GetSubInfo( sPath, TRUE ); + GenericInformation *pProjectsKey = pDrive->GetSubInfo( sPath, sal_True ); if ( pProjectsKey ) { if ( !sSrcRoot.Len()) { sPath = rVersion; sPath += "/settings/PATH"; - GenericInformation *pPath = pStandLst->GetInfo( sPath, TRUE ); + GenericInformation *pPath = pStandLst->GetInfo( sPath, sal_True ); if( pPath ) { ByteString sAddPath( pPath->GetValue()); #ifdef UNX @@ -1066,7 +1066,7 @@ StarWriter::StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, String sPrjDir( String::CreateFromAscii( "prj" )); String sSolarFile( String::CreateFromAscii( "build.lst" )); - for ( ULONG j = 0; j < pProjects->Count(); j++ ) { + for ( sal_uIntPtr j = 0; j < pProjects->Count(); j++ ) { ByteString sProject( *pProjects->GetObject( j )); String ssProject( sProject, RTL_TEXTENCODING_ASCII_US ); @@ -1099,7 +1099,7 @@ void StarWriter::CleanUp() } /*****************************************************************************/ -USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode ) +sal_uInt16 StarWriter::Read( String aFileName, sal_Bool bReadComments, sal_uInt16 nMode ) /*****************************************************************************/ { nStarMode = nMode; @@ -1114,9 +1114,9 @@ USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode ) while( aFileList.Count()) { - StarFile *pFile = new StarFile( *aFileList.GetObject(( ULONG ) 0 )); + StarFile *pFile = new StarFile( *aFileList.GetObject(( sal_uIntPtr ) 0 )); if ( pFile->Exists()) { - SimpleConfig aSolarConfig( *aFileList.GetObject(( ULONG ) 0 )); + SimpleConfig aSolarConfig( *aFileList.GetObject(( sal_uIntPtr ) 0 )); while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" ) InsertTokenLine ( aString ); } @@ -1124,7 +1124,7 @@ USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode ) aMutex.acquire(); aLoadedFilesList.Insert( pFile, LIST_APPEND ); aMutex.release(); - delete aFileList.Remove(( ULONG ) 0 ); + delete aFileList.Remove(( sal_uIntPtr ) 0 ); } // resolve all dependencies recursive Expand_Impl(); @@ -1135,7 +1135,7 @@ USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode ) } /*****************************************************************************/ -USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments ) +sal_uInt16 StarWriter::Read( SolarFileList *pSolarFiles, sal_Bool bReadComments ) /*****************************************************************************/ { nStarMode = STAR_MODE_MULTIPLE_PARSE; @@ -1144,9 +1144,9 @@ USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments ) while( pSolarFiles->Count()) { ByteString aString; - StarFile *pFile = new StarFile( *pSolarFiles->GetObject(( ULONG ) 0 )); + StarFile *pFile = new StarFile( *pSolarFiles->GetObject(( sal_uIntPtr ) 0 )); if ( pFile->Exists()) { - SimpleConfig aSolarConfig( *pSolarFiles->GetObject(( ULONG ) 0 )); + SimpleConfig aSolarConfig( *pSolarFiles->GetObject(( sal_uIntPtr ) 0 )); while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" ) InsertTokenLine ( aString ); } @@ -1154,7 +1154,7 @@ USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments ) aMutex.acquire(); aLoadedFilesList.Insert( pFile, LIST_APPEND ); aMutex.release(); - delete pSolarFiles->Remove(( ULONG ) 0 ); + delete pSolarFiles->Remove(( sal_uIntPtr ) 0 ); } delete pSolarFiles; @@ -1163,7 +1163,7 @@ USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments ) } /*****************************************************************************/ -USHORT StarWriter::WritePrj( Prj *pPrj, SvFileStream& rStream ) +sal_uInt16 StarWriter::WritePrj( Prj *pPrj, SvFileStream& rStream ) /*****************************************************************************/ { ByteString aDataString; @@ -1176,7 +1176,7 @@ USHORT StarWriter::WritePrj( Prj *pPrj, SvFileStream& rStream ) if ( pPrj->Count() > 0 ) { pCmdData = pPrj->First(); - SByteStringList* pPrjDepList = pPrj->GetDependencies( FALSE ); + SByteStringList* pPrjDepList = pPrj->GetDependencies( sal_False ); if ( pPrjDepList != 0 ) { aDataString = pPrj->GetPreFix(); @@ -1188,7 +1188,7 @@ USHORT StarWriter::WritePrj( Prj *pPrj, SvFileStream& rStream ) else aDataString+= ByteString(":"); aDataString += aTab; - for ( USHORT i = 0; i< pPrjDepList->Count(); i++ ) { + for ( sal_uInt16 i = 0; i< pPrjDepList->Count(); i++ ) { aDataString += *pPrjDepList->GetObject( i ); aDataString += aSpace; } @@ -1208,7 +1208,7 @@ USHORT StarWriter::WritePrj( Prj *pPrj, SvFileStream& rStream ) aDataString+= pCmdData->GetPath(); aDataString += aTab; - USHORT nPathLen = pCmdData->GetPath().Len(); + sal_uInt16 nPathLen = pCmdData->GetPath().Len(); if ( nPathLen < 40 ) for ( int i = 0; i < 9 - pCmdData->GetPath().Len() / 4 ; i++ ) aDataString += aTab; @@ -1235,7 +1235,7 @@ USHORT StarWriter::WritePrj( Prj *pPrj, SvFileStream& rStream ) pCmdDepList = pCmdData->GetDependencies(); if ( pCmdDepList ) - for ( USHORT i = 0; i< pCmdDepList->Count(); i++ ) { + for ( sal_uInt16 i = 0; i< pCmdDepList->Count(); i++ ) { aDataString += *pCmdDepList->GetObject( i ); aDataString += aSpace; } @@ -1252,7 +1252,7 @@ USHORT StarWriter::WritePrj( Prj *pPrj, SvFileStream& rStream ) } /*****************************************************************************/ -USHORT StarWriter::Write( String aFileName ) +sal_uInt16 StarWriter::Write( String aFileName ) /*****************************************************************************/ { SvFileStream aFileStream; @@ -1275,7 +1275,7 @@ USHORT StarWriter::Write( String aFileName ) } /*****************************************************************************/ -USHORT StarWriter::WriteMultiple( String rSourceRoot ) +sal_uInt16 StarWriter::WriteMultiple( String rSourceRoot ) /*****************************************************************************/ { if ( Count() > 0 ) @@ -1315,10 +1315,10 @@ void StarWriter::InsertTokenLine ( ByteString& rString ) ByteString aWhat, aWhatOS, sClientRestriction, aLogFileName, aProjectName, aPrefix, aCommandPara; static ByteString aDirName; - BOOL bPrjDep = FALSE; - BOOL bHardDep = FALSE; - USHORT nCommandType = 0; - USHORT nOSType = 0; + sal_Bool bPrjDep = sal_False; + sal_Bool bHardDep = sal_False; + sal_uInt16 nCommandType = 0; + sal_uInt16 nOSType = 0; CommandData* pCmdData; SByteStringList *pDepList2 = NULL; Prj* pPrj; @@ -1352,20 +1352,20 @@ void StarWriter::InsertTokenLine ( ByteString& rString ) case 2: if ( !strcmp( yytext, ":" )) { - bPrjDep = TRUE; - bHardDep = FALSE; + bPrjDep = sal_True; + bHardDep = sal_False; i = 9; } else if ( !strcmp( yytext, "::" )) { - bPrjDep = TRUE; - bHardDep = TRUE; + bPrjDep = sal_True; + bHardDep = sal_True; i = 9; } else { - bPrjDep = FALSE; - bHardDep = FALSE; + bPrjDep = sal_False; + bHardDep = sal_False; aWhat = yytext; if ( aWhat == "nmake" ) @@ -1373,8 +1373,8 @@ void StarWriter::InsertTokenLine ( ByteString& rString ) else if ( aWhat == "get" ) nCommandType = COMMAND_GET; else { - ULONG nOffset = aWhat.Copy( 3 ).ToInt32(); - nCommandType = sal::static_int_cast< USHORT >( + sal_uIntPtr nOffset = aWhat.Copy( 3 ).ToInt32(); + nCommandType = sal::static_int_cast< sal_uInt16 >( COMMAND_USER_START + nOffset - 1); } } @@ -1446,7 +1446,7 @@ void StarWriter::InsertTokenLine ( ByteString& rString ) { // Liste zu Ende i = -1; - bPrjDep= FALSE; + bPrjDep= sal_False; } else { @@ -1518,34 +1518,34 @@ void StarWriter::InsertTokenLine ( ByteString& rString ) } /*****************************************************************************/ -BOOL StarWriter::InsertProject ( Prj* ) +sal_Bool StarWriter::InsertProject ( Prj* ) /*****************************************************************************/ { - return FALSE; + return sal_False; } /*****************************************************************************/ Prj* StarWriter::RemoveProject ( ByteString aProjectName ) /*****************************************************************************/ { - ULONG nCountMember = Count(); + sal_uIntPtr nCountMember = Count(); Prj* pPrj; Prj* pPrjFound = NULL; SByteStringList* pPrjDeps; - for ( USHORT i = 0; i < nCountMember; i++ ) + for ( sal_uInt16 i = 0; i < nCountMember; i++ ) { pPrj = GetObject( i ); if ( pPrj->GetProjectName() == aProjectName ) pPrjFound = pPrj; else { - pPrjDeps = pPrj->GetDependencies( FALSE ); + pPrjDeps = pPrj->GetDependencies( sal_False ); if ( pPrjDeps ) { ByteString* pString; - ULONG nPrjDepsCount = pPrjDeps->Count(); - for ( ULONG j = nPrjDepsCount; j > 0; j-- ) + sal_uIntPtr nPrjDepsCount = pPrjDeps->Count(); + for ( sal_uIntPtr j = nPrjDepsCount; j > 0; j-- ) { pString = pPrjDeps->GetObject( j - 1 ); if ( pString->GetToken( 0, '.') == aProjectName ) @@ -1571,30 +1571,30 @@ StarFile::StarFile( const String &rFile ) { DirEntry aEntry( aFileName ); if ( aEntry.Exists()) { - bExists = TRUE; + bExists = sal_True; FileStat aStat( aEntry ); aDate = aStat.DateModified(); aTime = aStat.TimeModified(); } else - bExists = FALSE; + bExists = sal_False; } /*****************************************************************************/ -BOOL StarFile::NeedsUpdate() +sal_Bool StarFile::NeedsUpdate() /*****************************************************************************/ { DirEntry aEntry( aFileName ); if ( aEntry.Exists()) { if ( !bExists ) { - bExists = TRUE; - return TRUE; + bExists = sal_True; + return sal_True; } FileStat aStat( aEntry ); if (( aStat.DateModified() > aDate ) || (( aStat.DateModified() == aDate ) && ( aStat.TimeModified() > aTime ))) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx index 5c18793c9833..308794975bc5 100644 --- a/tools/bootstrp/rscdep.cxx +++ b/tools/bootstrp/rscdep.cxx @@ -87,7 +87,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()); @@ -171,7 +171,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) pDep->AddSource( &aBuf2[0] ); aRespArg += " "; aRespArg += &aBuf2[0]; - bSource = TRUE; + bSource = sal_True; } } } @@ -220,7 +220,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) aEntry.ToAbs(); // String aCwd = aEntry.GetName(); String aCwd(pFileNamePrefix, gsl_getSystemTextEncoding()); -/* USHORT nPos; +/* sal_uInt16 nPos; #ifndef UNX while ( (nPos = aCwd.Search('\\') != STRING_NOTFOUND )) #else @@ -271,7 +271,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) aString += aRespArg; pDep->Execute(); ByteStringList *pLst = pDep->GetDepList(); - ULONG nCount = pLst->Count(); + sal_uIntPtr nCount = pLst->Count(); if ( nCount == 0 ) { aOutStream.WriteLine( aString ); @@ -282,7 +282,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) aOutStream.WriteLine( aString ); } - for ( ULONG j=0; jGetObject(j); pStr->SearchAndReplaceAll('\\', ByteString( aDelim, RTL_TEXTENCODING_ASCII_US )); diff --git a/tools/bootstrp/sstring.cxx b/tools/bootstrp/sstring.cxx index 8c83dedf72ec..b8e70a6272e2 100644 --- a/tools/bootstrp/sstring.cxx +++ b/tools/bootstrp/sstring.cxx @@ -44,9 +44,9 @@ SByteStringList::~SByteStringList() { } -ULONG SByteStringList::IsString( ByteString* pStr ) +sal_uIntPtr SByteStringList::IsString( ByteString* pStr ) { - ULONG nRet = NOT_THERE; + sal_uIntPtr nRet = NOT_THERE; if ( (nRet = GetPrevString( pStr )) != 0 ) { ByteString* pString = GetObject( nRet ); @@ -65,15 +65,15 @@ ULONG SByteStringList::IsString( ByteString* pStr ) } } -ULONG SByteStringList::GetPrevString( ByteString* pStr ) +sal_uIntPtr SByteStringList::GetPrevString( ByteString* pStr ) { - ULONG nRet = 0; - BOOL bFound = FALSE; - ULONG nCountMember = Count(); - ULONG nUpper = nCountMember; - ULONG nLower = 0; - ULONG nCurrent = nUpper / 2; - ULONG nRem = 0; + sal_uIntPtr nRet = 0; + sal_Bool bFound = sal_False; + sal_uIntPtr nCountMember = Count(); + sal_uIntPtr nUpper = nCountMember; + sal_uIntPtr nLower = 0; + sal_uIntPtr nCurrent = nUpper / 2; + sal_uIntPtr nRem = 0; ByteString* pString; do @@ -109,17 +109,17 @@ ULONG SByteStringList::GetPrevString( ByteString* pStr ) * **************************************************************************/ -ULONG SByteStringList::PutString( ByteString* pStr ) +sal_uIntPtr SByteStringList::PutString( ByteString* pStr ) { - ULONG nPos = GetPrevString ( pStr ); + sal_uIntPtr nPos = GetPrevString ( pStr ); if ( Count() ) { { ByteString* pString = GetObject( 0 ); if ( pString->CompareTo( *pStr ) == COMPARE_GREATER ) { - Insert( pStr, (ULONG)0 ); - return (ULONG)0; + Insert( pStr, (sal_uIntPtr)0 ); + return (sal_uIntPtr)0; } } ByteString* pString = GetObject( nPos ); @@ -132,7 +132,7 @@ ULONG SByteStringList::PutString( ByteString* pStr ) else { Insert( pStr ); - return (ULONG)0; + return (sal_uIntPtr)0; } return NOT_THERE; @@ -140,7 +140,7 @@ ULONG SByteStringList::PutString( ByteString* pStr ) ByteString* SByteStringList::RemoveString( const ByteString& rName ) { - ULONG i; + sal_uIntPtr i; ByteString* pReturn; for( i = 0 ; i < Count(); i++ ) @@ -170,7 +170,7 @@ SByteStringList& SByteStringList::operator<< ( SvStream& rStream ) { sal_uInt32 nListCount; rStream >> nListCount; - for ( USHORT i = 0; i < nListCount; i++ ) { + for ( sal_uInt16 i = 0; i < nListCount; i++ ) { ByteString* pByteString = new ByteString(); rStream >> *pByteString; Insert (pByteString, LIST_APPEND); @@ -204,9 +204,9 @@ SUniStringList::~SUniStringList() { } -ULONG SUniStringList::IsString( UniString* pStr ) +sal_uIntPtr SUniStringList::IsString( UniString* pStr ) { - ULONG nRet = NOT_THERE; + sal_uIntPtr nRet = NOT_THERE; if ( (nRet = GetPrevString( pStr )) != 0 ) { UniString* pString = GetObject( nRet ); @@ -225,15 +225,15 @@ ULONG SUniStringList::IsString( UniString* pStr ) } } -ULONG SUniStringList::GetPrevString( UniString* pStr ) +sal_uIntPtr SUniStringList::GetPrevString( UniString* pStr ) { - ULONG nRet = 0; - BOOL bFound = FALSE; - ULONG nCountMember = Count(); - ULONG nUpper = nCountMember; - ULONG nLower = 0; - ULONG nCurrent = nUpper / 2; - ULONG nRem = 0; + sal_uIntPtr nRet = 0; + sal_Bool bFound = sal_False; + sal_uIntPtr nCountMember = Count(); + sal_uIntPtr nUpper = nCountMember; + sal_uIntPtr nLower = 0; + sal_uIntPtr nCurrent = nUpper / 2; + sal_uIntPtr nRem = 0; UniString* pString; do @@ -269,17 +269,17 @@ ULONG SUniStringList::GetPrevString( UniString* pStr ) * **************************************************************************/ -ULONG SUniStringList::PutString( UniString* pStr ) +sal_uIntPtr SUniStringList::PutString( UniString* pStr ) { - ULONG nPos = GetPrevString ( pStr ); + sal_uIntPtr nPos = GetPrevString ( pStr ); if ( Count() ) { { UniString* pString = GetObject( 0 ); if ( pString->CompareTo( *pStr ) == COMPARE_GREATER ) { - Insert( pStr, (ULONG)0); - return (ULONG)0; + Insert( pStr, (sal_uIntPtr)0); + return (sal_uIntPtr)0; } } UniString* pString = GetObject( nPos ); @@ -292,7 +292,7 @@ ULONG SUniStringList::PutString( UniString* pStr ) else { Insert( pStr ); - return (ULONG)0; + return (sal_uIntPtr)0; } return NOT_THERE; @@ -300,7 +300,7 @@ ULONG SUniStringList::PutString( UniString* pStr ) UniString* SUniStringList::RemoveString( const UniString& rName ) { - ULONG i; + sal_uIntPtr i; UniString* pReturn; for( i = 0 ; i < Count(); i++ ) diff --git a/tools/inc/bootstrp/command.hxx b/tools/inc/bootstrp/command.hxx index 638beb6cce1f..50781e1679a9 100644 --- a/tools/inc/bootstrp/command.hxx +++ b/tools/inc/bootstrp/command.hxx @@ -74,12 +74,12 @@ private: char *CommandBuffer; char *ComShell; char **ppArgv; - BOOL bTmpWrite; + sal_Bool bTmpWrite; public: - CommandLine(BOOL bTmpWrite = FALSE); - CommandLine(const char *, BOOL bTmpWrite = FALSE); - CommandLine(const CommandLine&, BOOL bTmpWrite = FALSE); + CommandLine(sal_Bool bTmpWrite = sal_False); + CommandLine(const char *, sal_Bool bTmpWrite = sal_False); + CommandLine(const CommandLine&, sal_Bool bTmpWrite = sal_False); virtual ~CommandLine(); int nArgc; @@ -102,12 +102,12 @@ private: ByteString aCommand; char *pArgv; char **ppArgv; - ULONG nArgc; + sal_uIntPtr nArgc; int nError; protected: void ImplInit(); - void Initpp( ULONG nCount, ByteString &rStr ); + void Initpp( sal_uIntPtr nCount, ByteString &rStr ); public: /** Creates the process specified without spawning it @@ -146,7 +146,7 @@ public: #define COMMAND_EXECUTE_WAIT 0x0000010 #define COMMAND_EXECUTE_REMOTE 0x1000000 -typedef ULONG CommandBits; +typedef sal_uIntPtr CommandBits; /** Allowes to spawn programms hidden, waiting etc. @see CCommand diff --git a/tools/inc/bootstrp/inimgr.hxx b/tools/inc/bootstrp/inimgr.hxx index 7be00ce14d48..d72df34f19af 100644 --- a/tools/inc/bootstrp/inimgr.hxx +++ b/tools/inc/bootstrp/inimgr.hxx @@ -39,7 +39,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/listmacr.hxx b/tools/inc/bootstrp/listmacr.hxx index 8c678ff32275..a27f51cfdd4c 100644 --- a/tools/inc/bootstrp/listmacr.hxx +++ b/tools/inc/bootstrp/listmacr.hxx @@ -36,9 +36,9 @@ public: \ void ClearAndDelete() \ { \ while ( Count()) { \ - PointerType pTmp = GetObject(( ULONG ) 0 ); \ + PointerType pTmp = GetObject(( sal_uIntPtr ) 0 ); \ delete pTmp; \ - Remove(( ULONG ) 0 ); \ + Remove(( sal_uIntPtr ) 0 ); \ } \ } \ ~ListType() \ diff --git a/tools/inc/bootstrp/mkcreate.hxx b/tools/inc/bootstrp/mkcreate.hxx index 991b5961a096..be3183d042d0 100644 --- a/tools/inc/bootstrp/mkcreate.hxx +++ b/tools/inc/bootstrp/mkcreate.hxx @@ -44,14 +44,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 +60,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 +93,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 +109,7 @@ public: /* returns the operating system */ - USHORT GetOperatingSystem() + sal_uInt16 GetOperatingSystem() { return nOSType; } @@ -124,8 +124,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 +140,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 +155,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 +170,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 +193,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 +204,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 +225,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 +252,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 ); }; @@ -284,7 +284,7 @@ public: /* insert a new directory */ - ULONG InsertSorted( + sal_uIntPtr InsertSorted( SourceDirectory *pDirectory // directory ) { diff --git a/tools/inc/bootstrp/prj.hxx b/tools/inc/bootstrp/prj.hxx index 2d7664b8b69f..6c61492b3bb7 100644 --- a/tools/inc/bootstrp/prj.hxx +++ b/tools/inc/bootstrp/prj.hxx @@ -78,10 +78,10 @@ class CommandData ByteString aComment; ByteString sClientRestriction; SByteStringList *pDepList; - USHORT nOSType; - USHORT nCommand; + sal_uInt16 nOSType; + sal_uInt16 nCommand; - ULONG nDepth; // Tiefe der Abhaenigkeit + sal_uIntPtr nDepth; // Tiefe der Abhaenigkeit public: CommandData(); @@ -108,19 +108,19 @@ public: void SetPath( ByteString aName ){aPath = aName;} ByteString GetPrePath(){return aPrePath;} void SetPrePath( ByteString aName ){aPrePath = aName;} - USHORT GetOSType(){return nOSType;} + sal_uInt16 GetOSType(){return nOSType;} ByteString GetOSTypeString(); - void SetOSType( USHORT nType ){nOSType = nType;} - USHORT GetCommandType(){return nCommand;} + void SetOSType( sal_uInt16 nType ){nOSType = nType;} + sal_uInt16 GetCommandType(){return nCommand;} ByteString GetCommandTypeString(); - void SetCommandType( USHORT nCommandType ){nCommand = nCommandType;} + void SetCommandType( sal_uInt16 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;} + sal_uIntPtr GetDepth(){return nDepth;} }; /********************************************************************* @@ -144,7 +144,7 @@ public: SimpleConfig(DirEntry& rDirEntry); ~SimpleConfig(); ByteString GetNext(); - ByteString GetCleanedNextLine( BOOL bReadComments = FALSE ); + ByteString GetCleanedNextLine( sal_Bool bReadComments = sal_False ); }; #define ENV_GUI 0x00000000 @@ -186,15 +186,15 @@ class Prj : public PrjList { friend class Star; private: - BOOL bVisited; + sal_Bool bVisited; ByteString aPrjPath; ByteString aProjectName; ByteString aProjectPrefix; // max. 2-buchstabige Abk. SByteStringList* pPrjInitialDepList; SByteStringList* pPrjDepList; - BOOL bHardDependencies; - BOOL bSorted; + sal_Bool bHardDependencies; + sal_Bool bSorted; public: Prj(); @@ -206,19 +206,19 @@ public: {return aProjectName;} void SetProjectName(ByteString aName) {aProjectName = aName;} - BOOL InsertDirectory( ByteString aDirName , USHORT aWhat, - USHORT aWhatOS, ByteString aLogFileName, + sal_Bool InsertDirectory( ByteString aDirName , sal_uInt16 aWhat, + sal_uInt16 aWhatOS, ByteString aLogFileName, const ByteString &rClientRestriction ); CommandData* RemoveDirectory( ByteString aLogFileName ); - CommandData* GetDirectoryList ( USHORT nWhatOs, USHORT nCommand ); + CommandData* GetDirectoryList ( sal_uInt16 nWhatOs, sal_uInt16 nCommand ); CommandData* GetDirectoryData( ByteString aLogFileName ); inline CommandData* GetData( ByteString aLogFileName ) { return GetDirectoryData( aLogFileName ); }; - SByteStringList* GetDependencies( BOOL bExpanded = TRUE ); + SByteStringList* GetDependencies( sal_Bool bExpanded = sal_True ); void AddDependencies( ByteString aStr ); - void HasHardDependencies( BOOL bHard ) { bHardDependencies = bHard; } - BOOL HasHardDependencies() { return bHardDependencies; } + void HasHardDependencies( sal_Bool bHard ) { bHardDependencies = bHard; } + sal_Bool HasHardDependencies() { return bHardDependencies; } }; /********************************************************************* @@ -239,7 +239,7 @@ private: Date aDate; Time aTime; - BOOL bExists; + sal_Bool bExists; public: StarFile( const String &rFile ); @@ -247,8 +247,8 @@ public: Date GetDate() { return aDate; } Time GetTime() { return aTime; } - BOOL NeedsUpdate(); - BOOL Exists() { return bExists; } + sal_Bool NeedsUpdate(); + sal_Bool Exists() { return bExists; } }; DECLARE_LIST( StarFileList, StarFile * ) @@ -266,7 +266,7 @@ private: protected: NAMESPACE_VOS( OMutex ) aMutex; - USHORT nStarMode; + sal_uInt16 nStarMode; SolarFileList aFileList; StarFileList aLoadedFilesList; String sSourceRoot; @@ -283,9 +283,9 @@ private: public: Star(); - Star( String aFileName, USHORT nMode = STAR_MODE_SINGLE_PARSE ); + Star( String aFileName, sal_uInt16 nMode = STAR_MODE_SINGLE_PARSE ); Star( SolarFileList *pSolarFiles ); - Star( GenericInformationList *pStandLst, ByteString &rVersion, BOOL bLocal = FALSE, + Star( GenericInformationList *pStandLst, ByteString &rVersion, sal_Bool bLocal = sal_False, const char *pSourceRoot = NULL ); ~Star(); @@ -294,36 +294,36 @@ public: ByteString GetName(){ return aStarName; }; - BOOL HasProject( ByteString aProjectName ); + sal_Bool HasProject( ByteString aProjectName ); Prj* GetPrj( ByteString aProjectName ); ByteString GetPrjName( DirEntry &rPath ); void InsertToken( char *pChar ); - BOOL NeedsUpdate(); + sal_Bool NeedsUpdate(); - USHORT GetMode() { return nStarMode; } + sal_uInt16 GetMode() { return nStarMode; } }; class StarWriter : public Star { private: - USHORT WritePrj( Prj *pPrj, SvFileStream& rStream ); + sal_uInt16 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, + StarWriter( String aFileName, sal_Bool bReadComments = sal_False, sal_uInt16 nMode = STAR_MODE_SINGLE_PARSE ); + StarWriter( SolarFileList *pSolarFiles, sal_Bool bReadComments = sal_False ); + StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, sal_Bool bLocal = sal_False, const char *pSourceRoot = NULL ); void CleanUp(); - BOOL InsertProject ( Prj* pNewPrj ); + sal_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 ); + sal_uInt16 Read( String aFileName, sal_Bool bReadComments = sal_False, sal_uInt16 nMode = STAR_MODE_SINGLE_PARSE ); + sal_uInt16 Read( SolarFileList *pSolarFiles, sal_Bool bReadComments = sal_False ); + sal_uInt16 Write( String aFileName ); + sal_uInt16 WriteMultiple( String rSourceRoot ); void InsertTokenLine( ByteString& rString ); }; diff --git a/tools/inc/bootstrp/sstring.hxx b/tools/inc/bootstrp/sstring.hxx index 933770887e37..08eb1da71a09 100644 --- a/tools/inc/bootstrp/sstring.hxx +++ b/tools/inc/bootstrp/sstring.hxx @@ -52,16 +52,16 @@ public: ~SByteStringList(); // neuen ByteString in Liste einfuegen - ULONG PutString( ByteString* ); + sal_uIntPtr PutString( ByteString* ); ByteString* RemoveString( const ByteString& rName ); // Position des ByteString in Liste, wenn nicht enthalten, dann // return = NOT_THERE - ULONG IsString( ByteString* ); + sal_uIntPtr IsString( ByteString* ); // Vorgaenger ermitteln ( auch wenn selbst noch nicht in // Liste enthalten - ULONG GetPrevString( ByteString* ); + sal_uIntPtr GetPrevString( ByteString* ); void CleanUp(); SByteStringList& operator<< ( SvStream& rStream ); @@ -79,16 +79,16 @@ public: ~SUniStringList(); // neuen UniString in Liste einfuegen - ULONG PutString( UniString* ); + sal_uIntPtr PutString( UniString* ); UniString* RemoveString( const UniString& rName ); // Position des UniString in Liste, wenn nicht enthalten, dann // return = NOT_THERE - ULONG IsString( UniString* ); + sal_uIntPtr IsString( UniString* ); // Vorgaenger ermitteln ( auch wenn selbst noch nicht in // Liste enthalten - ULONG GetPrevString( UniString* ); + sal_uIntPtr GetPrevString( UniString* ); }; class Text diff --git a/tools/inc/impcont.hxx b/tools/inc/impcont.hxx index 224d5a4429ef..9be0a909474d 100644 --- a/tools/inc/impcont.hxx +++ b/tools/inc/impcont.hxx @@ -42,8 +42,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 @@ -52,26 +52,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; } @@ -94,7 +94,7 @@ private: |* *************************************************************************/ -inline void* CBlock::GetObject( USHORT nIndex ) const +inline void* CBlock::GetObject( sal_uInt16 nIndex ) const { return pNodes[nIndex]; } @@ -111,11 +111,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/poly.h b/tools/inc/poly.h index e6678e071f28..459015da9ff3 100644 --- a/tools/inc/poly.h +++ b/tools/inc/poly.h @@ -30,7 +30,7 @@ #include -#define MAX_64KPOINTS ((((USHORT)0xFFFF)-32)/sizeof(Point)) +#define MAX_64KPOINTS ((((sal_uInt16)0xFFFF)-32)/sizeof(Point)) // ------------------- // - ImplPolygonData - @@ -41,15 +41,15 @@ class ImplPolygonData public: #ifdef WIN Point huge* mpPointAry; - BYTE* mpFlagAry; + sal_uInt8* mpFlagAry; GLOBALHANDLE mhPoints; #else Point* mpPointAry; - BYTE* mpFlagAry; + sal_uInt8* mpFlagAry; #endif - USHORT mnPoints; - ULONG mnRefCount; + sal_uInt16 mnPoints; + sal_uIntPtr mnRefCount; }; // --------------- @@ -59,22 +59,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; @@ -83,15 +83,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/bigint.hxx b/tools/inc/tools/bigint.hxx index 353fbb063191..9a5f1e6de886 100644 --- a/tools/inc/tools/bigint.hxx +++ b/tools/inc/tools/bigint.hxx @@ -93,8 +93,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; @@ -199,10 +199,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 1819792bb386..26085fb49e8b 100644 --- a/tools/inc/tools/cachestr.hxx +++ b/tools/inc/tools/cachestr.hxx @@ -42,7 +42,7 @@ class TOOLS_DLLPUBLIC SvCacheStream : public SvStream { private: String aFileName; - ULONG nMaxSize; + sal_uIntPtr nMaxSize; int bPersistent; SvStream* pSwapStream; @@ -51,17 +51,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); @@ -72,10 +72,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/color.hxx b/tools/inc/tools/color.hxx index 56d596453740..6ad654af0c6d 100644 --- a/tools/inc/tools/color.hxx +++ b/tools/inc/tools/color.hxx @@ -41,24 +41,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 ) @@ -78,7 +78,7 @@ typedef UINT32 ColorData; #define COL_YELLOW RGB_COLORDATA( 0xFF, 0xFF, 0x00 ) #define COL_WHITE RGB_COLORDATA( 0xFF, 0xFF, 0xFF ) #define COL_TRANSPARENT TRGB_COLORDATA( 0xFF, 0xFF, 0xFF, 0xFF ) -#define COL_AUTO (UINT32)0xFFFFFFFF +#define COL_AUTO (sal_uInt32)0xFFFFFFFF #define COL_AUTHOR1_DARK RGB_COLORDATA(198, 146, 0) #define COL_AUTHOR1_NORMAL RGB_COLORDATA(255, 255, 158) #define COL_AUTHOR1_LIGHT RGB_COLORDATA(255, 255, 195) @@ -108,7 +108,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 - @@ -122,9 +122,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! @@ -133,58 +133,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 ); @@ -193,43 +193,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 cb64cc2ec5bd..d0df492f5488 100644 --- a/tools/inc/tools/config.hxx +++ b/tools/inc/tools/config.hxx @@ -44,13 +44,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 @@ -66,9 +66,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; @@ -76,19 +76,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 5cf8e7b74569..804482afaea5 100644 --- a/tools/inc/tools/contnr.hxx +++ b/tools/inc/tools/contnr.hxx @@ -39,7 +39,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 @@ -50,11 +50,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 @@ -63,49 +63,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(); @@ -115,8 +115,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 50b31edb0f83..6e4a2291d954 100644 --- a/tools/inc/tools/date.hxx +++ b/tools/inc/tools/date.hxx @@ -54,7 +54,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); } @@ -62,40 +62,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 ) @@ -113,7 +113,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 1a782486250b..c642045c0e76 100644 --- a/tools/inc/tools/datetime.hxx +++ b/tools/inc/tools/datetime.hxx @@ -47,29 +47,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/errcode.hxx b/tools/inc/tools/errcode.hxx index cf767b842b7a..404ce7bd6e34 100644 --- a/tools/inc/tools/errcode.hxx +++ b/tools/inc/tools/errcode.hxx @@ -95,14 +95,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 45141af278b1..e059a7add067 100644 --- a/tools/inc/tools/errinf.hxx +++ b/tools/inc/tools/errinf.hxx @@ -47,18 +47,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); }; @@ -76,11 +76,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; }; @@ -91,14 +91,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; } }; @@ -115,9 +115,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; } }; @@ -131,8 +131,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() {} @@ -149,10 +149,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; } @@ -178,7 +178,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(); @@ -189,8 +189,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); @@ -202,22 +202,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* ); @@ -231,8 +231,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/fontenum.hxx b/tools/inc/tools/fontenum.hxx index 0e0f1b2f7368..54611c8f7c25 100644 --- a/tools/inc/tools/fontenum.hxx +++ b/tools/inc/tools/fontenum.hxx @@ -127,7 +127,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/fract.hxx b/tools/inc/tools/fract.hxx index 7769e88ab541..249f1723097b 100644 --- a/tools/inc/tools/fract.hxx +++ b/tools/inc/tools/fract.hxx @@ -48,7 +48,7 @@ public: Fraction( long nN1, long nN2, long nD1, long nD2 ); Fraction( double dVal ); - BOOL IsValid() const; + sal_Bool IsValid() const; long GetNumerator() const { return nNumerator; } long GetDenominator() const { return nDenominator; } @@ -70,24 +70,24 @@ public: friend Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 ); friend Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 ); - friend BOOL operator==( const Fraction& rVal1, const Fraction& rVal2 ); - friend BOOL operator!=( const Fraction& rVal1, const Fraction& rVal2 ); - friend BOOL operator< ( const Fraction& rVal1, const Fraction& rVal2 ); - friend BOOL operator> ( const Fraction& rVal1, const Fraction& rVal2 ); - friend BOOL operator<=( const Fraction& rVal1, const Fraction& rVal2 ); - friend BOOL operator>=( const Fraction& rVal1, const Fraction& rVal2 ); + friend sal_Bool operator==( const Fraction& rVal1, const Fraction& rVal2 ); + friend sal_Bool operator!=( const Fraction& rVal1, const Fraction& rVal2 ); + friend sal_Bool operator< ( const Fraction& rVal1, const Fraction& rVal2 ); + friend sal_Bool operator> ( const Fraction& rVal1, const Fraction& rVal2 ); + friend sal_Bool operator<=( const Fraction& rVal1, const Fraction& rVal2 ); + friend sal_Bool operator>=( const Fraction& rVal1, const Fraction& rVal2 ); #else friend inline Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 ); friend inline Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 ); friend inline Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 ); friend inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 ); - TOOLS_DLLPUBLIC friend BOOL operator==( const Fraction& rVal1, const Fraction& rVal2 ); - friend inline BOOL operator!=( const Fraction& rVal1, const Fraction& rVal2 ); - TOOLS_DLLPUBLIC friend BOOL operator< ( const Fraction& rVal1, const Fraction& rVal2 ); - TOOLS_DLLPUBLIC friend BOOL operator> ( const Fraction& rVal1, const Fraction& rVal2 ); - friend inline BOOL operator<=( const Fraction& rVal1, const Fraction& rVal2 ); - friend inline BOOL operator>=( const Fraction& rVal1, const Fraction& rVal2 ); + TOOLS_DLLPUBLIC friend sal_Bool operator==( const Fraction& rVal1, const Fraction& rVal2 ); + friend inline sal_Bool operator!=( const Fraction& rVal1, const Fraction& rVal2 ); + TOOLS_DLLPUBLIC friend sal_Bool operator< ( const Fraction& rVal1, const Fraction& rVal2 ); + TOOLS_DLLPUBLIC friend sal_Bool operator> ( const Fraction& rVal1, const Fraction& rVal2 ); + friend inline sal_Bool operator<=( const Fraction& rVal1, const Fraction& rVal2 ); + friend inline sal_Bool operator>=( const Fraction& rVal1, const Fraction& rVal2 ); #endif TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Fraction& rFract ); TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Fraction& rFract ); @@ -106,7 +106,7 @@ inline Fraction& Fraction::operator=( const Fraction& rFrac ) return *this; } -inline BOOL Fraction::IsValid() const +inline sal_Bool Fraction::IsValid() const { return (nDenominator > 0); } @@ -147,17 +147,17 @@ inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 ) return aErg; } -inline BOOL operator !=( const Fraction& rVal1, const Fraction& rVal2 ) +inline sal_Bool operator !=( const Fraction& rVal1, const Fraction& rVal2 ) { return !(rVal1 == rVal2); } -inline BOOL operator <=( const Fraction& rVal1, const Fraction& rVal2 ) +inline sal_Bool operator <=( const Fraction& rVal1, const Fraction& rVal2 ) { return !(rVal1 > rVal2); } -inline BOOL operator >=( const Fraction& rVal1, const Fraction& rVal2 ) +inline sal_Bool operator >=( const Fraction& rVal1, const Fraction& rVal2 ) { return !(rVal1 < rVal2); } diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 880768c89d8c..c716d372d139 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -146,7 +146,7 @@ typedef int FSysAction; #define RFS_LOWER "-rfs-" #define RFS_UPPER "-RFS-" -typedef ULONG FSysError; +typedef sal_uIntPtr FSysError; // FSysExact enum FSysExact @@ -187,9 +187,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; @@ -210,16 +210,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; } @@ -230,12 +230,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 ); @@ -262,7 +262,7 @@ friend class FileCopier; #endif ByteString aName; DirEntry* pParent; - ULONG nError; + sal_uIntPtr nError; DirEntryFlag eFlag; private: @@ -282,17 +282,17 @@ private: FSysPathStyle eStyle ); TOOLS_DLLPRIVATE FSysError ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eStyle ); - TOOLS_DLLPRIVATE USHORT ImpTryUrl( DirEntryStack& rStack, const String& rPfad, FSysPathStyle eStyle ); + TOOLS_DLLPRIVATE sal_uInt16 ImpTryUrl( DirEntryStack& rStack, const String& rPfad, FSysPathStyle eStyle ); TOOLS_DLLPRIVATE const DirEntry* ImpGetTopPtr() const; TOOLS_DLLPRIVATE DirEntry* ImpGetTopPtr(); TOOLS_DLLPRIVATE DirEntry* ImpGetPreTopPtr(); - 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; } @@ -302,7 +302,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 ); @@ -313,11 +313,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 = '.' ); @@ -333,31 +333,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; @@ -367,8 +367,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; @@ -383,11 +383,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(); }; // -------------- @@ -398,10 +398,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: @@ -409,7 +409,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 ); @@ -422,11 +422,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; } @@ -475,10 +475,10 @@ private: #ifndef _TOOLS_HXX protected: - BOOL ImpInsertPointReached( const DirEntry& rIsSmaller, + sal_Bool ImpInsertPointReached( const DirEntry& rIsSmaller, const FileStat& rNewStat, - ULONG nCurPos, - ULONG nSortIndex ) const; + sal_uIntPtr nCurPos, + sal_uIntPtr nSortIndex ) const; void ImpSortedInsert( const DirEntry *pNewEntry, const FileStat *pNewStat ); #endif @@ -497,12 +497,12 @@ public: FSysError SetSort( FSysSort nSort, ... ); void Reset(); - USHORT Scan( USHORT nCount = 5 ); - USHORT Count( BOOL bUpdated = TRUE ) const; - BOOL Update(); + sal_uInt16 Scan( sal_uInt16 nCount = 5 ); + sal_uInt16 Count( sal_Bool bUpdated = sal_True ) const; + sal_Bool Update(); Dir& operator +=( const Dir& rDir ); - DirEntry& operator []( USHORT nIndex ) const; + DirEntry& operator []( sal_uInt16 nIndex ) const; }; // we don't need this stuff for bootstraping @@ -520,7 +520,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 @@ -552,9 +552,9 @@ public: redirected (modified) path too, which can be of both formats too. - @return BOOL
- TRUE, if the path is redirected - FALSE, if the path is not redirected (unchanged) + @return sal_Bool
+ sal_True, if the path is redirected + sal_False, if the path is not redirected (unchanged) */ static void DoRedirect( String &rPath ); }; @@ -563,7 +563,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 308cc02165ce..360ecdf98325 100644 --- a/tools/inc/tools/gen.hxx +++ b/tools/inc/tools/gen.hxx @@ -84,8 +84,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 ); @@ -102,12 +102,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)); } @@ -129,10 +129,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 ); @@ -171,22 +171,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); } @@ -290,7 +290,7 @@ public: long& Min() { return nA; } long& Max() { return nB; } - BOOL IsInside( long nIs ) const; + sal_Bool IsInside( long nIs ) const; void Justify(); }; @@ -303,7 +303,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 )); } @@ -339,11 +339,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(); } @@ -364,7 +364,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 )); } @@ -435,15 +435,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 ); @@ -501,7 +501,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)); } @@ -654,7 +654,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 ) && @@ -662,7 +662,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 720ccb9cd788..889d8c1713cc 100644 --- a/tools/inc/tools/geninfo.hxx +++ b/tools/inc/tools/geninfo.hxx @@ -62,7 +62,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(); @@ -73,18 +73,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 ) @@ -132,43 +132,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); } @@ -177,7 +177,7 @@ GenericLockInformation( const ByteString &rKey, const ByteString &rValue, private: LockState aLockState; - UINT32 nLockKey; + sal_uInt32 nLockKey; }; // @@ -197,10 +197,10 @@ private: protected: // methods - ULONG InsertSorted( GenericInformation *pInfo, BOOL bOverwrite, - ULONG nStart, ULONG nEnd ); - GenericInformation *Search( ULONG &rPos, ByteString sKey, - ULONG nStart, ULONG nEnd ); + sal_uIntPtr InsertSorted( GenericInformation *pInfo, sal_Bool bOverwrite, + sal_uIntPtr nStart, sal_uIntPtr nEnd ); + GenericInformation *Search( sal_uIntPtr &rPos, ByteString sKey, + sal_uIntPtr nStart, sal_uIntPtr nEnd ); public: GenericInformationList( GenericInformation *pParent = NULL ); @@ -208,19 +208,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 7fac64e2f74b..1d56b1383c0f 100644 --- a/tools/inc/tools/globname.hxx +++ b/tools/inc/tools/globname.hxx @@ -36,8 +36,8 @@ *************************************************************************/ struct ImpSvGlobalName { - BYTE szData[ 16 ]; - USHORT nRefCount; + sal_Int8 szData[ 16 ]; + sal_uInt16 nRefCount; ImpSvGlobalName() { @@ -46,7 +46,7 @@ struct ImpSvGlobalName ImpSvGlobalName( const ImpSvGlobalName & rObj ); ImpSvGlobalName( int ); - BOOL operator == ( const ImpSvGlobalName & rObj ) const; + sal_Bool operator == ( const ImpSvGlobalName & rObj ) const; }; #ifdef WNT @@ -75,9 +75,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_Int8 b8, sal_Int8 b9, sal_Int8 b10, sal_Int8 b11, + sal_Int8 b12, sal_Int8 b13, sal_Int8 b14, sal_Int8 b15 ); // create SvGlobalName from a platform independent representation SvGlobalName( const ::com::sun::star::uno::Sequence< sal_Int8 >& aSeq ); @@ -88,16 +88,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 @@ -110,7 +110,7 @@ public: SvGlobalName( const CLSID & rId ); const CLSID & GetCLSID() const { return *(CLSID *)pImp->szData; } - const BYTE* GetBytes() const { return pImp->szData; } + const sal_Int8* GetBytes() const { return pImp->szData; } // platform independent representation of a "GlobalName" // maybe transported remotely @@ -125,9 +125,9 @@ public: ~SvGlobalNameList(); void Append( const SvGlobalName & ); - SvGlobalName GetObject( ULONG ); - BOOL IsEntry( const SvGlobalName & rName ); - ULONG Count() const { return aList.Count(); } + SvGlobalName GetObject( sal_uInt32 ); + sal_Bool IsEntry( const SvGlobalName & rName ); + sal_uInt32 Count() const { return aList.Count(); } private: // nicht erlaubt SvGlobalNameList( const SvGlobalNameList & ); diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index 4e8065f6264c..2408bf231665 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -1426,17 +1426,17 @@ public: void Clear(); - void Insert(INetContentTypeParameter * pParameter, ULONG nIndex) + void Insert(INetContentTypeParameter * pParameter, sal_uIntPtr nIndex) { List::Insert(pParameter, nIndex); } - inline const INetContentTypeParameter * GetObject(ULONG nIndex) const; + inline const INetContentTypeParameter * GetObject(sal_uIntPtr nIndex) const; const INetContentTypeParameter * find(const ByteString & rAttribute) const; }; inline const INetContentTypeParameter * -INetContentTypeParameterList::GetObject(ULONG nIndex) const +INetContentTypeParameterList::GetObject(sal_uIntPtr nIndex) const { return static_cast< INetContentTypeParameter * >(List::GetObject(nIndex)); } diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index d7619fc34a4d..1f14a67b62a7 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -116,7 +116,7 @@ class INetMessage { List m_aHeaderList; - ULONG m_nDocSize; + sal_uIntPtr m_nDocSize; UniString m_aDocName; SvLockBytesRef m_xDocLB; @@ -125,7 +125,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)); @@ -136,7 +136,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)); @@ -147,7 +147,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) @@ -166,7 +166,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); @@ -192,19 +192,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)); @@ -214,16 +214,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; } @@ -251,7 +251,7 @@ public: *=====================================================================*/ class INetMessageHeaderIterator { - ULONG nValueCount; + sal_uIntPtr nValueCount; List aValueList; UniString aEmptyString; @@ -260,8 +260,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) { @@ -301,7 +301,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; @@ -314,14 +314,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. */ @@ -495,23 +495,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; @@ -524,14 +524,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. */ @@ -575,34 +575,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 1fd9a913b382..b1c01333c63a 100644 --- a/tools/inc/tools/inetstrm.hxx +++ b/tools/inc/tools/inetstrm.hxx @@ -60,13 +60,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); @@ -83,13 +83,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); }; /* @@ -102,7 +102,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); }; @@ -128,9 +128,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; @@ -140,24 +140,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; } }; /* @@ -166,20 +166,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); @@ -188,8 +188,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; } }; /* @@ -204,7 +204,7 @@ class INetMessageIOStream INetMessageIOStream& operator= (const INetMessageIOStream& rStrm); public: - INetMessageIOStream (ULONG nBufferSize = 2048); + INetMessageIOStream (sal_uIntPtr nBufferSize = 2048); virtual ~INetMessageIOStream (void); }; @@ -226,7 +226,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream : public INetMessageIOStream { int eState; - ULONG nChildIndex; + sal_uIntPtr nChildIndex; INetMIMEMessageStream *pChildStrm; INetMessageEncoding eEncoding; @@ -243,11 +243,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 78eed43e8391..b581f74a35f9 100644 --- a/tools/inc/tools/iparser.hxx +++ b/tools/inc/tools/iparser.hxx @@ -77,13 +77,13 @@ key [value] 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; @@ -91,10 +91,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(); @@ -102,15 +102,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 @@ -129,15 +129,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 c6c70df842ca..32fc157a34a4 100644 --- a/tools/inc/tools/line.hxx +++ b/tools/inc/tools/line.hxx @@ -60,9 +60,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 1742759055d6..f31fcabc8108 100644 --- a/tools/inc/tools/link.hxx +++ b/tools/inc/tools/link.hxx @@ -112,14 +112,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() @@ -139,20 +139,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 dd8fbf454f80..bb0d8627838c 100644 --- a/tools/inc/tools/list.hxx +++ b/tools/inc/tools/list.hxx @@ -56,18 +56,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 ); } }; @@ -83,16 +83,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 ); } \ @@ -100,13 +100,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, \ @@ -114,16 +114,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(); } \ @@ -134,9 +134,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/mempool.hxx b/tools/inc/tools/mempool.hxx index a96a024d4b27..4c6c68ab0dd9 100644 --- a/tools/inc/tools/mempool.hxx +++ b/tools/inc/tools/mempool.hxx @@ -41,9 +41,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 f75f4c5f03af..6544fe771f95 100644 --- a/tools/inc/tools/multisel.hxx +++ b/tools/inc/tools/multisel.hxx @@ -56,17 +56,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 ULONG ImplFindSubSelection( long nIndex ) const; - TOOLS_DLLPRIVATE BOOL ImplMergeSubSelections( ULONG nPos1, ULONG nPos2 ); + TOOLS_DLLPRIVATE sal_uIntPtr ImplFindSubSelection( long nIndex ) const; + TOOLS_DLLPRIVATE sal_Bool ImplMergeSubSelections( sal_uIntPtr nPos1, sal_uIntPtr nPos2 ); TOOLS_DLLPRIVATE long ImplFwdUnselected(); TOOLS_DLLPRIVATE long ImplBwdUnselected(); #endif @@ -81,18 +81,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 ); @@ -101,15 +101,15 @@ 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(); - ULONG GetRangeCount() const { return aSels.Count(); } - const Range& GetRange( ULONG nRange ) const { return *(const Range*)aSels.GetObject(nRange); } + sal_uIntPtr GetRangeCount() const { return aSels.Count(); } + const Range& GetRange( sal_uIntPtr nRange ) const { return *(const Range*)aSels.GetObject(nRange); } }; class TOOLS_DLLPUBLIC StringRangeEnumerator diff --git a/tools/inc/tools/ownlist.hxx b/tools/inc/tools/ownlist.hxx index ac99537a9f0d..78cf5af8e89c 100644 --- a/tools/inc/tools/ownlist.hxx +++ b/tools/inc/tools/ownlist.hxx @@ -37,8 +37,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; } \ @@ -50,18 +50,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 ) \ @@ -69,7 +69,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; \ @@ -84,7 +84,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 b83877b88959..5abcca0c819d 100644 --- a/tools/inc/tools/poly.hxx +++ b/tools/inc/tools/poly.hxx @@ -85,16 +85,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; } }; // ----------- @@ -125,9 +125,9 @@ 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; @@ -135,49 +135,49 @@ public: 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 @@ -208,21 +208,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; @@ -235,7 +235,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; @@ -256,33 +256,33 @@ private: ImplPolyPolygon* mpImplPolyPolygon; //#if 0 // _SOLAR__PRIVATE - 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 ); //#endif // __PRIVATE 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 @@ -313,17 +313,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/postwin.h b/tools/inc/tools/postwin.h index a6bd3431a9dc..1e746a941f5c 100644 --- a/tools/inc/tools/postwin.h +++ b/tools/inc/tools/postwin.h @@ -247,9 +247,9 @@ #ifdef WNT 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 457b57142dcd..7e84a92fb257 100644 --- a/tools/inc/tools/presys.h +++ b/tools/inc/tools/presys.h @@ -32,9 +32,6 @@ #if defined WNT -#define BOOL WIN_BOOL -#define BYTE WIN_BYTE - #define Rectangle BLA_Rectangle #define Polygon BLA_Polygon #define PolyPolygon BLA_PolyPolygon diff --git a/tools/inc/tools/prewin.h b/tools/inc/tools/prewin.h index 43a4452594cc..86bda268722d 100644 --- a/tools/inc/tools/prewin.h +++ b/tools/inc/tools/prewin.h @@ -29,15 +29,6 @@ #if defined WNT -#define BOOL WIN_BOOL -#define BYTE WIN_BYTE -#ifndef VCL_NEED_BASETSD -#define INT64 WIN_INT64 -#define UINT64 WIN_UINT64 -#define INT32 WIN_INT32 -#define UINT32 WIN_UINT32 -#endif - #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 61088960bbfd..250a72b2476c 100644 --- a/tools/inc/tools/prex.h +++ b/tools/inc/tools/prex.h @@ -29,10 +29,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 0d14385e5f08..98ceee8f3d51 100644 --- a/tools/inc/tools/pstm.hxx +++ b/tools/inc/tools/pstm.hxx @@ -52,11 +52,11 @@ typedef void * (*SvCreateInstancePersist)( SvPersistBase ** ); class TOOLS_DLLPUBLIC SvClassManager { - typedef std::hash_map< USHORT, SvCreateInstancePersist > Map; + typedef std::hash_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 **************************/ @@ -80,11 +80,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 & ); @@ -98,7 +98,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)\ { \ @@ -121,7 +121,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, @@ -139,9 +139,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 &); }; @@ -179,7 +179,7 @@ class TOOLS_DLLPUBLIC SvPersistStream : public SvStream die im Stream vorkommen k"onnen, ben"otigt. Die Liste aller Klassen wird in einem 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 (, ). Es gibt auch die drei Hilfsmethoden , @@ -210,49 +210,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 ); @@ -263,8 +263,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/rc.hxx b/tools/inc/tools/rc.hxx index 4bf1827a1ab6..07d158e0cece 100644 --- a/tools/inc/tools/rc.hxx +++ b/tools/inc/tools/rc.hxx @@ -42,7 +42,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 @@ -56,7 +56,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() diff --git a/tools/inc/tools/ref.hxx b/tools/inc/tools/ref.hxx index ea1886b73e04..e2c2c5c893be 100644 --- a/tools/inc/tools/ref.hxx +++ b/tools/inc/tools/ref.hxx @@ -41,7 +41,7 @@ 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; } \ @@ -106,8 +106,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) \ @@ -126,7 +126,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 =\ @@ -134,17 +134,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 & );\ }; @@ -157,12 +157,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(); } \ @@ -173,7 +173,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 ) \ @@ -195,7 +195,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; \ @@ -210,7 +210,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; \ @@ -222,7 +222,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 ) );\ } @@ -234,23 +234,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();\ @@ -260,11 +260,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);}\ @@ -272,21 +272,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 );}\ @@ -300,10 +300,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)\ @@ -324,7 +324,7 @@ SV_IMPL_MEMBER_LIST(ClassName,EntryName) #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 @@ -343,9 +343,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; @@ -356,14 +356,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; } }; //#if 0 // _SOLAR__PRIVATE @@ -436,7 +436,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 cfefce8e6ab0..cf3ec3d78ea9 100644 --- a/tools/inc/tools/resid.hxx +++ b/tools/inc/tools/resid.hxx @@ -75,7 +75,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 ); } @@ -143,7 +143,7 @@ class ResId return *this; } - const ResId & SetAutoRelease(BOOL bRelease) const + const ResId & SetAutoRelease(sal_Bool bRelease) const { if( bRelease ) m_nResId &= ~RSC_DONTRELEASE; @@ -152,7 +152,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 b19524139078..5611563312f8 100644 --- a/tools/inc/tools/resmgr.hxx +++ b/tools/inc/tools/resmgr.hxx @@ -138,7 +138,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(); @@ -153,7 +153,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, @@ -165,11 +165,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,19 +182,19 @@ public: { return( pHT->GetGlobOff() ); } // Liefert einen String aus der Resource - static sal_uInt32 GetString( UniString& rStr, const BYTE* pStr ); + static sal_uInt32 GetString( UniString& 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 ); // 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(); @@ -206,12 +206,12 @@ public: const rtl::OUString&GetFileName() const; - INT16 ReadShort(); - INT32 ReadLong(); + sal_Int16 ReadShort(); + sal_Int32 ReadLong(); UniString ReadString(); // generate auto help id for current resource stack - ULONG GetAutoHelpId(); + sal_uIntPtr GetAutoHelpId(); static void SetReadStringHook( ResHookProc pProc ); static ResHookProc GetReadStringHook(); diff --git a/tools/inc/tools/rtti.hxx b/tools/inc/tools/rtti.hxx index 1f8673596b48..70a9dee7c04d 100644 --- a/tools/inc/tools/rtti.hxx +++ b/tools/inc/tools/rtti.hxx @@ -38,25 +38,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()) @@ -67,12 +67,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) \ @@ -121,16 +121,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 ab08e3cc7a58..73933d91e53b 100644 --- a/tools/inc/tools/shl.hxx +++ b/tools/inc/tools/shl.hxx @@ -109,6 +109,6 @@ #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 096d34d05b9e..8146f076bfcf 100644 --- a/tools/inc/tools/solar.h +++ b/tools/inc/tools/solar.h @@ -34,55 +34,12 @@ /*** 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; */ -typedef int FASTBOOL; - -#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 - /*** misc. macros to leverage platform and compiler differences ********/ #define DELETEZ( p ) ( delete p,p = 0 ) @@ -114,69 +71,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 @@ -395,7 +352,7 @@ template 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 ---------------------------------------- diff --git a/tools/inc/tools/stack.hxx b/tools/inc/tools/stack.hxx index 4f3223295114..6ac6aa2fc586 100644 --- a/tools/inc/tools/stack.hxx +++ b/tools/inc/tools/stack.hxx @@ -44,7 +44,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 ) {} @@ -55,9 +55,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 ); } }; @@ -72,8 +72,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 ) {} \ @@ -82,12 +82,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 ); } \ @@ -96,9 +96,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 61af361aa5b7..66034d1dc10e 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -142,16 +142,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; } @@ -183,7 +183,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) {} @@ -213,7 +213,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; @@ -228,7 +228,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); @@ -257,8 +257,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; @@ -648,7 +648,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; @@ -684,7 +684,7 @@ inline SvStream& SvStream::WriteNumber( int nInt ) /* inline SvStream& SvStream::WriteNumber( unsigned int nUInt ) { - WriteNumber( (ULONG)nUInt ); + WriteNumber( (sal_uIntPtr)nUInt ); return *this; } */ @@ -824,7 +824,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 8b86a1835596..46a182e63297 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -171,7 +171,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 @@ -273,29 +273,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(); @@ -308,17 +308,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; @@ -357,41 +357,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 )); } }; @@ -604,23 +604,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; @@ -664,17 +664,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 a0509bcc89be..a525618a6c17 100644 --- a/tools/inc/tools/svborder.hxx +++ b/tools/inc/tools/svborder.hxx @@ -42,12 +42,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 ) { @@ -73,7 +73,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 1ac3fbe27b6f..6fff4d7d7f2b 100644 --- a/tools/inc/tools/table.hxx +++ b/tools/inc/tools/table.hxx @@ -40,36 +40,36 @@ class TOOLS_DLLPUBLIC Table : private Container { private: - ULONG nCount; + sal_uIntPtr nCount; //#if 0 // _SOLAR__PRIVATE - TOOLS_DLLPRIVATE ULONG ImplGetIndex( ULONG nKey, ULONG* pIndex = NULL ) const; + TOOLS_DLLPRIVATE sal_uIntPtr ImplGetIndex( sal_uIntPtr nKey, sal_uIntPtr* pIndex = NULL ) const; //#endif 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(); @@ -78,9 +78,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 ); } }; @@ -107,30 +107,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 ); } \ @@ -143,9 +143,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 e24c2e259022..4c9968149291 100644 --- a/tools/inc/tools/tenccvt.hxx +++ b/tools/inc/tools/tenccvt.hxx @@ -52,7 +52,7 @@ 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 ); #endif // _TOOLS_TENCCVT_HXX diff --git a/tools/inc/tools/time.hxx b/tools/inc/tools/time.hxx index 269b104e57e6..5b0b508598d8 100644 --- a/tools/inc/tools/time.hxx +++ b/tools/inc/tools/time.hxx @@ -46,28 +46,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 ); @@ -75,27 +75,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 4e255e0efdd1..a8ef2587d486 100644 --- a/tools/inc/tools/unqid.hxx +++ b/tools/inc/tools/unqid.hxx @@ -36,8 +36,8 @@ struct ImpUniqueId { - ULONG nId; - USHORT nRefCount; + sal_uIntPtr nId; + sal_uInt16 nRefCount; void Release() { nRefCount--; @@ -71,7 +71,7 @@ public: pId = rId.pId; return *this; } - ULONG GetId() const { return pId ? pId->nId : 0; } + sal_uIntPtr GetId() const { return pId ? pId->nId : 0; } }; // --------------------- @@ -80,30 +80,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 95aac95d9cf4..6059af077abc 100644 --- a/tools/inc/tools/unqidx.hxx +++ b/tools/inc/tools/unqidx.hxx @@ -40,47 +40,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 )); } }; @@ -106,30 +106,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 ); } \ @@ -142,9 +142,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/vcompat.hxx b/tools/inc/tools/vcompat.hxx index f6ee6922faac..93517b77053d 100644 --- a/tools/inc/tools/vcompat.hxx +++ b/tools/inc/tools/vcompat.hxx @@ -35,10 +35,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 - @@ -49,22 +49,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 d346e1af2bbf..10c33b57c871 100644 --- a/tools/inc/tools/vector2d.hxx +++ b/tools/inc/tools/vector2d.hxx @@ -87,8 +87,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; } @@ -97,11 +97,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/wldcrd.hxx b/tools/inc/tools/wldcrd.hxx index 478566ce9b44..4938bc212db2 100644 --- a/tools/inc/tools/wldcrd.hxx +++ b/tools/inc/tools/wldcrd.hxx @@ -42,7 +42,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(); @@ -52,11 +52,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 430caa363663..d42e87f5d4e0 100644 --- a/tools/inc/tools/zcodec.hxx +++ b/tools/inc/tools/zcodec.hxx @@ -73,47 +73,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 @@ -122,7 +122,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/source/communi/geninfo.cxx b/tools/source/communi/geninfo.cxx index 97326836de2d..01a325054a69 100644 --- a/tools/source/communi/geninfo.cxx +++ b/tools/source/communi/geninfo.cxx @@ -55,7 +55,7 @@ GenericInformation::GenericInformation( const ByteString &rKey, /*****************************************************************************/ GenericInformation::GenericInformation( const GenericInformation& rInf, - BOOL bCopySubs) + sal_Bool bCopySubs) /*****************************************************************************/ : ByteString( rInf ), sValue( rInf.sValue ), @@ -80,15 +80,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 )); @@ -96,14 +96,14 @@ BOOL GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteSt /*****************************************************************************/ void GenericInformation::RemoveSubInfo( GenericInformation *pInfo, - BOOL bDelete ) + sal_Bool bDelete ) /*****************************************************************************/ { pInfoList->RemoveInfo( pInfo, bDelete ); } /*****************************************************************************/ -//void GenericInformation::RemoveSelf( BOOL bDelete ) +//void GenericInformation::RemoveSelf( sal_Bool bDelete ) /*****************************************************************************/ /*{ if ( pParent ) @@ -118,8 +118,8 @@ void GenericInformation::RemoveSubInfo( GenericInformation *pInfo, /*****************************************************************************/ GenericInformation *GenericInformation::GetSubInfo( ByteString &rKey, - BOOL bSearchByPath, - BOOL bCreatePath ) + sal_Bool bSearchByPath, + sal_Bool bCreatePath ) /*****************************************************************************/ { if ( !pInfoList && bCreatePath ) @@ -147,7 +147,7 @@ GenericInformationList::GenericInformationList(const GenericInformationList& rLi /*****************************************************************************/ : GenericInformationList_Impl() { - USHORT i; + sal_uInt16 i; GenericInformation* pTemp,*pWork; pOwner = pParent; @@ -155,7 +155,7 @@ GenericInformationList::GenericInformationList(const GenericInformationList& rLi for(i=0;iListDeleted(); delete GetObject( i ); Remove( i );*/ @@ -175,13 +175,13 @@ GenericInformationList::~GenericInformationList() while ( Count() ) { GetObject( 0 )->ListDeleted(); delete GetObject( 0 ); - Remove( (ULONG)0 ); + Remove( (sal_uIntPtr)0 ); } } /*****************************************************************************/ -GenericInformation *GenericInformationList::Search( ULONG &rPos, ByteString sKey, - ULONG nStart, ULONG nEnd ) +GenericInformation *GenericInformationList::Search( sal_uIntPtr &rPos, ByteString sKey, + sal_uIntPtr nStart, sal_uIntPtr nEnd ) /*****************************************************************************/ { if ( Count() == 0 ) { @@ -202,7 +202,7 @@ GenericInformation *GenericInformationList::Search( ULONG &rPos, ByteString sKey } // search binary in existing list - ULONG nActPos = nStart + (( nEnd - nStart ) / 2 ); + sal_uIntPtr nActPos = nStart + (( nEnd - nStart ) / 2 ); rPos = nActPos; ByteString sCandidate = ByteString( *GetObject( nActPos )); @@ -218,8 +218,8 @@ GenericInformation *GenericInformationList::Search( ULONG &rPos, ByteString sKey /*****************************************************************************/ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey, - BOOL bSearchByPath, - BOOL bCreatePath ) + sal_Bool bSearchByPath, + sal_Bool bCreatePath ) /*****************************************************************************/ { @@ -232,7 +232,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey, else sKey = rKey; - ULONG nPos = 0; + sal_uIntPtr nPos = 0; GenericInformation *pReturnInfo = Search( nPos, sKey, 0, Count() - 1 ); /* wenn kein Searchpath gesetzt und kein Returninfo vorhanden, * gib NULL zurueck @@ -241,7 +241,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 )); @@ -251,7 +251,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); @@ -261,9 +261,9 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey, } /*****************************************************************************/ -ULONG GenericInformationList::InsertSorted( GenericInformation *pInfo, - BOOL bOverwrite, - ULONG nStart, ULONG nEnd ) +sal_uIntPtr GenericInformationList::InsertSorted( GenericInformation *pInfo, + sal_Bool bOverwrite, + sal_uIntPtr nStart, sal_uIntPtr nEnd ) /*****************************************************************************/ { if ( Count() == 0 ) { @@ -292,11 +292,11 @@ ULONG GenericInformationList::InsertSorted( GenericInformation *pInfo, if ( sCandidate.ToUpperAscii() == sKey ) { // key allready exists in list if ( bOverwrite ) - Replace( pInfo, ULONG(0)); // ### Laut NF scheint hier ein Memory Leak zu sein + Replace( pInfo, sal_uIntPtr(0)); // ### Laut NF scheint hier ein Memory Leak zu sein return 0; } else if ( sCandidate > sKey ) { - Insert( pInfo, ULONG(0)); + Insert( pInfo, sal_uIntPtr(0)); return 0; } else { @@ -306,7 +306,7 @@ ULONG GenericInformationList::InsertSorted( GenericInformation *pInfo, } // ### GH: /ENDE/ dieser Block schein �berfl�ssig zu sein - ULONG nActPos = nStart + (( nEnd - nStart ) / 2 ); + sal_uIntPtr nActPos = nStart + (( nEnd - nStart ) / 2 ); ByteString sCandidate = ByteString( *GetObject( nActPos )); if ( sCandidate.ToUpperAscii() == sKey ) { @@ -348,21 +348,21 @@ ULONG GenericInformationList::InsertSorted( GenericInformation *pInfo, } /*****************************************************************************/ -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, Count() - 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; @@ -374,14 +374,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 ) /*****************************************************************************/ { Remove( pInfo ); diff --git a/tools/source/communi/parser.cxx b/tools/source/communi/parser.cxx index 20c2bb3ba059..f3baa37049e2 100644 --- a/tools/source/communi/parser.cxx +++ b/tools/source/communi/parser.cxx @@ -44,9 +44,9 @@ #define cKeyLevelChar '\t' /*****************************************************************************/ -InformationParser::InformationParser( BOOL bReplace ) +InformationParser::InformationParser( sal_Bool bReplace ) /*****************************************************************************/ - : bRecover( FALSE ), + : bRecover( sal_False ), sOldLine( "" ), bReplaceVariables( bReplace ), nLevel( 0 ), @@ -73,24 +73,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 ) @@ -164,7 +164,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", " " ); @@ -213,17 +213,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; @@ -250,7 +250,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 ) { @@ -260,20 +260,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; } /*****************************************************************************/ @@ -373,7 +373,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()); @@ -397,33 +397,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 ) /*****************************************************************************/ { @@ -431,14 +431,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 8b679478c535..ffdbd25789ac 100644 --- a/tools/source/datetime/datetime.cxx +++ b/tools/source/datetime/datetime.cxx @@ -41,13 +41,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; } /************************************************************************* @@ -60,13 +60,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; } /************************************************************************* @@ -79,13 +79,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; } /************************************************************************* @@ -117,13 +117,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; } /************************************************************************* @@ -161,14 +161,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 ); } @@ -186,7 +186,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 ) @@ -225,7 +225,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 ) @@ -421,22 +421,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/tdate.cxx b/tools/source/datetime/tdate.cxx index e6bb4345d9f9..2a3c36daf9ed 100644 --- a/tools/source/datetime/tdate.cxx +++ b/tools/source/datetime/tdate.cxx @@ -53,14 +53,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) ) || @@ -70,7 +70,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]; @@ -85,13 +85,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; @@ -100,23 +100,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 { @@ -125,7 +125,7 @@ static void DaysToDate( long nDays, if ( (nTempDays != 366) || !ImpIsLeapYear( rYear ) ) { i--; - bCalc = TRUE; + bCalc = sal_True; } } } @@ -133,12 +133,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; } // ======================================================================= @@ -150,17 +150,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; @@ -171,65 +171,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; @@ -307,76 +307,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; @@ -386,20 +386,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; @@ -409,16 +409,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; @@ -428,16 +428,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; } @@ -486,9 +486,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 9483cc10065e..fee1c159df44 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -145,7 +145,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; @@ -161,7 +161,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(); @@ -174,7 +174,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(); @@ -190,7 +190,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(); @@ -206,7 +206,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(); @@ -307,7 +307,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() ); @@ -327,7 +327,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; @@ -343,14 +343,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; @@ -382,7 +382,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; @@ -392,14 +392,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); @@ -409,37 +409,37 @@ 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 e17457c60525..7d77993317dc 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -104,7 +104,7 @@ class PointerList private: PBlock* pFirst; PBlock* pLast; - ULONG nCount; + sal_uIntPtr nCount; public: PointerList() { pFirst = NULL; pLast = NULL; nCount = 0; } @@ -113,9 +113,9 @@ public: void Add( const void* p ); BOOL Remove( const void* p ); - const void* Get( ULONG nPos ) const; + const void* Get( sal_uIntPtr nPos ) const; BOOL IsIn( const void* p ) const; - ULONG Count() const { return nCount; } + sal_uIntPtr Count() const { return nCount; } }; // --- Datentypen --- @@ -124,22 +124,22 @@ 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; PointerList aThisList; @@ -309,18 +309,18 @@ static BOOL ImplCoreDump() // ======================================================================= -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 ) { @@ -331,7 +331,7 @@ static ULONG ImplGetPerfTime() double fTicks = nTicks; fTicks *= 1000; fTicks /= dImplTicksPerSecond; - return (ULONG)fTicks; + return (sal_uIntPtr)fTicks; #endif } @@ -411,12 +411,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 ] = { @@ -464,14 +464,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; } - 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 ] = { @@ -481,7 +481,7 @@ namespace size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); if ( nValueLen ) { - for ( ULONG name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name ) + for ( sal_uIntPtr name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name ) { if ( strcmp( aBuf, names[ name ] ) == 0 ) { @@ -491,7 +491,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 ) ); @@ -574,7 +574,7 @@ BOOL PointerList::Remove( const void* p ) USHORT 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--; @@ -606,13 +606,13 @@ BOOL PointerList::Remove( const void* p ) // ----------------------------------------------------------------------- -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; @@ -647,7 +647,7 @@ BOOL PointerList::IsIn( const void* p ) const USHORT i = 0; while ( i < PBLOCKCOUNT ) { - if ( ((ULONG)p) == ((ULONG)pBlock->aData[i]) ) + if ( ((sal_uIntPtr)p) == ((sal_uIntPtr)pBlock->aData[i]) ) return TRUE; i++; } @@ -737,7 +737,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 ) ) @@ -971,9 +971,9 @@ 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 ) { @@ -1045,9 +1045,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; @@ -1065,7 +1065,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, @@ -1115,8 +1115,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() && @@ -1283,7 +1283,7 @@ void* DbgFunc( USHORT nAction, void* pParam ) break; case DBG_FUNC_ALLERROROUT: - return (void*)(ULONG)TRUE; + return (void*)(sal_uIntPtr)TRUE; case DBG_FUNC_SETTESTSOLARMUTEX: pDebugData->pDbgTestSolarMutex = (DbgTestSolarMutexProc)(long)pParam; @@ -1340,7 +1340,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 ); @@ -1617,7 +1617,7 @@ void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT DebugData* pData = GetDebugData(); sal_Char const * pStr; - ULONG nOut; + sal_uIntPtr nOut; int nBufLen = 0; if ( nDbgOut == DBG_OUT_ERROR ) diff --git a/tools/source/debug/stcktree.cxx b/tools/source/debug/stcktree.cxx index dccc4c198852..34cda7e81119 100644 --- a/tools/source/debug/stcktree.cxx +++ b/tools/source/debug/stcktree.cxx @@ -42,32 +42,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; @@ -90,7 +90,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 ); @@ -99,7 +99,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_, @@ -137,7 +137,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_ ) { @@ -167,9 +167,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 ) { @@ -190,10 +190,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]; } } @@ -209,7 +209,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" ); @@ -238,7 +238,7 @@ void DbgEndStackTree() // ----------------------------------------------------------------------- -void* DbgGetStackTree( ULONG nAlloc ) +void* DbgGetStackTree( sal_uIntPtr nAlloc ) { ImpDbgStackTree* pReturn = NULL; @@ -246,10 +246,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 ); @@ -261,7 +261,7 @@ void* DbgGetStackTree( ULONG nAlloc ) // ----------------------------------------------------------------------- -void DbgFreeStackTree( void* pVoid, ULONG nAlloc ) +void DbgFreeStackTree( void* pVoid, sal_uIntPtr nAlloc ) { ImpDbgStackTree* p = (ImpDbgStackTree*)pVoid; @@ -297,7 +297,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:" ); @@ -313,8 +313,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 043c5815f764..2c8ab11471d5 100644 --- a/tools/source/fsys/comdep.hxx +++ b/tools/source/fsys/comdep.hxx @@ -74,16 +74,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 @@ -145,9 +145,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 1bd43bffc4e7..b38d510322ac 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -130,11 +130,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 NAMESPACE_VOS( OMutex )* pRedirectMutex = 0; @@ -172,7 +172,7 @@ void FSysRedirector::DoRedirect( String &rPath ) return; // dont redirect on nested calls - bInRedirection = TRUE; + bInRedirection = sal_True; // convert to URL #ifndef UNX @@ -186,7 +186,7 @@ void FSysRedirector::DoRedirect( String &rPath ) // do redirection Redirector(); - bInRedirection = FALSE; + bInRedirection = sal_False; return; } @@ -293,7 +293,7 @@ ByteString ImplCutPath( const ByteString& rStr, USHORT nMax, char cAccDel ) { USHORT nMaxPathLen = nMax; ByteString aCutPath( rStr ); - BOOL bInsertPrefix = FALSE; + sal_Bool bInsertPrefix = sal_False; USHORT nBegin = aCutPath.Search( cAccDel ); if( nBegin == STRING_NOTFOUND ) @@ -310,7 +310,7 @@ ByteString ImplCutPath( const ByteString& rStr, USHORT nMax, char cAccDel ) { nCount = nEnd - nBegin; aCutPath.Erase( nBegin, nCount ); - bInsertPrefix = TRUE; + bInsertPrefix = sal_True; } else break; @@ -1010,7 +1010,7 @@ DirEntry* DirEntry::ImpGetPreTopPtr() |* *************************************************************************/ -DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize ) +DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, sal_Bool bNormalize ) { DBG_CHKTHIS( DirEntry, ImpCheckDirEntry ); @@ -1037,14 +1037,14 @@ DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize ) |* *************************************************************************/ -BOOL DirEntry::Exists( FSysAccess nAccess ) const +sal_Bool DirEntry::Exists( FSysAccess nAccess ) const { #ifndef BOOTSTRAP static NAMESPACE_VOS(OMutex) aLocalMutex; NAMESPACE_VOS(OGuard) aGuard( aLocalMutex ); #endif if ( !IsValid() ) - return FALSE; + return sal_False; #if defined WNT || defined OS2 // spezielle Filenamen sind vom System da @@ -1060,14 +1060,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 @@ -1090,7 +1090,7 @@ BOOL DirEntry::Exists( FSysAccess nAccess ) const |* *************************************************************************/ -BOOL DirEntry::First() +sal_Bool DirEntry::First() { FSysFailOnErrorImpl(); @@ -1120,12 +1120,12 @@ BOOL DirEntry::First() { aName = aFound; closedir( pDir ); - return TRUE; + return sal_True; } } closedir( pDir ); } - return FALSE; + return sal_False; } /************************************************************************* @@ -1138,7 +1138,7 @@ BOOL DirEntry::First() |* *************************************************************************/ -String DirEntry::GetFull( FSysPathStyle eStyle, BOOL bWithDelimiter, +String DirEntry::GetFull( FSysPathStyle eStyle, sal_Bool bWithDelimiter, USHORT nMaxChars ) const { DBG_CHKTHIS( DirEntry, ImpCheckDirEntry ); @@ -1463,18 +1463,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 @@ -1547,10 +1547,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 @@ -1572,7 +1572,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 || @@ -1767,14 +1767,14 @@ void DirEntry::SetName( const String& rName, FSysPathStyle eFormatter ) |* Letzte Aenderung MA 02.12.91 |* *************************************************************************/ -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]; @@ -1797,11 +1797,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; } /************************************************************************* @@ -1814,7 +1814,7 @@ BOOL DirEntry::Find( const String& rPfad, char cDelim ) |* *************************************************************************/ -BOOL DirEntry::ImpToRel( String aCurStr ) +sal_Bool DirEntry::ImpToRel( String aCurStr ) { DBG_CHKTHIS( DirEntry, ImpCheckDirEntry ); @@ -1840,7 +1840,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 @@ -1848,7 +1848,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 @@ -1864,7 +1864,7 @@ BOOL DirEntry::ImpToRel( String aCurStr ) // das ist dann unser relativer Pfad *this = DirEntry( aThisStr, FSYS_STYLE_HPFS ); - return TRUE; + return sal_True; } /************************************************************************* @@ -1917,7 +1917,7 @@ USHORT DirEntry::CutRelParents() |* *************************************************************************/ -BOOL DirEntry::ToRel() +sal_Bool DirEntry::ToRel() { DBG_CHKTHIS( DirEntry, ImpCheckDirEntry ); @@ -1936,7 +1936,7 @@ BOOL DirEntry::ToRel() |* *************************************************************************/ -BOOL DirEntry::ToRel( const DirEntry& rStart ) +sal_Bool DirEntry::ToRel( const DirEntry& rStart ) { DBG_CHKTHIS( DirEntry, ImpCheckDirEntry ); @@ -2075,7 +2075,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 ); @@ -2427,11 +2427,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 || @@ -2445,16 +2445,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) @@ -2464,12 +2464,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 )); } @@ -2488,8 +2488,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); @@ -2525,10 +2525,10 @@ 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 @@ -2604,11 +2604,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 ) @@ -2639,7 +2639,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; } /************************************************************************* @@ -2652,34 +2652,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(); @@ -2693,7 +2693,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 ? @@ -2708,7 +2708,7 @@ BOOL DirEntry::MakeDir( BOOL bSloppy ) const } } } - return TRUE; + return sal_True; } /************************************************************************* @@ -2820,7 +2820,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() ); } @@ -2942,10 +2942,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? @@ -3058,7 +3058,7 @@ 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" ); @@ -3068,10 +3068,10 @@ BOOL DirEntry::Contains( const DirEntry &rSubEntry ) const { 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; } /************************************************************************* @@ -3139,7 +3139,7 @@ String DirEntry::ConvertSystemToName( const String &rName ) |* *************************************************************************/ -BOOL DirEntry::IsValid() const +sal_Bool DirEntry::IsValid() const { return (nError == FSYS_ERR_OK); } @@ -3154,9 +3154,9 @@ BOOL DirEntry::IsValid() const |* *************************************************************************/ -BOOL DirEntry::IsRFSAvailable() +sal_Bool DirEntry::IsRFSAvailable() { - return FALSE; + return sal_False; } /************************************************************************* @@ -3171,14 +3171,14 @@ 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 @@ -3190,15 +3190,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 62d361aa4af4..d5dc5af3990a 100644 --- a/tools/source/fsys/filecopy.cxx +++ b/tools/source/fsys/filecopy.cxx @@ -158,14 +158,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 ) ); } } @@ -243,7 +243,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; diff --git a/tools/source/fsys/fstat.cxx b/tools/source/fsys/fstat.cxx index acdbe6bae510..8949ada7a612 100644 --- a/tools/source/fsys/fstat.cxx +++ b/tools/source/fsys/fstat.cxx @@ -86,8 +86,8 @@ FileStat::FileStat( const DirEntry& rDirEntry, FSysAccess nAccess ) aDateAccessed( ULONG(0) ), aTimeAccessed( ULONG(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; @@ -120,18 +120,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; } /************************************************************************* @@ -143,9 +143,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; @@ -160,12 +160,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 } @@ -178,7 +178,7 @@ BOOL FileStat::HasReadOnlyFlag() |* *************************************************************************/ -BOOL FileStat::GetReadOnlyFlag( const DirEntry &rEntry ) +sal_Bool FileStat::GetReadOnlyFlag( const DirEntry &rEntry ) { ByteString aFPath(rEntry.GetFull(), osl_getThreadTextEncoding()); @@ -194,17 +194,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 } @@ -217,7 +217,7 @@ BOOL FileStat::GetReadOnlyFlag( const DirEntry &rEntry ) |* *************************************************************************/ -ULONG FileStat::SetReadOnlyFlag( const DirEntry &rEntry, BOOL bRO ) +ULONG FileStat::SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO ) { ByteString aFPath(rEntry.GetFull(), osl_getThreadTextEncoding()); diff --git a/tools/source/fsys/tdir.cxx b/tools/source/fsys/tdir.cxx index b6bf48a8cdf9..6c3cbf47af32 100644 --- a/tools/source/fsys/tdir.cxx +++ b/tools/source/fsys/tdir.cxx @@ -60,7 +60,7 @@ DECLARE_LIST( FileStatList, FileStat* ) |* *************************************************************************/ -BOOL Dir::ImpInsertPointReached( const DirEntry& rNewEntry, +sal_Bool Dir::ImpInsertPointReached( const DirEntry& rNewEntry, const FileStat& rNewStat, ULONG nCurPos, ULONG nSortIndex ) const { @@ -70,7 +70,7 @@ BOOL Dir::ImpInsertPointReached( const DirEntry& rNewEntry, // einfache Dinge erfordern einfache Loesungen if ( !pLst->Count() ) - return TRUE; + return sal_True; FSysSort nSort = *( pSortLst->GetObject( nSortIndex ) ); FileStat *pOldStat = NULL; @@ -83,121 +83,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->Count() - 1 ) ) - return TRUE; + return sal_True; else //Rekursion return ImpInsertPointReached( rNewEntry, rNewStat, @@ -285,7 +285,7 @@ void Dir::Construct( DirEntryKind nKindFlags ) |* *************************************************************************/ -BOOL Dir::Update() +sal_Bool Dir::Update() { Reset(); return Scan( USHRT_MAX ) > 0; @@ -390,7 +390,7 @@ USHORT Dir::Scan( USHORT nCount ) if ( !pLst->Count() ) { // dann ggf. Laufwerke scannen - pReader->bInUse = TRUE; + pReader->bInUse = sal_True; nRead = pReader->Init(); } @@ -548,7 +548,7 @@ Dir::~Dir() FSysError Dir::ImpSetSort( std::va_list pArgs, int nFirstSort ) { - BOOL bLast; + sal_Bool bLast; FSysSort *pSort; FSysSortList *pNewSortLst = new FSysSortList; @@ -722,14 +722,14 @@ Dir& Dir::operator+=( const Dir& rDir ) pLst = new DirEntryList(); //Verlangen die Sortierkriterien FileStat's? - BOOL bStat = FALSE; + sal_Bool bStat = sal_False; if ( pSortLst ) { pSortLst->First(); do { if ( *(pSortLst->GetCurObject()) & ( FSYS_SORT_CREATED | FSYS_SORT_MODIFYED | FSYS_SORT_SIZE | FSYS_SORT_ACCESSED | FSYS_SORT_KIND ) ) - bStat = TRUE; + bStat = sal_True; } while ( !bStat && pSortLst->Next() ); } FileStat * stat = NULL; @@ -758,7 +758,7 @@ Dir& Dir::operator+=( const Dir& rDir ) *************************************************************************/ -USHORT Dir::Count( BOOL bUpdated ) const +USHORT Dir::Count( sal_Bool bUpdated ) const { // ggf. erst den Rest lesen if ( bUpdated && pReader ) diff --git a/tools/source/fsys/wldcrd.cxx b/tools/source/fsys/wldcrd.cxx index 293d16877498..16c71cbc51d5 100644 --- a/tools/source/fsys/wldcrd.cxx +++ b/tools/source/fsys/wldcrd.cxx @@ -48,7 +48,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; @@ -117,12 +117,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' ) { @@ -130,14 +130,14 @@ 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; } diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx index a8cf1c1eecec..17421d83feaa 100644 --- a/tools/source/fsys/wntmsc.cxx +++ b/tools/source/fsys/wntmsc.cxx @@ -52,7 +52,7 @@ DECLARE_LIST( FileStatList, FileStat* ); int Sys2SolarError_Impl( int nSysErr ); -static BOOL bLastCaseSensitive = FALSE; +static sal_Bool bLastCaseSensitive = sal_False; //-------------------------------------------------------------------- @@ -103,7 +103,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 ); @@ -136,7 +136,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; @@ -185,7 +185,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) @@ -194,7 +194,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; @@ -211,30 +211,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: @@ -245,18 +245,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; } } @@ -274,19 +274,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; } @@ -295,10 +295,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; } @@ -364,27 +364,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; } //------------------------------------------------------------------------- @@ -444,7 +444,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,".") || @@ -452,7 +452,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,".") || @@ -461,8 +461,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()) ) ) @@ -483,7 +483,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 ); @@ -502,7 +502,7 @@ USHORT DirReader_Impl::Read() } else - bReady = TRUE; + bReady = sal_True; return 0; } @@ -793,13 +793,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(); @@ -808,7 +808,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; @@ -825,7 +825,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 @@ -834,7 +834,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 @@ -849,7 +849,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 && @@ -857,7 +857,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 DBG_TRACE( "FSys: will access removable device!" ); if ( bAccess && ( aName == "a:" || aName == "b:" ) ) { @@ -881,7 +881,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; @@ -891,7 +891,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 ) @@ -905,7 +905,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess ) nError = ERRCODE_NONE; - return TRUE; + return sal_True; } // Statusinformation vom Betriebssystem holen @@ -945,7 +945,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess ) { nKindFlags = FSYS_KIND_UNKNOWN; nError = FSYS_ERR_NOTEXISTS; - return FALSE; + return sal_False; } // UNC-Volume? @@ -959,13 +959,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; } } } @@ -984,7 +984,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess ) { nKindFlags = FSYS_KIND_WILD; nError = FSYS_ERR_OK; - return TRUE; + return sal_True; } if ( bAccess ) @@ -1008,7 +1008,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] ) { @@ -1017,7 +1017,7 @@ BOOL IsRedirectable_Impl( const ByteString &rPath ) SetLastError( ERROR_SUCCESS ); return DRIVE_FIXED != nType; } - return FALSE; + return sal_False; } /************************************************************************* @@ -1067,7 +1067,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 a6202cc71cc6..d84e5af9680b 100644 --- a/tools/source/fsys/wntmsc.hxx +++ b/tools/source/fsys/wntmsc.hxx @@ -51,7 +51,7 @@ //-------------------------------------------------------------------- -#define FSYS_UNIX FALSE +#define FSYS_UNIX sal_False #define DOS_DIRECT _A_SUBDIR #define DOS_VOLUMEID 0x08 @@ -88,7 +88,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 7b10f31d733f..027105767063 100644 --- a/tools/source/generic/bigint.cxx +++ b/tools/source/generic/bigint.cxx @@ -49,7 +49,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. // ----------------------------------------------------------------------- @@ -649,7 +649,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 37e9dedf9259..8f62cc82b156 100644 --- a/tools/source/generic/color.cxx +++ b/tools/source/generic/color.cxx @@ -63,10 +63,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 @@ -77,60 +77,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) VOS_BOUND( (long) COLORDATA_RED( mnColor ) + cLumInc, 0L, 255L ) ); - SetGreen( (UINT8) VOS_BOUND( (long) COLORDATA_GREEN( mnColor ) + cLumInc, 0L, 255L ) ); - SetBlue( (UINT8) VOS_BOUND( (long) COLORDATA_BLUE( mnColor ) + cLumInc, 0L, 255L ) ); + SetRed( (sal_uInt8) VOS_BOUND( (long) COLORDATA_RED( mnColor ) + cLumInc, 0L, 255L ) ); + SetGreen( (sal_uInt8) VOS_BOUND( (long) COLORDATA_GREEN( mnColor ) + cLumInc, 0L, 255L ) ); + SetBlue( (sal_uInt8) VOS_BOUND( (long) COLORDATA_BLUE( mnColor ) + cLumInc, 0L, 255L ) ); } // ----------------------------------------------------------------------- -void Color::DecreaseLuminance( UINT8 cLumDec ) +void Color::DecreaseLuminance( sal_uInt8 cLumDec ) { - SetRed( (UINT8) VOS_BOUND( (long) COLORDATA_RED( mnColor ) - cLumDec, 0L, 255L ) ); - SetGreen( (UINT8) VOS_BOUND( (long) COLORDATA_GREEN( mnColor ) - cLumDec, 0L, 255L ) ); - SetBlue( (UINT8) VOS_BOUND( (long) COLORDATA_BLUE( mnColor ) - cLumDec, 0L, 255L ) ); + SetRed( (sal_uInt8) VOS_BOUND( (long) COLORDATA_RED( mnColor ) - cLumDec, 0L, 255L ) ); + SetGreen( (sal_uInt8) VOS_BOUND( (long) COLORDATA_GREEN( mnColor ) - cLumDec, 0L, 255L ) ); + SetBlue( (sal_uInt8) VOS_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) VOS_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) ); - SetGreen( (UINT8) VOS_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) ); - SetBlue( (UINT8) VOS_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) ); + SetRed( (sal_uInt8) VOS_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) ); + SetGreen( (sal_uInt8) VOS_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) ); + SetBlue( (sal_uInt8) VOS_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) VOS_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) ); - SetGreen( (UINT8) VOS_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) ); - SetBlue( (UINT8) VOS_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) ); + SetRed( (sal_uInt8) VOS_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) ); + SetGreen( (sal_uInt8) VOS_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) ); + SetBlue( (sal_uInt8) VOS_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) ); } } @@ -145,14 +145,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; } @@ -161,10 +161,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(); @@ -185,7 +185,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 ) @@ -216,14 +216,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 ) { @@ -235,17 +235,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 + 0.5 ) ) / 100 ); + sal_uInt8 c = (sal_uInt8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) + 0.5 ) ) / 100 ); switch( n ) { @@ -263,7 +263,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; @@ -275,7 +275,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; @@ -287,13 +287,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) // ----------------------------------------------------------------------- @@ -301,10 +301,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; @@ -313,7 +313,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; @@ -439,10 +439,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; @@ -450,7 +450,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 1a94c2b11198..ff919fcf2505 100644 --- a/tools/source/generic/config.cxx +++ b/tools/source/generic/config.cxx @@ -56,7 +56,7 @@ struct ImplKeyData ImplKeyData* mpNext; ByteString maKey; ByteString maValue; - BOOL mbIsComment; + sal_Bool mbIsComment; }; struct ImplGroupData @@ -64,20 +64,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; }; // ======================================================================= @@ -103,9 +103,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 ); @@ -121,10 +121,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 ) @@ -136,7 +136,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)]; if( aFile.read( pBuf, nPos, nRead ) == ::osl::FileBase::E_None && nRead == nPos ) { //skip the byte-order-mark 0xEF 0xBB 0xBF, if it was UTF8 files @@ -144,12 +144,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(nRead * sizeof(BYTE)) ); - rbIsUTF8BOM = TRUE; + rtl_moveMemory(pBuf, pBuf + 3, sal::static_int_cast(nRead * sizeof(sal_uInt8)) ); + rbIsUTF8BOM = sal_True; } rTimeStamp = ImplSysGetConfigTimeStamp( rFileName ); - rbRead = TRUE; + rbRead = sal_True; rRead = nRead; } else @@ -166,11 +166,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 ); @@ -189,13 +189,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 ) { @@ -258,7 +258,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(); @@ -274,7 +274,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 ) @@ -286,7 +286,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; @@ -380,7 +380,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--; @@ -398,11 +398,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++; @@ -449,17 +449,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 ) { @@ -512,7 +512,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]; @@ -525,7 +525,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; @@ -582,7 +582,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++; @@ -604,11 +604,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 ) @@ -617,11 +617,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; } // ----------------------------------------------------------------------- @@ -639,16 +639,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; } // ----------------------------------------------------------------------- @@ -692,8 +692,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; @@ -709,7 +709,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 ) ) @@ -717,10 +717,10 @@ BOOL Config::ImplUpdateConfig() const ImplDeleteConfigData( mpData ); ImplReadConfig( mpData ); mpData->mnDataUpdateId++; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -774,7 +774,7 @@ Config::Config() mpActGroup = NULL; mnDataUpdateId = 0; mnLockCount = 1; - mbPersistence = TRUE; + mbPersistence = sal_True; #ifdef DBG_UTIL DBG_TRACE( "Config::Config()" ); @@ -791,7 +791,7 @@ Config::Config( const XubString& rFileName ) mpActGroup = NULL; mnDataUpdateId = 0; mnLockCount = 1; - mbPersistence = TRUE; + mbPersistence = sal_True; #ifdef DBG_UTIL ByteString aTraceStr( "Config::Config( " ); @@ -854,7 +854,7 @@ void Config::DeleteGroup( const ByteString& rGroup ) if ( !mnLockCount || !mpData->mbRead ) { ImplUpdateConfig(); - mpData->mbRead = TRUE; + mpData->mbRead = sal_True; } ImplGroupData* pPrevGroup = NULL; @@ -892,7 +892,7 @@ void Config::DeleteGroup( const ByteString& rGroup ) ImplWriteConfig( mpData ); else { - mpData->mbModified = TRUE; + mpData->mbModified = sal_True; } // Gruppen auf ungluetig setzen @@ -903,14 +903,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 ) { @@ -929,14 +929,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++; @@ -948,20 +948,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; } @@ -1043,7 +1043,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 @@ -1061,18 +1061,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; @@ -1085,7 +1085,7 @@ void Config::WriteKey( const ByteString& rKey, const ByteString& rStr ) ImplWriteConfig( mpData ); else { - mpData->mbModified = TRUE; + mpData->mbModified = sal_True; } } } @@ -1108,7 +1108,7 @@ void Config::DeleteKey( const ByteString& rKey ) if ( !mnLockCount || !mpData->mbRead ) { ImplUpdateConfig(); - mpData->mbRead = TRUE; + mpData->mbRead = sal_True; } // Key suchen und Value setzen @@ -1140,7 +1140,7 @@ void Config::DeleteKey( const ByteString& rKey ) ImplWriteConfig( mpData ); else { - mpData->mbModified = TRUE; + mpData->mbModified = sal_True; } } } @@ -1148,7 +1148,7 @@ void Config::DeleteKey( const ByteString& rKey ) // ----------------------------------------------------------------------- -USHORT Config::GetKeyCount() const +sal_uInt16 Config::GetKeyCount() const { #ifdef DBG_UTIL ByteString aTraceStr( "Config::GetKeyCount()" ); @@ -1164,7 +1164,7 @@ USHORT Config::GetKeyCount() const ImplUpdateConfig(); // Key suchen und Value zurueckgeben - USHORT nCount = 0; + sal_uInt16 nCount = 0; ImplGroupData* pGroup = ImplGetGroup(); if ( pGroup ) { @@ -1183,7 +1183,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( " ); @@ -1218,7 +1218,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( " ); @@ -1275,7 +1275,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 0b8231d620ce..8481fef32e05 100644 --- a/tools/source/generic/fract.cxx +++ b/tools/source/generic/fract.cxx @@ -634,10 +634,10 @@ void Fraction::ReduceInaccurate( unsigned nSignificantBits ) |* *************************************************************************/ -BOOL operator == ( const Fraction& rVal1, const Fraction& rVal2 ) +sal_Bool operator == ( const Fraction& rVal1, const Fraction& rVal2 ) { if ( !rVal1.IsValid() || !rVal2.IsValid() ) - return FALSE; + return sal_False; return rVal1.nNumerator == rVal2.nNumerator && rVal1.nDenominator == rVal2.nDenominator; @@ -660,10 +660,10 @@ BOOL operator == ( const Fraction& rVal1, const Fraction& rVal2 ) // und (c*b) zu vergleichen. Das Ergebnis dieses Vergleichs wird // zurueckgegeben. -BOOL operator < ( const Fraction& rVal1, const Fraction& rVal2 ) +sal_Bool operator < ( const Fraction& rVal1, const Fraction& rVal2 ) { if ( !rVal1.IsValid() || !rVal2.IsValid() ) - return FALSE; + return sal_False; BigInt nN( rVal1.nNumerator ); nN *= BigInt( rVal2.nDenominator ); @@ -690,10 +690,10 @@ BOOL operator < ( const Fraction& rVal1, const Fraction& rVal2 ) // und (c*b) zu vergleichen. Das Ergebnis dieses Vergleichs wird // zurueckgegeben. -BOOL operator > ( const Fraction& rVal1, const Fraction& rVal2 ) +sal_Bool operator > ( const Fraction& rVal1, const Fraction& rVal2 ) { if ( !rVal1.IsValid() || !rVal2.IsValid() ) - return FALSE; + return sal_False; BigInt nN( rVal1.nNumerator ); nN *= BigInt( rVal2.nDenominator ); diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index b0eb57f1ab73..e4ef3ed58c82 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -44,7 +44,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair ) int i; int i1; int i2; - UINT32 nNum; + sal_uInt32 nNum; rIStream >> cId; i1 = (cId & 0x70) >> 4; @@ -61,7 +61,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; @@ -73,7 +73,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair ) } if ( cId & 0x08 ) nNum ^= 0xFFFFFFFF; - rPair.nB = (INT32)nNum; + rPair.nB = (sal_Int32)nNum; } else { @@ -93,11 +93,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; @@ -138,7 +138,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; @@ -323,31 +323,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; } @@ -362,12 +362,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; } /************************************************************************* @@ -380,7 +380,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(); @@ -402,7 +402,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; @@ -423,7 +423,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; @@ -436,7 +436,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; @@ -449,7 +449,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; @@ -461,7 +461,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect ) } if ( cIdAry[1] & 0x08 ) nNum ^= 0xFFFFFFFF; - rRect.nBottom = (INT32)nNum; + rRect.nBottom = (sal_Int32)nNum; } else { @@ -481,12 +481,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; @@ -527,7 +527,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; @@ -568,7 +568,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; @@ -609,7 +609,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 0c2de98d843d..ea3b92ad9005 100644 --- a/tools/source/generic/line.cxx +++ b/tools/source/generic/line.cxx @@ -47,50 +47,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 ) { @@ -99,10 +99,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 ) { @@ -119,11 +119,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 ) { @@ -170,7 +170,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 928251306901..2d485a5036c4 100644 --- a/tools/source/generic/link.cxx +++ b/tools/source/generic/link.cxx @@ -39,20 +39,20 @@ |* *************************************************************************/ -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; } diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 2290cfdbe7c2..75124ab9a59b 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -80,19 +80,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 @@ -108,12 +108,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 @@ -131,16 +131,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 @@ -171,7 +171,7 @@ ImplPolygon::~ImplPolygon() // ----------------------------------------------------------------------- -void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize ) +void ImplPolygon::ImplSetSize( sal_uInt16 nNewSize, sal_Bool bResize ) { if( mnPoints == nNewSize ) return; @@ -180,7 +180,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 ) { @@ -188,14 +188,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) ); } } } @@ -208,11 +208,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 ) { @@ -240,16 +240,16 @@ 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 USHORT nNewSize = mnPoints + nSpace; + const sal_uIntPtr nSpaceSize = nSpace * sizeof( Point ); + const sal_uInt16 nNewSize = mnPoints + nSpace; if( nPos >= mnPoints ) { // Hinten anhaengen nPos = mnPoints; - ImplSetSize( nNewSize, TRUE ); + ImplSetSize( nNewSize, sal_True ); if( pInitPoly ) { @@ -262,10 +262,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 ) ); @@ -280,7 +280,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 ); @@ -301,17 +301,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 ) ); @@ -321,7 +321,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 ); @@ -340,7 +340,7 @@ void ImplPolygon::ImplCreateFlagArray() { if( !mpFlagAry ) { - mpFlagAry = new BYTE[ mnPoints ]; + mpFlagAry = new sal_uInt8[ mnPoints ]; memset( mpFlagAry, 0, mnPoints ); } } @@ -376,7 +376,7 @@ Polygon::Polygon() // ----------------------------------------------------------------------- -Polygon::Polygon( USHORT nSize ) +Polygon::Polygon( sal_uInt16 nSize ) { DBG_CTOR( Polygon, NULL ); @@ -388,7 +388,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 ); @@ -432,7 +432,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 ); @@ -443,8 +443,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 ) { @@ -462,7 +462,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 ); @@ -489,7 +489,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 ); @@ -498,10 +498,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; @@ -511,9 +511,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 ); @@ -555,12 +555,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; @@ -574,8 +574,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; @@ -583,7 +583,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 ) @@ -622,7 +622,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 ); @@ -642,7 +642,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 ]; @@ -684,7 +684,7 @@ Point* Polygon::ImplGetPointAry() // ----------------------------------------------------------------------- -BYTE* Polygon::ImplGetFlagAry() +sal_uInt8* Polygon::ImplGetFlagAry() { DBG_CHKTHIS( Polygon, NULL ); @@ -703,7 +703,7 @@ const Point* Polygon::GetConstPointAry() const // ----------------------------------------------------------------------- -const BYTE* Polygon::GetConstFlagAry() const +const sal_uInt8* Polygon::GetConstFlagAry() const { DBG_CHKTHIS( Polygon, NULL ); return mpImplPolygon->mpFlagAry; @@ -711,7 +711,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, @@ -723,7 +723,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, @@ -735,13 +735,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, @@ -752,7 +752,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, @@ -771,7 +771,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, @@ -784,7 +784,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, @@ -797,9 +797,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 ] ) ) || @@ -809,7 +809,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; @@ -817,7 +817,7 @@ BOOL Polygon::IsRect() const // ----------------------------------------------------------------------- -void Polygon::SetSize( USHORT nNewSize ) +void Polygon::SetSize( sal_uInt16 nNewSize ) { DBG_CHKTHIS( Polygon, NULL ); @@ -830,7 +830,7 @@ void Polygon::SetSize( USHORT nNewSize ) // ----------------------------------------------------------------------- -USHORT Polygon::GetSize() const +sal_uInt16 Polygon::GetSize() const { DBG_CHKTHIS( Polygon, NULL ); @@ -856,7 +856,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" ); @@ -873,12 +873,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 ) { @@ -886,7 +886,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 ); @@ -895,7 +895,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; @@ -907,15 +907,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 ]; } @@ -1046,8 +1046,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 ); @@ -1056,8 +1056,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 ] ) && @@ -1078,7 +1078,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); } } @@ -1117,27 +1117,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 ]; @@ -1147,7 +1147,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 ] ); @@ -1176,7 +1176,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 @@ -1188,10 +1188,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; } } } @@ -1200,7 +1200,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 ) @@ -1229,8 +1229,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; @@ -1245,7 +1245,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; } @@ -1256,7 +1256,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() ); @@ -1266,7 +1266,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; @@ -1289,7 +1289,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 ]; @@ -1307,7 +1307,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; @@ -1324,7 +1324,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; @@ -1363,7 +1363,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 ]; @@ -1391,9 +1391,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 ); @@ -1429,7 +1429,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, @@ -1438,7 +1438,7 @@ public: mnLow( nLow ), mnHigh( nHigh ), mnEdge( nEdge ), - mbFirst( TRUE ) + mbFirst( sal_True ) { } @@ -1537,7 +1537,7 @@ void ImplEdgePointFilter::Input( const Point& rPoint ) if ( mbFirst ) { maFirstPoint = rPoint; - mbFirst = FALSE; + mbFirst = sal_False; if ( !nOutside ) mrNextFilter.Input( rPoint ); } @@ -1575,20 +1575,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(); @@ -1623,7 +1623,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(); @@ -1633,7 +1633,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]); @@ -1669,9 +1669,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 ]; @@ -1688,15 +1688,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 ) ) { @@ -1707,7 +1707,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 ]; @@ -1740,7 +1740,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; @@ -1748,7 +1748,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(); @@ -1762,16 +1762,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 ) { @@ -1789,7 +1789,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 ) ) @@ -1801,7 +1801,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" ); @@ -1839,15 +1839,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; } // ----------------------------------------------------------------------- @@ -1880,10 +1880,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; @@ -1899,7 +1899,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 ) @@ -1964,9 +1964,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; @@ -1984,9 +1984,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 @@ -1994,9 +1994,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 @@ -2009,7 +2009,7 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly ) i++; } - rOStream << bShort << (USHORT)(i-nStart); + rOStream << bShort << (sal_uInt16)(i-nStart); if ( bShort ) { @@ -2106,7 +2106,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 (!)"); @@ -2148,7 +2148,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; @@ -2269,7 +2269,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 @@ -2282,11 +2282,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++; } @@ -2297,11 +2297,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; } } @@ -2313,7 +2313,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 @@ -2322,7 +2322,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 46459353fa35..a995c66f9cf0 100644 --- a/tools/source/generic/poly2.cxx +++ b/tools/source/generic/poly2.cxx @@ -53,7 +53,7 @@ DBG_NAME( PolyPolygon ) // ----------------------------------------------------------------------- -ImplPolyPolygon::ImplPolyPolygon( USHORT nInitSize ) +ImplPolyPolygon::ImplPolyPolygon( sal_uInt16 nInitSize ) { mnRefCount = 1; mnCount = nInitSize; @@ -74,7 +74,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 @@ -87,7 +87,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; } @@ -95,7 +95,7 @@ ImplPolyPolygon::~ImplPolyPolygon() // ======================================================================= -PolyPolygon::PolyPolygon( USHORT nInitSize, USHORT nResize ) +PolyPolygon::PolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize ) { DBG_CTOR( PolyPolygon, NULL ); @@ -127,7 +127,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 ); @@ -136,7 +136,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; @@ -170,7 +170,7 @@ PolyPolygon::~PolyPolygon() // ----------------------------------------------------------------------- -void PolyPolygon::Insert( const Polygon& rPoly, USHORT nPos ) +void PolyPolygon::Insert( const Polygon& rPoly, sal_uInt16 nPos ) { DBG_CHKTHIS( PolyPolygon, NULL ); @@ -190,8 +190,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 ) @@ -217,7 +217,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" ); @@ -237,7 +237,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" ); @@ -254,7 +254,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" ); @@ -264,9 +264,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; @@ -288,7 +288,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; @@ -300,15 +300,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 ) { @@ -327,7 +327,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 ) { @@ -351,7 +351,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 ); @@ -388,7 +388,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 @@ -441,7 +441,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; @@ -464,8 +464,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 ); } } @@ -484,7 +484,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 ); } @@ -502,13 +502,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; @@ -534,7 +534,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 ); } @@ -552,7 +552,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 ); } @@ -570,7 +570,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 ); } @@ -588,7 +588,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 ); } @@ -598,8 +598,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; @@ -629,16 +629,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 ]; @@ -646,7 +646,7 @@ Rectangle PolyPolygon::GetBoundRect() const { nXMin = nXMax = pPt->X(); nYMin = nYMax = pPt->Y(); - bFirst = FALSE; + bFirst = sal_False; } else { @@ -670,7 +670,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" ); @@ -705,15 +705,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; } // ----------------------------------------------------------------------- @@ -746,7 +746,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; @@ -762,7 +762,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; @@ -783,11 +783,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; @@ -803,7 +803,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; @@ -819,7 +819,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 ); @@ -840,11 +840,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 eb254faf2310..fa302384745f 100644 --- a/tools/source/generic/svborder.cxx +++ b/tools/source/generic/svborder.cxx @@ -42,7 +42,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/inetmime.cxx b/tools/source/inet/inetmime.cxx index 5324e9be07b8..80b6987d041f 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -4552,7 +4552,7 @@ void INetContentTypeParameterList::Clear() const INetContentTypeParameter * INetContentTypeParameterList::find(const ByteString & rAttribute) const { - for (ULONG i = 0; i < Count(); ++i) + for (sal_uIntPtr i = 0; i < Count(); ++i) { const INetContentTypeParameter * pParameter = GetObject(i); if (pParameter->m_sAttribute.EqualsIgnoreCaseAscii(rAttribute)) diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index feec97168b59..8432bb52e23d 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -80,7 +80,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(); @@ -97,7 +97,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)); @@ -113,7 +113,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 ( @@ -125,10 +125,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, @@ -139,10 +139,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; } @@ -156,7 +156,7 @@ SvStream& INetMessage::operator<< (SvStream& rStrm) const rStrm << static_cast(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(n); for (i = 0; i < n; i++) @@ -182,7 +182,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; @@ -205,7 +205,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) @@ -219,7 +219,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(); @@ -291,14 +291,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]; } @@ -311,7 +311,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; @@ -358,28 +358,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()); @@ -403,47 +403,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 or , leading and trailing space. while ((nIndex < rDateField.Len()) && @@ -463,7 +463,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++; @@ -473,19 +473,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); @@ -498,8 +498,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; @@ -532,7 +532,7 @@ BOOL INetRFC822Message::ParseDateField ( else { // Junk. - return FALSE; + return sal_False; } return (rDateTime.IsValid() && @@ -545,15 +545,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; @@ -921,7 +921,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(m_nIndex[i]); return rStrm; @@ -935,7 +935,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; @@ -999,9 +999,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; } @@ -1058,7 +1058,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]; @@ -1092,15 +1092,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; @@ -1328,11 +1328,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; @@ -1392,14 +1392,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() */) { @@ -1407,21 +1407,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. @@ -1496,7 +1496,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) @@ -1522,7 +1522,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) { @@ -1541,7 +1541,7 @@ BOOL INetMIMEMessage::DetachChild ( { // Requested part not found. delete pDocStrm; - return FALSE; + return sal_False; } } } @@ -1581,7 +1581,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) { @@ -1600,9 +1600,9 @@ BOOL INetMIMEMessage::DetachChild ( // Done. if (pDocStrm) delete pDocStrm; if (pMsgStrm) delete pMsgStrm; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /* @@ -1612,7 +1612,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(m_nIndex[i]); #ifdef ENABLE_BYTESTRING_STREAM_OPERATORS @@ -1633,7 +1633,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 ca76d8750bf8..33ed7c8dc41f 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -53,23 +53,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); }; @@ -84,10 +84,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); @@ -104,22 +104,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); }; @@ -133,15 +133,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); }; @@ -167,7 +167,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); } @@ -178,7 +178,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); @@ -200,7 +200,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); @@ -236,7 +236,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); } @@ -249,9 +249,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) @@ -274,7 +274,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; @@ -284,13 +284,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 { @@ -309,7 +309,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'; } @@ -327,7 +327,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; @@ -336,7 +336,7 @@ int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize) if (!bHeaderGenerated) { - ULONG i, n; + sal_uIntPtr i, n; if (pMsgBuffer->Tell() == 0) { @@ -379,7 +379,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; } } @@ -396,7 +396,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) { @@ -427,7 +427,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; @@ -462,7 +462,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')) { @@ -534,7 +534,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; @@ -543,7 +543,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 ( @@ -582,7 +582,7 @@ int INetMessageOStream::PutMsgLine (const sal_Char *pData, ULONG nSize) /* * INetMessageIOStream. */ -INetMessageIOStream::INetMessageIOStream (ULONG nBufferSize) +INetMessageIOStream::INetMessageIOStream (sal_uIntPtr nBufferSize) : INetMessageIStream (nBufferSize), INetMessageOStream () { @@ -614,15 +614,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; @@ -644,7 +644,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; @@ -773,7 +773,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. @@ -788,7 +788,7 @@ int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize) *pTokRead++ = '\r'; *pTokRead++ = '\n'; - bDone = TRUE; + bDone = sal_True; } else { @@ -850,7 +850,7 @@ INetMessageDecodeQPStream_Impl::INetMessageDecodeQPStream_Impl (void) pMsgBuffer (new SvMemoryStream), nTokBufLen (0) { - ParseHeader (FALSE); + ParseHeader (sal_False); } /* @@ -865,7 +865,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; @@ -964,14 +964,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; @@ -993,7 +993,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; @@ -1063,7 +1063,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. @@ -1092,7 +1092,7 @@ int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize) *pTokRead++ = '\n'; // Mark we're done. - bDone = TRUE; + bDone = sal_True; } else { @@ -1108,7 +1108,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); @@ -1172,12 +1172,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; @@ -1195,7 +1195,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; @@ -1298,7 +1298,7 @@ int INetMessageDecode64Stream_Impl::PutMsgLine ( /* * INetMIMEMessageStream. */ -INetMIMEMessageStream::INetMIMEMessageStream (ULONG nBufferSize) +INetMIMEMessageStream::INetMIMEMessageStream (sal_uIntPtr nBufferSize) : INetMessageIOStream (nBufferSize), eState (INETMSG_EOL_BEGIN), nChildIndex (0), @@ -1360,7 +1360,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(); @@ -1594,7 +1594,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(); @@ -1623,8 +1623,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; @@ -1656,7 +1656,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 (' '); @@ -1678,7 +1678,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; @@ -1735,9 +1735,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/memtools/contnr.cxx b/tools/source/memtools/contnr.cxx index 4a4ee47886ee..63dc74e37441 100644 --- a/tools/source/memtools/contnr.cxx +++ b/tools/source/memtools/contnr.cxx @@ -84,7 +84,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 ); @@ -107,7 +107,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" ); @@ -175,7 +175,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" ); @@ -231,12 +231,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; @@ -368,7 +368,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 ); @@ -427,7 +427,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 ); @@ -448,7 +448,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 ); @@ -465,7 +465,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" ); @@ -589,7 +589,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 ); @@ -654,7 +654,7 @@ Container::Container( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) |* *************************************************************************/ -Container::Container( ULONG nSize ) +Container::Container( sal_uIntPtr nSize ) { DBG_CTOR( Container, DbgCheckContainer ); @@ -675,7 +675,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 @@ -696,7 +696,7 @@ Container::Container( ULONG nSize ) nSize -= nBlockSize; } - pLastBlock = new CBlock( (USHORT)nSize, pBlock1 ); + pLastBlock = new CBlock( (sal_uInt16)nSize, pBlock1 ); pBlock1->SetNextBlock( pLastBlock ); } @@ -756,7 +756,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 ); @@ -856,7 +856,7 @@ void Container::Insert( void* p ) |* *************************************************************************/ -void Container::Insert( void* p, ULONG nIndex ) +void Container::Insert( void* p, sal_uIntPtr nIndex ) { if ( nCount <= nIndex ) { @@ -875,7 +875,7 @@ void Container::Insert( void* p, ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - ImpInsert( p, pTemp, (USHORT)nIndex ); + ImpInsert( p, pTemp, (sal_uInt16)nIndex ); } } @@ -891,7 +891,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 ); } @@ -906,7 +906,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 ); @@ -1002,7 +1002,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 ) @@ -1017,7 +1017,7 @@ void* Container::Remove( ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - return ImpRemove( pTemp, (USHORT)nIndex ); + return ImpRemove( pTemp, (sal_uInt16)nIndex ); } } @@ -1051,7 +1051,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 ); @@ -1068,7 +1068,7 @@ void* Container::Replace( void* p, ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - return pTemp->Replace( p, (USHORT)nIndex ); + return pTemp->Replace( p, (sal_uInt16)nIndex ); } } @@ -1082,7 +1082,7 @@ void* Container::Replace( void* p, ULONG nIndex ) |* *************************************************************************/ -void Container::SetSize( ULONG nNewSize ) +void Container::SetSize( sal_uIntPtr nNewSize ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1092,7 +1092,7 @@ void Container::SetSize( ULONG nNewSize ) if ( nNewSize != nCount ) { CBlock* pTemp; - ULONG nTemp; + sal_uIntPtr nTemp; // Wird verkleinert if ( nNewSize < nCount ) @@ -1106,14 +1106,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; @@ -1124,7 +1124,7 @@ void Container::SetSize( ULONG nNewSize ) { pLastBlock = pTemp; pTemp->SetNextBlock( NULL ); - pTemp->SetSize( (USHORT)(nNewSize-nTemp) ); + pTemp->SetSize( (sal_uInt16)(nNewSize-nTemp) ); } else { @@ -1151,7 +1151,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 @@ -1172,7 +1172,7 @@ void Container::SetSize( ULONG nNewSize ) nNewSize -= nBlockSize; } - pLastBlock = new CBlock( (USHORT)nNewSize, pBlock1 ); + pLastBlock = new CBlock( (sal_uInt16)nNewSize, pBlock1 ); pBlock1->SetNextBlock( pLastBlock ); } @@ -1180,7 +1180,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 @@ -1201,7 +1201,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 @@ -1278,7 +1278,7 @@ void* Container::GetCurObject() const |* *************************************************************************/ -ULONG Container::GetCurPos() const +sal_uIntPtr Container::GetCurPos() const { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1289,7 +1289,7 @@ ULONG Container::GetCurPos() const { // Block suchen CBlock* pTemp = pFirstBlock; - ULONG nTemp = 0; + sal_uIntPtr nTemp = 0; while ( pTemp != pCurBlock ) { nTemp += pTemp->Count(); @@ -1310,7 +1310,7 @@ ULONG Container::GetCurPos() const |* *************************************************************************/ -void** Container::GetObjectPtr( ULONG nIndex ) +void** Container::GetObjectPtr( sal_uIntPtr nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1328,7 +1328,7 @@ void** Container::GetObjectPtr( ULONG nIndex ) } // Item innerhalb des gefundenen Blocks zurueckgeben - return pTemp->GetObjectPtr( (USHORT)nIndex ); + return pTemp->GetObjectPtr( (sal_uInt16)nIndex ); } } @@ -1342,7 +1342,7 @@ void** Container::GetObjectPtr( ULONG nIndex ) |* *************************************************************************/ -void* Container::GetObject( ULONG nIndex ) const +void* Container::GetObject( sal_uIntPtr nIndex ) const { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1360,7 +1360,7 @@ void* Container::GetObject( ULONG nIndex ) const } // Item innerhalb des gefundenen Blocks zurueckgeben - return pTemp->GetObject( (USHORT)nIndex ); + return pTemp->GetObject( (sal_uInt16)nIndex ); } } @@ -1374,15 +1374,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; @@ -1416,8 +1416,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 ); @@ -1427,12 +1427,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(); @@ -1443,7 +1443,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 { @@ -1465,12 +1465,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 { @@ -1494,7 +1494,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, else break; } - while ( TRUE ); + while ( sal_True ); } } @@ -1511,7 +1511,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, |* *************************************************************************/ -void* Container::Seek( ULONG nIndex ) +void* Container::Seek( sal_uIntPtr nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1530,7 +1530,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 ); } } @@ -1689,20 +1689,20 @@ 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; } diff --git a/tools/source/memtools/mempool.cxx b/tools/source/memtools/mempool.cxx index 45d6d2ea9367..27054a3b79db 100644 --- a/tools/source/memtools/mempool.cxx +++ b/tools/source/memtools/mempool.cxx @@ -42,7 +42,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 1e4da74348f4..8fd94361d2a3 100644 --- a/tools/source/memtools/multisel.cxx +++ b/tools/source/memtools/multisel.cxx @@ -63,7 +63,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(), @@ -93,10 +93,10 @@ void MultiSelection::ImplClear() // ----------------------------------------------------------------------- -ULONG MultiSelection::ImplFindSubSelection( long nIndex ) const +sal_uIntPtr MultiSelection::ImplFindSubSelection( long nIndex ) const { // iterate through the sub selections - ULONG n = 0; + sal_uIntPtr n = 0; for ( ; n < aSels.Count() && nIndex > aSels.GetObject(n)->Max(); ++n ) {} /* empty loop */ @@ -105,11 +105,11 @@ ULONG MultiSelection::ImplFindSubSelection( long nIndex ) const // ----------------------------------------------------------------------- -BOOL MultiSelection::ImplMergeSubSelections( ULONG nPos1, ULONG nPos2 ) +sal_Bool MultiSelection::ImplMergeSubSelections( sal_uIntPtr nPos1, sal_uIntPtr nPos2 ) { // didn't a sub selection at nPos2 exist? if ( nPos2 >= aSels.Count() ) - return FALSE; + return sal_False; // did the sub selections touch each other? if ( (aSels.GetObject(nPos1)->Max() + 1) == aSels.GetObject(nPos2)->Min() ) @@ -117,10 +117,10 @@ BOOL MultiSelection::ImplMergeSubSelections( ULONG nPos1, ULONG nPos2 ) // merge them aSels.GetObject(nPos1)->Max() = aSels.GetObject(nPos2)->Max(); delete aSels.Remove(nPos2); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -129,8 +129,8 @@ MultiSelection::MultiSelection(): aTotRange( 0, -1 ), nCurSubSel(0), nSelCount(0), - bCurValid(FALSE), - bSelectNew(FALSE) + bCurValid(sal_False), + bSelectNew(sal_False) { } @@ -140,8 +140,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.) @@ -150,8 +150,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, @@ -177,11 +177,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 '-': @@ -193,12 +193,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 ' ': @@ -214,12 +214,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; } @@ -233,7 +233,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 ) @@ -265,13 +265,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; } @@ -298,7 +298,7 @@ MultiSelection::MultiSelection( const MultiSelection& rOrig ) : aTotRange(rOrig.aTotRange), nSelCount(rOrig.nSelCount), bCurValid(rOrig.bCurValid), - bSelectNew(FALSE) + bSelectNew(sal_False) { if ( bCurValid ) { @@ -307,7 +307,7 @@ MultiSelection::MultiSelection( const MultiSelection& rOrig ) : } // copy the sub selections - for ( ULONG n = 0; n < rOrig.aSels.Count(); ++n ) + for ( sal_uIntPtr n = 0; n < rOrig.aSels.Count(); ++n ) aSels.Insert( new Range( *rOrig.aSels.GetObject(n) ), LIST_APPEND ); } @@ -317,8 +317,8 @@ MultiSelection::MultiSelection( const Range& rRange ): aTotRange(rRange), nCurSubSel(0), nSelCount(0), - bCurValid(FALSE), - bSelectNew(FALSE) + bCurValid(sal_False), + bSelectNew(sal_False) { } @@ -348,7 +348,7 @@ MultiSelection& MultiSelection::operator= ( const MultiSelection& rOrig ) // clear the old and copy the sub selections ImplClear(); - for ( ULONG n = 0; n < rOrig.aSels.Count(); ++n ) + for ( sal_uIntPtr n = 0; n < rOrig.aSels.Count(); ++n ) aSels.Insert( new Range( *rOrig.aSels.GetObject(n) ), LIST_APPEND ); nSelCount = rOrig.nSelCount; @@ -357,24 +357,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.Count() != rWith.aSels.Count() ) - return FALSE; + return sal_False; // compare the sub seletions - for ( ULONG n = 0; n < aSels.Count(); ++n ) + for ( sal_uIntPtr n = 0; n < aSels.Count(); ++n ) if ( *aSels.GetObject(n) != *rWith.aSels.GetObject(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 ) @@ -388,16 +388,16 @@ 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 - ULONG nSubSelPos = ImplFindSubSelection( nIndex ); + sal_uIntPtr nSubSelPos = ImplFindSubSelection( nIndex ); if ( bSelect ) { @@ -405,7 +405,7 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect ) if ( nSubSelPos < aSels.Count() && aSels.GetObject(nSubSelPos)->IsInside( nIndex ) ) // already selected, nothing to do - return FALSE; + return sal_False; // it will become selected ++nSelCount; @@ -441,7 +441,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 @@ -453,7 +453,7 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect ) // remove the complete sub selection delete aSels.Remove( nSubSelPos ); DBG(Print( this )); - return TRUE; + return sal_True; } // is it at the beginning of the found sub selection? @@ -475,20 +475,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" ); @@ -512,7 +512,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect ) if( nCurMin > (nTmpMax+1) ) { pRange = new Range( rIndexRange ); - aSels.Insert( pRange, (ULONG)0 ); + aSels.Insert( pRange, (sal_uIntPtr)0 ); nSelCount += pRange->Len(); } else @@ -522,7 +522,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect ) pRange->Min() = (long)nTmpMin; nSelCount += ( nOld - nTmpMin ); } - bCurValid = FALSE; + bCurValid = sal_False; } return; } @@ -545,7 +545,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect ) pRange->Max() = (long)nTmpMax; nSelCount += ( nTmpMax - nOld ); } - bCurValid = FALSE; + bCurValid = sal_False; } return; } @@ -560,10 +560,10 @@ 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 - ULONG nSubSelPos = ImplFindSubSelection( nIndex ); + sal_uIntPtr nSubSelPos = ImplFindSubSelection( nIndex ); return nSubSelPos < aSels.Count() && aSels.GetObject(nSubSelPos)->IsInside(nIndex); @@ -576,7 +576,7 @@ void MultiSelection::Insert( long nIndex, long nCount ) DBG(DbgOutf( "::Insert(%ld, %ld)\n", nIndex, nCount )); // find the virtual target position - ULONG nSubSelPos = ImplFindSubSelection( nIndex ); + sal_uIntPtr nSubSelPos = ImplFindSubSelection( nIndex ); // did we need to shift the sub selections? if ( nSubSelPos < aSels.Count() ) @@ -608,14 +608,14 @@ void MultiSelection::Insert( long nIndex, long nCount ) } // shift the sub selections behind the inserting position - for ( ULONG nPos = nSubSelPos; nPos < aSels.Count(); ++nPos ) + for ( sal_uIntPtr nPos = nSubSelPos; nPos < aSels.Count(); ++nPos ) { aSels.GetObject(nPos)->Min() += nCount; aSels.GetObject(nPos)->Max() += nCount; } } - bCurValid = FALSE; + bCurValid = sal_False; aTotRange.Max() += nCount; if ( bSelectNew ) nSelCount += nCount; @@ -630,7 +630,7 @@ void MultiSelection::Remove( long nIndex ) DBG(DbgOutf( "::Remove(%ld)\n", nIndex )); // find the virtual target position - ULONG nSubSelPos = ImplFindSubSelection( nIndex ); + sal_uIntPtr nSubSelPos = ImplFindSubSelection( nIndex ); // did we remove from an existing sub selection? if ( nSubSelPos < aSels.Count() && @@ -649,13 +649,13 @@ void MultiSelection::Remove( long nIndex ) } // shift the sub selections behind the removed index - for ( ULONG nPos = nSubSelPos; nPos < aSels.Count(); ++nPos ) + for ( sal_uIntPtr nPos = nSubSelPos; nPos < aSels.Count(); ++nPos ) { --( aSels.GetObject(nPos)->Min() ); --( aSels.GetObject(nPos)->Max() ); } - bCurValid = FALSE; + bCurValid = sal_False; aTotRange.Max() -= 1; DBG(Print( this )); @@ -713,14 +713,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; @@ -820,7 +820,7 @@ void MultiSelection::SetTotalRange( const Range& rTotRange ) if( pRange->Max() < aTotRange.Min() ) { delete pRange; - aSels.Remove( (ULONG)0 ); + aSels.Remove( (sal_uIntPtr)0 ); } else if( pRange->Min() < aTotRange.Min() ) { @@ -834,14 +834,14 @@ void MultiSelection::SetTotalRange( const Range& rTotRange ) } // die obere Bereichsgrenze anpassen - ULONG nCount = aSels.Count(); + sal_uIntPtr nCount = aSels.Count(); while( nCount ) { pRange = aSels.GetObject( nCount - 1 ); if( pRange->Min() > aTotRange.Max() ) { delete pRange; - aSels.Remove( (ULONG)(nCount - 1) ); + aSels.Remove( (sal_uIntPtr)(nCount - 1) ); } else if( pRange->Max() > aTotRange.Max() ) { @@ -863,7 +863,7 @@ void MultiSelection::SetTotalRange( const Range& rTotRange ) pRange = aSels.Next(); } - bCurValid = FALSE; + bCurValid = sal_False; nCurIndex = 0; } diff --git a/tools/source/memtools/table.cxx b/tools/source/memtools/table.cxx index 50ac46e99758..80b2c9747966 100644 --- a/tools/source/memtools/table.cxx +++ b/tools/source/memtools/table.cxx @@ -37,16 +37,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 @@ -57,7 +57,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 @@ -75,7 +75,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 @@ -102,7 +102,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" ); @@ -112,27 +112,27 @@ 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; //Modified by PengYunQuan for resolving a NULL pointer access } @@ -158,7 +158,7 @@ BOOL Table::Insert( ULONG nKey, void* p ) { i = 0; if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND ) - return FALSE; + return sal_False; } } else @@ -171,15 +171,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 ) @@ -197,10 +197,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 ) @@ -211,10 +211,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 ) @@ -232,16 +232,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++; } @@ -251,14 +251,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" ); @@ -266,7 +266,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 @@ -275,18 +275,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; } } @@ -297,10 +297,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; @@ -313,12 +313,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 ) @@ -340,7 +340,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 94624c3ac905..020ae64dde95 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -41,8 +41,8 @@ |* *************************************************************************/ -UniqueIndex::UniqueIndex( ULONG _nStartIndex, - ULONG _nInitSize, ULONG _nReSize ) : +UniqueIndex::UniqueIndex( sal_uIntPtr _nStartIndex, + sal_uIntPtr _nInitSize, sal_uIntPtr _nReSize ) : Container( _nInitSize ) { nReSize = _nReSize; @@ -80,7 +80,7 @@ UniqueIndex::UniqueIndex( const UniqueIndex& rIdx ) : |* *************************************************************************/ -ULONG UniqueIndex::Insert( void* p ) +sal_uIntPtr UniqueIndex::Insert( void* p ) { // NULL-Pointer ist nicht erlaubt if ( !p ) @@ -116,13 +116,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 ); @@ -145,7 +145,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) && @@ -172,7 +172,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 ) @@ -198,7 +198,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) && @@ -218,9 +218,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 ) ) @@ -239,13 +239,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; @@ -263,7 +263,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) && @@ -271,12 +271,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; } /************************************************************************* @@ -289,7 +289,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 ) ) @@ -314,7 +314,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 ) @@ -434,15 +434,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; } /************************************************************************* |* @@ -458,7 +458,7 @@ UniqueIdContainer::UniqueIdContainer( const UniqueIdContainer& rObj ) : UniqueIndex( rObj ) , nCollectCount( rObj.nCollectCount ) { - ULONG nCur = GetCurIndex(); + sal_uIntPtr nCur = GetCurIndex(); ImpUniqueId * pEle = (ImpUniqueId *)First(); while( pEle ) @@ -484,7 +484,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 ) @@ -506,12 +506,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 ) @@ -525,7 +525,7 @@ void UniqueIdContainer::Clear( BOOL bAll ) else { pId = (ImpUniqueId *)Prev(); - bLast = FALSE; + bLast = sal_False; } } } @@ -544,7 +544,7 @@ UniqueItemId UniqueIdContainer::CreateId() { if( nCollectCount > 50 ) { // aufraeumen - Clear( FALSE ); + Clear( sal_False ); nCollectCount = 0; } nCollectCount++; @@ -565,7 +565,7 @@ UniqueItemId UniqueIdContainer::CreateId() |* *************************************************************************/ -UniqueItemId UniqueIdContainer::CreateFreeId( ULONG nId ) +UniqueItemId UniqueIdContainer::CreateFreeId( sal_uIntPtr nId ) { // Einfach erzeugen, fuer abgeleitete Klasse ImpUniqueId * pId = new ImpUniqueId; @@ -584,7 +584,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/rc/rc.cxx b/tools/source/rc/rc.cxx index e24b8f8824d4..f9a08a5525e6 100644 --- a/tools/source/rc/rc.cxx +++ b/tools/source/rc/rc.cxx @@ -65,16 +65,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() ); } // ======================================================================= @@ -86,12 +86,12 @@ 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() ); } diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index daeaf8e4c3a5..ff9f016c9aea 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -94,11 +94,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; @@ -111,9 +111,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: @@ -548,7 +548,7 @@ InternalResMgr::InternalResMgr( const OUString& rFileURL, : pContent( NULL ) , pStringBlock( NULL ) , pStm( NULL ) - , bEqual2Content( TRUE ) + , bEqual2Content( sal_True ) , nEntries( 0 ) , aFileName( rFileURL ) , aPrefix( rPrefix ) @@ -599,15 +599,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 ); /* @@ -621,15 +621,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 @@ -651,10 +651,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 ); @@ -666,7 +666,7 @@ BOOL InternalResMgr::Create() ::std::sort(pContent,pContent+nEntries,ImpContentLessCompare()); // qsort( pContent, nEntries, sizeof( ImpContent ), Compare ); - bDone = TRUE; + bDone = sal_True; } return bDone; @@ -674,7 +674,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); @@ -716,18 +716,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 { @@ -737,7 +737,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; } @@ -763,12 +763,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 ); @@ -783,7 +783,7 @@ UniString GetTypeRes_Impl( const ResId& rTypeId ) rTypeId.GetResMgr()->Increment( sizeof( RSHEADER_TYPE ) ); } } - bInUse = FALSE; + bInUse = sal_False; } return aTypStr; @@ -895,14 +895,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()); } } @@ -1069,11 +1069,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 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(); @@ -1096,7 +1096,7 @@ BOOL ResMgr::IsAvailable( const ResId& rId, const Resource* pResObj ) const if ( pClassRes ) { if ( pClassRes->GetRT() == nRT ) - bAvailable = TRUE; + bAvailable = sal_True; } } @@ -1121,7 +1121,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 aGuard( getResMgrMutex() ); @@ -1166,7 +1166,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 @@ -1212,12 +1212,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; } // ----------------------------------------------------------------------- @@ -1266,7 +1266,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 ) @@ -1318,7 +1318,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) ); @@ -1326,7 +1326,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) | @@ -1349,7 +1349,7 @@ 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 ); UniString aString( (sal_Char*)pStr, RTL_TEXTENCODING_UTF8, @@ -1360,7 +1360,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 ); @@ -1372,7 +1372,7 @@ sal_uInt32 ResMgr::GetString( UniString& rStr, const BYTE* pStr ) // ------------------------------------------------------------------ -sal_uInt32 ResMgr::GetStringSize( const BYTE* pStr ) +sal_uInt32 ResMgr::GetStringSize( const sal_uInt8* pStr ) { return GetStringSize( strlen( (const char*)pStr ) ); } @@ -1387,9 +1387,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); } // ----------------------------------------------------------------------- @@ -1405,7 +1405,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; @@ -1496,7 +1496,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(); @@ -1707,29 +1707,29 @@ ResMgr* ResMgr::SearchCreateResMgr( // ----------------------------------------------------------------------- -INT16 ResMgr::ReadShort() +sal_Int16 ResMgr::ReadShort() { osl::Guard 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 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; } @@ -1752,7 +1752,7 @@ UniString ResMgr::ReadStringWithoutHook() #endif } else - Increment( GetStringWithoutHook( aRet, (const BYTE*)GetClass() ) ); + Increment( GetStringWithoutHook( aRet, (const sal_uInt8*)GetClass() ) ); return aRet; } @@ -1767,7 +1767,7 @@ UniString ResMgr::ReadString() // ----------------------------------------------------------------------- -ULONG ResMgr::GetAutoHelpId() +sal_uIntPtr ResMgr::GetAutoHelpId() { osl::Guard aGuard( getResMgrMutex() ); @@ -1781,12 +1781,12 @@ ULONG ResMgr::GetAutoHelpId() 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(); + sal_uIntPtr nGID = pRC->pResource->GetId(); if( !nGID || nGID > 32767 ) return 0; - ULONG nHID = 0; + sal_uIntPtr nHID = 0; // GGGg gggg::gggg gggg::ggLL LLLl::llll llll switch( pRC->pResource->GetRT() ) { // maximal 7 @@ -1805,7 +1805,7 @@ ULONG ResMgr::GetAutoHelpId() if( nCurStack == 2 ) { pRC = StackTop(); - ULONG nLID = pRC->pResource->GetId(); + sal_uIntPtr nLID = pRC->pResource->GetId(); if( !nLID || nLID > 511 ) return 0; @@ -1975,8 +1975,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 @@ -2052,7 +2052,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 ) @@ -2069,6 +2069,6 @@ 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 2f9c75a4b71c..1587f7324556 100644 --- a/tools/source/ref/errinf.cxx +++ b/tools/source/ref/errinf.cxx @@ -49,11 +49,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(); @@ -62,12 +62,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; @@ -76,7 +76,7 @@ friend class ErrorInfo; EDcrData::EDcrData() { - for(USHORT n=0;nnNextDcr + 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"); @@ -127,8 +127,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; @@ -142,7 +142,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); @@ -150,12 +150,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; @@ -169,32 +169,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) { } @@ -205,8 +205,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&); }; @@ -267,19 +267,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] @@ -316,8 +316,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 @@ -326,7 +326,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; } @@ -379,12 +379,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] @@ -404,30 +404,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); @@ -443,7 +443,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) @@ -452,7 +452,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 2d45e470e688..7278ba47718f 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -52,7 +52,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 ) ); } @@ -75,10 +75,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_Int8 Data4[8]; }; SvGlobalName::SvGlobalName( const CLSID & rId ) { @@ -87,16 +87,16 @@ 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_Int8 b8, sal_Int8 b9, sal_Int8 b10, sal_Int8 b11, + sal_Int8 b12, sal_Int8 b13, sal_Int8 b14, sal_Int8 b15 ) { pImp = new ImpSvGlobalName(); pImp->nRefCount++; - *(UINT32 *)pImp->szData = n1; - *(USHORT *)&pImp->szData[ 4 ] = n2; - *(USHORT *)&pImp->szData[ 6 ] = n3; + *(sal_uInt32 *)pImp->szData = n1; + *(sal_uInt16 *)&pImp->szData[ 4 ] = n2; + *(sal_uInt16 *)&pImp->szData[ 6 ] = n3; pImp->szData[ 8 ] = b8; pImp->szData[ 9 ] = b9; pImp->szData[ 10 ] = b10; @@ -149,9 +149,9 @@ void SvGlobalName::NewImp() *************************************************************************/ SvStream& operator << ( SvStream& rOStr, const SvGlobalName & rObj ) { - rOStr << *(UINT32 *)rObj.pImp->szData; - rOStr << *(USHORT *)&rObj.pImp->szData[ 4 ]; - rOStr << *(USHORT *)&rObj.pImp->szData[ 6 ]; + rOStr << *(sal_uInt32 *)rObj.pImp->szData; + rOStr << *(sal_uInt16 *)&rObj.pImp->szData[ 4 ]; + rOStr << *(sal_uInt16 *)&rObj.pImp->szData[ 6 ]; rOStr.Write( (sal_Char *)&rObj.pImp->szData[ 8 ], 8 ); return rOStr; } @@ -159,9 +159,9 @@ SvStream& operator << ( SvStream& rOStr, const SvGlobalName & rObj ) SvStream& operator >> ( SvStream& rStr, SvGlobalName & rObj ) { rObj.NewImp(); // kopieren, falls noetig - rStr >> *(UINT32 *)rObj.pImp->szData; - rStr >> *(USHORT *)&rObj.pImp->szData[ 4 ]; - rStr >> *(USHORT *)&rObj.pImp->szData[ 6 ]; + rStr >> *(sal_uInt32 *)rObj.pImp->szData; + rStr >> *(sal_uInt16 *)&rObj.pImp->szData[ 4 ]; + rStr >> *(sal_uInt16 *)&rObj.pImp->szData[ 6 ]; rStr.Read( (sal_Char *)&rObj.pImp->szData[ 8 ], 8 ); return rStr; } @@ -170,41 +170,41 @@ 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; - else if( *(USHORT *)&pImp->szData[ 4 ] < *(USHORT *)&rObj.pImp->szData[ 4 ] ) - return TRUE; - else if( *(USHORT *)&pImp->szData[ 4 ] == *(USHORT *)&rObj.pImp->szData[ 4 ] ) - return *(UINT32 *)pImp->szData < *(UINT32 *)rObj.pImp->szData; + return sal_False; + else if( *(sal_uInt16 *)&pImp->szData[ 4 ] < *(sal_uInt16 *)&rObj.pImp->szData[ 4 ] ) + return sal_True; + else if( *(sal_uInt16 *)&pImp->szData[ 4 ] == *(sal_uInt16 *)&rObj.pImp->szData[ 4 ] ) + return *(sal_uInt32 *)pImp->szData < *(sal_uInt32 *)rObj.pImp->szData; else - return FALSE; + return sal_False; } /************************************************************************* |* SvGlobalName::operator +=() *************************************************************************/ -SvGlobalName & SvGlobalName::operator += ( UINT32 n ) +SvGlobalName & SvGlobalName::operator += ( sal_uInt32 n ) { NewImp(); - UINT32 nOld = (*(UINT32 *)pImp->szData); - (*(UINT32 *)pImp->szData) += n; - if( nOld > *(UINT32 *)pImp->szData ) + sal_uInt32 nOld = (*(sal_uInt32 *)pImp->szData); + (*(sal_uInt32 *)pImp->szData) += n; + if( nOld > *(sal_uInt32 *)pImp->szData ) // ueberlauf - (*(USHORT *)&pImp->szData[ 4 ])++; + (*(sal_uInt16 *)&pImp->szData[ 4 ])++; return *this; } /************************************************************************* |* SvGlobalName::operator ==() *************************************************************************/ -BOOL SvGlobalName::operator == ( const SvGlobalName & rObj ) const +sal_Bool SvGlobalName::operator == ( const SvGlobalName & rObj ) const { return *pImp == *rObj.pImp; } @@ -218,7 +218,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(); @@ -226,7 +226,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++ ) { @@ -236,11 +236,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++ ) { @@ -248,13 +248,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++ ) { @@ -262,13 +262,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++ ) @@ -277,22 +277,22 @@ 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++; } NewImp(); - *(UINT32 *)pImp->szData = nFirst; - *(USHORT *)&pImp->szData[ 4 ] = nSec; - *(USHORT *)&pImp->szData[ 6 ] = nThird; + *(sal_uInt32 *)pImp->szData = nFirst; + *(sal_uInt16 *)&pImp->szData[ 4 ] = nSec; + *(sal_uInt16 *)&pImp->szData[ 6 ] = nThird; memcpy( &pImp->szData[ 8 ], szRemain, 8 ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /************************************************************************* @@ -303,13 +303,13 @@ String SvGlobalName::GetctorName() const ByteString aRet; sal_Char buf[ 20 ]; - sprintf( buf, "0x%8.8lX", (ULONG)*(UINT32 *)pImp->szData ); + sprintf( buf, "0x%8.8lX", (sal_uIntPtr)*(sal_uInt32 *)pImp->szData ); aRet += buf; - USHORT i; + sal_uInt16 i; for( i = 4; i < 8; i += 2 ) { aRet += ','; - sprintf( buf, "0x%4.4X", *(USHORT *)&pImp->szData[ i ] ); + sprintf( buf, "0x%4.4X", *(sal_uInt16 *)&pImp->szData[ i ] ); aRet += buf; } for( i = 8; i < 16; i++ ) @@ -329,13 +329,13 @@ String SvGlobalName::GetHexName() const ByteString aRet; sal_Char buf[ 10 ]; - sprintf( buf, "%8.8lX", (ULONG)*(UINT32 *)pImp->szData ); + sprintf( buf, "%8.8lX", (sal_uIntPtr)*(sal_uInt32 *)pImp->szData ); aRet += buf; aRet += '-'; - USHORT i ; + sal_uInt16 i ; for( i = 4; i < 8; i += 2 ) { - sprintf( buf, "%4.4X", *(USHORT *)&pImp->szData[ i ] ); + sprintf( buf, "%4.4X", *(sal_uInt16 *)&pImp->szData[ i ] ); aRet += buf; aRet += '-'; } @@ -368,7 +368,7 @@ SvGlobalNameList::SvGlobalNameList() *************************************************************************/ SvGlobalNameList::~SvGlobalNameList() { - for( ULONG i = Count(); i > 0; i-- ) + for( sal_uIntPtr i = Count(); i > 0; i-- ) { ImpSvGlobalName * pImp = (ImpSvGlobalName *)aList.GetObject( i -1 ); pImp->nRefCount--; @@ -389,7 +389,7 @@ void SvGlobalNameList::Append( const SvGlobalName & rName ) /************************************************************************* |* SvGlobalNameList::GetObject() *************************************************************************/ -SvGlobalName SvGlobalNameList::GetObject( ULONG nPos ) +SvGlobalName SvGlobalNameList::GetObject( sal_uIntPtr nPos ) { return SvGlobalName( (ImpSvGlobalName *)aList.GetObject( nPos ) ); } @@ -397,14 +397,14 @@ SvGlobalName SvGlobalNameList::GetObject( ULONG nPos ) /************************************************************************* |* SvGlobalNameList::IsEntry() *************************************************************************/ -BOOL SvGlobalNameList::IsEntry( const SvGlobalName & rName ) +sal_Bool SvGlobalNameList::IsEntry( const SvGlobalName & rName ) { - for( ULONG i = Count(); i > 0; i-- ) + for( sal_uIntPtr i = Count(); i > 0; i-- ) { if( *rName.pImp == *(ImpSvGlobalName *)aList.GetObject( i -1 ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } com::sun::star::uno::Sequence < sal_Int8 > SvGlobalName::GetByteSequence() const @@ -413,14 +413,14 @@ com::sun::star::uno::Sequence < sal_Int8 > SvGlobalName::GetByteSequence() const // maybe transported remotely com::sun::star::uno::Sequence< sal_Int8 > aResult( 16 ); - aResult[0] = (sal_Int8) (*(UINT32 *)pImp->szData >> 24); - aResult[1] = (sal_Int8) ((*(UINT32 *)pImp->szData << 8 ) >> 24); - aResult[2] = (sal_Int8) ((*(UINT32 *)pImp->szData << 16 ) >> 24); - aResult[3] = (sal_Int8) ((*(UINT32 *)pImp->szData << 24 ) >> 24); - aResult[4] = (sal_Int8) (*(USHORT *)&pImp->szData[ 4 ] >> 8); - aResult[5] = (sal_Int8) ((*(USHORT *)&pImp->szData[ 4 ] << 8 ) >> 8); - aResult[6] = (sal_Int8) (*(USHORT *)&pImp->szData[ 6 ] >> 8); - aResult[7] = (sal_Int8) ((*(USHORT *)&pImp->szData[ 6 ] << 8 ) >> 8); + aResult[0] = (sal_Int8) (*(sal_uInt32 *)pImp->szData >> 24); + aResult[1] = (sal_Int8) ((*(sal_uInt32 *)pImp->szData << 8 ) >> 24); + aResult[2] = (sal_Int8) ((*(sal_uInt32 *)pImp->szData << 16 ) >> 24); + aResult[3] = (sal_Int8) ((*(sal_uInt32 *)pImp->szData << 24 ) >> 24); + aResult[4] = (sal_Int8) (*(sal_uInt16 *)&pImp->szData[ 4 ] >> 8); + aResult[5] = (sal_Int8) ((*(sal_uInt16 *)&pImp->szData[ 4 ] << 8 ) >> 8); + aResult[6] = (sal_Int8) (*(sal_uInt16 *)&pImp->szData[ 6 ] >> 8); + aResult[7] = (sal_Int8) ((*(sal_uInt16 *)&pImp->szData[ 6 ] << 8 ) >> 8); aResult[8] = pImp->szData[ 8 ]; aResult[9] = pImp->szData[ 9 ]; aResult[10] = pImp->szData[ 10 ]; diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx index e0412fd5d675..b2a5600075cc 100644 --- a/tools/source/ref/pstm.cxx +++ b/tools/source/ref/pstm.cxx @@ -37,7 +37,7 @@ /************************************************************************ |* SvClassManager::Register() *************************************************************************/ -void SvClassManager::Register( USHORT nClassId, SvCreateInstancePersist pFunc ) +void SvClassManager::Register( sal_uInt16 nClassId, SvCreateInstancePersist pFunc ) { #ifdef DBG_UTIL SvCreateInstancePersist p; @@ -50,7 +50,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; @@ -63,32 +63,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 ) ) @@ -100,7 +100,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 ); @@ -126,7 +126,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 ) @@ -135,13 +135,13 @@ SvPersistStream& operator >> ( SvPersistStream & rStm, DBG_ERROR( "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; @@ -168,7 +168,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. */ ) @@ -187,7 +187,7 @@ SvPersistStream::SvPersistStream */ { DBG_ASSERT( nStartIdx != 0, "zero index not allowed" ); - bIsWritable = TRUE; + bIsWritable = sal_True; if( pStm ) { SetVersion( pStm->GetVersion() ); @@ -225,7 +225,7 @@ SvPersistStream::SvPersistStream wenn das erste aus dieser Hierarchie benutzt werden soll. */ { - bIsWritable = TRUE; + bIsWritable = sal_True; if( pStm ) { SetVersion( pStm->GetVersion() ); @@ -279,14 +279,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] @@ -311,10 +311,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; } @@ -322,10 +322,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; } @@ -333,10 +333,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; } @@ -351,15 +351,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; @@ -368,9 +368,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; @@ -379,7 +379,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 ); @@ -393,7 +393,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 */ @@ -405,14 +405,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; @@ -430,7 +430,7 @@ UINT32 SvPersistStream::ReadCompressed rStm >> nMask; nRet |= nMask; nRet <<= 16; - USHORT n; + sal_uInt16 n; rStm >> n; nRet |= n; } @@ -456,7 +456,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] @@ -474,30 +474,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 @@ -505,11 +505,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 ... @@ -522,13 +522,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(); } @@ -536,20 +536,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 ... @@ -561,19 +561,19 @@ void SvPersistStream::WriteLen , */ { - 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. */ ) @@ -583,7 +583,7 @@ UINT32 SvPersistStream::ReadLen und geschrieben wurde. */ { - UINT32 nLen; + sal_uInt32 nLen; *this >> nLen; if( pTestPos ) *pTestPos = Tell(); @@ -593,15 +593,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 @@ -611,9 +611,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 @@ -624,12 +624,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; } } @@ -646,9 +646,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; @@ -668,19 +668,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(); @@ -698,17 +698,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() ); @@ -723,15 +723,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 ); @@ -751,7 +751,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 ) @@ -772,9 +772,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" ); } @@ -809,7 +809,7 @@ SvPersistStream& SvPersistStream::ReadPointer SvPersistBase * & rpObj ) { - ReadObj( rpObj, TRUE ); + ReadObj( rpObj, sal_True ); return *this; } @@ -843,14 +843,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 ); @@ -870,23 +870,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 - UINT32 nId = rThis.ReadObj( pEle, FALSE ); + sal_uInt32 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 @@ -897,19 +897,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/stream/cachestr.cxx b/tools/source/stream/cachestr.cxx index 0233dc25fb52..17270048fcf4 100644 --- a/tools/source/stream/cachestr.cxx +++ b/tools/source/stream/cachestr.cxx @@ -43,13 +43,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; @@ -66,8 +66,8 @@ SvCacheStream::SvCacheStream( ULONG nMaxMemSize ) *************************************************************************/ SvCacheStream::SvCacheStream( const String &rFileName, - ULONG nExpectedSize, - ULONG nMaxMemSize ) + sal_uIntPtr nExpectedSize, + sal_uIntPtr nMaxMemSize ) { if( !nMaxMemSize ) nMaxMemSize = 20480; @@ -77,9 +77,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 ); @@ -105,7 +105,7 @@ SvCacheStream::~SvCacheStream() if( pSwapStream && !bPersistent && pTempFile ) { // temporaeres File loeschen - pTempFile->EnableKillingFile( TRUE ); + pTempFile->EnableKillingFile( sal_True ); } delete pTempFile; @@ -145,7 +145,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 ); @@ -167,7 +167,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 ); } @@ -182,7 +182,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 @@ -201,7 +201,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 ); } @@ -253,7 +253,7 @@ const void* SvCacheStream::GetBuffer() |* *************************************************************************/ -void SvCacheStream::SetSize( ULONG nSize ) +void SvCacheStream::SetSize( sal_uIntPtr nSize ) { pCurrentStream->SetStreamSize( nSize ); } @@ -268,13 +268,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 9fdef8436f1a..6e1a6401b7a0 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -101,7 +101,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 { @@ -144,7 +144,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) );\ @@ -420,7 +420,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 @@ -431,9 +431,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; @@ -536,7 +536,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 } @@ -609,8 +609,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 ) @@ -633,11 +633,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; } /************************************************************************* @@ -678,7 +678,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; @@ -694,8 +694,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; @@ -707,7 +707,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' @@ -727,7 +727,7 @@ sal_Bool SvStream::ReadLine( ByteString& rStr ) } if ( !bEnd && !GetError() && rStr.Len() ) - bEnd = TRUE; + bEnd = sal_True; nOldFilePos += nTotalLen; if( Tell() > nOldFilePos ) @@ -745,14 +745,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; @@ -771,8 +771,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; @@ -786,7 +786,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' @@ -806,7 +806,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 ) @@ -824,7 +824,7 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr ) } if ( bEnd ) - bIsEof = FALSE; + bIsEof = sal_False; return bEnd; } @@ -848,7 +848,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() ) @@ -1032,7 +1032,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 @@ -1375,7 +1375,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) ); @@ -1396,7 +1396,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) ); @@ -1415,7 +1415,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) ); @@ -1616,7 +1616,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 ? @@ -1661,10 +1661,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; @@ -1712,7 +1712,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount ) nBufActualLen = nBufActualPos; pBufPos += nCount; - bIsDirty = TRUE; + bIsDirty = sal_True; } else { @@ -1724,7 +1724,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 ? @@ -1752,7 +1752,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; @@ -1774,7 +1774,7 @@ sal_Size SvStream::Seek( sal_Size nFilePos ) { eIOMode = STREAM_IO_DONTKNOW; - bIsEof = FALSE; + bIsEof = sal_False; if( !pRWBuf ) { nBufFilePos = SeekPos( nFilePos ); @@ -1800,7 +1800,7 @@ sal_Size SvStream::Seek( sal_Size nFilePos ) CryptAndWriteBuffer( pRWBuf, nBufActualLen ); else PutData( pRWBuf, nBufActualLen ); - bIsDirty = FALSE; + bIsDirty = sal_False; } nBufActualLen = 0; nBufActualPos = 0; @@ -1836,7 +1836,7 @@ void SvStream::Flush() else if( PutData( pRWBuf, nBufActualLen ) != nBufActualLen ) SetError( SVSTREAM_WRITE_ERROR ); - bIsDirty = FALSE; + bIsDirty = sal_False; } if( bIsWritable ) FlushData(); @@ -1880,9 +1880,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 @@ -1911,7 +1911,7 @@ SvStream& SvStream::PutBack( char aCh ) *pRWBuf = aCh; } eIOMode = STREAM_IO_DONTKNOW; - bIsEof = FALSE; + bIsEof = sal_False; return *this; } @@ -1954,7 +1954,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 ); @@ -1962,7 +1962,7 @@ void SvStream::RefreshBuffer() nError = ERRCODE_NONE; if( nCryptMask ) EncryptBuffer(pRWBuf, (sal_Size)nBufActualLen); - bIsConsistent = TRUE; + bIsConsistent = sal_True; eIOMode = STREAM_IO_DONTKNOW; } @@ -2038,7 +2038,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; } @@ -2063,7 +2063,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; } @@ -2088,7 +2088,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; } @@ -2251,7 +2251,7 @@ sal_Bool SvStream::EncryptBuffer(void* pStart, sal_Size nLen) aCh ^= nMask; *pTemp = aCh; } - return TRUE; + return sal_True; } /************************************************************************* @@ -2432,12 +2432,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; @@ -2456,8 +2456,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; @@ -2535,7 +2535,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; @@ -2723,7 +2723,7 @@ void SvMemoryStream::ResetError() sal_Bool SvMemoryStream::AllocateMemory( sal_Size nNewSize ) { - pBuf = new BYTE[nNewSize]; + pBuf = new sal_uInt8[nNewSize]; return( pBuf != 0 ); } @@ -2739,18 +2739,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 ); @@ -2772,7 +2772,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 d211d7790b08..e7f760919a9a 100644 --- a/tools/source/stream/strmos2.cxx +++ b/tools/source/stream/strmos2.cxx @@ -59,20 +59,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 }, @@ -93,7 +93,7 @@ ULONG GetSvError( APIRET nPMError ) { 0xFFFF, SVSTREAM_GENERALERROR } }; - ULONG nRetVal = SVSTREAM_GENERALERROR; // Standardfehler + sal_uIntPtr nRetVal = SVSTREAM_GENERALERROR; // Standardfehler int i=0; do { @@ -120,9 +120,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 ); @@ -146,9 +146,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 ); } @@ -180,9 +180,9 @@ SvFileStream::~SvFileStream() |* *************************************************************************/ -ULONG SvFileStream::GetFileHandle() const +sal_uIntPtr SvFileStream::GetFileHandle() const { - return (ULONG)pInstanceData->hFile; + return (sal_uIntPtr)pInstanceData->hFile; } /************************************************************************* @@ -195,7 +195,7 @@ ULONG SvFileStream::GetFileHandle() const |* *************************************************************************/ -USHORT SvFileStream::IsA() const +sal_uInt16 SvFileStream::IsA() const { return ID_FILESTREAM; } @@ -210,7 +210,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(): " ); @@ -220,7 +220,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize ) DBG_TRACE( aTraceStr.GetBuffer() ); #endif - ULONG nCount = 0L; + sal_uIntPtr nCount = 0L; if( IsOpen() ) { APIRET nResult; @@ -241,7 +241,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: " ); @@ -251,7 +251,7 @@ ULONG SvFileStream::PutData( const void* pData, ULONG nSize ) DBG_TRACE( aTraceStr.GetBuffer() ); #endif - ULONG nCount = 0L; + sal_uIntPtr nCount = 0L; if( IsOpen() ) { APIRET nResult; @@ -274,9 +274,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; @@ -306,9 +306,9 @@ ULONG SvFileStream::SeekPos( ULONG nPos ) |* *************************************************************************/ /* -ULONG SvFileStream::Tell() +sal_uIntPtr SvFileStream::Tell() { - ULONG nPos = 0L; + sal_uIntPtr nPos = 0L; if( IsOpen() ) { @@ -352,9 +352,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; @@ -373,7 +373,7 @@ sal_Bool SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes ) if( nResult ) SetError(::GetSvError(nResult) ); else - bRetVal = TRUE; + bRetVal = sal_True; } return bRetVal; } @@ -388,9 +388,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; @@ -409,7 +409,7 @@ sal_Bool SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes ) if( nResult ) SetError(::GetSvError(nResult) ); else - bRetVal = TRUE; + bRetVal = sal_True; } return bRetVal; } @@ -426,19 +426,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; } @@ -455,7 +455,7 @@ sal_Bool SvFileStream::LockFile() sal_Bool SvFileStream::UnlockFile() { - sal_Bool bRetVal = FALSE; + sal_Bool bRetVal = sal_False; if( nLockCounter > 0) { if( nLockCounter == 1) @@ -463,13 +463,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; @@ -486,7 +486,7 @@ sal_Bool SvFileStream::UnlockFile() *************************************************************************/ #if 0 -BOOL createLongNameEA ( const PCSZ pszPath, ULONG ulAttributes, const String& aLongName ); +sal_Bool createLongNameEA ( const PCSZ pszPath, sal_uIntPtr ulAttributes, const String& aLongName ); #endif void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode ) @@ -500,7 +500,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode ) String aRealPart; String aVirtualPath; ItemIDPath aVirtualURL; - ULONG nDivider = 0; + sal_uIntPtr nDivider = 0; String aVirtualString(rFilename); @@ -534,10 +534,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 @@ -592,7 +592,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode ) // // resolves long FAT names used by OS2 // - BOOL bIsLongOS2=FALSE; + sal_Bool bIsLongOS2=sal_False; if (Folder::IsAvailable()) { DirEntry aDirEntry(rFilename); @@ -601,7 +601,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode ) // in kurzen Pfad wandeln ItemIDPath aItemIDPath(rFilename); aParsedFilename = aItemIDPath.GetHostNotationPath(); - bIsLongOS2 = TRUE; + bIsLongOS2 = sal_True; } } #endif @@ -623,7 +623,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, @@ -641,15 +641,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; } #if 0 @@ -714,10 +714,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(); } @@ -747,7 +747,7 @@ void SvFileStream::ResetError() |* *************************************************************************/ -void SvFileStream::SetSize( ULONG nSize ) +void SvFileStream::SetSize( sal_uIntPtr nSize ) { if( IsOpen() ) { @@ -768,7 +768,7 @@ void SvFileStream::SetSize( ULONG nSize ) |* *************************************************************************/ -sal_Bool SvSharedMemoryStream::AllocateMemory( ULONG nNewSize ) +sal_Bool SvSharedMemoryStream::AllocateMemory( sal_uIntPtr nNewSize ) { DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2"); DBG_ASSERT(nNewSize,"Cannot allocate zero Bytes"); @@ -791,8 +791,8 @@ sal_Bool SvSharedMemoryStream::AllocateMemory( ULONG nNewSize ) sal_Bool SvSharedMemoryStream::ReAllocateMemory( long nDiff ) { DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2"); - sal_Bool bRetVal = FALSE; - ULONG nNewSize = nSize + nDiff; + sal_Bool bRetVal = sal_False; + sal_uIntPtr nNewSize = nSize + nDiff; if( nNewSize ) { // neuen Speicher nicht ueber AllocateMemory holen, da wir den @@ -806,7 +806,7 @@ sal_Bool SvSharedMemoryStream::ReAllocateMemory( long nDiff ) if( !nRet ) { - bRetVal = TRUE; // Success! + bRetVal = sal_True; // Success! if( nNewSize < nSize ) // Verkleinern ? { memcpy( pNewBuf, pBuf, (size_t)nNewSize ); @@ -827,7 +827,7 @@ sal_Bool SvSharedMemoryStream::ReAllocateMemory( long nDiff ) } else { - bRetVal = TRUE; + bRetVal = sal_True; FreeMemory(); pBuf = 0; nSize = 0; diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index 88ccb2113e0d..346c408d7f82 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -123,7 +123,7 @@ sal_Bool InternalStreamLock::LockFile( sal_Size nStart, sal_Size nEnd, SvFileStr InternalStreamLock* pLock = NULL; InternalStreamLockList &rLockList = LockList::get(); - for( ULONG i = 0; i < rLockList.Count(); ++i ) + for( sal_uIntPtr i = 0; i < rLockList.Count(); ++i ) { pLock = rLockList.GetObject( i ); if( aStat.st_ino == pLock->m_aStat.st_ino ) @@ -167,7 +167,7 @@ void InternalStreamLock::UnlockFile( sal_Size nStart, sal_Size nEnd, SvFileStrea InternalStreamLockList &rLockList = LockList::get(); if( nStart == 0 && nEnd == 0 ) { - for( ULONG i = 0; i < rLockList.Count(); ++i ) + for( sal_uIntPtr i = 0; i < rLockList.Count(); ++i ) { if( ( pLock = rLockList.GetObject( i ) )->m_pStream == pStream ) { @@ -177,7 +177,7 @@ void InternalStreamLock::UnlockFile( sal_Size nStart, sal_Size nEnd, SvFileStrea } return; } - for( ULONG i = 0; i < rLockList.Count(); ++i ) + for( sal_uIntPtr i = 0; i < rLockList.Count(); ++i ) { if( ( pLock = rLockList.GetObject( i ) )->m_pStream == pStream && nStart == pLock->m_nStartPos && nEnd == pLock->m_nEndPos ) diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx index d9e7da92296b..20443e268964 100644 --- a/tools/source/stream/strmwnt.cxx +++ b/tools/source/stream/strmwnt.cxx @@ -63,9 +63,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 }, @@ -105,7 +105,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 { @@ -131,9 +131,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 ); @@ -157,9 +157,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 ); @@ -192,9 +192,9 @@ SvFileStream::~SvFileStream() |* *************************************************************************/ -ULONG SvFileStream::GetFileHandle() const +sal_uIntPtr SvFileStream::GetFileHandle() const { - return (ULONG)pInstanceData->hFile; + return (sal_uIntPtr)pInstanceData->hFile; } /************************************************************************* @@ -207,7 +207,7 @@ ULONG SvFileStream::GetFileHandle() const |* *************************************************************************/ -USHORT SvFileStream::IsA() const +sal_uInt16 SvFileStream::IsA() const { return ID_FILESTREAM; } @@ -222,7 +222,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() ) @@ -230,7 +230,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 ) ); } } @@ -247,7 +247,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() ) @@ -268,7 +268,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() ) @@ -287,7 +287,7 @@ ULONG SvFileStream::SeekPos( ULONG nPos ) } else SetError( SVSTREAM_GENERALERROR ); - return (ULONG)nNewPos; + return (sal_uIntPtr)nNewPos; } /************************************************************************* @@ -300,9 +300,9 @@ ULONG SvFileStream::SeekPos( ULONG nPos ) |* *************************************************************************/ /* -ULONG SvFileStream::Tell() +sal_uIntPtr SvFileStream::Tell() { - ULONG nPos = 0L; + sal_uIntPtr nPos = 0L; if( IsOpen() ) { @@ -347,7 +347,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() ) @@ -369,7 +369,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() ) @@ -391,21 +391,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; } @@ -420,9 +420,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) @@ -430,13 +430,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; @@ -555,7 +555,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); @@ -580,15 +580,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 ); } @@ -631,9 +631,9 @@ void SvFileStream::Close() Flush(); CloseHandle( pInstanceData->hFile ); } - bIsOpen = FALSE; + bIsOpen = sal_False; nLockCounter= 0; - bIsWritable = FALSE; + bIsWritable = sal_False; SvStream::ClearBuffer(); SvStream::ClearError(); } @@ -663,24 +663,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 8430eb17659b..fcbab9b98826 100644 --- a/tools/source/stream/vcompat.cxx +++ b/tools/source/stream/vcompat.cxx @@ -36,7 +36,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 ) @@ -64,7 +64,7 @@ VersionCompat::~VersionCompat() { if( STREAM_WRITE == mnStmMode ) { - const UINT32 nEndPos = mpRWStm->Tell(); + const sal_uInt32 nEndPos = mpRWStm->Tell(); mpRWStm->Seek( mnCompatPos ); *mpRWStm << ( nEndPos - mnTotalSize ); @@ -72,7 +72,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/strascii.cxx b/tools/source/string/strascii.cxx index 775e1ca7f142..e47517d93412 100644 --- a/tools/source/string/strascii.cxx +++ b/tools/source/string/strascii.cxx @@ -31,17 +31,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 @@ -504,7 +504,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 ), @@ -515,7 +515,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 ), @@ -526,7 +526,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 ); @@ -542,7 +542,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 ef55dee5bfe2..ce5c7ecdcad0 100644 --- a/tools/source/string/strcvt.cxx +++ b/tools/source/string/strcvt.cxx @@ -227,7 +227,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(); @@ -353,7 +353,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 ) @@ -409,7 +409,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 ); @@ -442,7 +442,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) ) @@ -480,7 +480,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]; @@ -530,7 +530,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 34038c576aa0..8712733c0851 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -1141,7 +1141,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 @@ -1164,7 +1164,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 @@ -1327,18 +1327,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); @@ -1346,7 +1346,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 ); @@ -1355,18 +1355,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); @@ -1374,7 +1374,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 ); @@ -1383,7 +1383,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 ); @@ -1395,7 +1395,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); } @@ -1405,7 +1405,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 ); @@ -1418,7 +1418,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 ); @@ -1430,7 +1430,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); } @@ -1440,7 +1440,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 5237b24948a7..f1f023a90502 100644 --- a/tools/source/string/tenccvt.cxx +++ b/tools/source/string/tenccvt.cxx @@ -84,14 +84,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 f2525e3bca84..734e729ceccb 100644 --- a/tools/source/string/tstring.cxx +++ b/tools/source/string/tstring.cxx @@ -188,7 +188,7 @@ double ByteString::ToDouble() const // ----------------------------------------------------------------------- -BOOL ByteString::IsLowerAscii() const +sal_Bool ByteString::IsLowerAscii() const { DBG_CHKTHIS( ByteString, DbgCheckByteString ); @@ -198,18 +198,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 ); @@ -219,18 +219,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 ); @@ -241,18 +241,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 ); @@ -262,18 +262,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 ); @@ -285,11 +285,11 @@ 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; } diff --git a/tools/source/testtoolloader/testtoolloader.cxx b/tools/source/testtoolloader/testtoolloader.cxx index ca269ef6eea2..d713ff94e2cc 100644 --- a/tools/source/testtoolloader/testtoolloader.cxx +++ b/tools/source/testtoolloader/testtoolloader.cxx @@ -137,7 +137,7 @@ void InitTestToolLib() if ( pInitFunc ) { (reinterpret_cast< pfunc_CreateEventLogger >(pInitFunc))(); - bLoggerStarted = TRUE; + bLoggerStarted = sal_True; } else { @@ -174,7 +174,7 @@ void DeInitTestToolLib() if ( pDeInitFunc ) { (reinterpret_cast< pfunc_DestroyEventLogger >(pDeInitFunc))(); - bLoggerStarted = FALSE; + bLoggerStarted = sal_False; } } diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index f4f62162854a..cf62c02e0c29 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -60,7 +60,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; @@ -87,11 +87,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; @@ -146,8 +146,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 ) { @@ -155,7 +155,7 @@ long ZCodec::Compress( SvStream& rIStm, SvStream& rOStm ) ImplWriteBack(); if ( deflate( PZSTREAM, Z_NO_FLUSH ) < 0 ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } }; @@ -167,7 +167,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 ) @@ -177,8 +177,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 { @@ -196,7 +196,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm ) err = inflate( PZSTREAM, Z_NO_FLUSH ); if ( err < 0 ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } @@ -205,18 +205,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; @@ -229,7 +229,7 @@ long ZCodec::Write( SvStream& rOStm, const BYTE* pData, ULONG nSize ) if ( deflate( PZSTREAM, Z_NO_FLUSH ) < 0 ) { - mbStatus = FALSE; + mbStatus = sal_False; break; } } @@ -238,10 +238,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; @@ -249,7 +249,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; @@ -278,17 +278,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; @@ -296,7 +296,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; @@ -306,9 +306,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 ) { @@ -337,7 +337,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); } @@ -346,7 +346,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 ) { @@ -359,35 +359,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 ) { @@ -396,19 +396,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 */ @@ -439,13 +439,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 { @@ -455,14 +455,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 @@ -473,14 +473,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/unotools/inc/unotools/accelcfg.hxx b/unotools/inc/unotools/accelcfg.hxx index a1884d34fbc3..5f0fcc61f9c4 100644 --- a/unotools/inc/unotools/accelcfg.hxx +++ b/unotools/inc/unotools/accelcfg.hxx @@ -78,7 +78,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/accessiblerelationsethelper.hxx b/unotools/inc/unotools/accessiblerelationsethelper.hxx index ba853381329f..c78bc0f34e84 100644 --- a/unotools/inc/unotools/accessiblerelationsethelper.hxx +++ b/unotools/inc/unotools/accessiblerelationsethelper.hxx @@ -107,8 +107,8 @@ public: AccessibleRelationType. @return - Returns if there is a (at least one) relation of the - given type and if there is no such relation in the set. + Returns if there is a (at least one) relation of the + given type and if there is no such relation in the set. */ virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType ) throw (::com::sun::star::uno::RuntimeException); diff --git a/unotools/inc/unotools/accessiblestatesethelper.hxx b/unotools/inc/unotools/accessiblestatesethelper.hxx index 3847beeee146..ca9a0e277556 100644 --- a/unotools/inc/unotools/accessiblestatesethelper.hxx +++ b/unotools/inc/unotools/accessiblestatesethelper.hxx @@ -86,8 +86,8 @@ public: /** Checks whether the current state set is empty. @return - Returns if there is no state in this state set and - if there is at least one state set in it. + Returns if there is no state in this state set and + if there is at least one state set in it. */ virtual sal_Bool SAL_CALL isEmpty () throw (::com::sun::star::uno::RuntimeException); @@ -100,8 +100,8 @@ public: the constants of AccessibleStateType. @return - Returns if the given state is a memeber of this object's - state set and otherwise. + Returns if the given state is a memeber of this object's + state set and otherwise. */ virtual sal_Bool SAL_CALL contains (sal_Int16 aState) throw (::com::sun::star::uno::RuntimeException); @@ -116,8 +116,8 @@ public: constants of AccessibleStateType. @return - Returns if all states of the given state set are members - of this object's state set. is returned if at least + Returns if all states of the given state set are members + of this object's state set. is returned if at least one of the states in the given state is not a member of this object's state set. */ diff --git a/unotools/inc/unotools/componentresmodule.hxx b/unotools/inc/unotools/componentresmodule.hxx index 0fe4e126ea74..079af63e9b4a 100644 --- a/unotools/inc/unotools/componentresmodule.hxx +++ b/unotools/inc/unotools/componentresmodule.hxx @@ -80,7 +80,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() ) { } }; //==================================================================== @@ -119,7 +119,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/configitem.hxx b/unotools/inc/unotools/configitem.hxx index d1477cba1b74..dd314ba3ba64 100644 --- a/unotools/inc/unotools/configitem.hxx +++ b/unotools/inc/unotools/configitem.hxx @@ -174,7 +174,7 @@ namespace utl
  • in: the base to use when calculating a new name
  • out: an unused element name
- @return if a free name could be generated + @return if a free name could be generated */ sal_Bool getUniqueSetElementName( const rtl::OUString& _rSetNode, rtl::OUString& _rBaseName); diff --git a/unotools/inc/unotools/configpathes.hxx b/unotools/inc/unotools/configpathes.hxx index 2a1e76abf1fc..c2d99bb54343 100644 --- a/unotools/inc/unotools/configpathes.hxx +++ b/unotools/inc/unotools/configpathes.hxx @@ -60,8 +60,8 @@ namespace utl configuration path, this is set to _sInPath. @returns - , if a parent path could be set - , if the path was a one-level path or an invalid path + , if a parent path could be set + , if the path was a one-level path or an invalid path */ UNOTOOLS_DLLPUBLIC sal_Bool splitLastFromConfigurationPath(::rtl::OUString const& _sInPath, @@ -101,9 +101,9 @@ namespace utl which is disregarded. @returns - , if _sPrefixPath is a prefix of _sNestedPath; - otherwise.
- If both pathes are equal is returned. + , if _sPrefixPath is a prefix of _sNestedPath; + otherwise.
+ If both pathes are equal is returned. */ sal_Bool isPrefixOfConfigurationPath(::rtl::OUString const& _sNestedPath, diff --git a/unotools/inc/unotools/configvaluecontainer.hxx b/unotools/inc/unotools/configvaluecontainer.hxx index a66ca4cb753a..3fd4feecc259 100644 --- a/unotools/inc/unotools/configvaluecontainer.hxx +++ b/unotools/inc/unotools/configvaluecontainer.hxx @@ -187,14 +187,14 @@ namespace utl

The current values in memory (your exchange locations registered using the registerXXX methods) is forwarded to their respective configuration nodes.

-

Note that calling write(commit().

+

Note that calling write(commit().

@precond The access must have been created for update access @param _bCommit - If set to , an automatic commit is done after the values have been synchronized.
- If set to , you must explicitly call commit to make your changes persistent. + If set to , an automatic commit is done after the values have been synchronized.
+ If set to , you must explicitly call commit to make your changes persistent. @see read @see commit @@ -203,15 +203,15 @@ namespace utl /** commits any changes done -

Note that calling write(commit().

+

Note that calling write(commit().

@precond The access must have been created for update access @param _bWrite - If , the current values in the exchange locations are written to the configuration nodes + If , the current values in the exchange locations are written to the configuration nodes before the changes are committed.
- If , only the current values in the config nodes (as present since the last call to + If , only the current values in the config nodes (as present since the last call to write) are committed. */ void commit( sal_Bool _bWrite = sal_True ); diff --git a/unotools/inc/unotools/defaultoptions.hxx b/unotools/inc/unotools/defaultoptions.hxx index ecd6b7928629..f4c10f0b9e09 100644 --- a/unotools/inc/unotools/defaultoptions.hxx +++ b/unotools/inc/unotools/defaultoptions.hxx @@ -47,7 +47,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 633c12c4c99c..8737c9763289 100644 --- a/unotools/inc/unotools/fontcfg.hxx +++ b/unotools/inc/unotools/fontcfg.hxx @@ -118,38 +118,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_uIntPtr)0x00000001) +#define IMPL_FONT_ATTR_STANDARD ((sal_uIntPtr)0x00000002) +#define IMPL_FONT_ATTR_NORMAL ((sal_uIntPtr)0x00000004) +#define IMPL_FONT_ATTR_SYMBOL ((sal_uIntPtr)0x00000008) +#define IMPL_FONT_ATTR_FIXED ((sal_uIntPtr)0x00000010) +#define IMPL_FONT_ATTR_SANSSERIF ((sal_uIntPtr)0x00000020) +#define IMPL_FONT_ATTR_SERIF ((sal_uIntPtr)0x00000040) +#define IMPL_FONT_ATTR_DECORATIVE ((sal_uIntPtr)0x00000080) +#define IMPL_FONT_ATTR_SPECIAL ((sal_uIntPtr)0x00000100) +#define IMPL_FONT_ATTR_ITALIC ((sal_uIntPtr)0x00000200) +#define IMPL_FONT_ATTR_TITLING ((sal_uIntPtr)0x00000400) +#define IMPL_FONT_ATTR_CAPITALS ((sal_uIntPtr)0x00000800) +#define IMPL_FONT_ATTR_CJK ((sal_uIntPtr)0x00001000) +#define IMPL_FONT_ATTR_CJK_JP ((sal_uIntPtr)0x00002000) +#define IMPL_FONT_ATTR_CJK_SC ((sal_uIntPtr)0x00004000) +#define IMPL_FONT_ATTR_CJK_TC ((sal_uIntPtr)0x00008000) +#define IMPL_FONT_ATTR_CJK_KR ((sal_uIntPtr)0x00010000) +#define IMPL_FONT_ATTR_CTL ((sal_uIntPtr)0x00020000) +#define IMPL_FONT_ATTR_NONELATIN ((sal_uIntPtr)0x00040000) +#define IMPL_FONT_ATTR_FULL ((sal_uIntPtr)0x00080000) +#define IMPL_FONT_ATTR_OUTLINE ((sal_uIntPtr)0x00100000) +#define IMPL_FONT_ATTR_SHADOW ((sal_uIntPtr)0x00200000) +#define IMPL_FONT_ATTR_ROUNDED ((sal_uIntPtr)0x00400000) +#define IMPL_FONT_ATTR_TYPEWRITER ((sal_uIntPtr)0x00800000) +#define IMPL_FONT_ATTR_SCRIPT ((sal_uIntPtr)0x01000000) +#define IMPL_FONT_ATTR_HANDWRITING ((sal_uIntPtr)0x02000000) +#define IMPL_FONT_ATTR_CHANCERY ((sal_uIntPtr)0x04000000) +#define IMPL_FONT_ATTR_COMIC ((sal_uIntPtr)0x08000000) +#define IMPL_FONT_ATTR_BRUSHSCRIPT ((sal_uIntPtr)0x10000000) +#define IMPL_FONT_ATTR_GOTHIC ((sal_uIntPtr)0x20000000) +#define IMPL_FONT_ATTR_SCHOOLBOOK ((sal_uIntPtr)0x40000000) +#define IMPL_FONT_ATTR_OTHERSTYLE ((sal_uIntPtr)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) @@ -219,7 +219,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_uIntPtr& rType ); }; } // namespace utl diff --git a/unotools/inc/unotools/fontcvt.hxx b/unotools/inc/unotools/fontcvt.hxx index 333ee36e706d..caf7df5c2e77 100644 --- a/unotools/inc/unotools/fontcvt.hxx +++ b/unotools/inc/unotools/fontcvt.hxx @@ -35,12 +35,12 @@ // - FontToSubsFont - // ------------------ -#define FONTTOSUBSFONT_IMPORT ((ULONG)0x00000001) -#define FONTTOSUBSFONT_EXPORT ((ULONG)0x00000002) -#define FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ((ULONG)0x00000004) +#define FONTTOSUBSFONT_IMPORT ((sal_uIntPtr)0x00000001) +#define FONTTOSUBSFONT_EXPORT ((sal_uIntPtr)0x00000002) +#define FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ((sal_uIntPtr)0x00000004) typedef void* FontToSubsFontConverter; -UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( const String& rFontName, ULONG nFlags ); +UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( const String& rFontName, sal_uIntPtr 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 12868aabe525..3fe59e895f25 100644 --- a/unotools/inc/unotools/fontdefs.hxx +++ b/unotools/inc/unotools/fontdefs.hxx @@ -40,12 +40,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_uIntPtr)0x00000001) +#define SUBSFONT_MS ((sal_uIntPtr)0x00000002) +#define SUBSFONT_PS ((sal_uIntPtr)0x00000004) +#define SUBSFONT_HTML ((sal_uIntPtr)0x00000008) -UNOTOOLS_DLLPUBLIC String GetSubsFontName( const String& rName, ULONG nFlags ); +UNOTOOLS_DLLPUBLIC String GetSubsFontName( const String& rName, sal_uIntPtr nFlags ); // ----------------- // - FontTokenName - @@ -79,29 +79,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 e35f4cc9268f..1ccc85b55037 100644 --- a/unotools/inc/unotools/intlwrapper.hxx +++ b/unotools/inc/unotools/intlwrapper.hxx @@ -69,7 +69,7 @@ private: void ImplNewCharClass() const; void ImplNewLocaleData() const; void ImplNewCalendar() const; - void ImplNewCollator( BOOL bCaseSensitive ) const; + void ImplNewCollator( sal_Bool bCaseSensitive ) const; public: @@ -108,14 +108,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 9a26bdd73021..affba64d9377 100755 --- a/unotools/inc/unotools/lingucfg.hxx +++ b/unotools/inc/unotools/lingucfg.hxx @@ -52,89 +52,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(); }; @@ -196,29 +196,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 fd09b07e58cb..587029b1c2c0 100644 --- a/unotools/inc/unotools/localedatawrapper.hxx +++ b/unotools/inc/unotools/localedatawrapper.hxx @@ -65,7 +65,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; @@ -81,11 +81,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 @@ -119,8 +119,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(); @@ -242,19 +242,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 MUST have loaded a calendar. @@ -262,14 +262,14 @@ public: 0 := abbreviated name 1 := full name @param bDayOfMonthWithLeadingZero - := without leading zero - := with leading zero if <10 + := without leading zero + := with leading zero if <10 @param nDisplayMonth 0 := abbreviated name 1 := full name @param bTwoDigitYear - := full year - := year % 100 + := full year + := year % 100 */ String getLongDate( const Date& rDate, CalendarWrapper& rCal, @@ -283,37 +283,37 @@ public: @param nNumber value * 10**nDecimals @param bTrailingZeros - := always display trailing zeros in + := always display trailing zeros in decimal places, even if integer value. - := trailing zeros are only displayed + := 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 01b8db21138f..9751e494e9a1 100644 --- a/unotools/inc/unotools/misccfg.hxx +++ b/unotools/inc/unotools/misccfg.hxx @@ -46,14 +46,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 4d94c93cca4a..de34b12d732f 100644 --- a/unotools/inc/unotools/pathoptions.hxx +++ b/unotools/inc/unotools/pathoptions.hxx @@ -101,7 +101,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 diff --git a/unotools/inc/unotools/regoptions.hxx b/unotools/inc/unotools/regoptions.hxx index 1cca531886ca..2714f60b10f0 100644 --- a/unotools/inc/unotools/regoptions.hxx +++ b/unotools/inc/unotools/regoptions.hxx @@ -69,7 +69,7 @@ namespace utl }; /** checks if the registration dialog is allowed -

A return value of does not mean that during this session, the dialog is allowed to +

A return value of does not mean that during this session, the dialog is allowed to be executed. It simply means executing it is allowed in general

*/ DialogPermission getDialogPermission( ) const; diff --git a/unotools/inc/unotools/searchopt.hxx b/unotools/inc/unotools/searchopt.hxx index ed4110011df7..ab9941da6507 100644 --- a/unotools/inc/unotools/searchopt.hxx +++ b/unotools/inc/unotools/searchopt.hxx @@ -47,71 +47,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/securityoptions.hxx b/unotools/inc/unotools/securityoptions.hxx index ddeed4b94520..0607597a4a00 100644 --- a/unotools/inc/unotools/securityoptions.hxx +++ b/unotools/inc/unotools/securityoptions.hxx @@ -163,7 +163,7 @@ class UNOTOOLS_DLLPUBLIC SvtSecurityOptions: public utl::detail::Options @seealso - @param "eOption", specify, which item is queried - @return if item is readonly; otherwhise + @return if item is readonly; otherwhise @onerror No error should occurre! *//*-*****************************************************************************************************/ diff --git a/unotools/inc/unotools/syslocaleoptions.hxx b/unotools/inc/unotools/syslocaleoptions.hxx old mode 100644 new mode 100755 index 63e271f1c435..2fec6ca05f2f --- a/unotools/inc/unotools/syslocaleoptions.hxx +++ b/unotools/inc/unotools/syslocaleoptions.hxx @@ -38,10 +38,10 @@ #include // 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_uIntPtr SYSLOCALEOPTIONS_HINT_LOCALE = 0x00000001; +const sal_uIntPtr SYSLOCALEOPTIONS_HINT_CURRENCY = 0x00000002; +const sal_uIntPtr SYSLOCALEOPTIONS_HINT_UILOCALE = 0x00000004; +const sal_uIntPtr SYSLOCALEOPTIONS_HINT_DECSEP = 0x00000008; class SvtSysLocaleOptions_Impl; class SvtListener; @@ -74,8 +74,8 @@ public: /** Add a listener to react on config changes which are broadcasted in a SfxSimpleHint @return - if added - if not added + if added + if not added */ /** Block broadcasts and accumulate hints. This may be useful if, for @@ -85,15 +85,15 @@ public: two currency changes broadcasted. @param bBlock - : broadcasts are blocked until reversed. - : broadcasts are not blocked anymore. Pending hints are + : broadcasts are blocked until reversed. + : broadcasts are not blocked anymore. Pending hints are broadcasted if no other instance blocks the broadcast. @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 e4cd095fcc14..fb89e0f15179 100644 --- a/unotools/inc/unotools/textsearch.hxx +++ b/unotools/inc/unotools/textsearch.hxx @@ -81,9 +81,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; } @@ -159,14 +159,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 687868adbdb4..6ac62d201171 100644 --- a/unotools/inc/unotools/ucbhelper.hxx +++ b/unotools/inc/unotools/ucbhelper.hxx @@ -73,12 +73,12 @@ namespace utl sal_Bool bNewOnly = sal_False ); static sal_Bool HasParentFolder( const String& rFolder ); - static ULONG GetSize( const String& rContent ); + static sal_uIntPtr 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 >() ); }; } diff --git a/unotools/inc/unotools/ucblockbytes.hxx b/unotools/inc/unotools/ucblockbytes.hxx index 2ba0a683745a..54185da6b70d 100644 --- a/unotools/inc/unotools/ucblockbytes.hxx +++ b/unotools/inc/unotools/ucblockbytes.hxx @@ -90,7 +90,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; } }; @@ -151,11 +151,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_uIntPtr nPos, void *pBuffer, sal_uIntPtr nCount, sal_uIntPtr *pRead) const; + virtual ErrCode WriteAt ( sal_uIntPtr, const void*, sal_uIntPtr, sal_uIntPtr *pWritten); virtual ErrCode Flush (void) const; - virtual ErrCode SetSize (ULONG); + virtual ErrCode SetSize (sal_uIntPtr); virtual ErrCode Stat ( SvLockBytesStat *pStat, SvLockBytesStatFlag) const; void SetError( ErrCode nError ) diff --git a/unotools/inc/unotools/useroptions.hxx b/unotools/inc/unotools/useroptions.hxx index 020ddd657eaf..0eca30fe3075 100644 --- a/unotools/inc/unotools/useroptions.hxx +++ b/unotools/inc/unotools/useroptions.hxx @@ -35,23 +35,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 -------------------------------------------------- @@ -111,8 +111,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/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx index 60e807ee9320..b0b3e6b0f6b9 100644 --- a/unotools/source/accessibility/accessiblerelationsethelper.cxx +++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx @@ -202,8 +202,8 @@ sal_Int32 SAL_CALL AccessibleRelationType. @return - Returns if there is a (at least one) relation of the - given type and if there is no such relation in the set. + Returns if there is a (at least one) relation of the + given type and if there is no such relation in the set. */ sal_Bool SAL_CALL AccessibleRelationSetHelper::containsRelation( sal_Int16 aRelationType ) diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx b/unotools/source/accessibility/accessiblestatesethelper.cxx index be7bf3fbeb28..2848bc6b038b 100644 --- a/unotools/source/accessibility/accessiblestatesethelper.cxx +++ b/unotools/source/accessibility/accessiblestatesethelper.cxx @@ -222,8 +222,8 @@ AccessibleStateSetHelper::~AccessibleStateSetHelper(void) /** Checks whether the current state set is empty. @return - Returns if there is no state in this state set and - if there is at least one state set in it. + Returns if there is no state in this state set and + if there is at least one state set in it. */ sal_Bool SAL_CALL AccessibleStateSetHelper::isEmpty () throw (uno::RuntimeException) @@ -240,8 +240,8 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::isEmpty () the constants of AccessibleStateType. @return - Returns if the given state is a memeber of this object's - state set and otherwise. + Returns if the given state is a memeber of this object's + state set and otherwise. */ sal_Bool SAL_CALL AccessibleStateSetHelper::contains (sal_Int16 aState) throw (uno::RuntimeException) @@ -260,8 +260,8 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::contains (sal_Int16 aState) constants of AccessibleStateType. @return - Returns if all states of the given state set are members - of this object's state set. is returned if at least + Returns if all states of the given state set are members + of this object's state set. is returned if at least one of the states in the given state is not a member of this object's state set. */ diff --git a/unotools/source/config/accelcfg.cxx b/unotools/source/config/accelcfg.cxx index fc0e6108138b..d3f26de35304 100644 --- a/unotools/source/config/accelcfg.cxx +++ b/unotools/source/config/accelcfg.cxx @@ -71,7 +71,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 1567bd1b841d..7bd4b566e928 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -107,7 +107,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& aPropertyNames); }; @@ -200,10 +200,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 ) { @@ -356,7 +356,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 94f7ff07d7d7..513de501109c 100644 --- a/unotools/source/config/fltrcfg.cxx +++ b/unotools/source/config/fltrcfg.cxx @@ -200,7 +200,7 @@ void SvtCalcFilterOptions_Impl::Load() ---------------------------------------------------------------------------*/ struct SvtFilterOptions_Impl { - ULONG nFlags; + sal_uIntPtr nFlags; SvtAppFilterOptions_Impl aWriterCfg; SvtCalcFilterOptions_Impl aCalcCfg; SvtAppFilterOptions_Impl aImpressCfg; @@ -228,8 +228,8 @@ struct SvtFilterOptions_Impl Load(); } - void SetFlag( ULONG nFlag, BOOL bSet ); - BOOL IsFlag( ULONG nFlag ) const; + void SetFlag( sal_uIntPtr nFlag, sal_Bool bSet ); + sal_Bool IsFlag( sal_uIntPtr nFlag ) const; void Load() { aWriterCfg.Load(); @@ -240,7 +240,7 @@ struct SvtFilterOptions_Impl /* -----------------------------22.01.01 10:34-------------------------------- ---------------------------------------------------------------------------*/ -void SvtFilterOptions_Impl::SetFlag( ULONG nFlag, BOOL bSet ) +void SvtFilterOptions_Impl::SetFlag( sal_uIntPtr nFlag, sal_Bool bSet ) { switch(nFlag) { @@ -261,9 +261,9 @@ void SvtFilterOptions_Impl::SetFlag( ULONG nFlag, BOOL bSet ) /* -----------------------------22.01.01 10:35-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SvtFilterOptions_Impl::IsFlag( ULONG nFlag ) const +sal_Bool SvtFilterOptions_Impl::IsFlag( sal_uIntPtr nFlag ) const { - BOOL bRet; + sal_Bool bRet; switch(nFlag) { case FILTERCFG_WORD_CODE : bRet = aWriterCfg.IsLoad();break; @@ -326,9 +326,9 @@ const Sequence& SvtFilterOptions::GetPropertyNames() return aNames; } //----------------------------------------------------------------------- -static ULONG lcl_GetFlag(sal_Int32 nProp) +static sal_uIntPtr lcl_GetFlag(sal_Int32 nProp) { - ULONG nFlag = 0; + sal_uIntPtr nFlag = 0; switch(nProp) { case 0: nFlag = FILTERCFG_MATH_LOAD; break; @@ -367,7 +367,7 @@ void SvtFilterOptions::Commit() const Type& rType = ::getBooleanCppuType(); for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - ULONG nFlag = lcl_GetFlag(nProp); + sal_uIntPtr nFlag = lcl_GetFlag(nProp); sal_Bool bVal = pImp->IsFlag( nFlag); pValues[nProp].setValue(&bVal, rType); @@ -391,7 +391,7 @@ void SvtFilterOptions::Load() if(pValues[nProp].hasValue()) { sal_Bool bVal = *(sal_Bool*)pValues[nProp].getValue(); - ULONG nFlag = lcl_GetFlag(nProp); + sal_uIntPtr nFlag = lcl_GetFlag(nProp); pImp->SetFlag( nFlag, bVal); } } @@ -399,106 +399,106 @@ void SvtFilterOptions::Load() } // ----------------------------------------------------------------------- -void SvtFilterOptions::SetLoadWordBasicCode( BOOL bFlag ) +void SvtFilterOptions::SetLoadWordBasicCode( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_WORD_CODE, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsLoadWordBasicCode() const +sal_Bool SvtFilterOptions::IsLoadWordBasicCode() const { return pImp->IsFlag( FILTERCFG_WORD_CODE ); } -void SvtFilterOptions::SetLoadWordBasicStorage( BOOL bFlag ) +void SvtFilterOptions::SetLoadWordBasicStorage( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_WORD_STORAGE, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsLoadWordBasicStorage() const +sal_Bool SvtFilterOptions::IsLoadWordBasicStorage() const { return pImp->IsFlag( FILTERCFG_WORD_STORAGE ); } // ----------------------------------------------------------------------- -void SvtFilterOptions::SetLoadExcelBasicCode( BOOL bFlag ) +void SvtFilterOptions::SetLoadExcelBasicCode( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_EXCEL_CODE, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsLoadExcelBasicCode() const +sal_Bool SvtFilterOptions::IsLoadExcelBasicCode() const { return pImp->IsFlag( FILTERCFG_EXCEL_CODE ); } -void SvtFilterOptions::SetLoadExcelBasicExecutable( BOOL bFlag ) +void SvtFilterOptions::SetLoadExcelBasicExecutable( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_EXCEL_EXECTBL, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsLoadExcelBasicExecutable() const +sal_Bool SvtFilterOptions::IsLoadExcelBasicExecutable() const { return pImp->IsFlag( FILTERCFG_EXCEL_EXECTBL ); } -void SvtFilterOptions::SetLoadExcelBasicStorage( BOOL bFlag ) +void SvtFilterOptions::SetLoadExcelBasicStorage( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_EXCEL_STORAGE, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsLoadExcelBasicStorage() const +sal_Bool SvtFilterOptions::IsLoadExcelBasicStorage() const { return pImp->IsFlag( FILTERCFG_EXCEL_STORAGE ); } // ----------------------------------------------------------------------- -void SvtFilterOptions::SetLoadPPointBasicCode( BOOL bFlag ) +void SvtFilterOptions::SetLoadPPointBasicCode( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_PPOINT_CODE, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsLoadPPointBasicCode() const +sal_Bool SvtFilterOptions::IsLoadPPointBasicCode() const { return pImp->IsFlag( FILTERCFG_PPOINT_CODE ); } -void SvtFilterOptions::SetLoadPPointBasicStorage( BOOL bFlag ) +void SvtFilterOptions::SetLoadPPointBasicStorage( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_PPOINT_STORAGE, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsLoadPPointBasicStorage() const +sal_Bool SvtFilterOptions::IsLoadPPointBasicStorage() const { return pImp->IsFlag( FILTERCFG_PPOINT_STORAGE ); } // ----------------------------------------------------------------------- -BOOL SvtFilterOptions::IsMathType2Math() const +sal_Bool SvtFilterOptions::IsMathType2Math() const { return pImp->IsFlag( FILTERCFG_MATH_LOAD ); } -void SvtFilterOptions::SetMathType2Math( BOOL bFlag ) +void SvtFilterOptions::SetMathType2Math( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_MATH_LOAD, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsMath2MathType() const +sal_Bool SvtFilterOptions::IsMath2MathType() const { return pImp->IsFlag( FILTERCFG_MATH_SAVE ); } -void SvtFilterOptions::SetMath2MathType( BOOL bFlag ) +void SvtFilterOptions::SetMath2MathType( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_MATH_SAVE, bFlag ); SetModified(); @@ -506,58 +506,58 @@ void SvtFilterOptions::SetMath2MathType( BOOL bFlag ) // ----------------------------------------------------------------------- -BOOL SvtFilterOptions::IsWinWord2Writer() const +sal_Bool SvtFilterOptions::IsWinWord2Writer() const { return pImp->IsFlag( FILTERCFG_WRITER_LOAD ); } -void SvtFilterOptions::SetWinWord2Writer( BOOL bFlag ) +void SvtFilterOptions::SetWinWord2Writer( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_WRITER_LOAD, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsWriter2WinWord() const +sal_Bool SvtFilterOptions::IsWriter2WinWord() const { return pImp->IsFlag( FILTERCFG_WRITER_SAVE ); } -void SvtFilterOptions::SetWriter2WinWord( BOOL bFlag ) +void SvtFilterOptions::SetWriter2WinWord( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_WRITER_SAVE, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsUseEnhancedFields() const +sal_Bool SvtFilterOptions::IsUseEnhancedFields() const { return false; // disable for now; // return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS ); } -void SvtFilterOptions::SetUseEnhancedFields( BOOL bFlag ) +void SvtFilterOptions::SetUseEnhancedFields( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_USE_ENHANCED_FIELDS, bFlag ); SetModified(); } // ----------------------------------------------------------------------- -BOOL SvtFilterOptions::IsExcel2Calc() const +sal_Bool SvtFilterOptions::IsExcel2Calc() const { return pImp->IsFlag( FILTERCFG_CALC_LOAD ); } -void SvtFilterOptions::SetExcel2Calc( BOOL bFlag ) +void SvtFilterOptions::SetExcel2Calc( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_CALC_LOAD, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsCalc2Excel() const +sal_Bool SvtFilterOptions::IsCalc2Excel() const { return pImp->IsFlag( FILTERCFG_CALC_SAVE ); } -void SvtFilterOptions::SetCalc2Excel( BOOL bFlag ) +void SvtFilterOptions::SetCalc2Excel( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_CALC_SAVE, bFlag ); SetModified(); @@ -565,23 +565,23 @@ void SvtFilterOptions::SetCalc2Excel( BOOL bFlag ) // ----------------------------------------------------------------------- -BOOL SvtFilterOptions::IsPowerPoint2Impress() const +sal_Bool SvtFilterOptions::IsPowerPoint2Impress() const { return pImp->IsFlag( FILTERCFG_IMPRESS_LOAD ); } -void SvtFilterOptions::SetPowerPoint2Impress( BOOL bFlag ) +void SvtFilterOptions::SetPowerPoint2Impress( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_IMPRESS_LOAD, bFlag ); SetModified(); } -BOOL SvtFilterOptions::IsImpress2PowerPoint() const +sal_Bool SvtFilterOptions::IsImpress2PowerPoint() const { return pImp->IsFlag( FILTERCFG_IMPRESS_SAVE ); } -void SvtFilterOptions::SetImpress2PowerPoint( BOOL bFlag ) +void SvtFilterOptions::SetImpress2PowerPoint( sal_Bool bFlag ) { pImp->SetFlag( FILTERCFG_IMPRESS_SAVE, bFlag ); SetModified(); @@ -596,19 +596,19 @@ SvtFilterOptions* SvtFilterOptions::Get() // ----------------------------------------------------------------------- -BOOL SvtFilterOptions::IsEnablePPTPreview() const +sal_Bool SvtFilterOptions::IsEnablePPTPreview() const { return pImp->IsFlag( FILTERCFG_ENABLE_PPT_PREVIEW ); } -BOOL SvtFilterOptions::IsEnableCalcPreview() const +sal_Bool SvtFilterOptions::IsEnableCalcPreview() const { return pImp->IsFlag( FILTERCFG_ENABLE_EXCEL_PREVIEW ); } -BOOL SvtFilterOptions::IsEnableWordPreview() const +sal_Bool SvtFilterOptions::IsEnableWordPreview() const { return pImp->IsFlag( FILTERCFG_ENABLE_WORD_PREVIEW ); } diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index a1d287337bea..c80f219f0f17 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -612,7 +612,7 @@ static ImplFontAttrWidthSearchData const aImplWidthAttrSearchList[] = struct ImplFontAttrTypeSearchData { const char* mpStr; - ULONG mnType; + sal_uIntPtr mnType; }; static ImplFontAttrTypeSearchData const aImplTypeAttrSearchList[] = @@ -776,23 +776,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_uIntPtr& rType ) { rShortName = rOrgName; diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 39233f022534..b17681331935 100755 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -69,25 +69,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) @@ -96,7 +96,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; @@ -114,34 +114,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; @@ -166,10 +166,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(); @@ -191,18 +191,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; }; @@ -240,7 +240,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}, @@ -292,12 +292,12 @@ const uno::Sequence< OUString > & SvtLinguConfigItem::GetPropertyNames() if (!bInitialized) { - INT32 nMax = sizeof(aNamesToHdl) / sizeof(aNamesToHdl[0]); + sal_Int32 nMax = sizeof(aNamesToHdl) / sizeof(aNamesToHdl[0]); 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) @@ -310,8 +310,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 ) { @@ -350,20 +350,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) @@ -438,31 +438,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) @@ -484,13 +484,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 : @@ -530,41 +530,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; } } @@ -576,34 +576,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 ); @@ -614,10 +614,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 ) { @@ -678,11 +678,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; @@ -708,7 +708,7 @@ BOOL SvtLinguConfigItem::LoadOptions( const uno::Sequence< OUString > &rProperyN } } - bRes = TRUE; + bRes = sal_True; } DBG_ASSERT( bRes, "LoadOptions failed" ); @@ -716,19 +716,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(); @@ -784,22 +784,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) @@ -915,47 +915,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 { @@ -996,7 +996,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 @@ -1113,7 +1113,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/menuoptions.cxx b/unotools/source/config/menuoptions.cxx index 2c5756c2140c..f826b1e36227 100644 --- a/unotools/source/config/menuoptions.cxx +++ b/unotools/source/config/menuoptions.cxx @@ -176,7 +176,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_bDontHideDisabledEntries = bState; SetModified(); - for ( USHORT n=0; nCall( this ); Commit(); } @@ -185,7 +185,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_bFollowMouse = bState; SetModified(); - for ( USHORT n=0; nCall( this ); Commit(); } @@ -194,7 +194,7 @@ class SvtMenuOptions_Impl : public ConfigItem { m_nMenuIcons = bState; SetModified(); - for ( USHORT n=0; nCall( this ); Commit(); } @@ -299,7 +299,7 @@ SvtMenuOptions_Impl::~SvtMenuOptions_Impl() Commit(); } - for ( USHORT n=0; n& seqPropertyNames ) m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; - for ( USHORT n=0; nCall( this ); } @@ -416,7 +416,7 @@ void SvtMenuOptions_Impl::AddListener( const Link& rLink ) void SvtMenuOptions_Impl::RemoveListener( const Link& rLink ) { - for ( USHORT n=0; n& GetPropertyNames(); @@ -73,14 +73,14 @@ public: virtual void Notify( const com::sun::star::uno::Sequence& 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; } @@ -93,9 +93,9 @@ public: --------------------------------------------------------------------*/ SfxMiscCfg::SfxMiscCfg() : ConfigItem(C2U("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()"); @@ -112,7 +112,7 @@ SfxMiscCfg::~SfxMiscCfg() Beschreibung: --------------------------------------------------------------------*/ -void SfxMiscCfg::SetNotFoundWarning( BOOL bSet) +void SfxMiscCfg::SetNotFoundWarning( sal_Bool bSet) { if(bNotFound != bSet) SetModified(); @@ -123,7 +123,7 @@ void SfxMiscCfg::SetNotFoundWarning( BOOL bSet) Beschreibung: --------------------------------------------------------------------*/ -void SfxMiscCfg::SetPaperSizeWarning( BOOL bSet) +void SfxMiscCfg::SetPaperSizeWarning( sal_Bool bSet) { if(bPaperSize != bSet) SetModified(); @@ -133,7 +133,7 @@ void SfxMiscCfg::SetPaperSizeWarning( BOOL bSet) /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ -void SfxMiscCfg::SetPaperOrientationWarning( BOOL bSet) +void SfxMiscCfg::SetPaperOrientationWarning( sal_Bool bSet) { if(bPaperOrientation != bSet) SetModified(); @@ -266,32 +266,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 afce713ccc49..ec2da6bff054 100644 --- a/unotools/source/config/moduleoptions.cxx +++ b/unotools/source/config/moduleoptions.cxx @@ -902,7 +902,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 2ae6f0c97f0c..132245d828ea 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -203,7 +203,7 @@ class SvtPathOptions_Impl ::com::sun::star::lang::Locale GetLocale() const { return m_aLocale; } - BOOL IsPathReadonly(SvtPathOptions::Pathes ePath)const; + sal_Bool IsPathReadonly(SvtPathOptions::Pathes ePath)const; }; // global ---------------------------------------------------------------- @@ -309,10 +309,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 xPrSet(m_xPathSettings, UNO_QUERY); @@ -392,7 +392,7 @@ OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) 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 @@ -419,7 +419,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; @@ -988,12 +988,12 @@ 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 ); @@ -1027,7 +1027,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 81f089919dfd..3e99cf2dd327 100644 --- a/unotools/source/config/regoptions.cxx +++ b/unotools/source/config/regoptions.cxx @@ -78,9 +78,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 cbb7e763b38a..379ba65dc9e6 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 f9318f150589..9e09dcc96dac 100644 --- a/unotools/source/config/searchopt.cxx +++ b/unotools/source/config/searchopt.cxx @@ -50,19 +50,19 @@ using namespace com::sun::star::i18n; 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; @@ -74,8 +74,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 ); }; @@ -86,7 +86,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 ); } @@ -107,28 +107,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) @@ -174,19 +174,19 @@ Sequence< OUString > SvtSearchOptions_Impl::GetPropertyNames() const const int nCount = sizeof( aPropNames ) / sizeof( aPropNames[0] ); 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(), @@ -195,16 +195,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) @@ -219,13 +219,13 @@ BOOL SvtSearchOptions_Impl::Load() else { DBG_ERROR( "unexpected type" ); - bSucc = FALSE; + bSucc = sal_False; } } else { DBG_ERROR( "value missing" ); - bSucc = FALSE; + bSucc = sal_False; } } } @@ -235,12 +235,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(); @@ -249,13 +249,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; } @@ -275,9 +275,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; @@ -322,312 +322,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 old mode 100644 new mode 100755 index 35333b0db6a8..491c17679839 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -88,7 +88,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_uIntPtr m_nBlockedHint; // pending hints sal_Bool m_bDecimalSeparator; //use decimal separator same as locale sal_Bool m_bROLocale; @@ -386,7 +386,7 @@ void SvtSysLocaleOptions_Impl::SetLocaleString( const OUString& rStr ) MakeRealLocale(); MsLangId::setConfiguredSystemLanguage( m_eRealLanguage ); SetModified(); - ULONG nHint = SYSLOCALEOPTIONS_HINT_LOCALE; + sal_uIntPtr nHint = SYSLOCALEOPTIONS_HINT_LOCALE; if ( !m_aCurrencyString.getLength() ) nHint |= SYSLOCALEOPTIONS_HINT_CURRENCY; NotifyListeners( nHint ); @@ -430,7 +430,7 @@ void SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale( sal_Bool bSet) void SvtSysLocaleOptions_Impl::Notify( const Sequence< rtl::OUString >& seqPropertyNames ) { - ULONG nHint = 0; + sal_uIntPtr 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 6c63bbfee34b..59f4a14548ca 100644 --- a/unotools/source/config/useroptions.cxx +++ b/unotools/source/config/useroptions.cxx @@ -127,8 +127,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: @@ -774,7 +774,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(); @@ -893,7 +893,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) @@ -1284,13 +1284,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/i18n/intlwrapper.cxx b/unotools/source/i18n/intlwrapper.cxx index 9f52cc60bfeb..aa20045eb17f 100644 --- a/unotools/source/i18n/intlwrapper.cxx +++ b/unotools/source/i18n/intlwrapper.cxx @@ -94,7 +94,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 8bbe6f182862..fb0472fc2f03 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -59,8 +59,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; @@ -79,7 +79,7 @@ namespace {}; } -BYTE LocaleDataWrapper::nLocaleDataChecking = 0; +sal_uInt8 LocaleDataWrapper::nLocaleDataChecking = 0; LocaleDataWrapper::LocaleDataWrapper( const Reference< lang::XMultiServiceFactory > & xSF, @@ -87,8 +87,8 @@ LocaleDataWrapper::LocaleDataWrapper( ) : xSMgr( xSF ), - bLocaleDataItemValid( FALSE ), - bReservedWordValid( FALSE ) + bLocaleDataItemValid( sal_False ), + bReservedWordValid( sal_False ) { setLocale( rLocale ); if ( xSMgr.is() ) @@ -170,7 +170,7 @@ void LocaleDataWrapper::invalidateData() { aLocaleItem[j].Erase(); } - bLocaleDataItemValid = FALSE; + bLocaleDataItemValid = sal_False; } if ( bReservedWordValid ) { @@ -178,7 +178,7 @@ void LocaleDataWrapper::invalidateData() { aReservedWord[j].Erase(); } - bReservedWordValid = FALSE; + bReservedWordValid = sal_False; } xDefaultCalendar.reset(); if (aGrouping.getLength()) @@ -546,7 +546,7 @@ void LocaleDataWrapper::getOneLocaleItemImpl( sal_Int16 nItem ) if ( !bLocaleDataItemValid ) { aLocaleDataItem = getLocaleItem(); - bLocaleDataItemValid = TRUE; + bLocaleDataItemValid = sal_True; } switch ( nItem ) { @@ -612,7 +612,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() ) @@ -721,7 +721,7 @@ const String& LocaleDataWrapper::getCurrBankSymbol() const } -USHORT LocaleDataWrapper::getCurrPositiveFormat() const +sal_uInt16 LocaleDataWrapper::getCurrPositiveFormat() const { ::utl::ReadWriteGuard aGuard( aMutex ); if ( nCurrPositiveFormat == nCurrFormatInvalid ) @@ -733,7 +733,7 @@ USHORT LocaleDataWrapper::getCurrPositiveFormat() const } -USHORT LocaleDataWrapper::getCurrNegativeFormat() const +sal_uInt16 LocaleDataWrapper::getCurrNegativeFormat() const { ::utl::ReadWriteGuard aGuard( aMutex ); if ( nCurrNegativeFormat == nCurrFormatInvalid ) @@ -745,7 +745,7 @@ USHORT LocaleDataWrapper::getCurrNegativeFormat() const } -USHORT LocaleDataWrapper::getCurrDigits() const +sal_uInt16 LocaleDataWrapper::getCurrDigits() const { ::utl::ReadWriteGuard aGuard( aMutex ); if ( nCurrDigits == nCurrFormatInvalid ) @@ -804,13 +804,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 { @@ -818,7 +818,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 ) @@ -1337,7 +1337,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" ); @@ -1352,7 +1352,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++; @@ -1395,29 +1395,29 @@ 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; - BOOL bNeg; + sal_uInt16 nNumLen; + sal_uInt16 i = 0; + sal_Bool bNeg; // negative number if ( nNumber < 0 ) { nNumber *= -1; - bNeg = TRUE; + bNeg = sal_True; *pBuf = '-'; pBuf++; } else - bNeg = FALSE; + bNeg = sal_False; // convert number pNumBuf = ImplAddUNum( aNumBuf, (sal_uInt64)nNumber ); - nNumLen = (USHORT)(ULONG)(pNumBuf-aNumBuf); + nNumLen = (sal_uInt16)(sal_uIntPtr)(pNumBuf-aNumBuf); pNumBuf = aNumBuf; if ( nNumLen <= nDecimals ) @@ -1463,7 +1463,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( @@ -1484,11 +1484,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++; @@ -1514,12 +1514,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 { @@ -1530,39 +1530,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_uIntPtr)(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 ) { @@ -1574,22 +1574,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_uIntPtr)(pBuf-aBuf) ); if ( bHour12 ) { @@ -1626,7 +1626,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_uIntPtr)(pBuf-aBuf) ); // month of year nVal = rCal.getValue( CalendarFieldIndex::MONTH ); String aMonth( rCal.getDisplayName( CalendarDisplayIndex::MONTH, nVal, nDisplayMonth ) ); @@ -1636,7 +1636,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_uIntPtr)(pBuf-aBuf) ); // concatenate switch ( getLongDateFormat() ) { @@ -1665,7 +1665,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]; @@ -1674,31 +1674,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_uIntPtr)(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; @@ -1710,8 +1710,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 @@ -1722,7 +1722,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_uIntPtr)(pBuf-pBuffer) ); if ( pBuffer != aBuf ) delete [] pBuffer; @@ -1730,8 +1730,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]; @@ -1748,26 +1748,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_uIntPtr)(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; @@ -1775,7 +1775,7 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, USHORT nDecimals, { if ( *pTempBuf != '0' ) { - bZero = FALSE; + bZero = sal_False; break; } @@ -1921,7 +1921,7 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, USHORT nDecimals, } } - String aNumber( pBuffer, (xub_StrLen)(ULONG)(pBuf-pBuffer) ); + String aNumber( pBuffer, (xub_StrLen)(sal_uIntPtr)(pBuf-pBuffer) ); if ( pBuffer != aBuf ) delete [] pBuffer; @@ -1981,7 +1981,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 3f722adb0dba..317e6f9b6e45 100644 --- a/unotools/source/i18n/textsearch.cxx +++ b/unotools/source/i18n/textsearch.cxx @@ -52,9 +52,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; @@ -66,7 +66,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; @@ -299,8 +299,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 ); @@ -329,17 +329,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 1a31272a483c..f4f15e6a65ab 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -1376,7 +1376,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_uIntPtr nLastIndex = (sal_uIntPtr)nIndex + nLen; if( nLastIndex > rStr.Len() ) nLastIndex = rStr.Len(); @@ -1460,7 +1460,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const //======================================================================= FontToSubsFontConverter CreateFontToSubsFontConverter( - const String& rOrgName, ULONG nFlags ) + const String& rOrgName, sal_uIntPtr nFlags ) { const ConvertChar* pCvt = NULL; diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index 4a3532b44659..e0ada01c98e1 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -517,7 +517,7 @@ void AddTokenFontName( String& rName, const String& rNewToken ) // ======================================================================= -String GetSubsFontName( const String& rName, ULONG nFlags ) +String GetSubsFontName( const String& rName, sal_uIntPtr nFlags ) { String aName; diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx index eefaa7498070..b9d0185ffd48 100644 --- a/unotools/source/streaming/streamwrap.cxx +++ b/unotools/source/streaming/streamwrap.cxx @@ -181,7 +181,7 @@ void OInputStreamWrapper::checkError() const //------------------------------------------------------------------------------ OSeekableInputStreamWrapper::OSeekableInputStreamWrapper(SvStream& _rStream) { - SetStream( &_rStream, FALSE ); + SetStream( &_rStream, sal_False ); } //------------------------------------------------------------------------------ @@ -328,7 +328,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/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx index 5ddd1f811923..a45d152b44f6 100644 --- a/unotools/source/ucbhelper/localfilehelper.cxx +++ b/unotools/source/ucbhelper/localfilehelper.cxx @@ -223,10 +223,10 @@ DECLARE_LIST( StringList_Impl, ::rtl::OUString* ) if ( pFiles ) { - ULONG nCount = pFiles->Count(); + sal_uIntPtr nCount = pFiles->Count(); Sequence < ::rtl::OUString > aRet( nCount ); ::rtl::OUString* pRet = aRet.getArray(); - for ( USHORT i = 0; i < nCount; ++i ) + for ( sal_uInt16 i = 0; i < nCount; ++i ) { ::rtl::OUString* pFile = pFiles->GetObject(i); pRet[i] = *( pFile ); diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 4160f2f2f443..a114e49d4949 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -366,10 +366,10 @@ Sequence < OUString > UCBContentHelper::GetFolderContents( const String& rFolder if ( pFiles ) { - ULONG nCount = pFiles->Count(); + sal_uIntPtr nCount = pFiles->Count(); Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( ULONG i = 0; i < nCount; ++i ) + for ( sal_uIntPtr i = 0; i < nCount; ++i ) { OUString* pFile = pFiles->GetObject(i); pRet[i] = *( pFile ); @@ -447,10 +447,10 @@ Sequence < OUString > UCBContentHelper::GetResultSet( const String& rURL ) if ( pList ) { - ULONG nCount = pList->Count(); + sal_uIntPtr nCount = pList->Count(); Sequence < OUString > aRet( nCount ); OUString* pRet = aRet.getArray(); - for ( ULONG i = 0; i < nCount; ++i ) + for ( sal_uIntPtr i = 0; i < nCount; ++i ) { OUString* pEntry = pList->GetObject(i); pRet[i] = *( pEntry ); @@ -626,9 +626,9 @@ sal_Bool UCBContentHelper::HasParentFolder( const String& rFolder ) // ----------------------------------------------------------------------- -ULONG UCBContentHelper::GetSize( const String& rContent ) +sal_uIntPtr UCBContentHelper::GetSize( const String& rContent ) { - ULONG nSize = 0; + sal_uIntPtr nSize = 0; sal_Int64 nTemp = 0; INetURLObject aObj( rContent ); DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); @@ -643,7 +643,7 @@ ULONG UCBContentHelper::GetSize( const String& rContent ) catch( ::com::sun::star::uno::Exception& ) { } - nSize = (UINT32)nTemp; + nSize = (sal_uInt32)nTemp; return nSize; } @@ -679,9 +679,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; @@ -689,7 +689,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 @@ -740,7 +740,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 @@ -759,18 +759,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 f21855d20aed..51b6bb0b1a61 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1284,7 +1284,7 @@ UcbLockBytes::UcbLockBytes( UcbLockBytesHandler* pHandler ) , m_bDontClose( sal_False ) , m_bStreamValid (sal_False) { - SetSynchronMode( TRUE ); + SetSynchronMode( sal_True ); } //---------------------------------------------------------------------------- @@ -1423,13 +1423,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_uIntPtr nPos, void *pBuffer, sal_uIntPtr nCount, sal_uIntPtr *pRead) const { if ( IsSynchronMode() ) { @@ -1488,13 +1488,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_uIntPtr(nSize); return ERRCODE_NONE; } //---------------------------------------------------------------------------- -ErrCode UcbLockBytes::WriteAt ( ULONG nPos, const void *pBuffer, ULONG nCount, ULONG *pWritten) +ErrCode UcbLockBytes::WriteAt ( sal_uIntPtr nPos, const void *pBuffer, sal_uIntPtr nCount, sal_uIntPtr *pWritten) { if ( pWritten ) *pWritten = 0; @@ -1543,11 +1543,11 @@ ErrCode UcbLockBytes::Flush() const } //---------------------------------------------------------------------------- -ErrCode UcbLockBytes::SetSize (ULONG nNewSize) +ErrCode UcbLockBytes::SetSize (sal_uIntPtr nNewSize) { SvLockBytesStat aStat; Stat( &aStat, (SvLockBytesStatFlag) 0 ); - ULONG nSize = aStat.nSize; + sal_uIntPtr nSize = aStat.nSize; if ( nSize > nNewSize ) { @@ -1564,8 +1564,8 @@ ErrCode UcbLockBytes::SetSize (ULONG nNewSize) if ( nSize < nNewSize ) { - ULONG nDiff = nNewSize-nSize, nCount=0; - BYTE* pBuffer = new BYTE[ nDiff ]; + sal_uIntPtr 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; @@ -1603,7 +1603,7 @@ ErrCode UcbLockBytes::Stat( SvLockBytesStat *pStat, SvLockBytesStatFlag) const try { - pStat->nSize = ULONG(xSeekable->getLength()); + pStat->nSize = sal_uIntPtr(xSeekable->getLength()); } catch (IOException) { -- cgit v1.2.3 From caa3d247d2ff8d34881e5fdb2edd4d153c2725c0 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 12 Jan 2011 16:31:19 +0100 Subject: removetooltypes01: #i112600# Exchange misleading sal_uIntPtr with sal_uLong in sot --- sot/inc/sot/exchange.hxx | 38 +++--- sot/inc/sot/filelist.hxx | 6 +- sot/inc/sot/formats.hxx | 276 +++++++++++++++++++-------------------- sot/inc/sot/object.hxx | 2 +- sot/inc/sot/stg.hxx | 56 ++++---- sot/inc/sot/storage.hxx | 22 ++-- sot/inc/sot/storinfo.hxx | 10 +- sot/source/base/exchange.cxx | 28 ++-- sot/source/base/factory.cxx | 6 +- sot/source/base/filelist.cxx | 14 +- sot/source/base/formats.cxx | 20 +-- sot/source/base/object.cxx | 8 +- sot/source/sdstor/stg.cxx | 34 ++--- sot/source/sdstor/stgcache.cxx | 20 +-- sot/source/sdstor/stgcache.hxx | 6 +- sot/source/sdstor/stgdir.cxx | 16 +-- sot/source/sdstor/stgio.cxx | 36 ++--- sot/source/sdstor/stgio.hxx | 4 +- sot/source/sdstor/stgole.cxx | 10 +- sot/source/sdstor/stgole.hxx | 10 +- sot/source/sdstor/stgstrms.cxx | 30 ++--- sot/source/sdstor/stgstrms.hxx | 12 +- sot/source/sdstor/storage.cxx | 36 ++--- sot/source/sdstor/storinfo.cxx | 8 +- sot/source/sdstor/ucbstorage.cxx | 104 +++++++-------- 25 files changed, 406 insertions(+), 406 deletions(-) (limited to 'sot/source/base/formats.cxx') diff --git a/sot/inc/sot/exchange.hxx b/sot/inc/sot/exchange.hxx index d079d9bfec2c..da5d5854f056 100644 --- a/sot/inc/sot/exchange.hxx +++ b/sot/inc/sot/exchange.hxx @@ -52,7 +52,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer { // - SotFormatStringId - // --------------------- -typedef sal_uIntPtr SotFormatStringId; +typedef sal_uLong SotFormatStringId; // ---------------- // - DataFlavorEx - @@ -77,14 +77,14 @@ typedef ::std::list< ::com::sun::star::datatransfer::DataFlavor > DataFlavorLi typedef ::std::list< DataFlavorEx > DataFlavorExList; SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, - sal_uIntPtr nId ); + sal_uLong nId ); // ------------------------- // - Vordefinierte Formate - // ------------------------- -// Die Reihenfolge und die Werte dürfen nicht geändert werden, -// da die Implementation sich darauf verläßt. +// 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 @@ -188,26 +188,26 @@ class SvGlobalName; class SOT_DLLPUBLIC SotExchange { public: - static sal_uIntPtr RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static sal_uIntPtr RegisterFormatName( const String& rName ); - static sal_uIntPtr RegisterFormatMimeType( const String& rMimeType ); - - static sal_uIntPtr GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static String GetFormatName( sal_uIntPtr nFormat ); - static sal_Bool GetFormatDataFlavor( sal_uIntPtr nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static String GetFormatMimeType( sal_uIntPtr nFormat ); + 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 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_uIntPtr GetFormatIdFromMimeType( const String& rMimeType ); + 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( sal_uIntPtr nFormat ) + static SotFormatStringId GetFormatStringId( sal_uLong nFormat ) { return nFormat; } static SotFormatStringId GetFormatStringId( const String& rName ) { return SotExchange::RegisterFormatMimeType( rName ); } - static sal_uIntPtr RegisterSotFormatName( SotFormatStringId nId ) + static sal_uLong RegisterSotFormatName( SotFormatStringId nId ) { return nId; } // same for XTransferable interface @@ -221,11 +221,11 @@ public: // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16 nUserAction, // In:- Out: Zu benutzendes Format - sal_uIntPtr& rFormat, + sal_uLong& rFormat, // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - sal_uIntPtr 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 ); @@ -240,11 +240,11 @@ public: // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16 nUserAction, // In:- Out: Zu benutzendes Format - sal_uIntPtr& rFormat, + sal_uLong& rFormat, // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - sal_uIntPtr nOnlyTestFormat = 0 ); + sal_uLong nOnlyTestFormat = 0 ); static sal_uInt16 IsChart( const SvGlobalName& rName ); static sal_uInt16 IsMath( const SvGlobalName& rName ); diff --git a/sot/inc/sot/filelist.hxx b/sot/inc/sot/filelist.hxx index fc04e92cb3d7..4db3e4866817 100644 --- a/sot/inc/sot/filelist.hxx +++ b/sot/inc/sot/filelist.hxx @@ -62,13 +62,13 @@ public: SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList ); // Clipboard, D&D usw. - static sal_uIntPtr GetFormat(); + static sal_uLong GetFormat(); // Liste fuellen/abfragen void AppendFile( const String& rStr ); - String GetFile( sal_uIntPtr i ) const; - sal_uIntPtr Count( void ) const; + String GetFile( sal_uLong i ) const; + sal_uLong Count( void ) const; }; diff --git a/sot/inc/sot/formats.hxx b/sot/inc/sot/formats.hxx index 8a61884c88e7..303afecb5a17 100644 --- a/sot/inc/sot/formats.hxx +++ b/sot/inc/sot/formats.hxx @@ -46,145 +46,145 @@ #endif #include -#define SOT_FORMAT_SYSTEM_START ((sal_uIntPtr)0) -#define SOT_FORMAT_STRING ((sal_uIntPtr)FORMAT_STRING) -#define SOT_FORMAT_BITMAP ((sal_uIntPtr)FORMAT_BITMAP) -#define SOT_FORMAT_GDIMETAFILE ((sal_uIntPtr)FORMAT_GDIMETAFILE) -#define SOT_FORMAT_PRIVATE ((sal_uIntPtr)FORMAT_PRIVATE) -#define SOT_FORMAT_FILE ((sal_uIntPtr)FORMAT_FILE) -#define SOT_FORMAT_FILE_LIST ((sal_uIntPtr)FORMAT_FILE_LIST) -#define SOT_FORMAT_RTF ((sal_uIntPtr)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 ((sal_uIntPtr)11) -#define SOT_FORMATSTR_ID_SVXB ((sal_uIntPtr)12) -#define SOT_FORMATSTR_ID_SVIM ((sal_uIntPtr)13) -#define SOT_FORMATSTR_ID_XFA ((sal_uIntPtr)14) -#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uIntPtr)15) -#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uIntPtr)16) -#define SOT_FORMATSTR_ID_SOLK ((sal_uIntPtr)17) -#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uIntPtr)18) -#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uIntPtr)19) -#define SOT_FORMATSTR_ID_NATIVE ((sal_uIntPtr)20) -#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uIntPtr)21) -#define SOT_FORMATSTR_ID_STARSERVER ((sal_uIntPtr)22) -#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uIntPtr)23) -#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uIntPtr)24) -#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uIntPtr)25) -#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uIntPtr)26) -#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uIntPtr)27) -#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uIntPtr)28) -#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uIntPtr)29) -#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uIntPtr)30) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uIntPtr)31) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uIntPtr)32) -#define SOT_FORMATSTR_ID_STARDRAW ((sal_uIntPtr)33) -#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uIntPtr)34) -#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uIntPtr)35) -#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uIntPtr)36) -#define SOT_FORMATSTR_ID_STARCALC ((sal_uIntPtr)37) -#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uIntPtr)38) -#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uIntPtr)39) -#define SOT_FORMATSTR_ID_STARCHART ((sal_uIntPtr)40) -#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uIntPtr)41) -#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uIntPtr)42) -#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uIntPtr)43) -#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uIntPtr)44) -#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uIntPtr)45) -#define SOT_FORMATSTR_ID_STARMATH ((sal_uIntPtr)46) -#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uIntPtr)47) -#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uIntPtr)48) -#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uIntPtr)49) -#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uIntPtr)50) -#define SOT_FORMATSTR_ID_HTML ((sal_uIntPtr)51) -#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uIntPtr)52) -#define SOT_FORMATSTR_ID_CHAOS ((sal_uIntPtr)53) -#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uIntPtr)54) -#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uIntPtr)55) -#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uIntPtr)56) -#define SOT_FORMATSTR_ID_SYLK ((sal_uIntPtr)57) -#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uIntPtr)58) -#define SOT_FORMATSTR_ID_LINK ((sal_uIntPtr)59) -#define SOT_FORMATSTR_ID_DIF ((sal_uIntPtr)60) -#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uIntPtr)61) -#define SOT_FORMATSTR_ID_SONLK ((sal_uIntPtr)62) -#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uIntPtr)63) -#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uIntPtr)64) -#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uIntPtr)65) -#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uIntPtr)66) -#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uIntPtr)67) -#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uIntPtr)68) -#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uIntPtr)69) -#define SOT_FORMATSTR_ID_EVDF ((sal_uIntPtr)70) -#define SOT_FORMATSTR_ID_ESDF ((sal_uIntPtr)71) -#define SOT_FORMATSTR_ID_IDF ((sal_uIntPtr)72) -#define SOT_FORMATSTR_ID_EFTP ((sal_uIntPtr)73) -#define SOT_FORMATSTR_ID_EFD ((sal_uIntPtr)74) -#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uIntPtr)75) -#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uIntPtr)76) -#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uIntPtr)77) -#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uIntPtr)78) -#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uIntPtr)79) -#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uIntPtr)80) -#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uIntPtr)81) -#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uIntPtr)82) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uIntPtr)83) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uIntPtr)84) -#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uIntPtr)85) -#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uIntPtr)86) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uIntPtr)87) -#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uIntPtr)88) -#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uIntPtr)89) -#define SOT_FORMATSTR_ID_FILENAME ((sal_uIntPtr)90) -#define SOT_FORMATSTR_ID_SD_OLE ((sal_uIntPtr)91) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uIntPtr)92) -#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uIntPtr)93) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uIntPtr)94) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uIntPtr)95) -#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uIntPtr)96) -#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uIntPtr)97) -#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uIntPtr)98) -#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uIntPtr)99) -#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uIntPtr)100) -#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uIntPtr)101) -#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uIntPtr)102) -#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uIntPtr)103) -#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uIntPtr)104) -#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uIntPtr)105) -#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uIntPtr)106) -#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uIntPtr)107) -#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uIntPtr)108) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uIntPtr)109) -#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uIntPtr)110) -#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uIntPtr)111) -#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uIntPtr)112) -#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uIntPtr)113) -#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uIntPtr)114) -#define SOT_FORMATSTR_ID_WMF ((sal_uIntPtr)115) -#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uIntPtr)116) -#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uIntPtr)117) -#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uIntPtr)118) -#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uIntPtr)119) -#define SOT_FORMATSTR_ID_EMF ((sal_uIntPtr)120) -#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uIntPtr)121) -#define SOT_FORMATSTR_ID_BMP ((sal_uIntPtr)122) -#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uIntPtr)123) -#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uIntPtr)124) -#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uIntPtr)125) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uIntPtr)126) -#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uIntPtr)127) -#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uIntPtr)128) -#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uIntPtr)129) -#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uIntPtr)130) -#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uIntPtr)131) -#define SOT_FORMATSTR_ID_XFORMS ((sal_uIntPtr)132) -#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uIntPtr)133) -#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uIntPtr)134) -#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uIntPtr)135) -#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uIntPtr)136) -#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uIntPtr)137) -#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uIntPtr)138) -#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uIntPtr)139) -#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uIntPtr)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 5b6cedfbf410..163f6932d66d 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -395,7 +395,7 @@ friend class SvObject; bInClose:1; // sal_True, im DoClose void * DownAggCast( const SotFactory * pFact ); - void RemoveInterface( sal_uIntPtr ); + void RemoveInterface( sal_uLong ); void RemoveInterface( SotObject * ); #if defined (GCC) && (defined (C281) || defined (C290) || defined (C291)) public: diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx index b4f13b8d2660..630c7d6a4a0f 100644 --- a/sot/inc/sot/stg.hxx +++ b/sot/inc/sot/stg.hxx @@ -73,7 +73,7 @@ struct ClsId class SOT_DLLPUBLIC StorageBase : public SvRefBase { protected: - sal_uIntPtr m_nError; // error code + sal_uLong m_nError; // error code StreamMode m_nMode; // open mode sal_Bool m_bAutoCommit; StorageBase(); @@ -84,8 +84,8 @@ public: virtual sal_Bool Validate( sal_Bool=sal_False ) const = 0; virtual sal_Bool ValidateMode( StreamMode ) const = 0; void ResetError() const; - void SetError( sal_uIntPtr ) const; - sal_uIntPtr GetError() const; + 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( sal_Bool bSet ) @@ -96,12 +96,12 @@ class BaseStorageStream : public StorageBase { public: TYPEINFO(); - virtual sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ) = 0; - virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ) = 0; - virtual sal_uIntPtr Seek( sal_uIntPtr nPos ) = 0; - virtual sal_uIntPtr 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 sal_Bool SetSize( sal_uIntPtr nNewSize ) = 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; @@ -119,13 +119,13 @@ public: virtual const ClsId& GetClassId() const = 0; virtual void SetDirty() = 0; virtual void SetClass( const SvGlobalName & rClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual SvGlobalName GetClassName() = 0; - virtual sal_uIntPtr GetFormat() = 0; + virtual sal_uLong GetFormat() = 0; virtual String GetUserName() = 0; virtual sal_Bool ShouldConvert() = 0; virtual void FillInfoList( SvStorageInfoList* ) const = 0; @@ -172,18 +172,18 @@ public: class StorageStream : public BaseStorageStream, public OLEStorageBase { //friend class Storage; - sal_uIntPtr nPos; // current position + sal_uLong nPos; // current position protected: ~StorageStream(); public: TYPEINFO(); StorageStream( StgIo*, StgDirEntry*, StreamMode ); - virtual sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr Seek( sal_uIntPtr nPos ); - virtual sal_uIntPtr 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 sal_Bool SetSize( sal_uIntPtr nNewSize ); + virtual sal_Bool SetSize( sal_uLong nNewSize ); virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); virtual sal_Bool Commit(); virtual sal_Bool Revert(); @@ -219,13 +219,13 @@ public: virtual const ClsId& GetClassId() const; virtual void SetDirty(); virtual void SetClass( const SvGlobalName & rClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual sal_uIntPtr GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); virtual sal_Bool ShouldConvert(); virtual void FillInfoList( SvStorageInfoList* ) const; @@ -274,12 +274,12 @@ public: 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 sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr Seek( sal_uIntPtr nPos ); - virtual sal_uIntPtr 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 sal_Bool SetSize( sal_uIntPtr nNewSize ); + virtual sal_Bool SetSize( sal_uLong nNewSize ); virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); virtual sal_Bool Commit(); virtual sal_Bool Revert(); @@ -339,13 +339,13 @@ public: virtual const ClsId& GetClassId() const; virtual void SetDirty(); virtual void SetClass( const SvGlobalName & rClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual sal_uIntPtr GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); virtual sal_Bool ShouldConvert(); virtual void FillInfoList( SvStorageInfoList* ) const; diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index ccfeae4d9193..3c253fd80d1e 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -71,9 +71,9 @@ friend class SotStorage; friend class ImpStream; BaseStorageStream * pOwnStm;// Zeiger auf den eigenen Stream protected: - 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 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: @@ -91,7 +91,7 @@ public: virtual void ResetError(); - virtual void SetSize( sal_uIntPtr nNewSize ); + virtual void SetSize( sal_uLong nNewSize ); sal_uInt32 GetSize() const; sal_Bool CopyTo( SotStorageStream * pDestStm ); virtual sal_Bool Commit(); @@ -125,7 +125,7 @@ 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 - sal_uIntPtr m_nError; + sal_uLong m_nError; String m_aName; // Name des Storage sal_Bool m_bIsRoot:1, // z.B.: File-Storage m_bDelStm:1; @@ -175,9 +175,9 @@ public: return m_nVersion; } - sal_uIntPtr GetErrorCode() const { return m_nError; } - sal_uIntPtr GetError() const { return ERRCODE_TOERROR(m_nError); } - void SetError( sal_uIntPtr 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; @@ -190,13 +190,13 @@ public: // eigener Datenbereich virtual void SetClass( const SvGlobalName & rClass, - sal_uIntPtr bOriginalClipFormat, + sal_uLong bOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr bOriginalClipFormat, + sal_uLong bOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName();// Typ der Daten im Storage - virtual sal_uIntPtr GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); virtual sal_Bool ShouldConvert(); void SetName( const String& rName ); diff --git a/sot/inc/sot/storinfo.hxx b/sot/inc/sot/storinfo.hxx index 5f225c26d0de..02db24529129 100644 --- a/sot/inc/sot/storinfo.hxx +++ b/sot/inc/sot/storinfo.hxx @@ -39,14 +39,14 @@ class SvStorageInfo friend class SvStorage; String aName; SvGlobalName aClassName; - sal_uIntPtr nSize; + sal_uLong nSize; sal_Bool bStream:1, bStorage:1; SvStorageInfo(){}; // Fuer SvStorage public: SvStorageInfo( const StgDirEntry& ); - SvStorageInfo( const String& rName, sal_uIntPtr nSz, sal_Bool bIsStorage ) + SvStorageInfo( const String& rName, sal_uLong nSz, sal_Bool bIsStorage ) : aName( rName ) , nSize( nSz ) , bStream( !bIsStorage ) @@ -57,7 +57,7 @@ public: const String & GetName() const { return aName; } sal_Bool IsStream() const { return bStream; } sal_Bool IsStorage() const { return bStorage; } - sal_uIntPtr GetSize() const { return nSize; } + sal_uLong GetSize() const { return nSize; } }; class SOT_DLLPUBLIC SvStorageInfoList @@ -66,7 +66,7 @@ class SOT_DLLPUBLIC SvStorageInfoList const SvStorageInfo * Get( const String & rName ); }; -SOT_DLLPUBLIC sal_uIntPtr ReadClipboardFormat( SvStream & rStm ); -SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uIntPtr nFormat ); +SOT_DLLPUBLIC sal_uLong ReadClipboardFormat( SvStream & rStm ); +SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ); #endif // _STORINFO_HXX diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index ec45c757c369..57e65862aea2 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -237,11 +237,11 @@ static List& InitFormats_Impl() |* |* Beschreibung CLIP.SDW *************************************************************************/ -sal_uIntPtr SotExchange::RegisterFormatName( const String& rName ) +sal_uLong SotExchange::RegisterFormatName( const String& rName ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); // teste zuerst die Standard - Name - sal_uIntPtr 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; @@ -277,11 +277,11 @@ sal_uIntPtr SotExchange::RegisterFormatName( const String& rName ) return nMax + SOT_FORMATSTR_ID_USER_END + 1; } -sal_uIntPtr SotExchange::RegisterFormatMimeType( const String& rMimeType ) +sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); // teste zuerst die Standard - Name - sal_uIntPtr 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; @@ -318,9 +318,9 @@ sal_uIntPtr SotExchange::RegisterFormatMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -sal_uIntPtr SotExchange::RegisterFormat( const DataFlavor& rFlavor ) +sal_uLong SotExchange::RegisterFormat( const DataFlavor& rFlavor ) { - sal_uIntPtr nRet = GetFormat( rFlavor ); + sal_uLong nRet = GetFormat( rFlavor ); if( !nRet ) { @@ -338,7 +338,7 @@ sal_uIntPtr SotExchange::RegisterFormat( const DataFlavor& rFlavor ) |* *************************************************************************/ -sal_Bool SotExchange::GetFormatDataFlavor( sal_uIntPtr nFormat, DataFlavor& rFlavor ) +sal_Bool SotExchange::GetFormatDataFlavor( sal_uLong nFormat, DataFlavor& rFlavor ) { sal_Bool bRet; @@ -376,11 +376,11 @@ sal_Bool SotExchange::GetFormatDataFlavor( sal_uIntPtr nFormat, DataFlavor& rFla /************************************************************************* |* -|* SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) +|* SotExchange::GetFormatMimeType( sal_uLong nFormat ) |* *************************************************************************/ -String SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) +String SotExchange::GetFormatMimeType( sal_uLong nFormat ) { String sMimeType; if( SOT_FORMATSTR_ID_USER_END >= nFormat ) @@ -406,10 +406,10 @@ String SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) |* *************************************************************************/ -sal_uIntPtr SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) +sal_uLong SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); - sal_uIntPtr 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; @@ -443,12 +443,12 @@ sal_uIntPtr SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -sal_uIntPtr 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 ); - sal_uIntPtr 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 ) ) @@ -482,7 +482,7 @@ sal_uIntPtr SotExchange::GetFormat( const DataFlavor& rFlavor ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -String SotExchange::GetFormatName( sal_uIntPtr nFormat ) +String SotExchange::GetFormatName( sal_uLong nFormat ) { DataFlavor aFlavor; String aRet; diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index 3b71382906ca..44e138f7aa1f 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -129,7 +129,7 @@ void SotFactory::DeInit() if( pSotData->pDataFlavorList ) { - for( sal_uIntPtr 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; @@ -295,8 +295,8 @@ void SotFactory::TestInvariant() SotData_Impl * pSotData = SOTDATA(); if( pSotData->pObjectList ) { - sal_uIntPtr nCount = pSotData->pObjectList->Count(); - for( sal_uIntPtr i = 0; i < nCount ; i++ ) + sal_uLong nCount = pSotData->pObjectList->Count(); + for( sal_uLong i = 0; i < nCount ; i++ ) { pSotData->pObjectList->GetObject( i )->TestInvariant( sal_False ); } diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx index 5be0b01e8de6..345e6ddec84b 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -61,8 +61,8 @@ FileList::~FileList() void FileList::ClearAll( void ) { // Strings in der Liste loeschen - sal_uIntPtr nCount = pStrList->Count(); - for( sal_uIntPtr i = 0 ; i < nCount ; i++ ) + sal_uLong nCount = pStrList->Count(); + for( sal_uLong i = 0 ; i < nCount ; i++ ) delete pStrList->GetObject( i ); // Liste loeschen @@ -81,8 +81,8 @@ FileList& FileList::operator=( const FileList& rFileList ) *pStrList = *rFileList.pStrList; // Strings in der Liste kopieren - sal_uIntPtr nCount = pStrList->Count(); - for( sal_uIntPtr i = 0 ; i < nCount ; i++ ) + sal_uLong nCount = pStrList->Count(); + for( sal_uLong i = 0 ; i < nCount ; i++ ) pStrList->Replace( new String( *rFileList.pStrList->GetObject( i ) ), i ); return *this; @@ -94,7 +94,7 @@ FileList& FileList::operator=( const FileList& rFileList ) |* \*************************************************************************/ -sal_uIntPtr FileList::GetFormat() +sal_uLong FileList::GetFormat() { return FORMAT_FILE_LIST; } @@ -184,7 +184,7 @@ void FileList::AppendFile( const String& rStr ) pStrList->Insert( new String( rStr ) , pStrList->Count() ); } -String FileList::GetFile( sal_uIntPtr i ) const +String FileList::GetFile( sal_uLong i ) const { String aStr; if( i < pStrList->Count() ) @@ -192,7 +192,7 @@ String FileList::GetFile( sal_uIntPtr i ) const return aStr; } -sal_uIntPtr FileList::Count( void ) const +sal_uLong FileList::Count( void ) const { return pStrList->Count(); } diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index 81deb8e90112..f04d5d439bdc 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -46,7 +46,7 @@ using namespace::com::sun::star::datatransfer; struct SotAction_Impl { - sal_uIntPtr nFormatId; // Clipboard Id + sal_uLong nFormatId; // Clipboard Id sal_uInt16 nAction; // Action Id sal_uInt8 nContextCheckId; // additional check of content in clipboard }; @@ -1283,7 +1283,7 @@ static SotDestinationEntry_Impl __READONLY_DATA aDestinationArray[] = \ // - new style GetExchange methods - // --------------------------------- -sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_uIntPtr nId ) +sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_uLong nId ) { DataFlavorExVector::iterator aIter( ( (DataFlavorExVector&) rDataFlavorExVector ).begin() ); DataFlavorExVector::iterator aEnd( ( (DataFlavorExVector&) rDataFlavorExVector ).end() ); @@ -1370,8 +1370,8 @@ rEntry static sal_uInt16 GetTransferableAction_Impl( const DataFlavorExVector& rDataFlavorExVector, const SotAction_Impl* pArray, - sal_uIntPtr& rFormat, - sal_uIntPtr nOnlyTestFormat, + sal_uLong& rFormat, + sal_uLong nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { try @@ -1380,11 +1380,11 @@ static sal_uInt16 GetTransferableAction_Impl( { DataFlavor aFlavor; const SotAction_Impl* pArrayStart = pArray; - sal_uIntPtr 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 sal_uIntPtr nChkFormat = 0; + static sal_uLong nChkFormat = 0; if( nChkFormat ) { for( ; 0xffff != pArray->nFormatId && @@ -1458,9 +1458,9 @@ sal_uInt16 SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavor sal_uInt16 nDestination, sal_uInt16 nSourceOptions, sal_uInt16 nUserAction, - sal_uIntPtr& rFormat, + sal_uLong& rFormat, sal_uInt16& rDefaultAction, - sal_uIntPtr nOnlyTestFormat, + sal_uLong nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { // hier wird jetzt die oben definierte Tabelle "implementiert" @@ -1571,8 +1571,8 @@ sal_uInt16 SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavor sal_uInt16 SotExchange::GetExchangeAction( const Reference< XTransferable >& rxTransferable, sal_uInt16 nDestination, sal_uInt16 nSourceOptions, - sal_uInt16 nUserAction, sal_uIntPtr& rFormat, - sal_uInt16& rDefaultAction, sal_uIntPtr nOnlyTestFormat ) + sal_uInt16 nUserAction, sal_uLong& rFormat, + sal_uInt16& rDefaultAction, sal_uLong nOnlyTestFormat ) { DataFlavorExVector aVector; diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 5ac3f7f45d87..d7530163d0b5 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -151,7 +151,7 @@ sal_Bool SotObject::ShouldDelete() return sal_False; } - sal_uIntPtr i; + sal_uLong i; for( i = 1; i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); @@ -212,7 +212,7 @@ SvAggregateMemberList & SotObject::GetAggList() |* |* Beschreibung *************************************************************************/ -void SotObject::RemoveInterface( sal_uIntPtr nPos ) +void SotObject::RemoveInterface( sal_uLong nPos ) { SvAggregate & rAgg = pAggList->GetObject( nPos ); if( !rAgg.bFactory ) @@ -238,7 +238,7 @@ void SotObject::RemoveInterface( SotObject * pObjP ) { DBG_ASSERT( pObjP, "null pointer" ); DBG_ASSERT( pAggList, "no aggregation list" ); - sal_uIntPtr i; + sal_uLong i; for( i = 0; i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); @@ -298,7 +298,7 @@ void * SotObject::DownAggCast( const SotFactory * pFact ) // geht den Pfad nur Richtung aggregierte Objekte if( pAggList ) { - for( sal_uIntPtr i = 1; !pCast || i < pAggList->Count(); i++ ) + for( sal_uLong i = 1; !pCast || i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); if( rAgg.bFactory ) diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index f1f51f20343b..bf1490447b08 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -79,14 +79,14 @@ StorageBase::~StorageBase() // The following three methods are declared as const, since they // may be called from within a const method. -sal_uIntPtr StorageBase::GetError() const +sal_uLong StorageBase::GetError() const { - sal_uIntPtr n = m_nError; + sal_uLong n = m_nError; ((StorageBase*) this)->m_nError = SVSTREAM_OK; return n; } -void StorageBase::SetError( sal_uIntPtr n ) const +void StorageBase::SetError( sal_uLong n ) const { if( !m_nError ) ((StorageBase*) this)->m_nError = n; @@ -205,7 +205,7 @@ sal_Bool StorageStream::Equals( const BaseStorageStream& rStream ) const return pOther && ( pOther->pEntry == pEntry ); } -sal_uIntPtr StorageStream::Read( void* pData, sal_uIntPtr nSize ) +sal_uLong StorageStream::Read( void* pData, sal_uLong nSize ) { if( Validate() ) { @@ -219,7 +219,7 @@ sal_uIntPtr StorageStream::Read( void* pData, sal_uIntPtr nSize ) return nSize; } -sal_uIntPtr StorageStream::Write( const void* pData, sal_uIntPtr nSize ) +sal_uLong StorageStream::Write( const void* pData, sal_uLong nSize ) { if( Validate( sal_True ) ) { @@ -233,7 +233,7 @@ sal_uIntPtr StorageStream::Write( const void* pData, sal_uIntPtr nSize ) return nSize; } -sal_uIntPtr StorageStream::Seek( sal_uIntPtr n ) +sal_uLong StorageStream::Seek( sal_uLong n ) { if( Validate() ) return nPos = pEntry->Seek( n ); @@ -247,7 +247,7 @@ void StorageStream::Flush() Commit(); } -sal_Bool StorageStream::SetSize( sal_uIntPtr nNewSize ) +sal_Bool StorageStream::SetSize( sal_uLong nNewSize ) { if( Validate( sal_True ) ) { @@ -346,7 +346,7 @@ sal_Bool Storage::IsStorageFile( const String & rFileName ) sal_Bool Storage::IsStorageFile( SvStream* pStream ) { StgHeader aHdr; - sal_uIntPtr nPos = pStream->Tell(); + 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 @@ -401,7 +401,7 @@ Storage::Storage( SvStream& r, sal_Bool bDirect ) if( r.GetError() == SVSTREAM_OK ) { pIo->SetStrm( &r, sal_False ); - sal_uIntPtr nSize = r.Seek( STREAM_SEEK_TO_END ); + sal_uLong nSize = r.Seek( STREAM_SEEK_TO_END ); r.Seek( 0L ); // Initializing is OK if the stream is empty Init( sal_Bool( nSize == 0 ) ); @@ -446,7 +446,7 @@ Storage::Storage( UCBStorageStream& rStrm, sal_Bool bDirect ) pIo->SetStrm( &rStrm ); - sal_uIntPtr 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( sal_Bool( nSize == 0 ) ); @@ -469,7 +469,7 @@ void Storage::Init( sal_Bool bCreate ) bIsRoot = sal_True; if( pIo->Good() ) { - sal_uIntPtr nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); + sal_uLong nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); pIo->GetStrm()->Seek( 0L ); if( nSize ) { @@ -743,7 +743,7 @@ sal_Bool Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& BaseStorage* p1 = OpenStorage( rElem, INTERNAL_MODE ); BaseStorage* p2 = pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); - sal_uIntPtr nTmpErr = p2->GetError(); + sal_uLong nTmpErr = p2->GetError(); if( !nTmpErr ) { p2->SetClassId( p1->GetClassId() ); @@ -769,7 +769,7 @@ sal_Bool Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& BaseStorageStream* p1 = OpenStream( rElem, INTERNAL_MODE ); BaseStorageStream* p2 = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); - sal_uIntPtr nTmpErr = p2->GetError(); + sal_uLong nTmpErr = p2->GetError(); if( !nTmpErr ) { p1->CopyTo( p2 ); @@ -855,7 +855,7 @@ sal_Bool Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String { pIo->MoveError( *this ); pDest->pIo->MoveError( *pDest ); - sal_uIntPtr nErr = GetError(); + sal_uLong nErr = GetError(); if( !nErr ) nErr = pDest->GetError(); SetError( nErr ); @@ -946,7 +946,7 @@ sal_Bool Storage::Revert() // Set the storage type void Storage::SetClass( const SvGlobalName & rClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { if( Validate( sal_True ) ) @@ -973,7 +973,7 @@ void Storage::SetClass( const SvGlobalName & rClass, } void Storage::SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { if( Validate( sal_True ) ) @@ -1000,7 +1000,7 @@ SvGlobalName Storage::GetClassName() return SvGlobalName(); } -sal_uIntPtr Storage::GetFormat() +sal_uLong Storage::GetFormat() { StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index d0f0b0332482..5a0fde8b9cf1 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -105,7 +105,7 @@ void StgPage::SetPage( short nOff, sal_Int32 nVal ) // The disk cache holds the cached sectors. The sector type differ according // to their purpose. -sal_Int32 lcl_GetPageCount( sal_uIntPtr 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 @@ -135,8 +135,8 @@ StgCache::~StgCache() void StgCache::SetPhysPageSize( short n ) { nPageSize = n; - sal_uIntPtr nPos = pStrm->Tell(); - sal_uIntPtr 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 ); } @@ -397,7 +397,7 @@ sal_Bool StgCache::Open( const String& rName, StreamMode nMode ) SetStrm( pFileStrm, sal_True ); if( pFileStrm->IsOpen() ) { - sal_uIntPtr nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); + sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); nPages = lcl_GetPageCount( nFileSize, nPageSize ); pStrm->Seek( 0L ); } @@ -431,9 +431,9 @@ sal_Bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) SetError( SVSTREAM_READ_ERROR ); else if ( nPage < nPages ) { - sal_uIntPtr nPos = Page2Pos( nPage ); + sal_uLong nPos = Page2Pos( nPage ); sal_Int32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; - sal_uIntPtr nBytes = nPg2 * nPageSize; + sal_uLong nBytes = nPg2 * nPageSize; // fixed address and size for the header if( nPage == -1 ) { @@ -462,8 +462,8 @@ sal_Bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) { if( Good() ) { - sal_uIntPtr nPos = Page2Pos( nPage ); - sal_uIntPtr 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,7 +475,7 @@ sal_Bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) #endif } } - sal_uIntPtr nRes = pStrm->Write( pBuf, nBytes ); + sal_uLong nRes = pStrm->Write( pBuf, nBytes ); if( nRes != nBytes ) SetError( SVSTREAM_WRITE_ERROR ); else @@ -510,7 +510,7 @@ sal_Bool StgCache::SetSize( sal_Int32 n ) return Good(); } -void StgCache::SetError( sal_uIntPtr n ) +void StgCache::SetError( sal_uLong n ) { if( n && !nError ) nError = n; diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx index 0c1fc3eab1ff..d6849bdd4b3d 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -47,7 +47,7 @@ class StorageBase; class StgCache { StgPage* pCur; // top of LRU list StgPage* pElem1; // top of ordered list - sal_uIntPtr nError; // error code + 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 @@ -78,9 +78,9 @@ public: 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_uIntPtr GetError() { return nError; } + sal_uLong GetError() { return nError; } void MoveError( StorageBase& ); - void SetError( sal_uIntPtr ); + void SetError( sal_uLong ); void ResetError(); sal_Bool Open( const String& rName, StreamMode ); void Close(); diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index 080a4aba5268..42676a9dd222 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -504,7 +504,7 @@ void StgDirEntry::Copy( BaseStorageStream& rDest ) sal_Int32 n = GetSize(); if( rDest.SetSize( n ) && n ) { - sal_uIntPtr Pos = rDest.Tell(); + sal_uLong Pos = rDest.Tell(); sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast( aTempBytes ); Seek( 0L ); @@ -618,7 +618,7 @@ sal_Bool StgDirEntry::Strm2Tmp() { if( !pTmpStrm ) { - sal_uIntPtr n = 0; + sal_uLong n = 0; if( pCurStrm ) { // It was already commited once @@ -640,10 +640,10 @@ sal_Bool StgDirEntry::Strm2Tmp() pStgStrm->Pos2Page( 0L ); while( n ) { - sal_uIntPtr nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; - if( (sal_uIntPtr) pStgStrm->Read( p, nn ) != nn ) + if( (sal_uLong) pStgStrm->Read( p, nn ) != nn ) break; if( pTmpStrm->Write( p, nn ) != nn ) break; @@ -676,10 +676,10 @@ sal_Bool StgDirEntry::Tmp2Strm() pTmpStrm = pCurStrm, pCurStrm = NULL; if( pTmpStrm ) { - sal_uIntPtr n = pTmpStrm->GetSize(); + sal_uLong n = pTmpStrm->GetSize(); StgStrm* pNewStrm; StgIo& rIo = pStgStrm->GetIo(); - sal_uIntPtr nThreshold = (sal_uIntPtr) rIo.aHdr.GetThreshold(); + sal_uLong nThreshold = (sal_uLong) rIo.aHdr.GetThreshold(); if( n < nThreshold ) pNewStrm = new StgSmallStrm( rIo, STG_EOF, 0 ); else @@ -690,12 +690,12 @@ sal_Bool StgDirEntry::Tmp2Strm() pTmpStrm->Seek( 0L ); while( n ) { - sal_uIntPtr nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; if( pTmpStrm->Read( p, nn ) != nn ) break; - if( (sal_uIntPtr) pNewStrm->Write( p, nn ) != nn ) + if( (sal_uLong) pNewStrm->Write( p, nn ) != nn ) break; n -= nn; } diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 54dbe1d43366..0a10192528c1 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -135,7 +135,7 @@ sal_Bool StgIo::CommitAll() if( aHdr.Store( *this ) ) { pStrm->Flush(); - sal_uIntPtr n = pStrm->GetError(); + sal_uLong n = pStrm->GetError(); SetError( n ); #ifdef DBG_UTIL if( n==0 ) ValidateFATs(); @@ -163,7 +163,7 @@ public: sal_Int32 Count() { return nPages; } sal_Int32 operator[]( sal_Int32 nOffset ) { return pFat[ nOffset ]; } - sal_uIntPtr Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ); + sal_uLong Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ); sal_Bool HasUnrefChains(); }; @@ -201,7 +201,7 @@ sal_Bool EasyFat::HasUnrefChains() return sal_False; } -sal_uIntPtr EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ) +sal_uLong EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ) { if( nCount > 0 ) --nCount /= GetPageSize(), nCount++; @@ -231,17 +231,17 @@ sal_uIntPtr EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect class Validator { - sal_uIntPtr nError; + sal_uLong nError; EasyFat aSmallFat; EasyFat aFat; StgIo &rIo; - sal_uIntPtr ValidateMasterFATs(); - sal_uIntPtr ValidateDirectoryEntries(); - sal_uIntPtr FindUnrefedChains(); - sal_uIntPtr MarkAll( StgDirEntry *pEntry ); + sal_uLong ValidateMasterFATs(); + sal_uLong ValidateDirectoryEntries(); + sal_uLong FindUnrefedChains(); + sal_uLong MarkAll( StgDirEntry *pEntry ); public: @@ -254,7 +254,7 @@ Validator::Validator( StgIo &rIoP ) aFat( rIoP, rIoP.pFAT, 1 << rIoP.aHdr.GetPageSize() ), rIo( rIoP ) { - sal_uIntPtr nErr = nError = FAT_OK; + sal_uLong nErr = nError = FAT_OK; if( ( nErr = ValidateMasterFATs() ) != FAT_OK ) nError = nErr; @@ -264,10 +264,10 @@ Validator::Validator( StgIo &rIoP ) nError = nErr; } -sal_uIntPtr Validator::ValidateMasterFATs() +sal_uLong Validator::ValidateMasterFATs() { sal_Int32 nCount = rIo.aHdr.GetFATSize(); - sal_uIntPtr nErr; + sal_uLong nErr; for( sal_Int32 i = 0; i < nCount; i++ ) { if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), sal_False ), aFat.GetPageSize(), -3 )) != FAT_OK ) @@ -279,10 +279,10 @@ sal_uIntPtr Validator::ValidateMasterFATs() return FAT_OK; } -sal_uIntPtr Validator::MarkAll( StgDirEntry *pEntry ) +sal_uLong Validator::MarkAll( StgDirEntry *pEntry ) { StgIterator aIter( *pEntry ); - sal_uIntPtr nErr = FAT_OK; + sal_uLong nErr = FAT_OK; for( StgDirEntry* p = aIter.First(); p ; p = aIter.Next() ) { if( p->aEntry.GetType() == STG_STORAGE ) @@ -305,10 +305,10 @@ sal_uIntPtr Validator::MarkAll( StgDirEntry *pEntry ) return FAT_OK; } -sal_uIntPtr Validator::ValidateDirectoryEntries() +sal_uLong Validator::ValidateDirectoryEntries() { // Normale DirEntries - sal_uIntPtr nErr = MarkAll( rIo.pTOC->GetRoot() ); + sal_uLong nErr = MarkAll( rIo.pTOC->GetRoot() ); if( nErr != FAT_OK ) return nErr; // Small Data @@ -328,7 +328,7 @@ sal_uIntPtr Validator::ValidateDirectoryEntries() return nErr; } -sal_uIntPtr Validator::FindUnrefedChains() +sal_uLong Validator::FindUnrefedChains() { if( aSmallFat.HasUnrefChains() || aFat.HasUnrefChains() ) @@ -349,7 +349,7 @@ const Link& StgIo::GetErrorLink() return ErrorLink::get(); } -sal_uIntPtr StgIo::ValidateFATs() +sal_uLong StgIo::ValidateFATs() { if( bFile ) { @@ -367,7 +367,7 @@ sal_uIntPtr StgIo::ValidateFATs() delete pV; } - sal_uIntPtr nErr; + sal_uLong nErr; if( bRet1 != bRet2 ) nErr = bRet1 ? FAT_ONFILEERROR : FAT_INMEMORYERROR; else nErr = bRet1 ? FAT_OK : FAT_BOTHERROR; diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx index 43f72ebefd59..45b1985618f1 100644 --- a/sot/source/sdstor/stgio.hxx +++ b/sot/source/sdstor/stgio.hxx @@ -53,7 +53,7 @@ enum FAT_ERROR struct StgLinkArg { String aFile; - sal_uIntPtr nErr; + sal_uLong nErr; }; class StgIo : public StgCache { @@ -74,7 +74,7 @@ public: static void SetErrorLink( const Link& ); static const Link& GetErrorLink(); - sal_uIntPtr ValidateFATs( ); + sal_uLong ValidateFATs( ); }; #endif diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 250e0bc4d12b..80481957b3d0 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -58,7 +58,7 @@ StgInternalStream::~StgInternalStream() delete pStrm; } -sal_uIntPtr StgInternalStream::GetData( void* pData, sal_uIntPtr nSize ) +sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize ) { if( pStrm ) { @@ -70,7 +70,7 @@ sal_uIntPtr StgInternalStream::GetData( void* pData, sal_uIntPtr nSize ) return 0; } -sal_uIntPtr StgInternalStream::PutData( const void* pData, sal_uIntPtr nSize ) +sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize ) { if( pStrm ) { @@ -82,7 +82,7 @@ sal_uIntPtr StgInternalStream::PutData( const void* pData, sal_uIntPtr nSize ) return 0; } -sal_uIntPtr StgInternalStream::SeekPos( sal_uIntPtr nPos ) +sal_uLong StgInternalStream::SeekPos( sal_uLong nPos ) { return pStrm ? pStrm->Seek( nPos ) : 0; } @@ -129,7 +129,7 @@ sal_Bool StgCompObjStream::Load() // higher bits are ignored nLen1 &= 0xFFFF; sal_Char* p = new sal_Char[ (sal_uInt16) nLen1 ]; - if( Read( p, nLen1 ) == (sal_uIntPtr) nLen1 ) + if( Read( p, nLen1 ) == (sal_uLong) nLen1 ) { aUserName = nLen1 ? String( p, gsl_getSystemTextEncoding() ) : String(); /* // Now we can read the CB format @@ -140,7 +140,7 @@ sal_Bool StgCompObjStream::Load() // get a string name if( nLen2 > nLen1 ) delete p, p = new char[ nLen2 ]; - if( Read( p, nLen2 ) == (sal_uIntPtr) nLen2 && nLen2 ) + if( Read( p, nLen2 ) == (sal_uLong) nLen2 && nLen2 ) nCbFormat = Exchange::RegisterFormatName( String( p ) ); else SetError( SVSTREAM_GENERALERROR ); diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 5448bd3b6f9c..4f3901f5212b 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -36,9 +36,9 @@ class StgInternalStream : public SvStream { BaseStorageStream* pStrm; - 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 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&, sal_Bool ); @@ -52,12 +52,12 @@ class StgCompObjStream : public StgInternalStream { ClsId aClsId; String aUserName; - sal_uIntPtr nCbFormat; + sal_uLong nCbFormat; public: StgCompObjStream( BaseStorage&, sal_Bool ); ClsId& GetClsId() { return aClsId; } String& GetUserName() { return aUserName; } - sal_uIntPtr& GetCbFormat() { return nCbFormat; } + sal_uLong& GetCbFormat() { return nCbFormat; } sal_Bool Load(); sal_Bool Store(); }; diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index a47695fc14d7..b3a775417817 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1043,7 +1043,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) #define THRESHOLD 32768L -StgTmpStrm::StgTmpStrm( sal_uIntPtr nInitSize ) +StgTmpStrm::StgTmpStrm( sal_uLong nInitSize ) : SvMemoryStream( nInitSize > THRESHOLD ? 16 : ( nInitSize ? nInitSize : 16 ), 4096 ) @@ -1057,8 +1057,8 @@ StgTmpStrm::StgTmpStrm( sal_uIntPtr nInitSize ) sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) { - sal_uIntPtr n = rSrc.GetSize(); - sal_uIntPtr nCur = rSrc.Tell(); + sal_uLong n = rSrc.GetSize(); + sal_uLong nCur = rSrc.Tell(); SetSize( n ); if( GetError() == SVSTREAM_OK ) { @@ -1067,7 +1067,7 @@ sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) Seek( 0L ); while( n ) { - sal_uIntPtr nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; if( rSrc.Read( p, nn ) != nn ) @@ -1095,12 +1095,12 @@ StgTmpStrm::~StgTmpStrm() } } -sal_uIntPtr StgTmpStrm::GetSize() const +sal_uLong StgTmpStrm::GetSize() const { - sal_uIntPtr n; + sal_uLong n; if( pStrm ) { - sal_uIntPtr old = pStrm->Tell(); + sal_uLong old = pStrm->Tell(); n = pStrm->Seek( STREAM_SEEK_TO_END ); pStrm->Seek( old ); } @@ -1109,7 +1109,7 @@ sal_uIntPtr StgTmpStrm::GetSize() const return n; } -void StgTmpStrm::SetSize( sal_uIntPtr n ) +void StgTmpStrm::SetSize( sal_uLong n ) { if( pStrm ) pStrm->SetStreamSize( n ); @@ -1119,15 +1119,15 @@ void StgTmpStrm::SetSize( sal_uIntPtr n ) { aName = TempFile::CreateTempName(); SvFileStream* s = new SvFileStream( aName, STREAM_READWRITE ); - sal_uIntPtr nCur = Tell(); - sal_uIntPtr i = nEndOfData; + sal_uLong nCur = Tell(); + sal_uLong i = nEndOfData; if( i ) { sal_uInt8* p = new sal_uInt8[ 4096 ]; Seek( 0L ); while( i ) { - sal_uIntPtr nb = ( i > 4096 ) ? 4096 : i; + sal_uLong nb = ( i > 4096 ) ? 4096 : i; if( Read( p, nb ) == nb && s->Write( p, nb ) == nb ) i -= nb; @@ -1163,7 +1163,7 @@ void StgTmpStrm::SetSize( sal_uIntPtr n ) { if( n > nEndOfData ) { - sal_uIntPtr nCur = Tell(); + sal_uLong nCur = Tell(); Seek( nEndOfData - 1 ); *this << (sal_uInt8) 0; Seek( nCur ); @@ -1174,7 +1174,7 @@ void StgTmpStrm::SetSize( sal_uIntPtr n ) } } -sal_uIntPtr StgTmpStrm::GetData( void* pData, sal_uIntPtr n ) +sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n ) { if( pStrm ) { @@ -1186,7 +1186,7 @@ sal_uIntPtr StgTmpStrm::GetData( void* pData, sal_uIntPtr n ) return SvMemoryStream::GetData( (sal_Char *)pData, n ); } -sal_uIntPtr StgTmpStrm::PutData( const void* pData, sal_uIntPtr n ) +sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n ) { sal_uInt32 nCur = Tell(); sal_uInt32 nNew = nCur + n; @@ -1206,7 +1206,7 @@ sal_uIntPtr StgTmpStrm::PutData( const void* pData, sal_uIntPtr n ) return nNew; } -sal_uIntPtr StgTmpStrm::SeekPos( sal_uIntPtr 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 1ececadae35e..a1bb0707cdd7 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -154,17 +154,17 @@ class StgTmpStrm : public SvMemoryStream String aName; SvFileStream* pStrm; using SvMemoryStream::GetData; - 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 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( sal_uIntPtr=16 ); + StgTmpStrm( sal_uLong=16 ); ~StgTmpStrm(); sal_Bool Copy( StgTmpStrm& ); - void SetSize( sal_uIntPtr ); - sal_uIntPtr GetSize() const; + void SetSize( sal_uLong ); + sal_uLong GetSize() const; }; #endif diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index f912d76cdaf6..13c254e0cb4d 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -170,7 +170,7 @@ SotStorageStream::~SotStorageStream() *************************************************************************/ void SotStorageStream::SyncSvStream() { - sal_uIntPtr nPos = 0; + sal_uLong nPos = 0; if( pOwnStm ) { pOwnStm->Flush(); @@ -197,9 +197,9 @@ void SotStorageStream::ResetError() |* |* Beschreibung *************************************************************************/ -sal_uIntPtr SotStorageStream::GetData( void* pData, sal_uIntPtr nSize ) +sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize ) { - sal_uIntPtr nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -216,9 +216,9 @@ sal_uIntPtr SotStorageStream::GetData( void* pData, sal_uIntPtr nSize ) |* |* Beschreibung *************************************************************************/ -sal_uIntPtr SotStorageStream::PutData( const void* pData, sal_uIntPtr nSize ) +sal_uLong SotStorageStream::PutData( const void* pData, sal_uLong nSize ) { - sal_uIntPtr nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -235,9 +235,9 @@ sal_uIntPtr SotStorageStream::PutData( const void* pData, sal_uIntPtr nSize ) |* |* Beschreibung *************************************************************************/ -sal_uIntPtr SotStorageStream::SeekPos( sal_uIntPtr nPos ) +sal_uLong SotStorageStream::SeekPos( sal_uLong nPos ) { - sal_uIntPtr nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -270,9 +270,9 @@ void SotStorageStream::FlushData() |* |* Beschreibung *************************************************************************/ -void SotStorageStream::SetSize( sal_uIntPtr nNewSize ) +void SotStorageStream::SetSize( sal_uLong nNewSize ) { - sal_uIntPtr nPos = Tell(); + sal_uLong nPos = Tell(); if( pOwnStm ) { pOwnStm->SetSize( nNewSize ); @@ -297,9 +297,9 @@ void SotStorageStream::SetSize( sal_uIntPtr nNewSize ) *************************************************************************/ sal_uInt32 SotStorageStream::GetSize() const { - sal_uIntPtr nPos = Tell(); + sal_uLong nPos = Tell(); ((SotStorageStream *)this)->Seek( STREAM_SEEK_TO_END ); - sal_uIntPtr nSize = Tell(); + sal_uLong nSize = Tell(); ((SotStorageStream *)this)->Seek( nPos ); return nSize; } @@ -316,12 +316,12 @@ sal_Bool SotStorageStream::CopyTo( SotStorageStream * pDestStm ) if( !pOwnStm || !pDestStm->pOwnStm ) { // Wenn Ole2 oder nicht nur eigene StorageStreams - sal_uIntPtr nPos = Tell(); // Position merken + sal_uLong nPos = Tell(); // Position merken Seek( 0L ); pDestStm->SetSize( 0 ); // Ziel-Stream leeren void * pMem = new sal_uInt8[ 8192 ]; - sal_uIntPtr nRead; + sal_uLong nRead; while( 0 != (nRead = Read( pMem, 8192 )) ) { if( nRead != pDestStm->Write( pMem, nRead ) ) @@ -651,7 +651,7 @@ SotStorage::SotStorage( BaseStorage * pStor ) } m_pOwnStg = pStor; - sal_uIntPtr 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; @@ -973,7 +973,7 @@ void SotStorage::ResetError() |* Beschreibung *************************************************************************/ void SotStorage::SetClass( const SvGlobalName & rName, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -984,7 +984,7 @@ void SotStorage::SetClass( const SvGlobalName & rName, } void SotStorage::SetConvertClass( const SvGlobalName & rName, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1013,9 +1013,9 @@ SvGlobalName SotStorage::GetClassName() return aGN; } -sal_uIntPtr SotStorage::GetFormat() +sal_uLong SotStorage::GetFormat() { - sal_uIntPtr nFormat = 0; + sal_uLong nFormat = 0; DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) nFormat = m_pOwnStg->GetFormat(); diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 0958362f64a9..383d2f20d1c5 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -39,7 +39,7 @@ PRV_SV_IMPL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) { - for( sal_uIntPtr i = 0; i < Count(); i++ ) + for( sal_uLong i = 0; i < Count(); i++ ) { const SvStorageInfo & rType = GetObject( i ); if( rType.GetName() == rEleName ) @@ -50,7 +50,7 @@ const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) /************** class SvStorageInfo ************************************** *************************************************************************/ -sal_uIntPtr ReadClipboardFormat( SvStream & rStm ) +sal_uLong ReadClipboardFormat( SvStream & rStm ) { sal_uInt32 nFormat = 0; sal_Int32 nLen = 0; @@ -61,7 +61,7 @@ sal_uIntPtr ReadClipboardFormat( SvStream & rStm ) { // get a string name sal_Char * p = new sal_Char[ nLen ]; - if( rStm.Read( p, nLen ) == (sal_uIntPtr) nLen ) + if( rStm.Read( p, nLen ) == (sal_uLong) nLen ) { nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( p, short(nLen-1) ) ); } @@ -88,7 +88,7 @@ sal_uIntPtr ReadClipboardFormat( SvStream & rStm ) return nFormat; } -void WriteClipboardFormat( SvStream & rStm, sal_uIntPtr nFormat ) +void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ) { // determine the clipboard format string String aCbFmt; diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index ccdd42bb04bd..532877117329 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -443,10 +443,10 @@ class UCBStorageStream_Impl : public SvRefBase, public SvStream ~UCBStorageStream_Impl(); public: - 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 SetSize( sal_uIntPtr 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(); @@ -482,19 +482,19 @@ public: sal_Int16 Commit(); // if modified and commited: transfer an XInputStream to the content sal_Bool Revert(); // discard all changes BaseStorage* CreateStorage();// create an OLE Storage on the UCBStorageStream - sal_uIntPtr GetSize(); + sal_uLong GetSize(); - sal_uIntPtr ReadSourceWriteTemporary( sal_uIntPtr 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 - sal_uIntPtr ReadSourceWriteTemporary(); // read source till the end and copy to temporary, + sal_uLong ReadSourceWriteTemporary(); // read source till the end and copy to temporary, // no seeking is produced #if 0 - sal_uIntPtr CopySourceToTemporary( sal_uIntPtr aLength ); // same as ReadSourceWriteToTemporary( aLength ) + sal_uLong CopySourceToTemporary( sal_uLong aLength ); // same as ReadSourceWriteToTemporary( aLength ) // but the writing is done at the end of temporary // pointer position is not changed #endif - sal_uIntPtr 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 GetXInputStream(); // return XInputStream, after that @@ -536,7 +536,7 @@ public: sal_Bool m_bDirty; // ??? sal_Bool m_bIsLinked; sal_Bool m_bListCreated; - sal_uIntPtr m_nFormat; + sal_uLong m_nFormat; String m_aUserTypeName; SvGlobalName m_aClassId; @@ -589,7 +589,7 @@ struct UCBStorageElement_Impl { String m_aName; // the actual URL relative to the root "folder" String m_aOriginalName;// the original name in the content - sal_uIntPtr m_nSize; + 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 @@ -598,7 +598,7 @@ struct UCBStorageElement_Impl UCBStorageStream_ImplRef m_xStream; // reference to the "real" stream UCBStorageElement_Impl( const ::rtl::OUString& rName, - sal_Bool bIsFolder = sal_False, sal_uIntPtr nSize = 0 ) + sal_Bool bIsFolder = sal_False, sal_uLong nSize = 0 ) : m_aName( rName ) , m_aOriginalName( rName ) , m_nSize( nSize ) @@ -896,12 +896,12 @@ sal_Bool UCBStorageStream_Impl::Init() return sal_True; } -sal_uIntPtr 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 - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { @@ -909,7 +909,7 @@ sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary() try { - sal_uIntPtr aReaded; + sal_uLong aReaded; do { aReaded = m_rSource->readBytes( aData, 32000 ); @@ -933,12 +933,12 @@ sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary() } -sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uIntPtr 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 - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { @@ -947,11 +947,11 @@ sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uIntPtr aLength try { - sal_uIntPtr aReaded = 32000; + sal_uLong aReaded = 32000; - for( sal_uIntPtr pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) + for( sal_uLong pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) { - sal_uIntPtr 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 ); } @@ -973,14 +973,14 @@ sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uIntPtr aLength return aResult; } -sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary() +sal_uLong UCBStorageStream_Impl::CopySourceToTemporary() { // current position of the temporary stream is not changed - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { - sal_uIntPtr aPos = m_pStream->Tell(); + sal_uLong aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary(); m_pStream->Seek( aPos ); @@ -991,14 +991,14 @@ sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary() } #if 0 -sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary( sal_uIntPtr aLength ) +sal_uLong UCBStorageStream_Impl::CopySourceToTemporary( sal_uLong aLength ) { // current position of the temporary stream is not changed - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { - sal_uIntPtr aPos = m_pStream->Tell(); + sal_uLong aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary( aLength ); m_pStream->Seek( aPos ); @@ -1011,9 +1011,9 @@ sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary( sal_uIntPtr aLength ) // 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 -sal_uIntPtr UCBStorageStream_Impl::GetData( void* pData, sal_uIntPtr nSize ) +sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) { - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( !Init() ) return 0; @@ -1026,13 +1026,13 @@ sal_uIntPtr UCBStorageStream_Impl::GetData( void* pData, sal_uIntPtr nSize ) // read the tail of the data from original stream // copy this tail to the temporary stream - sal_uIntPtr aToRead = nSize - aResult; + sal_uLong aToRead = nSize - aResult; pData = (void*)( (char*)pData + aResult ); try { Sequence aData( aToRead ); - sal_uIntPtr 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 ); } @@ -1053,7 +1053,7 @@ sal_uIntPtr UCBStorageStream_Impl::GetData( void* pData, sal_uIntPtr nSize ) return aResult; } -sal_uIntPtr UCBStorageStream_Impl::PutData( const void* pData, sal_uIntPtr nSize ) +sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1064,7 +1064,7 @@ sal_uIntPtr UCBStorageStream_Impl::PutData( const void* pData, sal_uIntPtr nSize if( !nSize || !Init() ) return 0; - sal_uIntPtr aResult = m_pStream->Write( pData, nSize ); + sal_uLong aResult = m_pStream->Write( pData, nSize ); m_bModified = aResult > 0; @@ -1072,12 +1072,12 @@ sal_uIntPtr UCBStorageStream_Impl::PutData( const void* pData, sal_uIntPtr nSize } -sal_uIntPtr UCBStorageStream_Impl::SeekPos( sal_uIntPtr nPos ) +sal_uLong UCBStorageStream_Impl::SeekPos( sal_uLong nPos ) { if( !Init() ) return 0; - sal_uIntPtr aResult; + sal_uLong aResult; if( nPos == STREAM_SEEK_TO_END ) { @@ -1129,7 +1129,7 @@ sal_uIntPtr UCBStorageStream_Impl::SeekPos( sal_uIntPtr nPos ) return aResult; } -void UCBStorageStream_Impl::SetSize( sal_uIntPtr nSize ) +void UCBStorageStream_Impl::SetSize( sal_uLong nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1144,7 +1144,7 @@ void UCBStorageStream_Impl::SetSize( sal_uIntPtr nSize ) if( m_bSourceRead ) { - sal_uIntPtr 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() ); @@ -1184,15 +1184,15 @@ void UCBStorageStream_Impl::ResetError() m_pAntiImpl->ResetError(); } -sal_uIntPtr UCBStorageStream_Impl::GetSize() +sal_uLong UCBStorageStream_Impl::GetSize() { if( !Init() ) return 0; - sal_uIntPtr nPos = m_pStream->Tell(); + sal_uLong nPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); ReadSourceWriteTemporary(); - sal_uIntPtr nRet = m_pStream->Tell(); + sal_uLong nRet = m_pStream->Tell(); m_pStream->Seek( nPos ); return nRet; @@ -1423,13 +1423,13 @@ UCBStorageStream::~UCBStorageStream() pImp->ReleaseRef(); } -sal_uIntPtr UCBStorageStream::Read( void * pData, sal_uIntPtr nSize ) +sal_uLong UCBStorageStream::Read( void * pData, sal_uLong nSize ) { //return pImp->m_pStream->Read( pData, nSize ); return pImp->GetData( pData, nSize ); } -sal_uIntPtr UCBStorageStream::Write( const void* pData, sal_uIntPtr nSize ) +sal_uLong UCBStorageStream::Write( const void* pData, sal_uLong nSize ) { /* // mba: does occur in writer ! @@ -1444,13 +1444,13 @@ sal_uIntPtr UCBStorageStream::Write( const void* pData, sal_uIntPtr nSize ) return pImp->PutData( pData, nSize ); } -sal_uIntPtr UCBStorageStream::Seek( sal_uIntPtr nPos ) +sal_uLong UCBStorageStream::Seek( sal_uLong nPos ) { //return pImp->m_pStream->Seek( nPos ); return pImp->Seek( nPos ); } -sal_uIntPtr UCBStorageStream::Tell() +sal_uLong UCBStorageStream::Tell() { if( !pImp->Init() ) return 0; @@ -1463,7 +1463,7 @@ void UCBStorageStream::Flush() Commit(); } -sal_Bool UCBStorageStream::SetSize( sal_uIntPtr nNewSize ) +sal_Bool UCBStorageStream::SetSize( sal_uLong nNewSize ) { /* if ( pImp->m_bCommited ) @@ -2013,7 +2013,7 @@ void UCBStorage_Impl::ReadContent() sal_Bool bIsFolder( xRow->getBoolean(2) ); sal_Int64 nSize = xRow->getLong(4); - UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (sal_uIntPtr) nSize ); + UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (sal_uLong) nSize ); m_aChildrenList.Insert( pElement, LIST_APPEND ); sal_Bool bIsOfficeDocument = m_bIsLinked || ( m_aClassId != SvGlobalName() ); @@ -2658,7 +2658,7 @@ void UCBStorage::SetDirty() pImp->m_bDirty = sal_True; } -void UCBStorage::SetClass( const SvGlobalName & rClass, sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) +void UCBStorage::SetClass( const SvGlobalName & rClass, sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { pImp->m_aClassId = rClass; pImp->m_nFormat = nOriginalClipFormat; @@ -2697,7 +2697,7 @@ const ClsId& UCBStorage::GetClassId() const return ( const ClsId& ) pImp->m_aClassId.GetCLSID(); } -void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, sal_uIntPtr /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) +void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, sal_uLong /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) { // ??? } @@ -2713,7 +2713,7 @@ SvGlobalName UCBStorage::GetClassName() return pImp->m_aClassId; } -sal_uIntPtr UCBStorage::GetFormat() +sal_uLong UCBStorage::GetFormat() { return pImp->m_nFormat; } @@ -2733,7 +2733,7 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const if ( !pElement->m_bIsRemoved ) { // problem: what about the size of a substorage ?! - sal_uIntPtr 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 ); @@ -3339,7 +3339,7 @@ sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) if ( !pFile ) return sal_False; - sal_uIntPtr nPos = pFile->Tell(); + sal_uLong nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); if ( pFile->Tell() < 4 ) return sal_False; @@ -3370,7 +3370,7 @@ sal_Bool UCBStorage::IsDiskSpannedFile( SvStream* pFile ) if ( !pFile ) return sal_False; - sal_uIntPtr nPos = pFile->Tell(); + sal_uLong nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); if ( !pFile->Tell() ) return sal_False; @@ -3394,7 +3394,7 @@ sal_Bool UCBStorage::IsDiskSpannedFile( SvStream* pFile ) String UCBStorage::GetLinkedFile( SvStream &rStream ) { String aString; - sal_uIntPtr nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); rStream.Seek( STREAM_SEEK_TO_END ); if ( !rStream.Tell() ) return aString; -- cgit v1.2.3