diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-11 14:24:23 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-11 14:24:23 +0100 |
commit | 67d2af6fac2d9bad52a6b1f6e0cbd1229eb88a42 (patch) | |
tree | 898019746162b464578da9c8345158a74321c904 /svl | |
parent | 86fb5fff88be611785b7908aac2a44475d77705f (diff) | |
parent | e2a3d487efb2bd5e582eb10e4150530c3f7377c5 (diff) |
Merge commit 'ooo/DEV300_m101' into intm101
The following builds for me:
basebmp, basegfx, comphelper, dtrans, i18npool, i18nutil, l10ntools, o3tl,
psprint_config, regexp, rsc, sax, sot, tools, ucbhelper, unotools, vcl
The rest still needs fixing ;-)
Conflicts:
canvas/prj/build.lst
canvas/source/cairo/cairo_textlayout.cxx
canvas/source/directx/dx_winstuff.hxx
canvas/source/tools/image.cxx
canvas/source/vcl/canvashelper.cxx
comphelper/inc/comphelper/documentconstants.hxx
comphelper/inc/comphelper/optionalvalue.hxx
comphelper/inc/comphelper/querydeep.hxx
comphelper/prj/build.lst
comphelper/qa/complex/makefile.mk
comphelper/qa/string/test_string_noadditional.cxx
comphelper/source/misc/componentmodule.cxx
comphelper/source/misc/mimeconfighelper.cxx
comphelper/source/misc/querydeep.cxx
comphelper/source/misc/uieventslogger.cxx
comphelper/source/property/TypeGeneration.cxx
comphelper/test/uno_iterators/uno_iterators.cxx
comphelper/util/makefile.mk
cppcanvas/source/mtfrenderer/implrenderer.cxx
dtrans/prj/build.lst
dtrans/source/generic/dtrans.cxx
dtrans/source/win32/dtobj/FmtFilter.cxx
i18npool/prj/build.lst
i18npool/source/localedata/data/localedata_others.map
i18npool/source/localedata/data/makefile.mk
i18npool/source/localedata/localedata.cxx
i18npool/source/localedata/saxparser.cxx
i18npool/source/registerservices/registerservices.cxx
i18npool/source/search/textsearch.cxx
l10ntools/inc/cfgmerge.hxx
l10ntools/inc/export.hxx
l10ntools/inc/gsicheck.hxx
l10ntools/inc/l10ntools/vosapp.hxx
l10ntools/inc/tagtest.hxx
l10ntools/inc/xmlparse.hxx
l10ntools/layout/layoutparse.cxx
l10ntools/layout/tralay.cxx
l10ntools/source/cfgmerge.cxx
l10ntools/source/export.cxx
l10ntools/source/export2.cxx
l10ntools/source/gsicheck.cxx
l10ntools/source/help/HelpLinker.cxx
l10ntools/source/lngex.cxx
l10ntools/source/lngmerge.cxx
l10ntools/source/merge.cxx
l10ntools/source/tagtest.cxx
l10ntools/source/xmlparse.cxx
padmin/source/fontentry.cxx
padmin/source/padialog.cxx
padmin/source/padialog.src
padmin/source/pamain.cxx
rsc/inc/rscarray.hxx
rsc/inc/rscclass.hxx
rsc/inc/rscclobj.hxx
rsc/inc/rsccont.hxx
rsc/inc/rscdb.hxx
rsc/inc/rscdef.hxx
rsc/inc/rscmgr.hxx
rsc/inc/rscrange.hxx
rsc/inc/rsctop.hxx
rsc/inc/vclrsc.hxx
rsc/source/parser/rscdb.cxx
rsc/source/parser/rscicpx.cxx
rsc/source/parser/rscinit.cxx
rsc/source/prj/start.cxx
rsc/source/res/rscarray.cxx
rsc/source/res/rscclass.cxx
rsc/source/res/rscclobj.cxx
rsc/source/res/rsccont.cxx
rsc/source/res/rscmgr.cxx
rsc/source/res/rscrange.cxx
rsc/source/res/rsctop.cxx
rsc/source/rsc/rsc.cxx
rsc/source/tools/rscdef.cxx
rsc/source/tools/rsctools.cxx
sax/source/expatwrap/sax_expat.cxx
sax/source/fastparser/facreg.cxx
sax/source/tools/fastserializer.cxx
sot/inc/sot/filelist.hxx
sot/inc/sot/object.hxx
sot/source/base/factory.cxx
sot/source/base/filelist.cxx
sot/source/sdstor/stg.cxx
sot/source/sdstor/stgcache.cxx
sot/source/sdstor/stgole.cxx
sot/source/sdstor/stgstrms.cxx
sot/source/sdstor/storage.cxx
sot/source/sdstor/ucbstorage.cxx
svl/inc/svl/cenumitm.hxx
svl/inc/svl/cintitem.hxx
svl/inc/svl/cntwall.hxx
svl/inc/svl/ctypeitm.hxx
svl/inc/svl/custritm.hxx
svl/inc/svl/dateitem.hxx
svl/inc/svl/filerec.hxx
svl/inc/svl/globalnameitem.hxx
svl/inc/svl/ilstitem.hxx
svl/inc/svl/imageitm.hxx
svl/inc/svl/intitem.hxx
svl/inc/svl/itempool.hxx
svl/inc/svl/itemset.hxx
svl/inc/svl/lckbitem.hxx
svl/inc/svl/poolitem.hxx
svl/inc/svl/ptitem.hxx
svl/inc/svl/rectitem.hxx
svl/inc/svl/sfontitm.hxx
svl/inc/svl/slstitm.hxx
svl/inc/svl/srchitem.hxx
svl/inc/svl/svarray.hxx
svl/inc/svl/svdde.hxx
svl/inc/svl/svstdarr.hxx
svl/inc/svl/szitem.hxx
svl/inc/svl/visitem.hxx
svl/inc/svl/zforlist.hxx
svl/inc/svl/zformat.hxx
svl/prj/build.lst
svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx
svl/qa/complex/ConfigItems/helper/makefile.mk
svl/qa/makefile.mk
svl/source/filepicker/pickerhelper.cxx
svl/source/filerec/filerec.cxx
svl/source/items/cenumitm.cxx
svl/source/items/cintitem.cxx
svl/source/items/cntwall.cxx
svl/source/items/ctypeitm.cxx
svl/source/items/custritm.cxx
svl/source/items/dateitem.cxx
svl/source/items/globalnameitem.cxx
svl/source/items/ilstitem.cxx
svl/source/items/imageitm.cxx
svl/source/items/intitem.cxx
svl/source/items/itempool.cxx
svl/source/items/itemprop.cxx
svl/source/items/itemset.cxx
svl/source/items/lckbitem.cxx
svl/source/items/poolio.cxx
svl/source/items/poolitem.cxx
svl/source/items/ptitem.cxx
svl/source/items/rectitem.cxx
svl/source/items/slstitm.cxx
svl/source/items/srchitem.cxx
svl/source/items/style.cxx
svl/source/items/szitem.cxx
svl/source/items/visitem.cxx
svl/source/items/whiter.cxx
svl/source/memtools/svarray.cxx
svl/source/misc/PasswordHelper.cxx
svl/source/misc/adrparse.cxx
svl/source/misc/lngmisc.cxx
svl/source/notify/brdcst.cxx
svl/source/notify/listener.cxx
svl/source/notify/listenerbase.cxx
svl/source/numbers/makefile.mk
svl/source/numbers/nbdll.cxx
svl/source/numbers/zforfind.cxx
svl/source/numbers/zforlist.cxx
svl/source/numbers/zformat.cxx
svl/source/numbers/zforscan.cxx
svl/source/passwordcontainer/passwordcontainer.cxx
svl/source/svdde/ddecli.cxx
svl/source/svdde/ddeimp.hxx
svl/source/svdde/ddemlos2.h
svl/source/svdde/ddesvr.cxx
svl/source/undo/undo.cxx
svl/source/uno/registerservices.cxx
svl/util/makefile.mk
svtools/bmpmaker/bmpsum.cxx
svtools/bmpmaker/g2g.cxx
svtools/bmpmaker/makefile.mk
svtools/inc/borderhelper.hxx
svtools/inc/svtools/accessiblefactory.hxx
svtools/inc/svtools/apearcfg.hxx
svtools/inc/svtools/brwbox.hxx
svtools/inc/svtools/ctrlbox.hxx
svtools/inc/svtools/ctrltool.hxx
svtools/inc/svtools/editbrowsebox.hxx
svtools/inc/svtools/ehdl.hxx
svtools/inc/svtools/embedhlp.hxx
svtools/inc/svtools/filter.hxx
svtools/inc/svtools/ivctrl.hxx
svtools/inc/svtools/parhtml.hxx
svtools/inc/svtools/printdlg.hxx
svtools/inc/svtools/rtftoken.h
svtools/inc/svtools/ruler.hxx
svtools/inc/svtools/svicnvw.hxx
svtools/inc/svtools/svlbitm.hxx
svtools/inc/svtools/svlbox.hxx
svtools/inc/svtools/svtreebx.hxx
svtools/inc/svtools/tabbar.hxx
svtools/inc/svtools/table/abstracttablecontrol.hxx
svtools/inc/svtools/taskbar.hxx
svtools/inc/svtools/textview.hxx
svtools/inc/svtools/valueset.hxx
svtools/source/brwbox/brwbox1.cxx
svtools/source/brwbox/brwbox2.cxx
svtools/source/brwbox/datwin.cxx
svtools/source/brwbox/datwin.hxx
svtools/source/brwbox/makefile.mk
svtools/source/config/apearcfg.cxx
svtools/source/config/htmlcfg.cxx
svtools/source/config/menuoptions.cxx
svtools/source/config/miscopt.cxx
svtools/source/contnr/cont_pch.cxx
svtools/source/contnr/ctrdll.cxx
svtools/source/contnr/fileview.cxx
svtools/source/contnr/imivctl1.cxx
svtools/source/contnr/ivctrl.cxx
svtools/source/contnr/makefile.mk
svtools/source/contnr/svcontnr.src
svtools/source/contnr/svicnvw.cxx
svtools/source/contnr/svimpbox.cxx
svtools/source/contnr/svimpicn.cxx
svtools/source/contnr/svlbitm.cxx
svtools/source/contnr/svtreebx.cxx
svtools/source/contnr/templwin.cxx
svtools/source/contnr/templwin.hxx
svtools/source/control/asynclink.cxx
svtools/source/control/ctrlbox.cxx
svtools/source/control/ctrldll.cxx
svtools/source/control/ctrltool.cxx
svtools/source/control/filectrl.cxx
svtools/source/control/filectrl.src
svtools/source/control/headbar.cxx
svtools/source/control/inettbc.cxx
svtools/source/control/makefile.mk
svtools/source/control/prgsbar.cxx
svtools/source/control/roadmap.cxx
svtools/source/control/ruler.cxx
svtools/source/control/scriptedtext.cxx
svtools/source/control/stdmenu.cxx
svtools/source/control/tabbar.cxx
svtools/source/control/taskbar.cxx
svtools/source/control/taskbox.cxx
svtools/source/control/taskmisc.cxx
svtools/source/control/taskstat.cxx
svtools/source/control/valueacc.cxx
svtools/source/control/valueset.cxx
svtools/source/dialogs/addresstemplate.cxx
svtools/source/dialogs/addresstemplate.src
svtools/source/dialogs/colrdlg.src
svtools/source/dialogs/filedlg2.cxx
svtools/source/dialogs/filedlg2.hxx
svtools/source/dialogs/makefile.mk
svtools/source/dialogs/printdlg.cxx
svtools/source/dialogs/printdlg.src
svtools/source/dialogs/propctrl.cxx
svtools/source/dialogs/propctrl.hxx
svtools/source/dialogs/property.cxx
svtools/source/edit/makefile.mk
svtools/source/edit/sychconv.cxx
svtools/source/edit/syntaxhighlight.cxx
svtools/source/edit/textdoc.cxx
svtools/source/edit/texteng.cxx
svtools/source/edit/textundo.cxx
svtools/source/edit/textview.cxx
svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
svtools/source/filter.vcl/filter/dlgejpg.cxx
svtools/source/filter.vcl/filter/dlgejpg.hxx
svtools/source/filter.vcl/filter/dlgejpg.src
svtools/source/filter.vcl/filter/dlgepng.cxx
svtools/source/filter.vcl/filter/dlgepng.hxx
svtools/source/filter.vcl/filter/dlgepng.src
svtools/source/filter.vcl/filter/dlgexpor.cxx
svtools/source/filter.vcl/filter/dlgexpor.hxx
svtools/source/filter.vcl/filter/dlgexpor.src
svtools/source/filter.vcl/filter/filter2.cxx
svtools/source/filter.vcl/filter/makefile.mk
svtools/source/filter.vcl/filter/sgfbram.cxx
svtools/source/filter.vcl/filter/sgvmain.cxx
svtools/source/filter.vcl/filter/sgvspln.cxx
svtools/source/filter.vcl/filter/strings.src
svtools/source/filter.vcl/jpeg/makefile.mk
svtools/source/filter.vcl/wmf/emfwr.cxx
svtools/source/filter.vcl/wmf/emfwr.hxx
svtools/source/filter.vcl/wmf/enhwmf.cxx
svtools/source/filter.vcl/wmf/winmtf.hxx
svtools/source/filter.vcl/wmf/wmfwr.cxx
svtools/source/filter.vcl/wmf/wmfwr.hxx
svtools/source/graphic/grfcache.cxx
svtools/source/graphic/grfcache.hxx
svtools/source/graphic/grfmgr.cxx
svtools/source/graphic/makefile.mk
svtools/source/inc/accessibletableimp.hxx
svtools/source/inc/svimpbox.hxx
svtools/source/java/patchjavaerror.src
svtools/source/misc/ehdl.cxx
svtools/source/misc/errtxt.src
svtools/source/misc/helpagentwindow.cxx
svtools/source/misc/imagemgr.cxx
svtools/source/misc/imagemgr.src
svtools/source/misc/imageresourceaccess.cxx
svtools/source/misc/imap.cxx
svtools/source/misc/langtab.src
svtools/source/misc/makefile.mk
svtools/source/misc/svtdata.cxx
svtools/source/misc/templatefoldercache.cxx
svtools/source/misc/transfer2.cxx
svtools/source/misc/undo.src
svtools/source/plugapp/commtest.cxx
svtools/source/plugapp/commtest.src
svtools/source/plugapp/makefile.mk
svtools/source/plugapp/testtool.src
svtools/source/productregistration/productregistration.cxx
svtools/source/svhtml/htmlkywd.cxx
svtools/source/svhtml/parhtml.cxx
svtools/source/svrtf/rtfkey2.cxx
svtools/source/svrtf/rtfkeywd.cxx
svtools/source/table/defaultinputhandler.cxx
svtools/source/table/makefile.mk
svtools/source/table/tablecontrol.cxx
svtools/source/table/tablecontrol_impl.cxx
svtools/source/table/tablecontrol_impl.hxx
svtools/source/table/tabledatawindow.cxx
svtools/source/table/tablegeometry.cxx
svtools/source/table/tablegeometry.hxx
svtools/source/toolpanel/makefile.mk
svtools/source/toolpanel/toolpaneldrawer.cxx
svtools/source/uno/addrtempuno.cxx
svtools/source/uno/miscservices.cxx
svtools/source/uno/svtxgridcontrol.cxx
svtools/source/uno/svtxgridcontrol.hxx
svtools/source/uno/toolboxcontroller.cxx
svtools/source/uno/treecontrolpeer.cxx
svtools/source/uno/unocontroltablemodel.cxx
svtools/source/uno/unocontroltablemodel.hxx
svtools/source/uno/unoimap.cxx
svtools/source/urlobj/inetimg.cxx
svtools/util/makefile.mk
svtools/workben/browser.cxx
svtools/workben/cui/makefile.mk
svtools/workben/makefile.mk
svtools/workben/stest.cxx
svtools/workben/toolpanel/makefile.mk
svtools/workben/urange.cxx
toolkit/inc/toolkit/awt/vclxdevice.hxx
toolkit/inc/toolkit/awt/vclxgraphics.hxx
toolkit/inc/toolkit/awt/vclxwindows.hxx
toolkit/inc/toolkit/controls/dialogcontrol.hxx
toolkit/inc/toolkit/helper/property.hxx
toolkit/inc/toolkit/helper/servicenames.hxx
toolkit/inc/toolkit/helper/throbberimpl.hxx
toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java
toolkit/source/awt/asynccallback.cxx
toolkit/source/awt/vclxgraphics.cxx
toolkit/source/awt/vclxtoolkit.cxx
toolkit/source/awt/vclxwindow.cxx
toolkit/source/awt/xsimpleanimation.cxx
toolkit/source/awt/xthrobber.cxx
toolkit/source/controls/dialogcontrol.cxx
toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
toolkit/source/controls/grid/defaultgriddatamodel.cxx
toolkit/source/controls/grid/gridcontrol.cxx
toolkit/source/controls/grid/initguard.hxx
toolkit/source/controls/unocontrol.cxx
toolkit/source/controls/unocontrolcontainer.cxx
toolkit/source/controls/unocontrols.cxx
toolkit/source/helper/listenermultiplexer.cxx
toolkit/source/helper/property.cxx
toolkit/source/helper/registerservices.cxx
toolkit/source/helper/servicenames.cxx
toolkit/source/helper/throbberimpl.cxx
toolkit/source/helper/tkresmgr.cxx
tools/StaticLibrary_ooopathutils.mk
tools/bootstrp/addexes/makefile.mk
tools/bootstrp/addexes2/makefile.mk
tools/bootstrp/addexes2/mkfilt.cxx
tools/bootstrp/command.cxx
tools/bootstrp/cppdep.cxx
tools/bootstrp/iserver.cxx
tools/bootstrp/makefile.mk
tools/bootstrp/mkcreate.cxx
tools/bootstrp/prj.cxx
tools/bootstrp/rscdep.cxx
tools/bootstrp/sstring.cxx
tools/inc/bootstrp/command.hxx
tools/inc/bootstrp/mkcreate.hxx
tools/inc/bootstrp/prj.hxx
tools/inc/bootstrp/sstring.hxx
tools/inc/tools/agapi.hxx
tools/inc/tools/agitem.hxx
tools/inc/tools/chapi.hxx
tools/inc/tools/download.hxx
tools/inc/tools/eacopier.hxx
tools/inc/tools/fract.hxx
tools/inc/tools/fsys.hxx
tools/inc/tools/geninfo.hxx
tools/inc/tools/globname.hxx
tools/inc/tools/inetmime.hxx
tools/inc/tools/multisel.hxx
tools/inc/tools/poly.hxx
tools/inc/tools/postsys.h
tools/inc/tools/postwin.h
tools/inc/tools/presys.h
tools/inc/tools/prewin.h
tools/inc/tools/pstm.hxx
tools/inc/tools/ref.hxx
tools/inc/tools/simplerm.hxx
tools/inc/tools/solar.h
tools/inc/tools/table.hxx
tools/inc/tools/urlkeys.hxx
tools/inc/tools/urlobj.hxx
tools/prj/build.lst
tools/prj/d.lst
tools/qa/makefile.mk
tools/source/communi/geninfo.cxx
tools/source/debug/debug.cxx
tools/source/fsys/dirent.cxx
tools/source/fsys/tdir.cxx
tools/source/fsys/unx.cxx
tools/source/fsys/urlobj.cxx
tools/source/generic/color.cxx
tools/source/generic/config.cxx
tools/source/generic/fract.cxx
tools/source/inet/inetmime.cxx
tools/source/memtools/multisel.cxx
tools/source/memtools/table.cxx
tools/source/rc/resmgr.cxx
tools/source/ref/globname.cxx
tools/source/ref/pstm.cxx
tools/source/solar/solar.c
tools/source/stream/strmos2.cxx
tools/source/stream/strmunx.cxx
tools/source/stream/strmwnt.cxx
tools/source/string/makefile.mk
tools/source/testtoolloader/testtoolloader.cxx
tools/test/makefile.mk
tools/util/makefile.mk
tools/win/inc/dll.hxx
tools/win/inc/parser.hxx
tools/win/inc/shellex.h
tools/win/inc/shutil.h
tools/win/inc/toolsdll.hxx
tools/win/inc/winshell.hxx
tools/workben/makefile.mk
ucbhelper/source/client/proxydecider.cxx
ucbhelper/workben/ucbexplorer/ucbexplorer.hrc
unotools/inc/unotools/unotunnelhelper.hxx
unotools/source/config/fltrcfg.cxx
unotools/source/config/lingucfg.cxx
unotools/source/config/misccfg.cxx
unotools/source/config/pathoptions.cxx
unotools/source/config/searchopt.cxx
unotools/source/i18n/localedatawrapper.cxx
unotools/source/ucbhelper/localfilehelper.cxx
unotools/source/ucbhelper/ucbhelper.cxx
unotools/source/ucbhelper/xtempfile.cxx
vcl/aqua/inc/salbmp.h
vcl/aqua/inc/salgdi.h
vcl/aqua/inc/salinst.h
vcl/aqua/source/app/salinst.cxx
vcl/aqua/source/gdi/aquaprintaccessoryview.mm
vcl/aqua/source/gdi/salgdi.cxx
vcl/aqua/source/gdi/salprn.cxx
vcl/aqua/source/window/salframeview.mm
vcl/aqua/source/window/salobj.cxx
vcl/inc/vcl/bitmap.hxx
vcl/inc/vcl/brdwin.hxx
vcl/inc/vcl/button.hxx
vcl/inc/vcl/cmdevt.hxx
vcl/inc/vcl/cvtgrf.hxx
vcl/inc/vcl/dialog.hxx
vcl/inc/vcl/dockwin.hxx
vcl/inc/vcl/event.hxx
vcl/inc/vcl/fixed.hxx
vcl/inc/vcl/fldunit.hxx
vcl/inc/vcl/floatwin.hxx
vcl/inc/vcl/gdimtf.hxx
vcl/inc/vcl/glyphcache.hxx
vcl/inc/vcl/graphite_adaptors.hxx
vcl/inc/vcl/graphite_features.hxx
vcl/inc/vcl/graphite_layout.hxx
vcl/inc/vcl/ilstbox.hxx
vcl/inc/vcl/image.h
vcl/inc/vcl/imgctrl.hxx
vcl/inc/vcl/impbmpconv.hxx
vcl/inc/vcl/impprn.hxx
vcl/inc/vcl/jobset.h
vcl/inc/vcl/keycodes.hxx
vcl/inc/vcl/lstbox.hxx
vcl/inc/vcl/mapunit.hxx
vcl/inc/vcl/menu.hxx
vcl/inc/vcl/msgbox.hxx
vcl/inc/vcl/outdev.hxx
vcl/inc/vcl/prndlg.hxx
vcl/inc/vcl/salatype.hxx
vcl/inc/vcl/salbmp.hxx
vcl/inc/vcl/salgdi.hxx
vcl/inc/vcl/salinst.hxx
vcl/inc/vcl/seleng.hxx
vcl/inc/vcl/settings.hxx
vcl/inc/vcl/smartid.hxx
vcl/inc/vcl/status.hxx
vcl/inc/vcl/strhelper.hxx
vcl/inc/vcl/svapp.hxx
vcl/inc/vcl/svdata.hxx
vcl/inc/vcl/syschild.hxx
vcl/inc/vcl/sysdata.hxx
vcl/inc/vcl/taskpanelist.hxx
vcl/inc/vcl/toolbox.hxx
vcl/inc/vcl/vclevent.hxx
vcl/inc/vcl/windata.hxx
vcl/inc/vcl/window.hxx
vcl/inc/vcl/wintypes.hxx
vcl/os2/source/app/salinst.cxx
vcl/os2/source/gdi/salgdi.cxx
vcl/os2/source/window/salmenu.cxx
vcl/os2/source/window/salobj.cxx
vcl/prj/build.lst
vcl/source/app/dbggui.cxx
vcl/source/app/help.cxx
vcl/source/app/idlemgr.cxx
vcl/source/app/settings.cxx
vcl/source/app/svapp.cxx
vcl/source/app/svdata.cxx
vcl/source/app/svmain.cxx
vcl/source/app/svmainhook.cxx
vcl/source/app/unohelp.cxx
vcl/source/app/vclevent.cxx
vcl/source/control/button.cxx
vcl/source/control/combobox.cxx
vcl/source/control/edit.cxx
vcl/source/control/field.cxx
vcl/source/control/fixed.cxx
vcl/source/control/ilstbox.cxx
vcl/source/control/imgctrl.cxx
vcl/source/control/makefile.mk
vcl/source/control/tabctrl.cxx
vcl/source/gdi/bitmap.cxx
vcl/source/gdi/bitmap2.cxx
vcl/source/gdi/bitmap4.cxx
vcl/source/gdi/bmpconv.cxx
vcl/source/gdi/cvtsvm.cxx
vcl/source/gdi/font.cxx
vcl/source/gdi/gdimtf.cxx
vcl/source/gdi/image.cxx
vcl/source/gdi/impimage.cxx
vcl/source/gdi/jobset.cxx
vcl/source/gdi/makefile.mk
vcl/source/gdi/metaact.cxx
vcl/source/gdi/outdev.cxx
vcl/source/gdi/outdev3.cxx
vcl/source/gdi/outdev4.cxx
vcl/source/gdi/outdevnative.cxx
vcl/source/gdi/pdfwriter.cxx
vcl/source/gdi/pdfwriter_impl.cxx
vcl/source/gdi/print3.cxx
vcl/source/gdi/salmisc.cxx
vcl/source/glyphs/gcach_ftyp.cxx
vcl/source/glyphs/gcach_ftyp.hxx
vcl/source/glyphs/glyphcache.cxx
vcl/source/glyphs/graphite_cache.cxx
vcl/source/glyphs/graphite_layout.cxx
vcl/source/glyphs/graphite_textsrc.hxx
vcl/source/helper/canvasbitmap.cxx
vcl/source/helper/smartid.cxx
vcl/source/helper/xconnection.cxx
vcl/source/src/btntext.src
vcl/source/src/images.src
vcl/source/src/print.src
vcl/source/window/accel.cxx
vcl/source/window/accmgr.cxx
vcl/source/window/brdwin.cxx
vcl/source/window/btndlg.cxx
vcl/source/window/dlgctrl.cxx
vcl/source/window/javachild.cxx
vcl/source/window/menu.cxx
vcl/source/window/msgbox.cxx
vcl/source/window/printdlg.cxx
vcl/source/window/status.cxx
vcl/source/window/syschild.cxx
vcl/source/window/toolbox.cxx
vcl/source/window/toolbox2.cxx
vcl/source/window/window.cxx
vcl/source/window/window2.cxx
vcl/source/window/wrkwin.cxx
vcl/unx/gtk/app/gtkdata.cxx
vcl/unx/gtk/app/gtkinst.cxx
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
vcl/unx/gtk/window/gtkframe.cxx
vcl/unx/gtk/window/gtkobject.cxx
vcl/unx/headless/svpbmp.hxx
vcl/unx/headless/svpgdi.cxx
vcl/unx/headless/svpgdi.hxx
vcl/unx/headless/svpinst.cxx
vcl/unx/headless/svpinst.hxx
vcl/unx/headless/svpprn.cxx
vcl/unx/headless/svpprn.hxx
vcl/unx/headless/svppspgraphics.cxx
vcl/unx/headless/svppspgraphics.hxx
vcl/unx/headless/svptext.cxx
vcl/unx/inc/dtint.hxx
vcl/unx/inc/plugins/gtk/gtkdata.hxx
vcl/unx/inc/pspgraphics.h
vcl/unx/inc/salbmp.h
vcl/unx/inc/saldata.hxx
vcl/unx/inc/saldisp.hxx
vcl/unx/inc/salgdi.h
vcl/unx/inc/salinst.h
vcl/unx/inc/xfont.hxx
vcl/unx/kde/kdedata.cxx
vcl/unx/kde4/KDESalGraphics.cxx
vcl/unx/source/app/keysymnames.cxx
vcl/unx/source/app/saldata.cxx
vcl/unx/source/app/saldisp.cxx
vcl/unx/source/app/salinst.cxx
vcl/unx/source/app/wmadaptor.cxx
vcl/unx/source/dtrans/X11_selection.cxx
vcl/unx/source/dtrans/X11_service.cxx
vcl/unx/source/gdi/makefile.mk
vcl/unx/source/gdi/pspgraphics.cxx
vcl/unx/source/gdi/salgdi.cxx
vcl/unx/source/gdi/salgdi3.cxx
vcl/unx/source/gdi/salprnpsp.cxx
vcl/unx/source/gdi/xfont.cxx
vcl/unx/source/gdi/xlfd_attr.cxx
vcl/unx/source/gdi/xlfd_attr.hxx
vcl/unx/source/gdi/xlfd_extd.cxx
vcl/unx/source/gdi/xlfd_extd.hxx
vcl/unx/source/gdi/xlfd_smpl.cxx
vcl/unx/source/gdi/xlfd_smpl.hxx
vcl/unx/source/printer/ppdparser.cxx
vcl/unx/source/printer/printerinfomanager.cxx
vcl/unx/source/window/salframe.cxx
vcl/unx/source/window/salmenu.cxx
vcl/unx/source/window/salobj.cxx
vcl/util/makefile2.pmk
vcl/win/inc/salbmp.h
vcl/win/inc/saldata.hxx
vcl/win/inc/salgdi.h
vcl/win/inc/salinst.h
vcl/win/source/app/saldata.cxx
vcl/win/source/app/salinst.cxx
vcl/win/source/gdi/salgdi.cxx
vcl/win/source/gdi/salgdi3.cxx
vcl/win/source/gdi/salprn.cxx
vcl/win/source/gdi/winlayout.cxx
vcl/win/source/window/salframe.cxx
vcl/win/source/window/salobj.cxx
vcl/workben/outdevgrind.cxx
vos/inc/vos/execabl.hxx
vos/inc/vos/macros.hxx
vos/inc/vos/pipe.hxx
vos/inc/vos/process.hxx
vos/inc/vos/refernce.hxx
vos/inc/vos/signal.hxx
vos/inc/vos/socket.hxx
vos/inc/vos/stream.hxx
vos/inc/vos/thread.hxx
vos/source/pipe.cxx
vos/source/process.cxx
vos/source/signal.cxx
vos/source/thread.cxx
vos/source/timer.cxx
Diffstat (limited to 'svl')
203 files changed, 5753 insertions, 6321 deletions
diff --git a/svl/inc/makefile.mk b/svl/AllLangResTarget_svl.mk index a99cf8acc0d2..1ecd4dcff389 100644 --- a/svl/inc/makefile.mk +++ b/svl/AllLangResTarget_svl.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -24,25 +24,26 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ=.. -PRJNAME=svl -TARGET=inc +$(eval $(call gb_AllLangResTarget_AllLangResTarget,svl)) -# --- Settings ----------------------------------------------------- +$(eval $(call gb_AllLangResTarget_add_srs,svl,\ + svl/res \ +)) -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk +$(eval $(call gb_SrsTarget_SrsTarget,svl/res)) -# --- Files -------------------------------------------------------- -# --- Targets ------------------------------------------------------- +$(eval $(call gb_SrsTarget_set_include,svl/res,\ + $$(INCLUDE) \ + -I$(WORKDIR)/inc \ + -I$(SRCDIR)/svl/source/inc \ + -I$(SRCDIR)/svl/inc/ \ + -I$(SRCDIR)/svl/inc/svl \ +)) -.INCLUDE : target.mk +$(eval $(call gb_SrsTarget_add_files,svl/res,\ + svl/source/misc/mediatyp.src \ + svl/source/items/cstitem.src \ +)) -.IF "$(ENABLE_PCH)"!="" -ALLTAR : \ - $(SLO)$/precompiled.pch \ - $(SLO)$/precompiled_ex.pch - -.ENDIF # "$(ENABLE_PCH)"!="" diff --git a/svl/JunitTest_svl_complex.mk b/svl/JunitTest_svl_complex.mk new file mode 100755 index 000000000000..f141dadc342b --- /dev/null +++ b/svl/JunitTest_svl_complex.mk @@ -0,0 +1,59 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_JunitTest_JunitTest,svl_complex)) + +$(eval $(call gb_JunitTest_set_defs,svl_complex,\ + $$(DEFS) \ + -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/svl/qa/complex/broken_document/test_documents \ +)) + +$(eval $(call gb_JunitTest_add_jars,svl_complex,\ + $(OUTDIR)/bin/OOoRunner.jar \ + $(OUTDIR)/bin/ridl.jar \ + $(OUTDIR)/bin/test.jar \ + $(OUTDIR)/bin/unoil.jar \ + $(OUTDIR)/bin/jurt.jar \ + $(OUTDIR)/bin/ConnectivityTools.jar \ +)) + +$(eval $(call gb_JunitTest_add_sourcefiles,svl_complex,\ + svl/qa/complex/ConfigItems/CheckConfigItems \ + svl/qa/complex/passwordcontainer/PasswordContainerUnitTest \ + svl/qa/complex/passwordcontainer/TestHelper \ + svl/qa/complex/passwordcontainer/Test03 \ + svl/qa/complex/passwordcontainer/Test02 \ + svl/qa/complex/passwordcontainer/Test01 \ + svl/qa/complex/passwordcontainer/PasswordContainerTest \ + svl/qa/complex/passwordcontainer/MasterPasswdHandler \ +)) + +$(eval $(call gb_JunitTest_add_classes,svl_complex,\ + complex.passwordcontainer.PasswordContainerUnitTest \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/svl/source/filepicker/makefile.mk b/svl/Library_fsstorage.mk index a4c97ea41aa1..b3e0f02d0b8c 100644 --- a/svl/source/filepicker/makefile.mk +++ b/svl/Library_fsstorage.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -24,24 +24,39 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ=..$/.. - -PRJNAME=svl -TARGET=filepicker -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------------- - -SLOFILES =\ - $(SLO)$/pickerhelper.obj \ - $(SLO)$/pickerhistory.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk +$(eval $(call gb_Library_Library,fsstorage)) + +$(eval $(call gb_Library_set_componentfile,fsstorage,svl/source/fsstor/fsstorage)) + +$(eval $(call gb_Library_set_include,fsstorage,\ + $$(SOLARINC) \ + -I$(WORKDIR)/inc/svl \ + -I$(WORKDIR)/inc/ \ + -I$(SRCDIR)/svl/inc \ + -I$(SRCDIR)/svl/inc/svl \ + -I$(SRCDIR)/svl/source/inc \ + -I$(SRCDIR)/svl/inc/pch \ + -I$(OUTDIR)/inc/offuh \ + -I$(OUTDIR)/inc \ +)) + +$(eval $(call gb_Library_add_linked_libs,fsstorage,\ + comphelper \ + cppu \ + cppuhelper \ + sal \ + tl \ + ucbhelper \ + utl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_Library_add_exception_objects,fsstorage,\ + svl/source/fsstor/fsfactory \ + svl/source/fsstor/fsstorage \ + svl/source/fsstor/oinputstreamcontainer \ + svl/source/fsstor/ostreamcontainer \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/svl/source/filerec/makefile.mk b/svl/Library_passwordcontainer.mk index ea2b88d8d493..b4e807b7ffff 100644 --- a/svl/source/filerec/makefile.mk +++ b/svl/Library_passwordcontainer.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -25,22 +25,34 @@ # #************************************************************************* -PRJ=..$/.. - -PRJNAME=svl -TARGET=filerec - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/filerec.obj - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk - +$(eval $(call gb_Library_Library,passwordcontainer)) + +$(eval $(call gb_Library_set_componentfile,passwordcontainer,svl/source/passwordcontainer/passwordcontainer)) + +$(eval $(call gb_Library_set_include,passwordcontainer,\ + $$(SOLARINC) \ + -I$(WORKDIR)/inc/svl \ + -I$(WORKDIR)/inc/ \ + -I$(SRCDIR)/svl/inc \ + -I$(SRCDIR)/svl/inc/svl \ + -I$(SRCDIR)/svl/source/inc \ + -I$(SRCDIR)/svl/inc/pch \ + -I$(OUTDIR)/inc/offuh \ + -I$(OUTDIR)/inc \ +)) + +$(eval $(call gb_Library_add_linked_libs,passwordcontainer,\ + cppu \ + cppuhelper \ + sal \ + ucbhelper \ + utl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_Library_add_exception_objects,passwordcontainer,\ + svl/source/passwordcontainer/passwordcontainer \ + svl/source/passwordcontainer/syscreds \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk new file mode 100644 index 000000000000..2d43441cbb96 --- /dev/null +++ b/svl/Library_svl.mk @@ -0,0 +1,168 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_Library_Library,svl)) + +$(eval $(call gb_Library_add_package_headers,svl,svl_inc)) + +$(eval $(call gb_Library_add_precompiled_header,svl,$(SRCDIR)/svl/inc/pch/precompiled_svl)) + +$(eval $(call gb_Library_set_componentfile,svl,svl/util/svl)) + +$(eval $(call gb_Library_set_include,svl,\ + $$(SOLARINC) \ + -I$(SRCDIR)/svl/source/inc \ + -I$(SRCDIR)/svl/inc/pch \ + -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_set_defs,svl,\ + $$(DEFS) \ + -DSVL_DLLIMPLEMENTATION \ +)) + +$(eval $(call gb_Library_add_linked_libs,svl,\ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + i18nisolang1 \ + i18nutil \ + jvmfwk \ + sal \ + sot \ + tl \ + ucbhelper \ + utl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_Library_add_exception_objects,svl,\ + svl/inc/pch/precompiled_svl \ + svl/source/config/asiancfg \ + svl/source/config/cjkoptions \ + svl/source/config/ctloptions \ + svl/source/config/itemholder2 \ + svl/source/config/languageoptions \ + svl/source/config/srchcfg \ + svl/source/filepicker/pickerhistory \ + svl/source/filerec/filerec \ + svl/source/items/aeitem \ + svl/source/items/cenumitm \ + svl/source/items/cintitem \ + svl/source/items/cntwall \ + svl/source/items/ctypeitm \ + svl/source/items/custritm \ + svl/source/items/dateitem \ + svl/source/items/eitem \ + svl/source/items/flagitem \ + svl/source/items/globalnameitem \ + svl/source/items/ilstitem \ + svl/source/items/imageitm \ + svl/source/items/intitem \ + svl/source/items/itemiter \ + svl/source/items/itempool \ + svl/source/items/itemprop \ + svl/source/items/itemset \ + svl/source/items/lckbitem \ + svl/source/items/macitem \ + svl/source/items/poolcach \ + svl/source/items/poolio \ + svl/source/items/poolitem \ + svl/source/items/ptitem \ + svl/source/items/rectitem \ + svl/source/items/rngitem \ + svl/source/items/sfontitm \ + svl/source/items/sitem \ + svl/source/items/slstitm \ + svl/source/items/srchitem \ + svl/source/items/stritem \ + svl/source/items/style \ + svl/source/items/stylepool \ + svl/source/items/szitem \ + svl/source/items/visitem \ + svl/source/items/whiter \ + svl/source/memtools/svarray \ + svl/source/misc/PasswordHelper \ + svl/source/misc/adrparse \ + svl/source/misc/documentlockfile \ + svl/source/misc/filenotation \ + svl/source/misc/folderrestriction \ + svl/source/misc/fstathelper \ + svl/source/misc/inethist \ + svl/source/misc/inettype \ + svl/source/misc/lngmisc \ + svl/source/misc/lockfilecommon \ + svl/source/misc/ownlist \ + svl/source/misc/restrictedpaths \ + svl/source/misc/sharecontrolfile \ + svl/source/misc/strmadpt \ + svl/source/misc/svldata \ + svl/source/misc/urihelper \ + svl/source/notify/brdcst \ + svl/source/notify/broadcast \ + svl/source/notify/hint \ + svl/source/notify/isethint \ + svl/source/notify/listener \ + svl/source/notify/listenerbase \ + svl/source/notify/listeneriter \ + svl/source/notify/lstner \ + svl/source/notify/smplhint \ + svl/source/numbers/numfmuno \ + svl/source/numbers/numhead \ + svl/source/numbers/numuno \ + svl/source/numbers/supservs \ + svl/source/numbers/zforfind \ + svl/source/numbers/zforlist \ + svl/source/numbers/zformat \ + svl/source/numbers/zforscan \ + svl/source/svsql/converter \ + svl/source/undo/undo \ + svl/source/uno/pathservice \ + svl/source/uno/registerservices \ +)) + +ifeq ($(OS),WNT) +$(eval $(call gb_Library_add_exception_objects,svl,\ + svl/source/svdde/ddecli \ + svl/source/svdde/ddedata \ + svl/source/svdde/ddeinf \ + svl/source/svdde/ddestrg \ + svl/source/svdde/ddesvr \ + svl/source/svdde/ddewrap \ +)) + +$(eval $(call gb_Library_add_linked_libs,svl,\ + user32 \ +)) + +else +$(eval $(call gb_Library_add_exception_objects,svl,\ + svl/unx/source/svdde/ddedummy \ +)) +endif +# vim: set noet sw=4 ts=4: diff --git a/svl/source/memtools/makefile.mk b/svl/Makefile index e19667214d13..a79aff831024 100644 --- a/svl/source/memtools/makefile.mk +++ b/svl/Makefile @@ -25,22 +25,14 @@ # #************************************************************************* -PRJ=..$/.. +ifeq ($(strip $(SOLARENV)),) +$(error No environment set!) +endif -PRJNAME=svl -TARGET=svarray +gb_PARTIALBUILD := T +GBUILDDIR := $(SOLARENV)/gbuild +include $(GBUILDDIR)/gbuild.mk -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES=\ - $(SLO)$/svarray.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk +$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk))) +# vim: set noet sw=4 ts=4: diff --git a/svl/source/svsql/makefile.mk b/svl/Module_svl.mk index e837d022fb1e..108d487c8e0d 100644 --- a/svl/source/svsql/makefile.mk +++ b/svl/Module_svl.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -25,22 +25,22 @@ # #************************************************************************* -PRJ=..$/.. +$(eval $(call gb_Module_Module,svl)) -PRJNAME=svl -TARGET=svsql +$(eval $(call gb_Module_add_targets,svl,\ + AllLangResTarget_svl \ + Library_fsstorage \ + Library_passwordcontainer \ + Library_svl \ + Package_inc \ +)) -# --- Settings ----------------------------------------------------- +$(eval $(call gb_Module_add_subsequentcheck_targets,svl,\ + JunitTest_svl_complex \ +)) -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/converter.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk +#todo: dde platform dependent +#todo: package_inc +#todo: map file +# vim: set noet ts=4 sw=4: diff --git a/svl/Package_inc.mk b/svl/Package_inc.mk new file mode 100644 index 000000000000..c070c9ee5a6f --- /dev/null +++ b/svl/Package_inc.mk @@ -0,0 +1,129 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_Package_Package,svl_inc,$(SRCDIR)/svl/inc)) + + +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/PasswordHelper.hxx,svl/PasswordHelper.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/adrparse.hxx,svl/adrparse.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/aeitem.hxx,svl/aeitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/asiancfg.hxx,svl/asiancfg.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/brdcst.hxx,svl/brdcst.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/broadcast.hxx,svl/broadcast.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/broadcast.hxx,svl/broadcast.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cenumitm.hxx,svl/cenumitm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cintitem.hxx,svl/cintitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cjkoptions.hxx,svl/cjkoptions.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cntnrsrt.hxx,svl/cntnrsrt.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cntwall.hxx,svl/cntwall.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cntwids.hrc,svl/cntwids.hrc)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/converter.hxx,svl/converter.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ctloptions.hxx,svl/ctloptions.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ctypeitm.hxx,svl/ctypeitm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/custritm.hxx,svl/custritm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/dateitem.hxx,svl/dateitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/documentlockfile.hxx,svl/documentlockfile.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/eitem.hxx,svl/eitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/filenotation.hxx,svl/filenotation.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/filerec.hxx,svl/filerec.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/flagitem.hxx,svl/flagitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/folderrestriction.hxx,svl/folderrestriction.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/fstathelper.hxx,svl/fstathelper.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/globalnameitem.hxx,svl/globalnameitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/hint.hxx,svl/hint.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/httpcook.hxx,svl/httpcook.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ilstitem.hxx,svl/ilstitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/imageitm.hxx,svl/imageitm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inetdef.hxx,svl/inetdef.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inethist.hxx,svl/inethist.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inetmsg.hxx,svl/inetmsg.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inetstrm.hxx,svl/inetstrm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inettype.hxx,svl/inettype.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/instrm.hxx,svl/instrm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/intitem.hxx,svl/intitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/isethint.hxx,svl/isethint.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/itemiter.hxx,svl/itemiter.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/itempool.hxx,svl/itempool.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/itemprop.hxx,svl/itemprop.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/itemset.hxx,svl/itemset.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/languageoptions.hxx,svl/languageoptions.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/lckbitem.hxx,svl/lckbitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/listener.hxx,svl/listener.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/listeneriter.hxx,svl/listeneriter.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/lngmisc.hxx,svl/lngmisc.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/lockfilecommon.hxx,svl/lockfilecommon.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/lstner.hxx,svl/lstner.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/macitem.hxx,svl/macitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/mailenum.hxx,svl/mailenum.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/memberid.hrc,svl/memberid.hrc)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/metitem.hxx,svl/metitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfkeytab.hxx,svl/nfkeytab.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfsymbol.hxx,svl/nfsymbol.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfversi.hxx,svl/nfversi.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nranges.hxx,svl/nranges.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/numuno.hxx,svl/numuno.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ondemand.hxx,svl/ondemand.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/outstrm.hxx,svl/outstrm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ownlist.hxx,svl/ownlist.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/pickerhelper.hxx,svl/pickerhelper.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/pickerhistory.hxx,svl/pickerhistory.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/pickerhistoryaccess.hxx,svl/pickerhistoryaccess.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/poolcach.hxx,svl/poolcach.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/poolitem.hxx,svl/poolitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ptitem.hxx,svl/ptitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/rectitem.hxx,svl/rectitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/restrictedpaths.hxx,svl/restrictedpaths.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/rngitem.hxx,svl/rngitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/sfontitm.hxx,svl/sfontitm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/sharecontrolfile.hxx,svl/sharecontrolfile.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/slstitm.hxx,svl/slstitm.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/smplhint.hxx,svl/smplhint.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/solar.hrc,svl/solar.hrc)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/srchcfg.hxx,svl/srchcfg.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/srchdefs.hxx,svl/srchdefs.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/srchitem.hxx,svl/srchitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/stritem.hxx,svl/stritem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/strmadpt.hxx,svl/strmadpt.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/style.hrc,svl/style.hrc)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/style.hxx,svl/style.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/stylepool.hxx,svl/stylepool.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svarray.hxx,svl/svarray.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svdde.hxx,svl/svdde.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svl.hrc,svl/svl.hrc)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svldata.hxx,svl/svldata.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svldllapi.h,svl/svldllapi.h)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svstdarr.hxx,svl/svstdarr.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/szitem.hxx,svl/szitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/undo.hxx,svl/undo.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/urihelper.hxx,svl/urihelper.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/urlbmk.hxx,svl/urlbmk.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/urlfilter.hxx,svl/urlfilter.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/visitem.hxx,svl/visitem.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/whiter.hxx,svl/whiter.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/xmlement.hxx,svl/xmlement.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/zforlist.hxx,svl/zforlist.hxx)) +$(eval $(call gb_Package_add_file,svl_inc,inc/svl/zformat.hxx,svl/zformat.hxx)) diff --git a/svl/inc/PasswordHelper.hxx b/svl/inc/svl/PasswordHelper.hxx index 29f092f5fc9d..29f092f5fc9d 100644 --- a/svl/inc/PasswordHelper.hxx +++ b/svl/inc/svl/PasswordHelper.hxx diff --git a/svl/inc/adrparse.hxx b/svl/inc/svl/adrparse.hxx index dbb671889ec3..dbb671889ec3 100644 --- a/svl/inc/adrparse.hxx +++ b/svl/inc/svl/adrparse.hxx diff --git a/svl/inc/svl/aeitem.hxx b/svl/inc/svl/aeitem.hxx index 373316882829..47c437f8a177 100644 --- a/svl/inc/svl/aeitem.hxx +++ b/svl/inc/svl/aeitem.hxx @@ -41,32 +41,32 @@ class SVL_DLLPUBLIC SfxAllEnumItem: public SfxEnumItem SvUShorts* pDisabledValues; protected: - USHORT _GetPosByValue( USHORT nValue ) const; + sal_uInt16 _GetPosByValue( sal_uInt16 nValue ) const; public: TYPEINFO(); SfxAllEnumItem(); - SfxAllEnumItem( USHORT nWhich); - SfxAllEnumItem( USHORT nWhich, USHORT nVal ); - SfxAllEnumItem( USHORT nWhich, USHORT nVal, const XubString &rText ); - SfxAllEnumItem( USHORT nWhich, SvStream &rStream ); + SfxAllEnumItem( sal_uInt16 nWhich); + SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal ); + SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal, const XubString &rText ); + SfxAllEnumItem( sal_uInt16 nWhich, SvStream &rStream ); SfxAllEnumItem( const SfxAllEnumItem & ); ~SfxAllEnumItem(); - void InsertValue( USHORT nValue ); - void InsertValue( USHORT nValue, const XubString &rText ); - void RemoveValue( USHORT nValue ); + void InsertValue( sal_uInt16 nValue ); + void InsertValue( sal_uInt16 nValue, const XubString &rText ); + void RemoveValue( sal_uInt16 nValue ); void RemoveAllValues(); - USHORT GetPosByValue( USHORT nValue ) const; + sal_uInt16 GetPosByValue( sal_uInt16 nValue ) const; - virtual USHORT GetValueCount() const; - virtual USHORT GetValueByPos( USHORT nPos ) const; - virtual XubString GetValueTextByPos( USHORT nPos ) const; + virtual sal_uInt16 GetValueCount() const; + virtual sal_uInt16 GetValueByPos( sal_uInt16 nPos ) const; + virtual XubString GetValueTextByPos( sal_uInt16 nPos ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; - virtual BOOL IsEnabled( USHORT ) const; - void DisableValue( USHORT ); + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const; + virtual sal_Bool IsEnabled( sal_uInt16 ) const; + void DisableValue( sal_uInt16 ); }; #endif diff --git a/svl/inc/svl/brdcst.hxx b/svl/inc/svl/brdcst.hxx index 03c5a8316ee1..d8ad823ed6d8 100644 --- a/svl/inc/svl/brdcst.hxx +++ b/svl/inc/svl/brdcst.hxx @@ -48,7 +48,7 @@ friend class SfxListener; SfxListenerArr_Impl aListeners; private: - BOOL AddListener( SfxListener& rListener ); + sal_Bool AddListener( SfxListener& rListener ); void RemoveListener( SfxListener& rListener ); const SfxBroadcaster& operator=(const SfxBroadcaster &); // verboten @@ -67,9 +67,9 @@ public: void BroadcastDelayed( const SfxHint& rHint ); void BroadcastInIdle( const SfxHint& rHint ); - BOOL HasListeners() const; - USHORT GetListenerCount() const { return aListeners.Count(); } - SfxListener* GetListener( USHORT nNo ) const + sal_Bool HasListeners() const; + sal_uInt16 GetListenerCount() const { return aListeners.Count(); } + SfxListener* GetListener( sal_uInt16 nNo ) const { return (SfxListener*) aListeners[nNo]; } }; diff --git a/svl/inc/broadcast.hxx b/svl/inc/svl/broadcast.hxx index a1cde13a2483..1e4be881d271 100644 --- a/svl/inc/broadcast.hxx +++ b/svl/inc/svl/broadcast.hxx @@ -60,7 +60,7 @@ public: void Broadcast( const SfxHint &rHint ); - BOOL HasListeners() const { return 0 != pRoot; } + sal_Bool HasListeners() const { return 0 != pRoot; } }; diff --git a/svl/inc/svl/cenumitm.hxx b/svl/inc/svl/cenumitm.hxx index 785adccfb8e2..b74de9373f6a 100644 --- a/svl/inc/svl/cenumitm.hxx +++ b/svl/inc/svl/cenumitm.hxx @@ -39,7 +39,7 @@ DBG_NAMEEX(SfxEnumItemInterface) class SVL_DLLPUBLIC SfxEnumItemInterface: public SfxPoolItem { protected: - SfxEnumItemInterface(USHORT which): SfxPoolItem(which) {} + SfxEnumItemInterface(sal_uInt16 which): SfxPoolItem(which) {} SfxEnumItemInterface(const SfxEnumItemInterface & rItem): SfxPoolItem(rItem) {} @@ -55,15 +55,15 @@ public: const IntlWrapper * = 0) const; - virtual bool QueryValue(com::sun::star::uno::Any & rVal, BYTE = 0) const; + virtual bool QueryValue(com::sun::star::uno::Any & rVal, sal_uInt8 = 0) const; - virtual bool PutValue(const com::sun::star::uno::Any & rVal, BYTE = 0); + virtual bool PutValue(const com::sun::star::uno::Any & rVal, sal_uInt8 = 0); - virtual USHORT GetValueCount() const = 0; + virtual sal_uInt16 GetValueCount() const = 0; - virtual XubString GetValueTextByPos(USHORT nPos) const; + virtual XubString GetValueTextByPos(sal_uInt16 nPos) const; - virtual USHORT GetValueByPos(USHORT nPos) const; + virtual sal_uInt16 GetValueByPos(sal_uInt16 nPos) const; /// Return the position of some value within this enumeration. /// @@ -75,19 +75,19 @@ public: /// /// @return The position of nValue within this enumeration, or USHRT_MAX /// if not included. - virtual USHORT GetPosByValue(USHORT nValue) const; + virtual sal_uInt16 GetPosByValue(sal_uInt16 nValue) const; - virtual BOOL IsEnabled(USHORT nValue) const; + virtual sal_Bool IsEnabled(sal_uInt16 nValue) const; - virtual USHORT GetEnumValue() const = 0; + virtual sal_uInt16 GetEnumValue() const = 0; - virtual void SetEnumValue(USHORT nValue) = 0; + virtual void SetEnumValue(sal_uInt16 nValue) = 0; virtual int HasBoolValue() const; - virtual BOOL GetBoolValue() const; + virtual sal_Bool GetBoolValue() const; - virtual void SetBoolValue(BOOL bValue); + virtual void SetBoolValue(sal_Bool bValue); }; //============================================================================ @@ -95,13 +95,13 @@ DBG_NAMEEX(CntEnumItem) class SVL_DLLPUBLIC CntEnumItem: public SfxEnumItemInterface { - USHORT m_nValue; + sal_uInt16 m_nValue; protected: - CntEnumItem(USHORT which = 0, USHORT nTheValue = 0): + CntEnumItem(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0): SfxEnumItemInterface(which), m_nValue(nTheValue) {} - CntEnumItem(USHORT which, SvStream & rStream); + CntEnumItem(sal_uInt16 which, SvStream & rStream); CntEnumItem(const CntEnumItem & rItem): SfxEnumItemInterface(rItem), m_nValue(rItem.m_nValue) {} @@ -109,18 +109,18 @@ protected: public: TYPEINFO(); - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; - virtual USHORT GetEnumValue() const; + virtual sal_uInt16 GetEnumValue() const; - virtual void SetEnumValue(USHORT nTheValue); + virtual void SetEnumValue(sal_uInt16 nTheValue); - USHORT GetValue() const { return m_nValue; } + sal_uInt16 GetValue() const { return m_nValue; } - inline void SetValue(USHORT nTheValue); + inline void SetValue(sal_uInt16 nTheValue); }; -inline void CntEnumItem::SetValue(USHORT nTheValue) +inline void CntEnumItem::SetValue(sal_uInt16 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntEnumItem::SetValue(): Pooled item"); m_nValue = nTheValue; @@ -131,15 +131,15 @@ DBG_NAMEEX(CntBoolItem) class SVL_DLLPUBLIC CntBoolItem: public SfxPoolItem { - BOOL m_bValue; + sal_Bool m_bValue; public: TYPEINFO(); - CntBoolItem(USHORT which = 0, BOOL bTheValue = FALSE): + CntBoolItem(sal_uInt16 which = 0, sal_Bool bTheValue = sal_False): SfxPoolItem(which), m_bValue(bTheValue) {} - CntBoolItem(USHORT nWhich, SvStream & rStream); + CntBoolItem(sal_uInt16 nWhich, SvStream & rStream); CntBoolItem(const CntBoolItem & rItem): SfxPoolItem(rItem), m_bValue(rItem.m_bValue) {} @@ -155,23 +155,23 @@ public: const IntlWrapper * = 0) const; - virtual bool QueryValue(com::sun::star::uno::Any& rVal, BYTE = 0) const; + virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0) const; - virtual bool PutValue(const com::sun::star::uno::Any& rVal, BYTE = 0); + virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual USHORT GetValueCount() const; + virtual sal_uInt16 GetValueCount() const; - virtual UniString GetValueTextByVal(BOOL bTheValue) const; + virtual UniString GetValueTextByVal(sal_Bool bTheValue) const; - BOOL GetValue() const { return m_bValue; } + sal_Bool GetValue() const { return m_bValue; } - void SetValue(BOOL bTheValue) { m_bValue = bTheValue; } + void SetValue(sal_Bool bTheValue) { m_bValue = bTheValue; } }; #endif // _SVTOOLS_CENUMITM_HXX diff --git a/svl/inc/svl/cintitem.hxx b/svl/inc/svl/cintitem.hxx index 91cb08344b22..a6725b2fcf0b 100644 --- a/svl/inc/svl/cintitem.hxx +++ b/svl/inc/svl/cintitem.hxx @@ -38,15 +38,15 @@ DBG_NAMEEX_VISIBILITY(CntByteItem, SVL_DLLPUBLIC) class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem { - BYTE m_nValue; + sal_uInt8 m_nValue; public: TYPEINFO(); - CntByteItem(USHORT which = 0, BYTE nTheValue = 0): + CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntByteItem, 0); } - CntByteItem(USHORT which, SvStream & rStream); + CntByteItem(sal_uInt16 which, SvStream & rStream); CntByteItem(const CntByteItem & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -66,29 +66,29 @@ public: const; virtual bool QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + sal_uInt8 nMemberId = 0) const; virtual bool PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + sal_uInt8 nMemberId = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual BYTE GetMin() const; + virtual sal_uInt8 GetMin() const; - virtual BYTE GetMax() const; + virtual sal_uInt8 GetMax() const; virtual SfxFieldUnit GetUnit() const; - BYTE GetValue() const { return m_nValue; } + sal_uInt8 GetValue() const { return m_nValue; } - inline void SetValue(BYTE nTheValue); + inline void SetValue(sal_uInt8 nTheValue); }; -inline void CntByteItem::SetValue(BYTE nTheValue) +inline void CntByteItem::SetValue(sal_uInt8 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item"); m_nValue = nTheValue; @@ -99,16 +99,16 @@ DBG_NAMEEX_VISIBILITY(CntUInt16Item, SVL_DLLPUBLIC) class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem { - UINT16 m_nValue; + sal_uInt16 m_nValue; public: TYPEINFO(); - CntUInt16Item(USHORT which = 0, UINT16 nTheValue = 0): + CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntUInt16Item, 0); } - CntUInt16Item(USHORT which, SvStream & rStream); + CntUInt16Item(sal_uInt16 which, SvStream & rStream); CntUInt16Item(const CntUInt16Item & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -128,29 +128,29 @@ public: const; virtual bool QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + sal_uInt8 nMemberId = 0) const; virtual bool PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + sal_uInt8 nMemberId = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual UINT16 GetMin() const; + virtual sal_uInt16 GetMin() const; - virtual UINT16 GetMax() const; + virtual sal_uInt16 GetMax() const; virtual SfxFieldUnit GetUnit() const; - INT16 GetValue() const { return m_nValue; } + sal_Int16 GetValue() const { return m_nValue; } - inline void SetValue(UINT16 nTheValue); + inline void SetValue(sal_uInt16 nTheValue); }; -inline void CntUInt16Item::SetValue(UINT16 nTheValue) +inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item"); m_nValue = nTheValue; @@ -161,16 +161,16 @@ DBG_NAMEEX_VISIBILITY(CntInt32Item, SVL_DLLPUBLIC) class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem { - INT32 m_nValue; + sal_Int32 m_nValue; public: TYPEINFO(); - CntInt32Item(USHORT which = 0, INT32 nTheValue = 0): + CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntInt32Item, 0); } - CntInt32Item(USHORT which, SvStream & rStream); + CntInt32Item(sal_uInt16 which, SvStream & rStream); CntInt32Item(const CntInt32Item & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -190,29 +190,29 @@ public: const; virtual bool QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + sal_uInt8 nMemberId = 0) const; virtual bool PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + sal_uInt8 nMemberId = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream &, USHORT) const; + virtual SvStream & Store(SvStream &, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual INT32 GetMin() const; + virtual sal_Int32 GetMin() const; - virtual INT32 GetMax() const; + virtual sal_Int32 GetMax() const; virtual SfxFieldUnit GetUnit() const; - INT32 GetValue() const { return m_nValue; } + sal_Int32 GetValue() const { return m_nValue; } - inline void SetValue(INT32 nTheValue); + inline void SetValue(sal_Int32 nTheValue); }; -inline void CntInt32Item::SetValue(INT32 nTheValue) +inline void CntInt32Item::SetValue(sal_Int32 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item"); m_nValue = nTheValue; @@ -223,16 +223,16 @@ DBG_NAMEEX_VISIBILITY(CntUInt32Item, SVL_DLLPUBLIC) class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem { - UINT32 m_nValue; + sal_uInt32 m_nValue; public: TYPEINFO(); - CntUInt32Item(USHORT which = 0, UINT32 nTheValue = 0): + CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntUInt32Item, 0); } - CntUInt32Item(USHORT nWhich, SvStream & rStream); + CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream); CntUInt32Item(const CntUInt32Item & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -252,29 +252,29 @@ public: const; virtual bool QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + sal_uInt8 nMemberId = 0) const; virtual bool PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + sal_uInt8 nMemberId = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual UINT32 GetMin() const; + virtual sal_uInt32 GetMin() const; - virtual UINT32 GetMax() const; + virtual sal_uInt32 GetMax() const; virtual SfxFieldUnit GetUnit() const; - UINT32 GetValue() const { return m_nValue; } + sal_uInt32 GetValue() const { return m_nValue; } - inline void SetValue(UINT32 nTheValue); + inline void SetValue(sal_uInt32 nTheValue); }; -inline void CntUInt32Item::SetValue(UINT32 nTheValue) +inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item"); m_nValue = nTheValue; diff --git a/svl/inc/cntnrsrt.hxx b/svl/inc/svl/cntnrsrt.hxx index fd31ded8456c..7d2c119e9fd1 100644 --- a/svl/inc/cntnrsrt.hxx +++ b/svl/inc/svl/cntnrsrt.hxx @@ -62,17 +62,17 @@ public: \ using Container::Count; \ \ - ClassName( USHORT InitSize, USHORT ReSize ) : \ + ClassName( sal_uInt16 InitSize, sal_uInt16 ReSize ) : \ Container( CONTAINER_MAXBLOCKSIZE, InitSize, ReSize ) {} \ \ - BOOL Insert( Type* pObj ); \ + sal_Bool Insert( Type* pObj ); \ \ - Type *Remove( ULONG nPos ) \ + Type *Remove( sal_uLong nPos ) \ { return (Type *)Container::Remove( nPos ); } \ \ Type *Remove( Type* pObj ); \ \ - void DeleteAndDestroy( ULONG nPos ) \ + void DeleteAndDestroy( sal_uLong nPos ) \ { \ Type *pObj = Remove( nPos ); \ if( pObj ) \ @@ -82,15 +82,15 @@ public: \ void DeleteAndDestroy() \ { while( Count() ) DeleteAndDestroy( 0 ); } \ \ - Type* GetObject( ULONG nPos ) const \ + Type* GetObject( sal_uLong nPos ) const \ { return (Type *)Container::GetObject( nPos ); } \ \ - Type* operator[]( ULONG nPos ) const \ + Type* operator[]( sal_uLong nPos ) const \ { return GetObject(nPos); } \ \ - BOOL Seek_Entry( const Type *pObj, ULONG* pPos ) const; \ + sal_Bool Seek_Entry( const Type *pObj, sal_uLong* pPos ) const; \ \ - ULONG GetPos( const Type* pObj ) const; \ + sal_uLong GetPos( const Type* pObj ) const; \ #define DECLARE_CONTAINER_SORT( ClassName, Type ) \ @@ -110,10 +110,10 @@ class ClassName : private Container \ #define IMPL_CONTAINER_SORT( ClassName, Type, SortFunc ) \ -BOOL ClassName::Insert( Type *pObj ) \ +sal_Bool ClassName::Insert( Type *pObj ) \ { \ - ULONG nPos; \ - BOOL bExist = Seek_Entry( pObj, &nPos ); \ + sal_uLong nPos; \ + sal_Bool bExist = Seek_Entry( pObj, &nPos ); \ if( !bExist ) \ Container::Insert( pObj, nPos ); \ return !bExist; \ @@ -121,25 +121,25 @@ BOOL ClassName::Insert( Type *pObj ) \ \ Type *ClassName::Remove( Type* pObj ) \ { \ - ULONG nPos; \ + sal_uLong nPos; \ if( Seek_Entry( pObj, &nPos ) ) \ return Remove( nPos ); \ else \ return 0; \ } \ \ -ULONG ClassName::GetPos( const Type* pObj ) const \ +sal_uLong ClassName::GetPos( const Type* pObj ) const \ { \ - ULONG nPos; \ + sal_uLong nPos; \ if( Seek_Entry( pObj, &nPos ) ) \ return nPos; \ else \ return CONTAINER_ENTRY_NOTFOUND; \ } \ \ -BOOL ClassName::Seek_Entry( const Type* pObj, ULONG* pPos ) const \ +sal_Bool ClassName::Seek_Entry( const Type* pObj, sal_uLong* pPos ) const \ { \ - register ULONG nO = Count(), \ + register sal_uLong nO = Count(), \ nM, \ nU = 0; \ if( nO > 0 ) \ @@ -153,21 +153,21 @@ BOOL ClassName::Seek_Entry( const Type* pObj, ULONG* pPos ) const \ if( 0 == nCmp ) \ { \ if( pPos ) *pPos = nM; \ - return TRUE; \ + return sal_True; \ } \ else if( nCmp < 0 ) \ nU = nM + 1; \ else if( nM == 0 ) \ { \ if( pPos ) *pPos = nU; \ - return FALSE; \ + return sal_False; \ } \ else \ nO = nM - 1; \ } \ } \ if( pPos ) *pPos = nU; \ - return FALSE; \ + return sal_False; \ } \ #endif diff --git a/svl/inc/svl/cntwall.hxx b/svl/inc/svl/cntwall.hxx index dc36880daa1b..5e7828641c8f 100644 --- a/svl/inc/svl/cntwall.hxx +++ b/svl/inc/svl/cntwall.hxx @@ -42,35 +42,35 @@ class SVL_DLLPUBLIC CntWallpaperItem : public SfxPoolItem private: UniString _aURL; Color _nColor; - USHORT _nStyle; + sal_uInt16 _nStyle; public: TYPEINFO(); - CntWallpaperItem( USHORT nWhich ); - CntWallpaperItem( USHORT nWhich, SvStream& rStream, USHORT nVersion ); + CntWallpaperItem( sal_uInt16 nWhich ); + CntWallpaperItem( sal_uInt16 nWhich, SvStream& rStream, sal_uInt16 nVersion ); CntWallpaperItem( const CntWallpaperItem& rCpy ); ~CntWallpaperItem(); - virtual USHORT GetVersion(USHORT) const; + virtual sal_uInt16 GetVersion(sal_uInt16) const; virtual int operator==( const SfxPoolItem& ) const; - virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; - virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const; + virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; virtual bool PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); void SetBitmapURL( const UniString& rURL ) { _aURL = rURL; } void SetColor( Color nColor ) { _nColor = nColor; } - void SetStyle( USHORT nStyle ) { _nStyle = nStyle; } + void SetStyle( sal_uInt16 nStyle ) { _nStyle = nStyle; } const UniString& GetBitmapURL() const { return _aURL; } Color GetColor() const { return _nColor; } - USHORT GetStyle() const { return _nStyle; } + sal_uInt16 GetStyle() const { return _nStyle; } }; //////////////////////////////////////////////////////////////////////////////// diff --git a/svl/inc/cntwids.hrc b/svl/inc/svl/cntwids.hrc index d14cf590d740..d14cf590d740 100644 --- a/svl/inc/cntwids.hrc +++ b/svl/inc/svl/cntwids.hrc diff --git a/svl/inc/converter.hxx b/svl/inc/svl/converter.hxx index 1a9411656839..fc2513c3b61f 100644 --- a/svl/inc/converter.hxx +++ b/svl/inc/svl/converter.hxx @@ -34,8 +34,8 @@ class SvDbaseConverter { public: - SVL_DLLPUBLIC static INT32 ConvertPrecisionToDbase(INT32 _nLen, INT32 _nScale); - SVL_DLLPUBLIC static INT32 ConvertPrecisionToOdbc(INT32 _nLen, INT32 _nScale); + SVL_DLLPUBLIC static sal_Int32 ConvertPrecisionToDbase(sal_Int32 _nLen, sal_Int32 _nScale); + SVL_DLLPUBLIC static sal_Int32 ConvertPrecisionToOdbc(sal_Int32 _nLen, sal_Int32 _nScale); }; #endif //_CONVERTER_HXX_ diff --git a/svl/inc/svl/ctypeitm.hxx b/svl/inc/svl/ctypeitm.hxx index 03a10d99d951..82f0bd1179c4 100644 --- a/svl/inc/svl/ctypeitm.hxx +++ b/svl/inc/svl/ctypeitm.hxx @@ -43,17 +43,17 @@ public: TYPEINFO(); CntContentTypeItem(); - CntContentTypeItem( USHORT nWhich, const XubString& rType ); - CntContentTypeItem( USHORT nWhich, const INetContentType eType ); + CntContentTypeItem( sal_uInt16 nWhich, const XubString& rType ); + CntContentTypeItem( sal_uInt16 nWhich, const INetContentType eType ); CntContentTypeItem( const CntContentTypeItem& rOrig ); virtual SfxPoolItem* Create( SvStream& rStream, - USHORT nItemVersion ) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + sal_uInt16 nItemVersion ) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual int operator==( const SfxPoolItem& rOrig ) const; - virtual USHORT GetVersion(USHORT) const; + virtual sal_uInt16 GetVersion(sal_uInt16) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = NULL ) const; @@ -70,9 +70,9 @@ public: const IntlWrapper* pIntlWrapper = 0 ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; virtual bool PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + sal_uInt8 nMemberId = 0); INetContentType GetEnumValue() const; diff --git a/svl/inc/svl/custritm.hxx b/svl/inc/svl/custritm.hxx index b84d8a8ee29b..d0346ef5d461 100644 --- a/svl/inc/svl/custritm.hxx +++ b/svl/inc/svl/custritm.hxx @@ -43,10 +43,10 @@ class SVL_DLLPUBLIC CntUnencodedStringItem: public SfxPoolItem public: TYPEINFO(); - CntUnencodedStringItem(USHORT which = 0): SfxPoolItem(which) + CntUnencodedStringItem(sal_uInt16 which = 0): SfxPoolItem(which) { DBG_CTOR(CntUnencodedStringItem, 0); } - CntUnencodedStringItem(USHORT which, const XubString & rTheValue): + CntUnencodedStringItem(sal_uInt16 which, const XubString & rTheValue): SfxPoolItem(which), m_aValue(rTheValue) { DBG_CTOR(CntUnencodedStringItem, 0); } @@ -70,10 +70,10 @@ public: const; virtual bool QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + sal_uInt8 nMemberId = 0) const; virtual bool PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + sal_uInt8 nMemberId = 0); virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; diff --git a/svl/inc/svl/dateitem.hxx b/svl/inc/svl/dateitem.hxx index 51770ab651a4..e9bae366b018 100644 --- a/svl/inc/svl/dateitem.hxx +++ b/svl/inc/svl/dateitem.hxx @@ -47,8 +47,8 @@ private: public: TYPEINFO(); - SfxDateTimeItem( USHORT nWhich ); - SfxDateTimeItem( USHORT nWhich, + SfxDateTimeItem( sal_uInt16 nWhich ); + SfxDateTimeItem( sal_uInt16 nWhich, const DateTime& rDT ); SfxDateTimeItem( const SfxDateTimeItem& rCpy ); @@ -58,8 +58,8 @@ public: virtual int operator==( const SfxPoolItem& ) const; using SfxPoolItem::Compare; virtual int Compare( const SfxPoolItem &rWith ) const; - virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; - virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const; + virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -76,9 +76,9 @@ public: aDateTime = rDT; } virtual bool PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; }; class SfxColumnDateTimeItem : public SfxDateTimeItem @@ -86,8 +86,8 @@ class SfxColumnDateTimeItem : public SfxDateTimeItem public: TYPEINFO(); - SfxColumnDateTimeItem( USHORT nWhich ); - SfxColumnDateTimeItem( USHORT nWhich, + SfxColumnDateTimeItem( sal_uInt16 nWhich ); + SfxColumnDateTimeItem( sal_uInt16 nWhich, const DateTime& rDT ); SfxColumnDateTimeItem( const SfxDateTimeItem& rCpy ); diff --git a/svl/inc/svl/eitem.hxx b/svl/inc/svl/eitem.hxx index c678ec9ab30a..ea715c349922 100644 --- a/svl/inc/svl/eitem.hxx +++ b/svl/inc/svl/eitem.hxx @@ -36,10 +36,10 @@ class SVL_DLLPUBLIC SfxEnumItem: public CntEnumItem { protected: - SfxEnumItem(USHORT which = 0, USHORT nValue = 0): + SfxEnumItem(sal_uInt16 which = 0, sal_uInt16 nValue = 0): CntEnumItem(which, nValue) {} - SfxEnumItem(USHORT which, SvStream & rStream): + SfxEnumItem(sal_uInt16 which, SvStream & rStream): CntEnumItem(which, rStream) {} public: @@ -53,13 +53,13 @@ class SVL_DLLPUBLIC SfxBoolItem: public CntBoolItem public: TYPEINFO(); - SfxBoolItem(USHORT which = 0, BOOL bValue = FALSE): + SfxBoolItem(sal_uInt16 which = 0, sal_Bool bValue = sal_False): CntBoolItem(which, bValue) {} - SfxBoolItem(USHORT which, SvStream & rStream): + SfxBoolItem(sal_uInt16 which, SvStream & rStream): CntBoolItem(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const { return new SfxBoolItem(Which(), rStream); } virtual SfxPoolItem * Clone(SfxItemPool * = 0) const diff --git a/svl/inc/filenotation.hxx b/svl/inc/svl/filenotation.hxx index b339282fc96a..65f28659e056 100644 --- a/svl/inc/filenotation.hxx +++ b/svl/inc/svl/filenotation.hxx @@ -1,4 +1,3 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,4 +69,3 @@ namespace svt #endif // SVTOOLS_FILENOTATION_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/filerec.hxx b/svl/inc/svl/filerec.hxx index ca17a939fc60..6b7ff27ba506 100644 --- a/svl/inc/svl/filerec.hxx +++ b/svl/inc/svl/filerec.hxx @@ -36,22 +36,22 @@ #include <tools/stream.hxx> #include <svl/svarray.hxx> -SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) +SV_DECL_VARARR( SfxUINT32s, sal_uInt32, 8, 8 ) //------------------------------------------------------------------------ -#define SFX_REC_PRETAG_EXT BYTE(0x00) // Pre-Tag f"ur Extended-Records -#define SFX_REC_PRETAG_EOR BYTE(0xFF) // Pre-Tag f"ur End-Of-Records - -#define SFX_REC_TYPE_NONE BYTE(0x00) // unbekannter Record-Typ -#define SFX_REC_TYPE_FIRST BYTE(0x01) -#define SFX_REC_TYPE_SINGLE BYTE(0x01) // Single-Content-Record -#define SFX_REC_TYPE_FIXSIZE BYTE(0x02) // Fix-Size-Multi-Content-Record -#define SFX_REC_TYPE_VARSIZE_RELOC BYTE(0x03) // variable Rec-Size -#define SFX_REC_TYPE_VARSIZE BYTE(0x04) // alt (nicht verschiebbar) -#define SFX_REC_TYPE_MIXTAGS_RELOC BYTE(0x07) // Mixed Tag Content-Record -#define SFX_REC_TYPE_MIXTAGS BYTE(0x08) // alt (nicht verschiebbar) -#define SFX_REC_TYPE_LAST BYTE(0x08) +#define SFX_REC_PRETAG_EXT sal_uInt8(0x00) // Pre-Tag f"ur Extended-Records +#define SFX_REC_PRETAG_EOR sal_uInt8(0xFF) // Pre-Tag f"ur End-Of-Records + +#define SFX_REC_TYPE_NONE sal_uInt8(0x00) // unbekannter Record-Typ +#define SFX_REC_TYPE_FIRST sal_uInt8(0x01) +#define SFX_REC_TYPE_SINGLE sal_uInt8(0x01) // Single-Content-Record +#define SFX_REC_TYPE_FIXSIZE sal_uInt8(0x02) // Fix-Size-Multi-Content-Record +#define SFX_REC_TYPE_VARSIZE_RELOC sal_uInt8(0x03) // variable Rec-Size +#define SFX_REC_TYPE_VARSIZE sal_uInt8(0x04) // alt (nicht verschiebbar) +#define SFX_REC_TYPE_MIXTAGS_RELOC sal_uInt8(0x07) // Mixed Tag Content-Record +#define SFX_REC_TYPE_MIXTAGS sal_uInt8(0x08) // alt (nicht verschiebbar) +#define SFX_REC_TYPE_LAST sal_uInt8(0x08) #define SFX_REC_TYPE_MINI 0x100 // Mini-Record #define SFX_REC_TYPE_DRAWENG 0x400 // Drawing-Engine-Record #define SFX_REC_TYPE_EOR 0xF00 // End-Of-Records @@ -123,9 +123,9 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) Struktur des Mini-Records: - 1 BYTE Pre-Tag - 3 BYTE OffsetToEndOfRec - OffsetToEndOfRec* 1 BYTE Content + 1 sal_uInt8 Pre-Tag + 3 sal_uInt8 OffsetToEndOfRec + OffsetToEndOfRec* 1 sal_uInt8 Content Bei den Extended-Reords folgt auf diesen 4-Byte-Header ein erweiterter Header, der zun"achst den o.g. Record-Typ, dann eine Versions-Kennung @@ -133,13 +133,13 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) Struktur des Extended-Records: - 1 BYTE Pre-Tag (==0x00) - 3 BYTE OffsetToEndOfRec - OffsetToEndOfRec* 1 BYTE Content - 1 BYTE Record-Type - 1 BYTE Version - 2 BYTE Tag - ContentSize* 1 BYTE Content + 1 sal_uInt8 Pre-Tag (==0x00) + 3 sal_uInt8 OffsetToEndOfRec + OffsetToEndOfRec* 1 sal_uInt8 Content + 1 sal_uInt8 Record-Type + 1 sal_uInt8 Version + 2 sal_uInt8 Tag + ContentSize* 1 sal_uInt8 Content (ContentSize = OffsetToEndOfRec - 8) @@ -159,7 +159,7 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) m"ussen. => die Bytes 2-4 werden bei allen Records als Offset zum Ende des Records interpretiert, so da\s die Gesamt-Recors-Size sich wie - folgt berechnet: sizeof(UINT32) + OffsetToEndOfRec + folgt berechnet: sizeof(sal_uInt32) + OffsetToEndOfRec Die Records sollten einfach zu parsen un einheitlich aufgebaut sein. => Sie bauen aufeinander auf, so ist z.B. der SfxMiniRecord in jedem @@ -190,7 +190,7 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter /* [Beschreibung] Mit Instanzen dieser Klasse kann ein einfacher Record in einen Stream - geschrieben werden, der sich durch ein BYTE-Tag identifiziert, sowie + geschrieben werden, der sich durch ein sal_uInt8-Tag identifiziert, sowie seine eigene L"ange speichert und somit auch von "alteren Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen, "ubersprungen werden kann. Es wird keine Version-Nummer gespeichert. @@ -205,9 +205,9 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter [Fileformat] - 1* BYTE Content-Tag (!= 0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - SizeOfContent* BYTE Content + 1* sal_uInt8 Content-Tag (!= 0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + SizeOfContent* sal_uInt8 Content [Beispiel] @@ -221,15 +221,15 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter { protected: SvStream* _pStream; // <SvStream>, in dem der Record liegt - UINT32 _nStartPos; // Start-Position des Gesamt-Records im Stream + sal_uInt32 _nStartPos; // Start-Position des Gesamt-Records im Stream bool _bHeaderOk; /* TRUE, wenn der Header schon geschrieben ist; */ - BYTE _nPreTag; // in den Header zu schreibendes 'Pre-Tag' + sal_uInt8 _nPreTag; // in den Header zu schreibendes 'Pre-Tag' public: inline SfxMiniRecordWriter( SvStream *pStream, - BYTE nTag ); - inline SfxMiniRecordWriter( SvStream *pStream, BYTE nTag, - UINT32 nSize ); + sal_uInt8 nTag ); + inline SfxMiniRecordWriter( SvStream *pStream, sal_uInt8 nTag, + sal_uInt32 nSize ); inline ~SfxMiniRecordWriter(); @@ -237,7 +237,7 @@ public: inline void Reset(); - UINT32 Close( bool bSeekToEndOfRec = true ); + sal_uInt32 Close( bool bSeekToEndOfRec = true ); private: // not implementend, not allowed @@ -276,35 +276,35 @@ class SVL_DLLPUBLIC SfxMiniRecordReader { protected: SvStream* _pStream; // <SvStream>, aus dem gelesen wird - UINT32 _nEofRec; // Position direkt hinter dem Record + sal_uInt32 _nEofRec; // Position direkt hinter dem Record bool _bSkipped; // TRUE: der Record wurde explizit geskippt - BYTE _nPreTag; // aus dem Header gelesenes Pre-Tag + sal_uInt8 _nPreTag; // aus dem Header gelesenes Pre-Tag // Drei-Phasen-Ctor f"ur Subklassen SfxMiniRecordReader() {} - void Construct_Impl( SvStream *pStream, BYTE nTag ) + void Construct_Impl( SvStream *pStream, sal_uInt8 nTag ) { _pStream = pStream; - _bSkipped = FALSE; + _bSkipped = sal_False; _nPreTag = nTag; } - inline bool SetHeader_Impl( UINT32 nHeader ); + inline bool SetHeader_Impl( sal_uInt32 nHeader ); // als ung"ultig markieren und zur"uck-seeken - void SetInvalid_Impl( UINT32 nRecordStartPos ) + void SetInvalid_Impl( sal_uInt32 nRecordStartPos ) { _nPreTag = SFX_REC_PRETAG_EOR; _pStream->Seek( nRecordStartPos ); } public: - static USHORT ScanRecordType( SvStream *pStream ); + static sal_uInt16 ScanRecordType( SvStream *pStream ); SfxMiniRecordReader( SvStream *pStream ); - SfxMiniRecordReader( SvStream *pStream, BYTE nTag ); + SfxMiniRecordReader( SvStream *pStream, sal_uInt8 nTag ); inline ~SfxMiniRecordReader(); - inline BYTE GetTag() const; + inline sal_uInt8 GetTag() const; inline bool IsValid() const; inline SvStream& operator*() const; @@ -324,8 +324,8 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter /* [Beschreibung] Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben - werden, dessen einziger Inhalt sich durch ein UINT16-Tag und eine - BYTE-Versions-Nummer identifiziert, sowie seine eigene L"ange speichert + werden, dessen einziger Inhalt sich durch ein sal_uInt16-Tag und eine + sal_uInt8-Versions-Nummer identifiziert, sowie seine eigene L"ange speichert und somit auch von "alteren Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen, "ubersprungen werden kann. @@ -339,12 +339,12 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter [Fileformat] - 1* BYTE Pre-Tag (!= 0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - 1* BYTE Record-Type (==SFX_REC_TYPE_SINGLE) - 1* BYTE Content-Version - 1* USHORT Content-Tag - SizeOfContent* BYTE Content + 1* sal_uInt8 Pre-Tag (!= 0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_SINGLE) + 1* sal_uInt8 Content-Version + 1* sal_uInt16 Content-Tag + SizeOfContent* sal_uInt8 Content [Beispiel] @@ -357,20 +357,20 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter { protected: - SfxSingleRecordWriter( BYTE nRecordType, + SfxSingleRecordWriter( sal_uInt8 nRecordType, SvStream *pStream, - UINT16 nTag, BYTE nCurVer ); + sal_uInt16 nTag, sal_uInt8 nCurVer ); public: SfxSingleRecordWriter( SvStream *pStream, - UINT16 nTag, BYTE nCurVer ); + sal_uInt16 nTag, sal_uInt8 nCurVer ); SfxSingleRecordWriter( SvStream *pStream, - UINT16 nTag, BYTE nCurVer, - UINT32 nSize ); + sal_uInt16 nTag, sal_uInt8 nCurVer, + sal_uInt32 nSize ); inline void Reset(); - UINT32 Close( bool bSeekToEndOfRec = true ); + sal_uInt32 Close( bool bSeekToEndOfRec = true ); }; //------------------------------------------------------------------------ @@ -405,9 +405,9 @@ class SVL_DLLPUBLIC SfxSingleRecordReader: public SfxMiniRecordReader { protected: - UINT16 _nRecordTag; // Art des Gesamt-Inhalts - BYTE _nRecordVer; // Version des Gesamt-Inhalts - BYTE _nRecordType; // Record Type aus dem Header + sal_uInt16 _nRecordTag; // Art des Gesamt-Inhalts + sal_uInt8 _nRecordVer; // Version des Gesamt-Inhalts + sal_uInt8 _nRecordType; // Record Type aus dem Header // Drei-Phasen-Ctor f"ur Subklassen SfxSingleRecordReader() {} @@ -416,17 +416,17 @@ protected: SfxMiniRecordReader::Construct_Impl( pStream, SFX_REC_PRETAG_EXT ); } - bool FindHeader_Impl( UINT16 nTypes, UINT16 nTag ); - bool ReadHeader_Impl( USHORT nTypes ); + bool FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag ); + bool ReadHeader_Impl( sal_uInt16 nTypes ); public: SfxSingleRecordReader( SvStream *pStream ); - SfxSingleRecordReader( SvStream *pStream, USHORT nTag ); + SfxSingleRecordReader( SvStream *pStream, sal_uInt16 nTag ); - inline UINT16 GetTag() const; + inline sal_uInt16 GetTag() const; - inline BYTE GetVersion() const; - inline bool HasVersion( USHORT nVersion ) const; + inline sal_uInt8 GetVersion() const; + inline bool HasVersion( sal_uInt16 nVersion ) const; }; //------------------------------------------------------------------------ @@ -454,22 +454,22 @@ class SVL_DLLPUBLIC SfxMultiFixRecordWriter: public SfxSingleRecordWriter [Fileformat] - 1* BYTE Pre-Tag (==0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - 1* BYTE Record-Type (==SFX_REC_TYPE_FIXSIZE) - 1* BYTE Content-Version - 1* UINT16 Content-Tag - 1* UINT16 NumberOfContents - 1* UINT32 SizeOfEachContent + 1* sal_uInt8 Pre-Tag (==0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_FIXSIZE) + 1* sal_uInt8 Content-Version + 1* sal_uInt16 Content-Tag + 1* sal_uInt16 NumberOfContents + 1* sal_uInt32 SizeOfEachContent NumberOfContents* ( - SizeOfEachContent BYTE Content + SizeOfEachContent sal_uInt8 Content ) [Beispiel] { SfxMultiFixRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION ); - for ( USHORT n = 0; n < Count(); ++n ) + for ( sal_uInt16 n = 0; n < Count(); ++n ) { aRecord.NewContent(); *aRecord << aMember1[n]; @@ -480,28 +480,28 @@ class SVL_DLLPUBLIC SfxMultiFixRecordWriter: public SfxSingleRecordWriter { protected: - UINT32 _nContentStartPos; /* Startposition des jeweiligen + sal_uInt32 _nContentStartPos; /* Startposition des jeweiligen Contents - nur bei DBG_UTIL und f"ur Subklassen */ - UINT32 _nContentSize; // Gr"o\se jedes Contents - UINT16 _nContentCount; // jeweilige Anzahl der Contents + sal_uInt32 _nContentSize; // Gr"o\se jedes Contents + sal_uInt16 _nContentCount; // jeweilige Anzahl der Contents - SfxMultiFixRecordWriter( BYTE nRecordType, + SfxMultiFixRecordWriter( sal_uInt8 nRecordType, SvStream *pStream, - UINT16 nTag, BYTE nCurVer, - UINT32 nContentSize ); + sal_uInt16 nTag, sal_uInt8 nCurVer, + sal_uInt32 nContentSize ); public: SfxMultiFixRecordWriter( SvStream *pStream, - UINT16 nTag, BYTE nCurVer, - UINT32 nContentSize ); + sal_uInt16 nTag, sal_uInt8 nCurVer, + sal_uInt32 nContentSize ); inline ~SfxMultiFixRecordWriter(); inline void NewContent(); inline void Reset(); - UINT32 Close( bool bSeekToEndOfRec = true ); + sal_uInt32 Close( bool bSeekToEndOfRec = true ); }; //------------------------------------------------------------------------ @@ -527,23 +527,23 @@ class SVL_DLLPUBLIC SfxMultiVarRecordWriter: public SfxMultiFixRecordWriter [Fileformat] - 1* BYTE Pre-Tag (==0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - 1* BYTE Record-Type (==SFX_FILETYPE_TYPE_VARSIZE) - 1* BYTE Content-Version - 1* USHORT Content-Tag - 1* UINT16 NumberOfContents - 1* UINT32 OffsetToOfsTable + 1* sal_uInt8 Pre-Tag (==0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + 1* sal_uInt8 Record-Type (==SFX_FILETYPE_TYPE_VARSIZE) + 1* sal_uInt8 Content-Version + 1* sal_uInt16 Content-Tag + 1* sal_uInt16 NumberOfContents + 1* sal_uInt32 OffsetToOfsTable NumberOfContents* ( - ContentSize* BYTE Content + ContentSize* sal_uInt8 Content ) - NumberOfContents* UINT32 ContentOfs (je per <<8 verschoben) + NumberOfContents* sal_uInt32 ContentOfs (je per <<8 verschoben) [Beispiel] { SfxMultiVarRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION ); - for ( USHORT n = 0; n < Count(); ++n ) + for ( sal_uInt16 n = 0; n < Count(); ++n ) { aRecord.NewContent(); *aRecord << aMember1[n]; @@ -555,24 +555,24 @@ class SVL_DLLPUBLIC SfxMultiVarRecordWriter: public SfxMultiFixRecordWriter { protected: SfxUINT32s _aContentOfs; - USHORT _nContentVer; // nur f"ur SfxMultiMixRecordWriter + sal_uInt16 _nContentVer; // nur f"ur SfxMultiMixRecordWriter - SfxMultiVarRecordWriter( BYTE nRecordType, + SfxMultiVarRecordWriter( sal_uInt8 nRecordType, SvStream *pStream, - USHORT nRecordTag, - BYTE nRecordVer ); + sal_uInt16 nRecordTag, + sal_uInt8 nRecordVer ); void FlushContent_Impl(); public: SfxMultiVarRecordWriter( SvStream *pStream, - USHORT nRecordTag, - BYTE nRecordVer ); + sal_uInt16 nRecordTag, + sal_uInt8 nRecordVer ); virtual ~SfxMultiVarRecordWriter(); void NewContent(); - virtual UINT32 Close( bool bSeekToEndOfRec = true ); + virtual sal_uInt32 Close( bool bSeekToEndOfRec = true ); }; //------------------------------------------------------------------------ @@ -597,27 +597,27 @@ class SVL_DLLPUBLIC SfxMultiMixRecordWriter: public SfxMultiVarRecordWriter [Fileformat] - 1* BYTE Pre-Tag (==0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - 1* BYTE Record-Type (==SFX_REC_TYPE_MIXTAGS) - 1* BYTE Content-Version - 1* USHORT Record-Tag - 1* UINT16 NumberOfContents - 1* UINT32 OffsetToOfsTable + 1* sal_uInt8 Pre-Tag (==0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_MIXTAGS) + 1* sal_uInt8 Content-Version + 1* sal_uInt16 Record-Tag + 1* sal_uInt16 NumberOfContents + 1* sal_uInt32 OffsetToOfsTable NumberOfContents* ( - 1* USHORT Content-Tag - ContentSize* BYTE Content + 1* sal_uInt16 Content-Tag + ContentSize* sal_uInt8 Content ) - NumberOfContents* UINT32 ( ContentOfs << 8 + Version ) + NumberOfContents* sal_uInt32 ( ContentOfs << 8 + Version ) */ { public: inline SfxMultiMixRecordWriter( SvStream *pStream, - USHORT nRecordTag, - BYTE nRecordVer ); + sal_uInt16 nRecordTag, + sal_uInt8 nRecordVer ); - void NewContent( USHORT nTag, BYTE nVersion ); + void NewContent( sal_uInt16 nTag, sal_uInt8 nVersion ); // private: geht nicht, da einige Compiler dann auch vorherige privat machen void NewContent() @@ -642,7 +642,7 @@ class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader { SfxMultiRecordReader aRecord( pStream ); - for ( USHORT nRecNo = 0; aRecord.GetContent(); ++nRecNo ) + for ( sal_uInt16 nRecNo = 0; aRecord.GetContent(); ++nRecNo ) { switch ( aRecord.GetTag() ) { @@ -661,30 +661,30 @@ class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader */ { - UINT32 _nStartPos; // Start-Position des Records - UINT32* _pContentOfs; // Offsets der Startpositionen - UINT32 _nContentSize; // Size jedes einzelnen / Tabellen-Pos - UINT16 _nContentCount; // Anzahl der Contents im Record - UINT16 _nContentNo; /* der Index des aktuellen Contents + sal_uInt32 _nStartPos; // Start-Position des Records + sal_uInt32* _pContentOfs; // Offsets der Startpositionen + sal_uInt32 _nContentSize; // Size jedes einzelnen / Tabellen-Pos + sal_uInt16 _nContentCount; // Anzahl der Contents im Record + sal_uInt16 _nContentNo; /* der Index des aktuellen Contents enth"alt jeweils den Index des Contents, der beim n"achsten GetContent() geholt wird */ - UINT16 _nContentTag; // Art-Kennung des aktuellen Contents - BYTE _nContentVer; // Versions-Kennung des akt. Contents + sal_uInt16 _nContentTag; // Art-Kennung des aktuellen Contents + sal_uInt8 _nContentVer; // Versions-Kennung des akt. Contents bool ReadHeader_Impl(); public: SfxMultiRecordReader( SvStream *pStream ); - SfxMultiRecordReader( SvStream *pStream, UINT16 nTag ); + SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag ); ~SfxMultiRecordReader(); bool GetContent(); - inline UINT16 GetContentTag(); - inline BYTE GetContentVersion() const; - inline bool HasContentVersion( USHORT nVersion ) const; + inline sal_uInt16 GetContentTag(); + inline sal_uInt8 GetContentVersion() const; + inline bool HasContentVersion( sal_uInt16 nVersion ) const; - inline UINT32 ContentCount() const; + inline sal_uInt32 ContentCount() const; }; //========================================================================= @@ -692,7 +692,7 @@ public: inline SfxMiniRecordWriter::SfxMiniRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - BYTE nTag // Record-Tag zwischen 0x01 und 0xFE + sal_uInt8 nTag // Record-Tag zwischen 0x01 und 0xFE ) /* [Beschreibung] @@ -718,8 +718,8 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter inline SfxMiniRecordWriter::SfxMiniRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - BYTE nTag, // Record-Tag zwischen 0x01 und 0xFE - UINT32 nSize // Gr"o\se der Daten in Bytes + sal_uInt8 nTag, // Record-Tag zwischen 0x01 und 0xFE + sal_uInt32 nSize // Gr"o\se der Daten in Bytes ) /* [Beschreibung] @@ -809,12 +809,12 @@ inline void SfxMiniRecordReader::Skip() { _pStream->Seek(_nEofRec); - _bSkipped = TRUE; + _bSkipped = sal_True; } //------------------------------------------------------------------------- -inline BYTE SfxMiniRecordReader::GetTag() const +inline sal_uInt8 SfxMiniRecordReader::GetTag() const /* [Beschreibung] @@ -861,18 +861,18 @@ inline SvStream& SfxMiniRecordReader::operator*() const //========================================================================= -inline UINT32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec ) +inline sal_uInt32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec ) // siehe <SfxMiniRecordWriter::Close(bool)> { - UINT32 nRet = 0; + sal_uInt32 nRet = 0; // wurde der Header noch nicht geschrieben? if ( !_bHeaderOk ) { // Basisklassen-Header schreiben - UINT32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec ); + sal_uInt32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec ); // ggf. ans Ende des eigenen Headers seeken oder hinter Rec bleiben if ( !bSeekToEndOfRec ) @@ -901,7 +901,7 @@ inline void SfxSingleRecordWriter::Reset() //========================================================================= -inline UINT16 SfxSingleRecordReader::GetTag() const +inline sal_uInt16 SfxSingleRecordReader::GetTag() const /* [Beschreibung] @@ -914,7 +914,7 @@ inline UINT16 SfxSingleRecordReader::GetTag() const //------------------------------------------------------------------------- -inline BYTE SfxSingleRecordReader::GetVersion() const +inline sal_uInt8 SfxSingleRecordReader::GetVersion() const /* [Beschreibung] @@ -927,7 +927,7 @@ inline BYTE SfxSingleRecordReader::GetVersion() const //------------------------------------------------------------------------- -inline bool SfxSingleRecordReader::HasVersion( USHORT nVersion ) const +inline bool SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const /* [Beschreibung] @@ -969,7 +969,7 @@ inline void SfxMultiFixRecordWriter::NewContent() { #ifdef DBG_UTIL - ULONG nOldStartPos; + sal_uLong nOldStartPos; // Startposition des aktuellen Contents merken - Achtung Subklassen! nOldStartPos = _nContentStartPos; #endif @@ -994,8 +994,8 @@ inline void SfxMultiFixRecordWriter::NewContent() inline SfxMultiMixRecordWriter::SfxMultiMixRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - USHORT nRecordTag, // Gesamt-Record-Art-Kennung - BYTE nRecordVer // Gesamt-Record-Versions-Kennung + sal_uInt16 nRecordTag, // Gesamt-Record-Art-Kennung + sal_uInt8 nRecordVer // Gesamt-Record-Versions-Kennung ) /* [Beschreibung] @@ -1022,7 +1022,7 @@ inline void SfxMultiFixRecordWriter::Reset() //========================================================================= -inline UINT16 SfxMultiRecordReader::GetContentTag() +inline sal_uInt16 SfxMultiRecordReader::GetContentTag() /* [Beschreibung] @@ -1036,7 +1036,7 @@ inline UINT16 SfxMultiRecordReader::GetContentTag() //------------------------------------------------------------------------- -inline BYTE SfxMultiRecordReader::GetContentVersion() const +inline sal_uInt8 SfxMultiRecordReader::GetContentVersion() const /* [Beschreibung] @@ -1050,7 +1050,7 @@ inline BYTE SfxMultiRecordReader::GetContentVersion() const //------------------------------------------------------------------------- -inline bool SfxMultiRecordReader::HasContentVersion( USHORT nVersion ) const +inline bool SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const /* [Beschreibung] @@ -1065,7 +1065,7 @@ inline bool SfxMultiRecordReader::HasContentVersion( USHORT nVersion ) const //------------------------------------------------------------------------- -inline UINT32 SfxMultiRecordReader::ContentCount() const +inline sal_uInt32 SfxMultiRecordReader::ContentCount() const /* [Beschreibung] diff --git a/svl/inc/svl/flagitem.hxx b/svl/inc/svl/flagitem.hxx index e424372d52c9..f64efc455867 100644 --- a/svl/inc/svl/flagitem.hxx +++ b/svl/inc/svl/flagitem.hxx @@ -35,7 +35,7 @@ class SvStream; -extern USHORT nSfxFlagVal[16]; +extern sal_uInt16 nSfxFlagVal[16]; // ----------------------------------------------------------------------- @@ -43,24 +43,24 @@ DBG_NAMEEX_VISIBILITY(SfxFlagItem, SVL_DLLPUBLIC) class SVL_DLLPUBLIC SfxFlagItem: public SfxPoolItem { - USHORT nVal; + sal_uInt16 nVal; public: TYPEINFO(); - SfxFlagItem( USHORT nWhich = 0, USHORT nValue = 0 ); - SfxFlagItem( USHORT nWhich, SvStream & ); + SfxFlagItem( sal_uInt16 nWhich = 0, sal_uInt16 nValue = 0 ); + SfxFlagItem( sal_uInt16 nWhich, SvStream & ); SfxFlagItem( const SfxFlagItem& ); ~SfxFlagItem() { DBG_DTOR(SfxFlagItem, 0); } - virtual BYTE GetFlagCount() const; - virtual XubString GetFlagText( BYTE nFlag ) const; + virtual sal_uInt8 GetFlagCount() const; + virtual XubString GetFlagText( sal_uInt8 nFlag ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -68,14 +68,14 @@ public: SfxMapUnit ePresMetric, XubString &rText, const IntlWrapper * = 0 ) const; - USHORT GetValue() const { return nVal; } - void SetValue( USHORT nNewVal ) { + sal_uInt16 GetValue() const { return nVal; } + void SetValue( sal_uInt16 nNewVal ) { DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); nVal = nNewVal; } - int GetFlag( BYTE nFlag ) const { + int GetFlag( sal_uInt8 nFlag ) const { return ( (nVal & nSfxFlagVal[nFlag]) != 0 ); } - void SetFlag( BYTE nFlag, int bVal ); + void SetFlag( sal_uInt8 nFlag, int bVal ); }; #endif diff --git a/svl/inc/folderrestriction.hxx b/svl/inc/svl/folderrestriction.hxx index e39c5aeb84d3..e39c5aeb84d3 100644 --- a/svl/inc/folderrestriction.hxx +++ b/svl/inc/svl/folderrestriction.hxx diff --git a/svl/inc/fstathelper.hxx b/svl/inc/svl/fstathelper.hxx index fcc71502e639..fcc71502e639 100644 --- a/svl/inc/fstathelper.hxx +++ b/svl/inc/svl/fstathelper.hxx diff --git a/svl/inc/svl/globalnameitem.hxx b/svl/inc/svl/globalnameitem.hxx index 2db51b22999e..478b530f3510 100644 --- a/svl/inc/svl/globalnameitem.hxx +++ b/svl/inc/svl/globalnameitem.hxx @@ -43,7 +43,7 @@ class SVL_DLLPUBLIC SfxGlobalNameItem: public SfxPoolItem public: TYPEINFO(); SfxGlobalNameItem(); - SfxGlobalNameItem( USHORT nWhich, const SvGlobalName& ); + SfxGlobalNameItem( sal_uInt16 nWhich, const SvGlobalName& ); ~SfxGlobalNameItem(); virtual int operator==( const SfxPoolItem& ) const; @@ -51,9 +51,9 @@ public: SvGlobalName GetValue() const { return m_aName; } virtual bool PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/svl/hint.hxx b/svl/inc/svl/hint.hxx index 49ab106e45e3..ce840500b4ab 100644 --- a/svl/inc/svl/hint.hxx +++ b/svl/inc/svl/hint.hxx @@ -45,26 +45,26 @@ public: class Visibility Name: public SfxHint \ { \ Type* pObj; \ - BOOL bIsOwner; \ + sal_Bool bIsOwner; \ \ public: \ TYPEINFO(); \ - Name( Type* Object, BOOL bOwnedByHint = FALSE ); \ + Name( Type* Object, sal_Bool bOwnedByHint = sal_False ); \ ~Name(); \ \ Type* GetObject() const { return pObj; } \ - BOOL IsOwner() const { return bIsOwner; } \ + sal_Bool IsOwner() const { return bIsOwner; } \ } #define IMPL_PTRHINT_AUTODELETE(Name, Type) \ TYPEINIT1(Name, SfxHint); \ - Name::Name( Type* pObject, BOOL bOwnedByHint ) \ + Name::Name( Type* pObject, sal_Bool bOwnedByHint ) \ { pObj = pObject; bIsOwner = bOwnedByHint; } \ Name::~Name() { if ( bIsOwner ) delete pObj; } #define IMPL_PTRHINT(Name, Type) \ TYPEINIT1(Name, SfxHint); \ - Name::Name( Type* pObject, BOOL bOwnedByHint ) \ + Name::Name( Type* pObject, sal_Bool bOwnedByHint ) \ { pObj = pObject; bIsOwner = bOwnedByHint; } \ Name::~Name() {} diff --git a/svl/inc/svl/httpcook.hxx b/svl/inc/svl/httpcook.hxx index ab5dc857ef7f..2d5d434592af 100644 --- a/svl/inc/svl/httpcook.hxx +++ b/svl/inc/svl/httpcook.hxx @@ -62,8 +62,8 @@ struct CntHTTPCookie String m_aDomain; String m_aPath; DateTime m_aExpires; - USHORT m_nFlags; - USHORT m_nPolicy; + sal_uInt16 m_nFlags; + sal_uInt16 m_nPolicy; CntHTTPCookie (void) : m_aExpires (Date(0), Time(0)), @@ -71,14 +71,14 @@ struct CntHTTPCookie m_nPolicy (CNTHTTP_COOKIE_POLICY_INTERACTIVE) {} - BOOL replaces (const CntHTTPCookie& rOther) const + sal_Bool replaces (const CntHTTPCookie& rOther) const { return ((m_aDomain == rOther.m_aDomain) && (m_aPath == rOther.m_aPath ) && (m_aName == rOther.m_aName ) ); } - BOOL operator== (const CntHTTPCookie& rOther) const + sal_Bool operator== (const CntHTTPCookie& rOther) const { return ((m_aName == rOther.m_aName ) && (m_aValue == rOther.m_aValue ) && @@ -137,7 +137,7 @@ struct CntHTTPCookieRequest const String& m_rURL; List& m_rCookieList; CntHTTPCookieRequestType m_eType; - USHORT m_nRet; + sal_uInt16 m_nRet; CntHTTPCookieRequest ( const String& rURL, diff --git a/svl/inc/svl/ilstitem.hxx b/svl/inc/svl/ilstitem.hxx index abe4100407ce..a0527cec556c 100644 --- a/svl/inc/svl/ilstitem.hxx +++ b/svl/inc/svl/ilstitem.hxx @@ -43,7 +43,7 @@ public: TYPEINFO(); SfxIntegerListItem(); - SfxIntegerListItem( USHORT nWhich, const SvULongs& rList ); + SfxIntegerListItem( sal_uInt16 nWhich, const SvULongs& rList ); SfxIntegerListItem( const SfxIntegerListItem& rItem ); ~SfxIntegerListItem(); @@ -56,8 +56,8 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual bool PutValue ( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; }; #endif // _SFXINTITEM_HXX diff --git a/svl/inc/svl/imageitm.hxx b/svl/inc/svl/imageitm.hxx index 7e6bbf3d0a1e..e6cd1d552fd1 100644 --- a/svl/inc/svl/imageitm.hxx +++ b/svl/inc/svl/imageitm.hxx @@ -40,20 +40,20 @@ class SVL_DLLPUBLIC SfxImageItem : public SfxInt16Item SfxImageItem_Impl* pImp; public: TYPEINFO(); - SfxImageItem( USHORT nWhich = 0, UINT16 nImage = 0 ); - SfxImageItem( USHORT nWhich, const String& rURL ); + SfxImageItem( sal_uInt16 nWhich = 0, sal_uInt16 nImage = 0 ); + SfxImageItem( sal_uInt16 nWhich, const String& rURL ); SfxImageItem( const SfxImageItem& ); virtual ~SfxImageItem(); virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); void SetRotation( long nValue ); long GetRotation() const; - void SetMirrored( BOOL bSet ); - BOOL IsMirrored() const; + void SetMirrored( sal_Bool bSet ); + sal_Bool IsMirrored() const; String GetURL() const; }; diff --git a/svl/inc/inetdef.hxx b/svl/inc/svl/inetdef.hxx index 3984dcced8f6..3984dcced8f6 100644 --- a/svl/inc/inetdef.hxx +++ b/svl/inc/svl/inetdef.hxx diff --git a/svl/inc/svl/inethist.hxx b/svl/inc/svl/inethist.hxx index 8dbc20c51324..982ad1d25f43 100644 --- a/svl/inc/svl/inethist.hxx +++ b/svl/inc/svl/inethist.hxx @@ -63,7 +63,7 @@ class INetURLHistory : public SfxBroadcaster static void NormalizeUrl_Impl (INetURLObject &rUrl); SVL_DLLPUBLIC void PutUrl_Impl (const INetURLObject &rUrl); - SVL_DLLPUBLIC BOOL QueryUrl_Impl (const INetURLObject &rUrl); + SVL_DLLPUBLIC sal_Bool QueryUrl_Impl (const INetURLObject &rUrl); /** Not implemented. */ @@ -77,7 +77,7 @@ public: /** QueryProtocol. */ - BOOL QueryProtocol (INetProtocol eProto) const + sal_Bool QueryProtocol (INetProtocol eProto) const { return ((eProto == INET_PROT_FILE ) || (eProto == INET_PROT_FTP ) || @@ -87,22 +87,22 @@ public: /** QueryUrl. */ - BOOL QueryUrl (const INetURLObject &rUrl) + sal_Bool QueryUrl (const INetURLObject &rUrl) { if (QueryProtocol (rUrl.GetProtocol())) return QueryUrl_Impl (rUrl); else - return FALSE; + return sal_False; } - BOOL QueryUrl (const String &rUrl) + sal_Bool QueryUrl (const String &rUrl) { INetProtocol eProto = INetURLObject::CompareProtocolScheme (rUrl); if (QueryProtocol (eProto)) return QueryUrl_Impl (INetURLObject (rUrl)); else - return FALSE; + return sal_False; } /** PutUrl. diff --git a/svl/inc/inetmsg.hxx b/svl/inc/svl/inetmsg.hxx index 049c54219bb1..049c54219bb1 100644 --- a/svl/inc/inetmsg.hxx +++ b/svl/inc/svl/inetmsg.hxx diff --git a/svl/inc/inetstrm.hxx b/svl/inc/svl/inetstrm.hxx index f1d7812f623f..f1d7812f623f 100644 --- a/svl/inc/inetstrm.hxx +++ b/svl/inc/svl/inetstrm.hxx diff --git a/svl/inc/instrm.hxx b/svl/inc/svl/instrm.hxx index 566ef4fb02e7..8e97babaf372 100644 --- a/svl/inc/instrm.hxx +++ b/svl/inc/svl/instrm.hxx @@ -48,19 +48,19 @@ class SVL_DLLPUBLIC SvInputStream: public SvStream com::sun::star::uno::Reference< com::sun::star::io::XSeekable > m_xSeekable; SvDataPipe_Impl * m_pPipe; - ULONG m_nSeekedFrom; + sal_uLong m_nSeekedFrom; SVL_DLLPRIVATE bool open(); - SVL_DLLPRIVATE virtual ULONG GetData(void * pData, ULONG nSize); + SVL_DLLPRIVATE virtual sal_uLong GetData(void * pData, sal_uLong nSize); - SVL_DLLPRIVATE virtual ULONG PutData(void const *, ULONG); + SVL_DLLPRIVATE virtual sal_uLong PutData(void const *, sal_uLong); - SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG nPos); + SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong nPos); SVL_DLLPRIVATE virtual void FlushData(); - SVL_DLLPRIVATE virtual void SetSize(ULONG); + SVL_DLLPRIVATE virtual void SetSize(sal_uLong); public: SvInputStream( @@ -70,11 +70,11 @@ public: virtual ~SvInputStream(); - virtual USHORT IsA() const; + virtual sal_uInt16 IsA() const; - virtual void AddMark(ULONG nPos); + virtual void AddMark(sal_uLong nPos); - virtual void RemoveMark(ULONG nPos); + virtual void RemoveMark(sal_uLong nPos); }; #endif // SVTOOLS_INSTRM_HXX diff --git a/svl/inc/svl/intitem.hxx b/svl/inc/svl/intitem.hxx index d6f7239df0ce..9ecb9a904dc5 100644 --- a/svl/inc/svl/intitem.hxx +++ b/svl/inc/svl/intitem.hxx @@ -38,13 +38,13 @@ class SVL_DLLPUBLIC SfxByteItem: public CntByteItem public: TYPEINFO(); - SfxByteItem(USHORT which = 0, BYTE nValue = 0): + SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0): CntByteItem(which, nValue) {} - SfxByteItem(USHORT which, SvStream & rStream): + SfxByteItem(sal_uInt16 which, SvStream & rStream): CntByteItem(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const { return new SfxByteItem(*this); } @@ -55,16 +55,16 @@ DBG_NAMEEX_VISIBILITY(SfxInt16Item, SVL_DLLPUBLIC) class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem { - INT16 m_nValue; + sal_Int16 m_nValue; public: TYPEINFO(); - SfxInt16Item(USHORT which = 0, INT16 nTheValue = 0): + SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(SfxInt16Item, 0); } - SfxInt16Item(USHORT nWhich, SvStream & rStream); + SfxInt16Item(sal_uInt16 nWhich, SvStream & rStream); SfxInt16Item(const SfxInt16Item & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -84,29 +84,29 @@ public: const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual INT16 GetMin() const; + virtual sal_Int16 GetMin() const; - virtual INT16 GetMax() const; + virtual sal_Int16 GetMax() const; virtual SfxFieldUnit GetUnit() const; - INT16 GetValue() const { return m_nValue; } + sal_Int16 GetValue() const { return m_nValue; } - inline void SetValue(INT16 nTheValue); + inline void SetValue(sal_Int16 nTheValue); }; -inline void SfxInt16Item::SetValue(INT16 nTheValue) +inline void SfxInt16Item::SetValue(sal_Int16 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item"); m_nValue = nTheValue; @@ -118,13 +118,13 @@ class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item public: TYPEINFO(); - SfxUInt16Item(USHORT which = 0, UINT16 nValue = 0): + SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0): CntUInt16Item(which, nValue) {} - SfxUInt16Item(USHORT which, SvStream & rStream): + SfxUInt16Item(sal_uInt16 which, SvStream & rStream): CntUInt16Item(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const { return new SfxUInt16Item(Which(), rStream); } virtual SfxPoolItem * Clone(SfxItemPool * = 0) const @@ -137,13 +137,13 @@ class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item public: TYPEINFO(); - SfxInt32Item(USHORT which = 0, INT32 nValue = 0): + SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0): CntInt32Item(which, nValue) {} - SfxInt32Item(USHORT which, SvStream & rStream): + SfxInt32Item(sal_uInt16 which, SvStream & rStream): CntInt32Item(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const { return new SfxInt32Item(Which(), rStream); } virtual SfxPoolItem * Clone(SfxItemPool * = 0) const @@ -157,13 +157,13 @@ class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item public: TYPEINFO(); - SfxUInt32Item(USHORT which = 0, UINT32 nValue = 0): + SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0): CntUInt32Item(which, nValue) {} - SfxUInt32Item(USHORT which, SvStream & rStream): + SfxUInt32Item(sal_uInt16 which, SvStream & rStream): CntUInt32Item(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const { return new SfxUInt32Item(Which(), rStream); } virtual SfxPoolItem * Clone(SfxItemPool * = 0) const diff --git a/svl/inc/svl/itemiter.hxx b/svl/inc/svl/itemiter.hxx index a98f2da24d55..55ad0e7b02a5 100644 --- a/svl/inc/svl/itemiter.hxx +++ b/svl/inc/svl/itemiter.hxx @@ -40,7 +40,7 @@ class SVL_DLLPUBLIC SfxItemIter { // Item-Feld - Start & Ende const SfxItemSet& _rSet; - USHORT _nStt, _nEnd, _nAkt; + sal_uInt16 _nStt, _nEnd, _nAkt; public: SfxItemIter( const SfxItemSet& rSet ); @@ -58,12 +58,12 @@ public: const SfxPoolItem* NextItem(); const SfxPoolItem* PrevItem(); - BOOL IsAtStart() const { return _nAkt == _nStt; } - BOOL IsAtEnd() const { return _nAkt == _nEnd; } + sal_Bool IsAtStart() const { return _nAkt == _nStt; } + sal_Bool IsAtEnd() const { return _nAkt == _nEnd; } - USHORT GetCurPos() const { return _nAkt; } - USHORT GetFirstPos() const { return _nStt; } - USHORT GetLastPos() const { return _nEnd; } + sal_uInt16 GetCurPos() const { return _nAkt; } + sal_uInt16 GetFirstPos() const { return _nStt; } + sal_uInt16 GetLastPos() const { return _nEnd; } }; #endif diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx index 04ae4f07d29b..3cec7f75dee2 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.hxx @@ -71,8 +71,8 @@ DBG_NAMEEX(SfxItemPool) struct SfxItemInfo { - USHORT _nSID; - USHORT _nFlags; + sal_uInt16 _nSID; + sal_uInt16 _nFlags; }; //==================================================================== @@ -105,23 +105,23 @@ class SVL_DLLPUBLIC SfxItemPool */ { - SVL_DLLPRIVATE void readTheItems(SvStream & rStream, USHORT nCount, USHORT nVersion, + SVL_DLLPRIVATE void readTheItems(SvStream & rStream, sal_uInt32 nCount, sal_uInt16 nVersion, SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** pArr); UniString aName; - USHORT nStart, nEnd; - USHORT _nFileFormatVersion; + sal_uInt16 nStart, nEnd; + sal_uInt16 _nFileFormatVersion; #ifdef TF_POOLABLE const SfxItemInfo* pItemInfos; #else - USHORT* pSlotIds; + sal_uInt16* pSlotIds; #endif SfxItemPool_Impl* pImp; SfxPoolItem** ppStaticDefaults; SfxPoolItem** ppPoolDefaults; SfxItemPool* pSecondary; SfxItemPool* pMaster; - USHORT* _pPoolRanges; + sal_uInt16* _pPoolRanges; bool bPersistentRefCounts; private: @@ -138,16 +138,16 @@ public: friend class SfxPoolWhichMap; private: - inline USHORT GetIndex_Impl(USHORT nWhich) const; - inline USHORT GetSize_Impl() const { return nEnd - nStart + 1; } + inline sal_uInt16 GetIndex_Impl(sal_uInt16 nWhich) const; + inline sal_uInt16 GetSize_Impl() const { return nEnd - nStart + 1; } SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream ); - SVL_DLLPRIVATE bool IsItemFlag_Impl( USHORT nWhich, USHORT nFlag ) const; + SVL_DLLPRIVATE bool IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; public: // fuer dflt. SfxItemSet::CTOR, setze dflt. WhichRanges - void FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const; - const USHORT* GetFrozenIdRanges() const + void FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const; + const sal_uInt16* GetFrozenIdRanges() const { return _pPoolRanges; } bool IsVer2_Impl() const; @@ -155,21 +155,21 @@ public: //--------------------------------------------------------------------- protected: - static inline void SetRefCount( SfxPoolItem& rItem, ULONG n ); - static inline ULONG AddRef( const SfxPoolItem& rItem, ULONG n = 1 ); - static inline ULONG ReleaseRef( const SfxPoolItem& rItem, ULONG n = 1); + static inline void SetRefCount( SfxPoolItem& rItem, sal_uLong n ); + static inline sal_uLong AddRef( const SfxPoolItem& rItem, sal_uLong n = 1 ); + static inline sal_uLong ReleaseRef( const SfxPoolItem& rItem, sal_uLong n = 1); public: SfxItemPool( const SfxItemPool &rPool, - BOOL bCloneStaticDefaults = FALSE ); + sal_Bool bCloneStaticDefaults = sal_False ); SfxItemPool( const UniString &rName, - USHORT nStart, USHORT nEnd, + sal_uInt16 nStart, sal_uInt16 nEnd, #ifdef TF_POOLABLE const SfxItemInfo *pItemInfos, #endif SfxPoolItem **pDefaults = 0, #ifndef TF_POOLABLE - USHORT *pSlotIds = 0, + sal_uInt16 *pSlotIds = 0, #endif bool bLoadRefCounts = true ); protected: @@ -180,14 +180,14 @@ public: SfxBroadcaster& BC(); void SetPoolDefaultItem( const SfxPoolItem& ); - const SfxPoolItem* GetPoolDefaultItem( USHORT nWhich ) const; - void ResetPoolDefaultItem( USHORT nWhich ); + const SfxPoolItem* GetPoolDefaultItem( sal_uInt16 nWhich ) const; + void ResetPoolDefaultItem( sal_uInt16 nWhich ); void SetDefaults( SfxPoolItem **pDefaults ); - void ReleaseDefaults( BOOL bDelete = FALSE ); - static void ReleaseDefaults( SfxPoolItem **pDefaults, USHORT nCount, BOOL bDelete = FALSE ); + void ReleaseDefaults( sal_Bool bDelete = sal_False ); + static void ReleaseDefaults( SfxPoolItem **pDefaults, sal_uInt16 nCount, sal_Bool bDelete = sal_False ); - virtual SfxMapUnit GetMetric( USHORT nWhich ) const; + virtual SfxMapUnit GetMetric( sal_uInt16 nWhich ) const; void SetDefaultMetric( SfxMapUnit eNewMetric ); virtual SfxItemPresentation GetPresentation( const SfxPoolItem& rItem, SfxItemPresentation ePresentation, @@ -198,9 +198,9 @@ public: virtual SfxItemPool* Clone() const; UniString const & GetName() const { return aName; } - virtual const SfxPoolItem& Put( const SfxPoolItem&, USHORT nWhich = 0 ); + virtual const SfxPoolItem& Put( const SfxPoolItem&, sal_uInt16 nWhich = 0 ); virtual void Remove( const SfxPoolItem& ); - virtual const SfxPoolItem& GetDefaultItem( USHORT nWhich ) const; + virtual const SfxPoolItem& GetDefaultItem( sal_uInt16 nWhich ) const; const SfxPoolItem* LoadItem( SvStream &rStream, bool bDirect = false, @@ -209,11 +209,11 @@ public: const SfxPoolItem &rItem, bool bDirect = false ) const; - USHORT GetSurrogate(const SfxPoolItem *) const; - const SfxPoolItem * GetItem(USHORT nWhich, USHORT nSurrogate) const; - USHORT GetItemCount(USHORT nWhich) const; + sal_uInt32 GetSurrogate(const SfxPoolItem *) const; + const SfxPoolItem * GetItem2(sal_uInt16 nWhich, sal_uInt32 nSurrogate) const; + sal_uInt32 GetItemCount2(sal_uInt16 nWhich) const; const SfxPoolItem* LoadSurrogate(SvStream& rStream, - USHORT &rWhich, USHORT nSlotId, + sal_uInt16 &rWhich, sal_uInt16 nSlotId, const SfxItemPool* pRefPool = 0 ); bool StoreSurrogate(SvStream& rStream, const SfxPoolItem *pItem ) const; @@ -224,14 +224,14 @@ public: return bPersistentRefCounts; } void LoadCompleted(); - USHORT GetFirstWhich() const { return nStart; } - USHORT GetLastWhich() const { return nEnd; } - bool IsInRange( USHORT nWhich ) const { + sal_uInt16 GetFirstWhich() const { return nStart; } + sal_uInt16 GetLastWhich() const { return nEnd; } + bool IsInRange( sal_uInt16 nWhich ) const { return nWhich >= nStart && nWhich <= nEnd; } - bool IsInVersionsRange( USHORT nWhich ) const; - bool IsInStoringRange( USHORT nWhich ) const; - void SetStoringRange( USHORT nFrom, USHORT nTo ); + bool IsInVersionsRange( sal_uInt16 nWhich ) const; + bool IsInStoringRange( sal_uInt16 nWhich ) const; + void SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo ); void SetSecondaryPool( SfxItemPool *pPool ); SfxItemPool* GetSecondaryPool() const { return pSecondary; } @@ -243,35 +243,35 @@ public: void Delete(); #ifdef TF_POOLABLE - bool IsItemFlag( USHORT nWhich, USHORT nFlag ) const; - bool IsItemFlag( const SfxPoolItem &rItem, USHORT nFlag ) const + bool IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; + bool IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const { return IsItemFlag( rItem.Which(), nFlag ); } void SetItemInfos( const SfxItemInfo *pInfos ) { pItemInfos = pInfos; } #else int HasMap() const { return 0 != pSlotIds; } - void SetMap( USHORT *pNewSlotIds ) + void SetMap( sal_uInt16 *pNewSlotIds ) { pSlotIds = pNewSlotIds; } #endif - USHORT GetWhich( USHORT nSlot, BOOL bDeep = TRUE ) const; - USHORT GetSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const; - USHORT GetTrueWhich( USHORT nSlot, BOOL bDeep = TRUE ) const; - USHORT GetTrueSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const; - - void SetVersionMap( USHORT nVer, - USHORT nOldStart, USHORT nOldEnd, - USHORT *pWhichIdTab ); - USHORT GetNewWhich( USHORT nOldWhich ) const; - USHORT GetVersion() const; - USHORT GetFileFormatVersion() const + sal_uInt16 GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const; + sal_uInt16 GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const; + sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const; + sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const; + + void SetVersionMap( sal_uInt16 nVer, + sal_uInt16 nOldStart, sal_uInt16 nOldEnd, + sal_uInt16 *pWhichIdTab ); + sal_uInt16 GetNewWhich( sal_uInt16 nOldWhich ) const; + sal_uInt16 GetVersion() const; + sal_uInt16 GetFileFormatVersion() const { return _nFileFormatVersion; } - void SetFileFormatVersion( USHORT nFileFormatVersion ); - USHORT GetLoadingVersion() const; + void SetFileFormatVersion( sal_uInt16 nFileFormatVersion ); + sal_uInt16 GetLoadingVersion() const; bool IsCurrentVersionLoading() const; - static int IsWhich(USHORT nId) { + static int IsWhich(sal_uInt16 nId) { return nId && nId <= SFX_WHICH_MAX; } - static int IsSlot(USHORT nId) { + static int IsSlot(sal_uInt16 nId) { return nId && nId > SFX_WHICH_MAX; } static const SfxItemPool* GetStoringPool(); @@ -284,19 +284,19 @@ private: // --------------- Inline Implementierungen ------------------------------ // nur der Pool darf den Referenz-Zaehler manipulieren !!! -inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, ULONG n ) +inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, sal_uLong n ) { rItem.SetRefCount(n); } // nur der Pool darf den Referenz-Zaehler manipulieren !!! -inline ULONG SfxItemPool::AddRef( const SfxPoolItem& rItem, ULONG n ) +inline sal_uLong SfxItemPool::AddRef( const SfxPoolItem& rItem, sal_uLong n ) { return rItem.AddRef(n); } // nur der Pool darf den Referenz-Zaehler manipulieren !!! -inline ULONG SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, ULONG n ) +inline sal_uLong SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, sal_uLong n ) { return rItem.ReleaseRef(n); } diff --git a/svl/inc/svl/itemprop.hxx b/svl/inc/svl/itemprop.hxx index 46dce586bb94..aeaa9e26c2d9 100644 --- a/svl/inc/svl/itemprop.hxx +++ b/svl/inc/svl/itemprop.hxx @@ -44,20 +44,20 @@ struct SfxItemPropertyMapEntry { const char* pName; - USHORT nNameLen; - USHORT nWID; + sal_uInt16 nNameLen; + sal_uInt16 nWID; const com::sun::star::uno::Type* pType; long nFlags; - BYTE nMemberId; + sal_uInt8 nMemberId; }; struct SfxItemPropertySimpleEntry { - USHORT nWID; + sal_uInt16 nWID; const com::sun::star::uno::Type* pType; long nFlags; - BYTE nMemberId; + sal_uInt8 nMemberId; SfxItemPropertySimpleEntry() : nWID( 0 ), @@ -65,8 +65,8 @@ struct SfxItemPropertySimpleEntry nFlags( 0 ), nMemberId( 0 ){} - SfxItemPropertySimpleEntry(USHORT _nWID, const com::sun::star::uno::Type* _pType, - long _nFlags, BYTE _nMemberId) : + SfxItemPropertySimpleEntry(sal_uInt16 _nWID, const com::sun::star::uno::Type* _pType, + long _nFlags, sal_uInt8 _nMemberId) : nWID( _nWID ), pType( _pType ), nFlags( _nFlags ), @@ -114,7 +114,7 @@ class SVL_DLLPUBLIC SfxItemPropertySet SfxItemPropertyMap m_aMap; mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo; protected: - virtual BOOL FillItem(SfxItemSet& rSet, USHORT nWhich, BOOL bGetProperty) const; + virtual sal_Bool FillItem(SfxItemSet& rSet, sal_uInt16 nWhich, sal_Bool bGetProperty) const; public: SfxItemPropertySet( const SfxItemPropertyMapEntry *pMap ) : diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx index 8a4f3248a06c..b3dea2cfa08b 100644 --- a/svl/inc/svl/itemset.hxx +++ b/svl/inc/svl/itemset.hxx @@ -47,8 +47,8 @@ typedef SfxPoolItem const** SfxItemArray; #ifndef DBG #ifdef DBG_UTILx #define DBG(s) s -#define _pChildCount(THIS) ( *(USHORT**)SfxPointerServer::GetServer()->GetPointer(THIS) ) -#define _pChildCountCtor ( (*(USHORT**)SfxPointerServer::GetServer()->CreatePointer(this)) = new USHORT ) +#define _pChildCount(THIS) ( *(sal_uInt16**)SfxPointerServer::GetServer()->GetPointer(THIS) ) +#define _pChildCountCtor ( (*(sal_uInt16**)SfxPointerServer::GetServer()->CreatePointer(this)) = new sal_uInt16 ) #define _pChildCountDtor ( SfxPointerServer::GetServer()->ReleasePointer(this) ) #else #define DBG(s) @@ -76,8 +76,8 @@ class SVL_DLLPUBLIC SfxItemSet SfxItemPool* _pPool; // der verwendete Pool const SfxItemSet* _pParent; // Ableitung SfxItemArray _aItems; // Item-Feld - USHORT* _pWhichRanges; // Array von Which-Bereichen - USHORT _nCount; // Anzahl Items + sal_uInt16* _pWhichRanges; // Array von Which-Bereichen + sal_uInt16 _nCount; // Anzahl Items //--------------------------------------------------------------------- #ifndef _SFXITEMS_HXX @@ -87,9 +87,9 @@ friend class SfxAllItemSet; friend const char *DbgCheckItemSet( const void* ); private: - SVL_DLLPRIVATE void InitRanges_Impl(const USHORT *nWhichPairTable); - SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, USHORT n1, USHORT n2, USHORT n3); - SVL_DLLPRIVATE void InitRanges_Impl(USHORT nWh1, USHORT nWh2); + SVL_DLLPRIVATE void InitRanges_Impl(const sal_uInt16 *nWhichPairTable); + SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, sal_uInt16 n1, sal_uInt16 n2, sal_uInt16 n3); + SVL_DLLPRIVATE void InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2); public: SfxItemArray GetItems_Impl() const { return _aItems; } @@ -110,59 +110,59 @@ protected: public: SfxItemSet( const SfxItemSet& ); - SfxItemSet( SfxItemPool&, BOOL bTotalPoolRanges = FALSE ); - SfxItemSet( SfxItemPool&, USHORT nWhich1, USHORT nWhich2 ); + SfxItemSet( SfxItemPool&, sal_Bool bTotalPoolRanges = sal_False ); + SfxItemSet( SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 ); SfxItemSet( SfxItemPool&, USHORT_ARG nWh1, USHORT_ARG nWh2, USHORT_ARG nNull, ... ); - SfxItemSet( SfxItemPool&, const USHORT* nWhichPairTable ); + SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable ); virtual ~SfxItemSet(); - virtual SfxItemSet * Clone(BOOL bItems = TRUE, SfxItemPool *pToPool = 0) const; + virtual SfxItemSet * Clone(sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0) const; // Items erfragen - USHORT Count() const { return _nCount; } - USHORT TotalCount() const; + sal_uInt16 Count() const { return _nCount; } + sal_uInt16 TotalCount() const; - virtual const SfxPoolItem& Get( USHORT nWhich, BOOL bSrchInParent = TRUE ) const; - const SfxPoolItem* GetItem( USHORT nWhich, BOOL bSrchInParent = TRUE, + virtual const SfxPoolItem& Get( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True ) const; + const SfxPoolItem* GetItem( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True, TypeId aItemType = 0 ) const; // Which-Wert des Items an der Position nPos erfragen - USHORT GetWhichByPos(USHORT nPos) const; + sal_uInt16 GetWhichByPos(sal_uInt16 nPos) const; // Item-Status erfragen - SfxItemState GetItemState( USHORT nWhich, - BOOL bSrchInParent = TRUE, + SfxItemState GetItemState( sal_uInt16 nWhich, + sal_Bool bSrchInParent = sal_True, const SfxPoolItem **ppItem = 0 ) const; - virtual void DisableItem(USHORT nWhich); - virtual void InvalidateItem( USHORT nWhich ); - virtual USHORT ClearItem( USHORT nWhich = 0); - virtual void ClearInvalidItems( BOOL bHardDefault = FALSE ); + virtual void DisableItem(sal_uInt16 nWhich); + virtual void InvalidateItem( sal_uInt16 nWhich ); + virtual sal_uInt16 ClearItem( sal_uInt16 nWhich = 0); + virtual void ClearInvalidItems( sal_Bool bHardDefault = sal_False ); void InvalidateAllItems(); HACK(via nWhich = 0) inline void SetParent( const SfxItemSet* pNew ); // Items hinzufuegen, loeschen etc. - virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich ); + virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich ); const SfxPoolItem* Put( const SfxPoolItem& rItem ) { return Put(rItem, rItem.Which()); } virtual int Put( const SfxItemSet&, - BOOL bInvalidAsDefault = TRUE ); + sal_Bool bInvalidAsDefault = sal_True ); void PutExtended( const SfxItemSet&, SfxItemState eDontCareAs = SFX_ITEM_UNKNOWN, SfxItemState eDefaultAs = SFX_ITEM_UNKNOWN ); - virtual int Set( const SfxItemSet&, BOOL bDeep = TRUE ); + virtual int Set( const SfxItemSet&, sal_Bool bDeep = sal_True ); virtual void Intersect( const SfxItemSet& rSet ); - virtual void MergeValues( const SfxItemSet& rSet, BOOL bOverwriteDefaults = FALSE ); + virtual void MergeValues( const SfxItemSet& rSet, sal_Bool bOverwriteDefaults = sal_False ); virtual void Differentiate( const SfxItemSet& rSet ); - virtual void MergeValue( const SfxPoolItem& rItem, BOOL bOverwriteDefaults = FALSE ); + virtual void MergeValue( const SfxPoolItem& rItem, sal_Bool bOverwriteDefaults = sal_False ); SfxItemPool* GetPool() const { return _pPool; } - const USHORT* GetRanges() const { return _pWhichRanges; } - void SetRanges( const USHORT *pRanges ); - void MergeRange( USHORT nFrom, USHORT nTo ); + const sal_uInt16* GetRanges() const { return _pWhichRanges; } + void SetRanges( const sal_uInt16 *pRanges ); + void MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo ); const SfxItemSet* GetParent() const { return _pParent; } virtual SvStream & Load( SvStream &, bool bDirect = false, @@ -191,19 +191,19 @@ class SVL_DLLPUBLIC SfxAllItemSet: public SfxItemSet { SfxVoidItem aDefault; - USHORT nFree; + sal_uInt16 nFree; public: SfxAllItemSet( SfxItemPool &rPool ); SfxAllItemSet( const SfxItemSet & ); SfxAllItemSet( const SfxAllItemSet & ); - virtual SfxItemSet * Clone( BOOL bItems = TRUE, SfxItemPool *pToPool = 0 ) const; - virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich ); + virtual SfxItemSet * Clone( sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0 ) const; + virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich ); const SfxPoolItem* Put( const SfxPoolItem& rItem ) { return Put(rItem, rItem.Which()); } virtual int Put( const SfxItemSet&, - BOOL bInvalidAsDefault = TRUE ); + sal_Bool bInvalidAsDefault = sal_True ); }; #endif // #ifndef _SFXITEMSET_HXX diff --git a/svl/inc/svl/lckbitem.hxx b/svl/inc/svl/lckbitem.hxx index 015b72264da2..3b41c834010f 100644 --- a/svl/inc/svl/lckbitem.hxx +++ b/svl/inc/svl/lckbitem.hxx @@ -43,23 +43,23 @@ class SVL_DLLPUBLIC SfxLockBytesItem : public SfxPoolItem public: TYPEINFO(); SfxLockBytesItem(); - SfxLockBytesItem( USHORT nWhich, + SfxLockBytesItem( sal_uInt16 nWhich, SvLockBytes *pLockBytes ); - SfxLockBytesItem( USHORT nWhich, SvStream & ); + SfxLockBytesItem( sal_uInt16 nWhich, SvStream & ); SfxLockBytesItem( const SfxLockBytesItem& ); ~SfxLockBytesItem(); virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const; SvLockBytes* GetValue() const { return _xVal; } virtual bool PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/listener.hxx b/svl/inc/svl/listener.hxx index bb35150c8afd..87bf85426747 100644 --- a/svl/inc/listener.hxx +++ b/svl/inc/svl/listener.hxx @@ -51,12 +51,12 @@ public: SvtListener( const SvtListener &rCopy ); virtual ~SvtListener(); - BOOL StartListening( SvtBroadcaster& rBroadcaster ); - BOOL EndListening( SvtBroadcaster& rBroadcaster ); + sal_Bool StartListening( SvtBroadcaster& rBroadcaster ); + sal_Bool EndListening( SvtBroadcaster& rBroadcaster ); void EndListeningAll(); - BOOL IsListening( SvtBroadcaster& rBroadcaster ) const; + sal_Bool IsListening( SvtBroadcaster& rBroadcaster ) const; - BOOL HasBroadcaster() const { return 0 != pBrdCastLst; } + sal_Bool HasBroadcaster() const { return 0 != pBrdCastLst; } virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint ); }; diff --git a/svl/inc/listeneriter.hxx b/svl/inc/svl/listeneriter.hxx index 0dcdec811250..0dcdec811250 100644 --- a/svl/inc/listeneriter.hxx +++ b/svl/inc/svl/listeneriter.hxx diff --git a/svl/inc/lngmisc.hxx b/svl/inc/svl/lngmisc.hxx index b4da28604721..9e6c5c242451 100644 --- a/svl/inc/lngmisc.hxx +++ b/svl/inc/svl/lngmisc.hxx @@ -33,6 +33,7 @@ #include <tools/solar.h> #include <sal/types.h> #include <rtl/ustring.hxx> +#include <tools/string.hxx> /////////////////////////////////////////////////////////////////////////// @@ -45,29 +46,31 @@ namespace linguistic { -inline BOOL IsHyphen( sal_Unicode cChar ) +inline sal_Bool IsHyphen( sal_Unicode cChar ) { return cChar == SVT_SOFT_HYPHEN || cChar == SVT_HARD_HYPHEN; } -inline BOOL IsControlChar( sal_Unicode cChar ) +inline sal_Bool IsControlChar( sal_Unicode cChar ) { return cChar < (sal_Unicode) ' '; } -inline BOOL HasHyphens( const rtl::OUString &rTxt ) +inline sal_Bool HasHyphens( const rtl::OUString &rTxt ) { return rTxt.indexOf( SVT_SOFT_HYPHEN ) != -1 || rTxt.indexOf( SVT_HARD_HYPHEN ) != -1; } -SVL_DLLPUBLIC INT32 GetNumControlChars( const rtl::OUString &rTxt ); -SVL_DLLPUBLIC BOOL RemoveHyphens( rtl::OUString &rTxt ); -SVL_DLLPUBLIC BOOL RemoveControlChars( rtl::OUString &rTxt ); +SVL_DLLPUBLIC sal_Int32 GetNumControlChars( const rtl::OUString &rTxt ); +SVL_DLLPUBLIC sal_Bool RemoveHyphens( rtl::OUString &rTxt ); +SVL_DLLPUBLIC sal_Bool RemoveControlChars( rtl::OUString &rTxt ); -SVL_DLLPUBLIC BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' ); +SVL_DLLPUBLIC sal_Bool ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' ); + +SVL_DLLPUBLIC String GetThesaurusReplaceText( const String &rText ); } // namespace linguistic diff --git a/svl/inc/svl/lstner.hxx b/svl/inc/svl/lstner.hxx index a129cf588b91..c87d88ac890c 100644 --- a/svl/inc/svl/lstner.hxx +++ b/svl/inc/svl/lstner.hxx @@ -58,15 +58,15 @@ public: SfxListener( const SfxListener &rCopy ); virtual ~SfxListener(); - BOOL StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDups = FALSE ); - BOOL EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups = FALSE ); - void EndListening( USHORT nNo ); + sal_Bool StartListening( SfxBroadcaster& rBroadcaster, sal_Bool bPreventDups = sal_False ); + sal_Bool EndListening( SfxBroadcaster& rBroadcaster, sal_Bool bAllDups = sal_False ); + void EndListening( sal_uInt16 nNo ); void EndListeningAll(); - BOOL IsListening( SfxBroadcaster& rBroadcaster ) const; + sal_Bool IsListening( SfxBroadcaster& rBroadcaster ) const; - USHORT GetBroadcasterCount() const + sal_uInt16 GetBroadcasterCount() const { return aBCs.Count(); } - SfxBroadcaster* GetBroadcasterJOE( USHORT nNo ) const + SfxBroadcaster* GetBroadcasterJOE( sal_uInt16 nNo ) const { return (SfxBroadcaster*) aBCs.GetObject(nNo); } virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); diff --git a/svl/inc/svl/macitem.hxx b/svl/inc/svl/macitem.hxx index 35290e6558e4..2bc93a177539 100644 --- a/svl/inc/svl/macitem.hxx +++ b/svl/inc/svl/macitem.hxx @@ -92,7 +92,7 @@ public: ScriptType GetScriptType() const { return eType; } - BOOL HasMacro() const { return aMacName.Len() ? TRUE : FALSE; } + sal_Bool HasMacro() const { return aMacName.Len() ? sal_True : sal_False; } #ifdef SOLAR_JAVA // JavaScript-Function-Objekt holen @@ -124,7 +124,7 @@ DECLARE_TABLE( _SvxMacroTableDtor, SvxMacro* ) class SVL_DLLPUBLIC SvxMacroTableDtor : public _SvxMacroTableDtor { public: - inline SvxMacroTableDtor( const USHORT nInitSz = 0, const USHORT nReSz = 1 ); + inline SvxMacroTableDtor( const sal_uInt16 nInitSz = 0, const sal_uInt16 nReSz = 1 ); inline SvxMacroTableDtor( const SvxMacroTableDtor &rCpy ) : _SvxMacroTableDtor() { *this = rCpy; } inline ~SvxMacroTableDtor() { DelDtor(); } SvxMacroTableDtor& operator=( const SvxMacroTableDtor &rCpy ); @@ -132,14 +132,14 @@ public: // loescht alle Eintraege void DelDtor(); - SvStream& Read( SvStream &, USHORT nVersion = SVX_MACROTBL_AKTVERSION ); + SvStream& Read( SvStream &, sal_uInt16 nVersion = SVX_MACROTBL_AKTVERSION ); SvStream& Write( SvStream & ) const; - USHORT GetVersion() const { return SVX_MACROTBL_AKTVERSION; } + sal_uInt16 GetVersion() const { return SVX_MACROTBL_AKTVERSION; } }; -inline SvxMacroTableDtor::SvxMacroTableDtor( const USHORT nInitSz, - const USHORT nReSz) +inline SvxMacroTableDtor::SvxMacroTableDtor( const sal_uInt16 nInitSz, + const sal_uInt16 nReSz) : _SvxMacroTableDtor( nInitSz, nReSz ) {} @@ -153,7 +153,7 @@ class SVL_DLLPUBLIC SvxMacroItem: public SfxPoolItem public: TYPEINFO(); - inline SvxMacroItem ( const USHORT nId /*= ITEMID_MACRO*/ ); + inline SvxMacroItem ( const sal_uInt16 nId /*= ITEMID_MACRO*/ ); // "pure virtual Methoden" vom SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; @@ -163,17 +163,17 @@ public: XubString &rText, const IntlWrapper * = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; - virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const; + virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; inline const SvxMacroTableDtor& GetMacroTable() const { return aMacroTable;} inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aMacroTable = rTbl; } - inline const SvxMacro& GetMacro( USHORT nEvent ) const; - inline BOOL HasMacro( USHORT nEvent ) const; - void SetMacro( USHORT nEvent, const SvxMacro& ); - inline BOOL DelMacro( USHORT nEvent ); + inline const SvxMacro& GetMacro( sal_uInt16 nEvent ) const; + inline sal_Bool HasMacro( sal_uInt16 nEvent ) const; + void SetMacro( sal_uInt16 nEvent, const SvxMacro& ); + inline sal_Bool DelMacro( sal_uInt16 nEvent ); private: SvxMacroTableDtor aMacroTable; @@ -182,7 +182,7 @@ private: SvxMacroItem &operator=( const SvxMacroItem & ); }; -inline SvxMacroItem::SvxMacroItem( const USHORT nId ) +inline SvxMacroItem::SvxMacroItem( const sal_uInt16 nId ) : SfxPoolItem( nId ) {} inline SvxMacroItem::SvxMacroItem( const SvxMacroItem &rCpy ) @@ -190,15 +190,15 @@ inline SvxMacroItem::SvxMacroItem( const SvxMacroItem &rCpy ) aMacroTable( rCpy.GetMacroTable() ) {} -inline BOOL SvxMacroItem::HasMacro( USHORT nEvent ) const +inline sal_Bool SvxMacroItem::HasMacro( sal_uInt16 nEvent ) const { return aMacroTable.IsKeyValid( nEvent ); } -inline const SvxMacro& SvxMacroItem::GetMacro( USHORT nEvent ) const +inline const SvxMacro& SvxMacroItem::GetMacro( sal_uInt16 nEvent ) const { return *(aMacroTable.Get(nEvent)); } -inline BOOL SvxMacroItem::DelMacro( USHORT nEvent ) +inline sal_Bool SvxMacroItem::DelMacro( sal_uInt16 nEvent ) { SvxMacro *pMacro = aMacroTable.Remove( nEvent ); delete pMacro; diff --git a/svl/inc/svl/mailenum.hxx b/svl/inc/svl/mailenum.hxx index 1302499f6777..87f66299bd33 100644 --- a/svl/inc/svl/mailenum.hxx +++ b/svl/inc/svl/mailenum.hxx @@ -86,10 +86,10 @@ enum MailAction // Textformat zum Versenden von Nachrichten ------------------------------ -#define TXTFORMAT_ASCII ((BYTE)0x01) -#define TXTFORMAT_HTML ((BYTE)0x02) -#define TXTFORMAT_RTF ((BYTE)0x04) -#define TXTFORMAT_OFFICE ((BYTE)0x08) +#define TXTFORMAT_ASCII ((sal_uInt8)0x01) +#define TXTFORMAT_HTML ((sal_uInt8)0x02) +#define TXTFORMAT_RTF ((sal_uInt8)0x04) +#define TXTFORMAT_OFFICE ((sal_uInt8)0x08) #endif diff --git a/svl/inc/svl/metitem.hxx b/svl/inc/svl/metitem.hxx index e53008c12f35..92f46002d5ee 100644 --- a/svl/inc/svl/metitem.hxx +++ b/svl/inc/svl/metitem.hxx @@ -39,8 +39,8 @@ class SVL_DLLPUBLIC SfxMetricItem: public SfxInt32Item { public: TYPEINFO(); - SfxMetricItem( USHORT nWhich = 0, UINT32 nValue = 0 ); - SfxMetricItem( USHORT nWhich, SvStream & ); + SfxMetricItem( sal_uInt16 nWhich = 0, sal_uInt32 nValue = 0 ); + SfxMetricItem( sal_uInt16 nWhich, SvStream & ); SfxMetricItem( const SfxMetricItem& ); ~SfxMetricItem() { DBG_DTOR(SfxMetricItem, 0); } diff --git a/svl/inc/nfsymbol.hxx b/svl/inc/svl/nfsymbol.hxx index 57b2ddde339e..57b2ddde339e 100644 --- a/svl/inc/nfsymbol.hxx +++ b/svl/inc/svl/nfsymbol.hxx diff --git a/svl/inc/svl/nranges.hxx b/svl/inc/svl/nranges.hxx index f9548bc78cbb..2654a2125f99 100644 --- a/svl/inc/svl/nranges.hxx +++ b/svl/inc/svl/nranges.hxx @@ -36,12 +36,12 @@ #ifndef NUMTYPE -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SfxNumRanges SfxUShortRanges #include <svl/nranges.hxx> #undef NUMTYPE -#define NUMTYPE ULONG +#define NUMTYPE sal_uLong #define SfxNumRanges SfxULongRanges #include <svl/nranges.hxx> @@ -67,8 +67,8 @@ public: ~SfxNumRanges() { delete [] _pRanges; } - BOOL operator == ( const SfxNumRanges & ) const; - BOOL operator != ( const SfxNumRanges & rRanges ) const + sal_Bool operator == ( const SfxNumRanges & ) const; + sal_Bool operator != ( const SfxNumRanges & rRanges ) const { return !( *this == rRanges ); } SfxNumRanges& operator = ( const SfxNumRanges & ); @@ -78,10 +78,10 @@ public: SfxNumRanges& operator /= ( const SfxNumRanges & ); NUMTYPE Count() const; - BOOL IsEmpty() const + sal_Bool IsEmpty() const { return !_pRanges || 0 == *_pRanges; } - BOOL Contains( NUMTYPE n ) const; - BOOL Intersects( const SfxNumRanges & ) const; + sal_Bool Contains( NUMTYPE n ) const; + sal_Bool Intersects( const SfxNumRanges & ) const; operator const NUMTYPE* () const { return _pRanges; } diff --git a/svl/inc/numuno.hxx b/svl/inc/svl/numuno.hxx index 85db8c5906b9..85db8c5906b9 100644 --- a/svl/inc/numuno.hxx +++ b/svl/inc/svl/numuno.hxx diff --git a/svl/inc/outstrm.hxx b/svl/inc/svl/outstrm.hxx index d147d2741700..dba7c2847c5e 100644 --- a/svl/inc/outstrm.hxx +++ b/svl/inc/svl/outstrm.hxx @@ -43,15 +43,15 @@ class SVL_DLLPUBLIC SvOutputStream: public SvStream com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > m_xStream; - SVL_DLLPRIVATE virtual ULONG GetData(void *, ULONG); + SVL_DLLPRIVATE virtual sal_uLong GetData(void *, sal_uLong); - SVL_DLLPRIVATE virtual ULONG PutData(void const * pData, ULONG nSize); + SVL_DLLPRIVATE virtual sal_uLong PutData(void const * pData, sal_uLong nSize); - SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG); + SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong); SVL_DLLPRIVATE virtual void FlushData(); - SVL_DLLPRIVATE virtual void SetSize(ULONG); + SVL_DLLPRIVATE virtual void SetSize(sal_uLong); public: SvOutputStream(com::sun::star::uno::Reference< @@ -60,7 +60,7 @@ public: virtual ~SvOutputStream(); - virtual USHORT IsA() const; + virtual sal_uInt16 IsA() const; }; #endif // SVTOOLS_OUTSTRM_HXX diff --git a/svl/inc/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx index 051cf18bf9e4..9dc31764c53c 100644 --- a/svl/inc/svl/ownlist.hxx +++ b/svl/inc/svl/ownlist.hxx @@ -87,10 +87,10 @@ class SVL_DLLPUBLIC SvCommandList { PRV_SV_DECL_OWNER_LIST(SvCommandList,SvCommand); SvCommand & Append( const String & rCommand, const String & rArg ); - BOOL AppendCommands( const String & rCmd, USHORT * pEaten ); + sal_Bool AppendCommands( const String & rCmd, sal_uInt16 * pEaten ); String GetCommands() const; - BOOL FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); + sal_Bool FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); void FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); SVL_DLLPUBLIC friend SvStream& operator >> ( SvStream& rStm, SvCommandList & ); diff --git a/svl/inc/pickerhelper.hxx b/svl/inc/svl/pickerhelper.hxx index bf877722f541..bf877722f541 100644 --- a/svl/inc/pickerhelper.hxx +++ b/svl/inc/svl/pickerhelper.hxx diff --git a/svl/inc/pickerhistory.hxx b/svl/inc/svl/pickerhistory.hxx index 45f9ab15c33b..45f9ab15c33b 100644 --- a/svl/inc/pickerhistory.hxx +++ b/svl/inc/svl/pickerhistory.hxx diff --git a/svl/inc/pickerhistoryaccess.hxx b/svl/inc/svl/pickerhistoryaccess.hxx index 392933a431a4..392933a431a4 100644 --- a/svl/inc/pickerhistoryaccess.hxx +++ b/svl/inc/svl/pickerhistoryaccess.hxx diff --git a/svl/inc/poolcach.hxx b/svl/inc/svl/poolcach.hxx index 7552d697f5ad..c8b1b87ee3ef 100644 --- a/svl/inc/poolcach.hxx +++ b/svl/inc/svl/poolcach.hxx @@ -30,13 +30,24 @@ #include "svl/svldllapi.h" #include <tools/solar.h> +#include <vector> + +//------------------------------------------------------------------------ -class SfxItemModifyArr_Impl; class SfxItemPool; class SfxItemSet; class SfxPoolItem; class SfxSetItem; +struct SfxItemModifyImpl +{ + const SfxSetItem *pOrigItem; + SfxSetItem *pPoolItem; +}; + +typedef std::vector<SfxItemModifyImpl> SfxItemModifyArr_Impl; + + class SVL_DLLPUBLIC SfxItemPoolCache { SfxItemPool *pPool; @@ -51,7 +62,7 @@ public: const SfxItemSet *pPutSet ); ~SfxItemPoolCache(); - const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, BOOL bNew = FALSE ); + const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, sal_Bool bNew = sal_False ); }; diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx index eb922a99fe25..0101720da14d 100644 --- a/svl/inc/svl/poolitem.hxx +++ b/svl/inc/svl/poolitem.hxx @@ -51,8 +51,9 @@ class IntlWrapper; namespace com { namespace sun { namespace star { namespace uno { class Any; } } } } -#define SFX_ITEMS_DIRECT 0xffff -#define SFX_ITEMS_NULL 0xfff0 // anstelle StoreSurrogate +static const sal_uInt32 SFX_ITEMS_DIRECT= 0xffffffff; +static const sal_uInt32 SFX_ITEMS_NULL= 0xfffffff0; // instead StoreSurrogate +static const sal_uInt32 SFX_ITEMS_DEFAULT= 0xfffffffe; #define SFX_ITEMS_POOLDEFAULT 0xffff #define SFX_ITEMS_STATICDEFAULT 0xfffe @@ -143,7 +144,7 @@ enum SfxItemPresentation // ----------------------------------------------------------------------- -typedef USHORT SfxItemState; +typedef sal_uInt16 SfxItemState; #define SFX_ITEM_UNKNOWN 0x0000 @@ -183,31 +184,31 @@ friend class SfxItemPoolCache; friend class SfxItemSet; friend class SfxVoidItem; - ULONG nRefCount; // Referenzzaehler - USHORT nWhich; - USHORT nKind; + sal_uLong nRefCount; // Referenzzaehler + sal_uInt16 nWhich; + sal_uInt16 nKind; private: - inline void SetRefCount( ULONG n ); - inline void SetKind( USHORT n ); + inline void SetRefCount( sal_uLong n ); + inline void SetKind( sal_uInt16 n ); public: - inline ULONG AddRef( ULONG n = 1 ) const; + inline sal_uLong AddRef( sal_uLong n = 1 ) const; private: - inline ULONG ReleaseRef( ULONG n = 1 ) const; + inline sal_uLong ReleaseRef( sal_uLong n = 1 ) const; SVL_DLLPRIVATE long Delete_Impl(void*); protected: - SfxPoolItem( USHORT nWhich = 0 ); + SfxPoolItem( sal_uInt16 nWhich = 0 ); SfxPoolItem( const SfxPoolItem& ); public: TYPEINFO(); virtual ~SfxPoolItem(); - void SetWhich( USHORT nId ) { + void SetWhich( sal_uInt16 nId ) { DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; } - USHORT Which() const { + sal_uInt16 Which() const { DBG_CHKTHIS(SfxPoolItem, 0); return nWhich; } virtual int operator==( const SfxPoolItem& ) const = 0; @@ -222,19 +223,19 @@ public: XubString &rText, const IntlWrapper * pIntlWrapper = 0 ) const; - virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; virtual bool ScaleMetrics( long lMult, long lDiv ); virtual bool HasMetrics() const; - virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual SfxPoolItem* Create( SvStream &, USHORT nItemVersion ) const; - virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nItemVersion ) const; + virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0; - ULONG GetRefCount() const { return nRefCount; } - inline USHORT GetKind() const { return nKind; } + sal_uLong GetRefCount() const { return nRefCount; } + inline sal_uInt16 GetKind() const { return nKind; } /** Read in a Unicode string from a streamed byte string representation. @@ -289,21 +290,21 @@ private: // ----------------------------------------------------------------------- -inline void SfxPoolItem::SetRefCount( ULONG n ) +inline void SfxPoolItem::SetRefCount( sal_uLong n ) { DBG_CHKTHIS( SfxPoolItem, 0 ); nRefCount = n; nKind = 0; } -inline void SfxPoolItem::SetKind( USHORT n ) +inline void SfxPoolItem::SetKind( sal_uInt16 n ) { DBG_CHKTHIS( SfxPoolItem, 0 ); nRefCount = SFX_ITEMS_SPECIAL; nKind = n; } -inline ULONG SfxPoolItem::AddRef( ULONG n ) const +inline sal_uLong SfxPoolItem::AddRef( sal_uLong n ) const { DBG_CHKTHIS( SfxPoolItem, 0 ); DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); @@ -311,7 +312,7 @@ inline ULONG SfxPoolItem::AddRef( ULONG n ) const return ( ((SfxPoolItem *)this)->nRefCount += n ); } -inline ULONG SfxPoolItem::ReleaseRef( ULONG n ) const +inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const { DBG_CHKTHIS( SfxPoolItem, 0 ); DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); @@ -354,8 +355,8 @@ class SVL_DLLPUBLIC SfxVoidItem: public SfxPoolItem SfxVoidItem & operator=( const SfxVoidItem& ); // not implemented. public: TYPEINFO(); - SfxVoidItem( USHORT nWhich ); - SfxVoidItem( USHORT nWhich, SvStream & ); + SfxVoidItem( sal_uInt16 nWhich ); + SfxVoidItem( sal_uInt16 nWhich, SvStream & ); SfxVoidItem( const SfxVoidItem& ); ~SfxVoidItem(); @@ -369,7 +370,7 @@ public: // von sich selbst eine Kopie erzeugen virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - void SetWhich(USHORT nWh) { nWhich = nWh; } + void SetWhich(sal_uInt16 nWh) { nWhich = nWh; } }; // ----------------------------------------------------------------------- @@ -382,8 +383,8 @@ class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem public: TYPEINFO(); - SfxSetItem( USHORT nWhich, SfxItemSet *pSet ); - SfxSetItem( USHORT nWhich, const SfxItemSet &rSet ); + SfxSetItem( sal_uInt16 nWhich, SfxItemSet *pSet ); + SfxSetItem( sal_uInt16 nWhich, const SfxItemSet &rSet ); SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = 0 ); ~SfxSetItem(); @@ -397,8 +398,8 @@ public: // von sich selbst eine Kopie erzeugen virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0; - virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const = 0; - virtual SvStream& Store(SvStream &, USHORT nVer) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const = 0; + virtual SvStream& Store(SvStream &, sal_uInt16 nVer) const; const SfxItemSet& GetItemSet() const { return *pSet; } @@ -411,7 +412,7 @@ public: class SVL_DLLPUBLIC SfxItemHandle { - USHORT *pRef; + sal_uInt16 *pRef; SfxPoolItem *pItem; public: SfxItemHandle( SfxPoolItem& ); diff --git a/svl/inc/svl/ptitem.hxx b/svl/inc/svl/ptitem.hxx index ce613d582909..46963d8b7ade 100644 --- a/svl/inc/svl/ptitem.hxx +++ b/svl/inc/svl/ptitem.hxx @@ -45,8 +45,8 @@ class SVL_DLLPUBLIC SfxPointItem: public SfxPoolItem public: TYPEINFO(); SfxPointItem(); - SfxPointItem( USHORT nWhich, const Point& rVal ); - SfxPointItem( USHORT nWhich, SvStream & ); + SfxPointItem( sal_uInt16 nWhich, const Point& rVal ); + SfxPointItem( sal_uInt16 nWhich, SvStream & ); SfxPointItem( const SfxPointItem& ); ~SfxPointItem() { DBG_DTOR(SfxPointItem, 0); } @@ -60,8 +60,8 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; const Point& GetValue() const { return aVal; } void SetValue( const Point& rNewVal ) { @@ -70,9 +70,9 @@ public: } virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); }; #endif diff --git a/svl/inc/svl/rectitem.hxx b/svl/inc/svl/rectitem.hxx index 6e4f1132ebf6..31f5717ee1f1 100644 --- a/svl/inc/svl/rectitem.hxx +++ b/svl/inc/svl/rectitem.hxx @@ -46,8 +46,8 @@ class SVL_DLLPUBLIC SfxRectangleItem: public SfxPoolItem public: TYPEINFO(); SfxRectangleItem(); - SfxRectangleItem( USHORT nWhich, const Rectangle& rVal ); - SfxRectangleItem( USHORT nWhich, SvStream & ); + SfxRectangleItem( sal_uInt16 nWhich, const Rectangle& rVal ); + SfxRectangleItem( sal_uInt16 nWhich, SvStream & ); SfxRectangleItem( const SfxRectangleItem& ); ~SfxRectangleItem() { DBG_DTOR(SfxRectangleItem, 0); } @@ -60,8 +60,8 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; const Rectangle& GetValue() const { return aVal; } void SetValue( const Rectangle& rNewVal ) { @@ -69,9 +69,9 @@ public: aVal = rNewVal; } virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); }; #endif diff --git a/svl/inc/svl/rngitem.hxx b/svl/inc/svl/rngitem.hxx index 0962f3bc8370..0a90af8c16d5 100644 --- a/svl/inc/svl/rngitem.hxx +++ b/svl/inc/svl/rngitem.hxx @@ -30,7 +30,7 @@ #ifndef NUMTYPE -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SfxXRangeItem SfxRangeItem #define SfxXRangesItem SfxUShortRangesItem #include <svl/rngitem.hxx> @@ -39,7 +39,7 @@ #undef SfxXRangesItem #ifndef _SFXITEMS_HXX -#define NUMTYPE ULONG +#define NUMTYPE sal_uLong #define SfxXRangeItem SfxULongRangeItem #define SfxXRangesItem SfxULongRangesItem #include <svl/rngitem.hxx> @@ -66,8 +66,8 @@ private: public: TYPEINFO(); SfxXRangeItem(); - SfxXRangeItem( USHORT nWID, NUMTYPE nFrom, NUMTYPE nTo ); - SfxXRangeItem( USHORT nWID, SvStream &rStream ); + SfxXRangeItem( sal_uInt16 nWID, NUMTYPE nFrom, NUMTYPE nTo ); + SfxXRangeItem( sal_uInt16 nWID, SvStream &rStream ); SfxXRangeItem( const SfxXRangeItem& rItem ); virtual int operator==( const SfxPoolItem& ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -80,9 +80,9 @@ public: inline NUMTYPE From() const { return nFrom; } inline NUMTYPE& To() { return nTo; } inline NUMTYPE To() const { return nTo; } - inline BOOL HasRange() const { return nTo>nFrom; } - virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; - virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; + inline sal_Bool HasRange() const { return nTo>nFrom; } + virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const; + virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; }; // ----------------------------------------------------------------------- @@ -95,8 +95,8 @@ private: public: TYPEINFO(); SfxXRangesItem(); - SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges ); - SfxXRangesItem( USHORT nWID, SvStream &rStream ); + SfxXRangesItem( sal_uInt16 nWID, const NUMTYPE *pRanges ); + SfxXRangesItem( sal_uInt16 nWID, SvStream &rStream ); SfxXRangesItem( const SfxXRangesItem& rItem ); virtual ~SfxXRangesItem(); virtual int operator==( const SfxPoolItem& ) const; @@ -107,8 +107,8 @@ public: const IntlWrapper * = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; inline const NUMTYPE* GetRanges() const { return _pRanges; } - virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; - virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const; + virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; }; #endif diff --git a/svl/inc/svl/sfontitm.hxx b/svl/inc/svl/sfontitm.hxx index 01be43ffb76f..ac1e30061c05 100644 --- a/svl/inc/svl/sfontitm.hxx +++ b/svl/inc/svl/sfontitm.hxx @@ -63,12 +63,12 @@ class SfxFontItem: public SfxPoolItem public: TYPEINFO(); - inline SfxFontItem(USHORT nWhich); + inline SfxFontItem(sal_uInt16 nWhich); virtual int operator ==(const SfxPoolItem & rItem) const; - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const { return new SfxFontItem(*this); } @@ -116,7 +116,7 @@ public: inline void setLanguage(LanguageType nTheLanguage); }; -inline SfxFontItem::SfxFontItem(USHORT which): +inline SfxFontItem::SfxFontItem(sal_uInt16 which): SfxPoolItem(which), m_nCharSet(RTL_TEXTENCODING_DONTKNOW), m_nLanguage(LANGUAGE_DONTKNOW), diff --git a/svl/inc/svl/slstitm.hxx b/svl/inc/svl/slstitm.hxx index f946d29faf88..e72a5ffde911 100644 --- a/svl/inc/svl/slstitm.hxx +++ b/svl/inc/svl/slstitm.hxx @@ -45,8 +45,8 @@ public: TYPEINFO(); SfxStringListItem(); - SfxStringListItem( USHORT nWhich, const List* pList=NULL ); - SfxStringListItem( USHORT nWhich, SvStream& rStream ); + SfxStringListItem( sal_uInt16 nWhich, const List* pList=NULL ); + SfxStringListItem( sal_uInt16 nWhich, SvStream& rStream ); SfxStringListItem( const SfxStringListItem& rItem ); ~SfxStringListItem(); @@ -73,14 +73,14 @@ public: XubString &rText, const IntlWrapper * = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; - virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; - void Sort( BOOL bAscending = TRUE, List* pParallelList = 0 ); + virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const; + virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; + void Sort( sal_Bool bAscending = sal_True, List* pParallelList = 0 ); virtual bool PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/svl/smplhint.hxx b/svl/inc/svl/smplhint.hxx index 0d3cc374a02e..1ce98191a059 100644 --- a/svl/inc/svl/smplhint.hxx +++ b/svl/inc/svl/smplhint.hxx @@ -69,11 +69,11 @@ class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint { private: - ULONG nId; + sal_uLong nId; public: TYPEINFO(); - SfxSimpleHint( ULONG nId ); - ULONG GetId() const { return nId; } + SfxSimpleHint( sal_uLong nId ); + sal_uLong GetId() const { return nId; } }; //-------------------------------------------------------------------- @@ -85,14 +85,14 @@ public: \ public: \ TYPEINFO(); \ - Name( USHORT nId, const Type& rObject ); \ + Name( sal_uInt16 nId, const Type& rObject ); \ ~Name(); \ const Type& GetObject() const { return aObj; } \ } #define IMPL_OBJHINT(Name, Type) \ TYPEINIT1(Name, SfxSimpleHint); \ - Name::Name( USHORT nID, const Type& rObject ): \ + Name::Name( sal_uInt16 nID, const Type& rObject ): \ SfxSimpleHint( nID ), aObj(rObject) \ { } \ Name::~Name() {} diff --git a/svl/inc/svl/srchitem.hxx b/svl/inc/svl/srchitem.hxx index 01e7250c9f6d..7a0be711147b 100644 --- a/svl/inc/svl/srchitem.hxx +++ b/svl/inc/svl/srchitem.hxx @@ -91,8 +91,8 @@ public: SvxSearchItem( const SvxSearchItem& rItem ); virtual ~SvxSearchItem(); - virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual int operator == ( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -239,7 +239,7 @@ sal_Bool SvxSearchItem::IsLEVRelaxed() const sal_uInt16 SvxSearchItem::GetLEVOther() const { - return (INT16) aSearchOpt.changedChars; + return (sal_Int16) aSearchOpt.changedChars; } void SvxSearchItem::SetLEVOther( sal_uInt16 nVal ) @@ -249,7 +249,7 @@ void SvxSearchItem::SetLEVOther( sal_uInt16 nVal ) sal_uInt16 SvxSearchItem::GetLEVShorter() const { - return (INT16) aSearchOpt.insertedChars; + return (sal_Int16) aSearchOpt.insertedChars; } void SvxSearchItem::SetLEVShorter( sal_uInt16 nVal ) @@ -259,7 +259,7 @@ void SvxSearchItem::SetLEVShorter( sal_uInt16 nVal ) sal_uInt16 SvxSearchItem::GetLEVLonger() const { - return (INT16) aSearchOpt.deletedChars; + return (sal_Int16) aSearchOpt.deletedChars; } void SvxSearchItem::SetLEVLonger( sal_uInt16 nVal ) diff --git a/svl/inc/svl/stritem.hxx b/svl/inc/svl/stritem.hxx index fd20b9719a9e..ddcb4dfa8b63 100644 --- a/svl/inc/svl/stritem.hxx +++ b/svl/inc/svl/stritem.hxx @@ -40,14 +40,14 @@ public: SfxStringItem() {} - SfxStringItem(USHORT which, const XubString & rValue): + SfxStringItem(sal_uInt16 which, const XubString & rValue): CntUnencodedStringItem(which, rValue) {} - SfxStringItem(USHORT nWhich, SvStream & rStream); + SfxStringItem(sal_uInt16 nWhich, SvStream & rStream); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; }; diff --git a/svl/inc/strmadpt.hxx b/svl/inc/svl/strmadpt.hxx index 8505bd0f786d..eceb68a3b1aa 100644 --- a/svl/inc/strmadpt.hxx +++ b/svl/inc/svl/strmadpt.hxx @@ -52,23 +52,23 @@ public: rTheOutputStream): m_xOutputStream(rTheOutputStream), m_nPosition(0) {} - virtual ErrCode ReadAt(ULONG, void *, ULONG, ULONG *) const; + virtual ErrCode ReadAt(sal_uLong, void *, sal_uLong, sal_uLong *) const; - virtual ErrCode WriteAt(ULONG nPos, const void * pBuffer, ULONG nCount, - ULONG * pWritten); + virtual ErrCode WriteAt(sal_uLong nPos, const void * pBuffer, sal_uLong nCount, + sal_uLong * pWritten); virtual ErrCode Flush() const; - virtual ErrCode SetSize(ULONG); + virtual ErrCode SetSize(sal_uLong); virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const; - virtual ErrCode FillAppend(const void * pBuffer, ULONG nCount, - ULONG * pWritten); + virtual ErrCode FillAppend(const void * pBuffer, sal_uLong nCount, + sal_uLong * pWritten); - virtual ULONG Tell() const; + virtual sal_uLong Tell() const; - virtual ULONG Seek(ULONG); + virtual sal_uLong Seek(sal_uLong); virtual void Terminate(); }; diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx index 7950915fb38d..615d5d690aba 100644 --- a/svl/inc/svl/style.hxx +++ b/svl/inc/svl/style.hxx @@ -75,7 +75,7 @@ SfxSimpleHint(SFX_HINT_DYING) from: SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) from: SfxStyleSheetBasePool::Make( const String& rName, - SfxStyleFamily eFam, USHORT mask, USHORT nPos) + SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos) SfxStyleSheetHint( SFX_STYLESHEET_CHANGED, *pNew ) from: SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet ) @@ -99,17 +99,17 @@ protected: rtl::OUString maDisplayName; String aHelpFile; // Name der Hilfedatei SfxItemSet* pSet; // ItemSet - USHORT nMask; // Flags + sal_uInt16 nMask; // Flags - ULONG nHelpId; // Hilfe-ID + sal_uLong nHelpId; // Hilfe-ID - BOOL bMySet; // TRUE: Set loeschen im dtor + sal_Bool bMySet; // sal_True: Set loeschen im dtor SfxStyleSheetBase(); // do not use! - SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool&, SfxStyleFamily eFam, USHORT mask ); + SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool&, SfxStyleFamily eFam, sal_uInt16 mask ); SfxStyleSheetBase( const SfxStyleSheetBase& ); virtual ~SfxStyleSheetBase(); - virtual void Load( SvStream&, USHORT ); + virtual void Load( SvStream&, sal_uInt16 ); virtual void Store( SvStream& ); public: @@ -119,7 +119,7 @@ public: virtual const UniString& GetName() const; // sets the internal name of this style - virtual BOOL SetName( const UniString& ); + virtual sal_Bool SetName( const UniString& ); /** returns the display name of this style, it is used at the user interface. If the display name is empty, this method returns the internal name. */ @@ -129,13 +129,13 @@ public: virtual void SetDisplayName( const rtl::OUString& ); virtual const UniString& GetParent() const; - virtual BOOL SetParent( const UniString& ); + virtual sal_Bool SetParent( const UniString& ); virtual const UniString& GetFollow() const; - virtual BOOL SetFollow( const UniString& ); - virtual BOOL HasFollowSupport() const; // Default TRUE - virtual BOOL HasParentSupport() const; // Default TRUE - virtual BOOL HasClearParentSupport() const; // Default FALSE - virtual BOOL IsUsed() const; // Default TRUE + virtual sal_Bool SetFollow( const UniString& ); + virtual sal_Bool HasFollowSupport() const; // Default sal_True + virtual sal_Bool HasParentSupport() const; // Default sal_True + virtual sal_Bool HasClearParentSupport() const; // Default sal_False + virtual sal_Bool IsUsed() const; // Default sal_True // Default aus dem Itemset; entweder dem uebergebenen // oder aus dem per GetItemSet() zurueckgelieferten Set virtual UniString GetDescription(); @@ -143,16 +143,16 @@ public: SfxStyleSheetBasePool& GetPool() { return rPool; } SfxStyleFamily GetFamily() const { return nFamily; } - USHORT GetMask() const { return nMask; } - void SetMask( USHORT mask) { nMask = mask; } - BOOL IsUserDefined() const - { return BOOL( ( nMask & SFXSTYLEBIT_USERDEF) != 0 ); } + sal_uInt16 GetMask() const { return nMask; } + void SetMask( sal_uInt16 mask) { nMask = mask; } + sal_Bool IsUserDefined() const + { return sal_Bool( ( nMask & SFXSTYLEBIT_USERDEF) != 0 ); } - virtual ULONG GetHelpId( String& rFile ); - virtual void SetHelpId( const String& r, ULONG nId ); + virtual sal_uLong GetHelpId( String& rFile ); + virtual void SetHelpId( const String& r, sal_uLong nId ); virtual SfxItemSet& GetItemSet(); - virtual USHORT GetVersion() const; + virtual sal_uInt16 GetVersion() const; }; //========================================================================= @@ -172,11 +172,11 @@ class SVL_DLLPUBLIC SfxStyleSheetIterator { public: SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase, - SfxStyleFamily eFam, USHORT n=0xFFFF ); - virtual USHORT GetSearchMask() const; + SfxStyleFamily eFam, sal_uInt16 n=0xFFFF ); + virtual sal_uInt16 GetSearchMask() const; virtual SfxStyleFamily GetSearchFamily() const; - virtual USHORT Count(); - virtual SfxStyleSheetBase *operator[](USHORT nIdx); + virtual sal_uInt16 Count(); + virtual SfxStyleSheetBase *operator[](sal_uInt16 nIdx); virtual SfxStyleSheetBase* First(); virtual SfxStyleSheetBase* Next(); virtual SfxStyleSheetBase* Find(const UniString& rStr); @@ -186,18 +186,18 @@ protected: SfxStyleSheetBasePool* pBasePool; SfxStyleFamily nSearchFamily; - USHORT nMask; - BOOL SearchUsed() const { return bSearchUsed; } + sal_uInt16 nMask; + sal_Bool SearchUsed() const { return bSearchUsed; } private: - USHORT GetPos(){return nAktPosition;} - SVL_DLLPRIVATE BOOL IsTrivialSearch(); - SVL_DLLPRIVATE BOOL DoesStyleMatch(SfxStyleSheetBase *pStyle); + sal_uInt16 GetPos(){return nAktPosition;} + SVL_DLLPRIVATE sal_Bool IsTrivialSearch(); + SVL_DLLPRIVATE sal_Bool DoesStyleMatch(SfxStyleSheetBase *pStyle); void* pImp; SfxStyleSheetBase* pAktStyle; - USHORT nAktPosition; - BOOL bSearchUsed; + sal_uInt16 nAktPosition; + sal_Bool bSearchUsed; friend class SfxStyleSheetBasePool; }; @@ -214,18 +214,18 @@ friend class SfxStyleSheetBase; SfxStyleSheetBasePool_Impl *pImp; private: - SVL_DLLPRIVATE BOOL Load1_Impl( SvStream& ); + SVL_DLLPRIVATE sal_Bool Load1_Impl( SvStream& ); SVL_DLLPRIVATE SfxStyleSheetIterator& GetIterator_Impl(); protected: String aAppName; SfxItemPool& rPool; SfxStyles aStyles; SfxStyleFamily nSearchFamily; - USHORT nMask; + sal_uInt16 nMask; SfxStyleSheetBase& Add( SfxStyleSheetBase& ); - void ChangeParent( const UniString&, const UniString&, BOOL bVirtual = TRUE ); - virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, USHORT ); + void ChangeParent( const UniString&, const UniString&, sal_Bool bVirtual = sal_True ); + virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, sal_uInt16 ); virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ); ~SfxStyleSheetBasePool(); @@ -241,14 +241,14 @@ public: SfxItemPool& GetPool(); const SfxItemPool& GetPool() const; - virtual SfxStyleSheetIterator* CreateIterator(SfxStyleFamily, USHORT nMask); - virtual USHORT Count(); - virtual SfxStyleSheetBase* operator[](USHORT nIdx); + virtual SfxStyleSheetIterator* CreateIterator(SfxStyleFamily, sal_uInt16 nMask); + virtual sal_uInt16 Count(); + virtual SfxStyleSheetBase* operator[](sal_uInt16 nIdx); virtual SfxStyleSheetBase& Make(const UniString&, SfxStyleFamily eFam, - USHORT nMask = 0xffff , - USHORT nPos = 0xffff); + sal_uInt16 nMask = 0xffff , + sal_uInt16 nPos = 0xffff); virtual void Replace( SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget ); @@ -264,21 +264,21 @@ public: const SfxStyles& GetStyles(); virtual SfxStyleSheetBase* First(); virtual SfxStyleSheetBase* Next(); - virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, USHORT n=0xFFFF ); + virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, sal_uInt16 n=0xFFFF ); - virtual BOOL SetParent(SfxStyleFamily eFam, + virtual sal_Bool SetParent(SfxStyleFamily eFam, const UniString &rStyle, const UniString &rParent); SfxStyleSheetBase* Find(const UniString& rStr) { return Find(rStr, nSearchFamily, nMask); } - void SetSearchMask(SfxStyleFamily eFam, USHORT n=0xFFFF ); - USHORT GetSearchMask() const; + void SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n=0xFFFF ); + sal_uInt16 GetSearchMask() const; SfxStyleFamily GetSearchFamily() const { return nSearchFamily; } - BOOL Load( SvStream& ); - BOOL Store( SvStream&, BOOL bUsed = TRUE ); + sal_Bool Load( SvStream& ); + sal_Bool Store( SvStream&, sal_Bool bUsed = sal_True ); }; //========================================================================= @@ -289,11 +289,11 @@ class SVL_DLLPUBLIC SfxStyleSheet: public SfxStyleSheetBase, public: TYPEINFO(); - SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, USHORT ); + SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, sal_uInt16 ); SfxStyleSheet( const SfxStyleSheet& ); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - virtual BOOL SetParent( const UniString& ); + virtual sal_Bool SetParent( const UniString& ); protected: SfxStyleSheet(); // do not use! @@ -306,13 +306,13 @@ class SVL_DLLPUBLIC SfxStyleSheetPool: public SfxStyleSheetBasePool { protected: using SfxStyleSheetBasePool::Create; - virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, USHORT mask); + virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, sal_uInt16 mask); virtual SfxStyleSheetBase* Create(const SfxStyleSheet &); public: SfxStyleSheetPool( SfxItemPool const& ); -// virtual BOOL CopyTo(SfxStyleSheetPool &rDest, const String &rSourceName); +// virtual sal_Bool CopyTo(SfxStyleSheetPool &rDest, const String &rSourceName); }; //========================================================================= @@ -332,13 +332,13 @@ public: class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint { - USHORT nHint; + sal_uInt16 nHint; public: TYPEINFO(); - SfxStyleSheetPoolHint(USHORT nArgHint) : nHint(nArgHint){} - USHORT GetHint() const + SfxStyleSheetPoolHint(sal_uInt16 nArgHint) : nHint(nArgHint){} + sal_uInt16 GetHint() const { return nHint; } }; @@ -347,16 +347,16 @@ public: class SVL_DLLPUBLIC SfxStyleSheetHint: public SfxHint { SfxStyleSheetBase* pStyleSh; - USHORT nHint; + sal_uInt16 nHint; public: TYPEINFO(); - SfxStyleSheetHint( USHORT ); - SfxStyleSheetHint( USHORT, SfxStyleSheetBase& ); + SfxStyleSheetHint( sal_uInt16 ); + SfxStyleSheetHint( sal_uInt16, SfxStyleSheetBase& ); SfxStyleSheetBase* GetStyleSheet() const { return pStyleSh; } - USHORT GetHint() const + sal_uInt16 GetHint() const { return nHint; } }; @@ -368,9 +368,9 @@ public: TYPEINFO(); SfxStyleSheetHintExtended( - USHORT, const String& rOld ); + sal_uInt16, const String& rOld ); SfxStyleSheetHintExtended( - USHORT, const String& rOld, + sal_uInt16, const String& rOld, SfxStyleSheetBase& ); const String& GetOldName() { return aName; } }; @@ -378,7 +378,7 @@ public: class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel > { public: - SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, USHORT _nMaske ); + SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ); SfxUnoStyleSheet( const SfxStyleSheet& _rSheet ); static SfxUnoStyleSheet* getUnoStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >& xStyle ); diff --git a/svl/inc/stylepool.hxx b/svl/inc/svl/stylepool.hxx index c6db7d42c707..c6db7d42c707 100644 --- a/svl/inc/stylepool.hxx +++ b/svl/inc/svl/stylepool.hxx diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index 76f6020cd824..e216cd08c746 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -39,12 +39,6 @@ * enthaelt. (Sie werden im Speicher verschoben, koennen also * z.B. keine String sein) * -* SV_DECL_OBJARR(nm, AE, IS, GS) -* SV_IMPL_OBJARR( nm, AE ) -* definiere/implementiere ein Array das Objecte enthaelt. -* (Hier koennen es auch Strings sein) -* -* * SV_DECL_PTRARR(nm, AE, IS, GS) * SV_IMPL_PTRARR(nm, AE) * definiere/implementiere ein Array das Pointer haelt. Diese @@ -86,10 +80,6 @@ * Basiert auf einem VARARR. * Sortierung mit Hilfe der Object-operatoren "<" und "==" * -* JP 23.12.94 neu: -* SV_DECL_PTRARR_STACK(nm, AE, IS, GS) -* ein Stack mit einem PtrArray als Grundlage. -* * JP 09.10.96: vordefinierte Arrays: * VarArr: SvULongs, SvUShorts, SvLongs * PtrArr: SvStrings, SvStringsDtor @@ -127,15 +117,15 @@ inline void operator delete( void*, DummyType* ) {} #if defined(PRODUCT) #define _SVVARARR_DEF_GET_OP_INLINE( nm, ArrElem ) \ -ArrElem& operator[](USHORT nP) const { return *(pData+nP); }\ +ArrElem& operator[](sal_uInt16 nP) const { return *(pData+nP); }\ \ -void Insert( const nm * pI, USHORT nP,\ - USHORT nS = 0, USHORT nE = USHRT_MAX )\ +void Insert( const nm * pI, sal_uInt16 nP,\ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX )\ {\ if( USHRT_MAX == nE ) \ nE = pI->nA; \ if( nS < nE ) \ - Insert( (const ArrElem*)pI->pData+nS, (USHORT)nE-nS, nP );\ + Insert( (const ArrElem*)pI->pData+nS, (sal_uInt16)nE-nS, nP );\ } #define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem ) @@ -143,71 +133,69 @@ void Insert( const nm * pI, USHORT nP,\ #else #define _SVVARARR_DEF_GET_OP_INLINE( nm,ArrElem )\ -ArrElem& operator[](USHORT nP) const;\ -void Insert( const nm *pI, USHORT nP,\ - USHORT nS = 0, USHORT nE = USHRT_MAX ); +ArrElem& operator[](sal_uInt16 nP) const;\ +void Insert( const nm *pI, sal_uInt16 nP,\ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ); #define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem )\ -ArrElem& nm::operator[](USHORT nP) const\ +ArrElem& nm::operator[](sal_uInt16 nP) const\ {\ DBG_ASSERT( pData && nP < nA,"Op[]");\ return *(pData+nP);\ }\ -void nm::Insert( const nm *pI, USHORT nP, USHORT nStt, USHORT nE)\ +void nm::Insert( const nm *pI, sal_uInt16 nP, sal_uInt16 nStt, sal_uInt16 nE)\ {\ DBG_ASSERT(nP<=nA,"Ins,Ar[Start.End]");\ if( USHRT_MAX == nE ) \ nE = pI->nA; \ if( nStt < nE ) \ - Insert( (const ArrElem*)pI->pData+nStt, (USHORT)nE-nStt, nP );\ + Insert( (const ArrElem*)pI->pData+nStt, (sal_uInt16)nE-nStt, nP );\ } #endif #define _SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ -typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\ class vis nm\ {\ protected:\ AE *pData;\ - USHORT nFree;\ - USHORT nA;\ + sal_uInt16 nFree;\ + sal_uInt16 nA;\ \ void _resize(size_t n);\ \ public:\ - nm( USHORT= IS, BYTE= GS );\ + nm( sal_uInt16= IS, sal_uInt8= GS );\ ~nm() { rtl_freeMemory( pData ); }\ \ _SVVARARR_DEF_GET_OP_INLINE(nm, AE )\ - AERef GetObject(USHORT nP) const { return (*this)[nP]; } \ -\ - void Insert( const AERef aE, USHORT nP );\ - void Insert( const AE *pE, USHORT nL, USHORT nP );\ - void Remove( USHORT nP, USHORT nL = 1 );\ - void Replace( const AERef aE, USHORT nP );\ - void Replace( const AE *pE, USHORT nL, USHORT nP );\ - USHORT Count() const { return nA; }\ + AERef GetObject(sal_uInt16 nP) const { return (*this)[nP]; } \ +\ + void Insert( const AERef aE, sal_uInt16 nP );\ + void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP );\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );\ + void Replace( const AERef aE, sal_uInt16 nP );\ + void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP );\ + sal_uInt16 Count() const { return nA; }\ const AE* GetData() const { return (const AE*)pData; }\ \ void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( 0, nA, fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, fnForEach, pArgs );\ }\ \ - void _ForEach( USHORT nStt, USHORT nE, \ + void _ForEach( sal_uInt16 nStt, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\ \ #define _SV_DECL_VARARR(nm, AE, IS, GS ) \ _SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE & ) -#define _SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \ -_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE ) #define SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ _SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ @@ -218,17 +206,12 @@ nm& operator=( const nm& );\ #define SV_DECL_VARARR(nm, AE, IS, GS ) \ SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, ) -#define SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \ -SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, ) #define SV_DECL_VARARR_VISIBILITY(nm, AE, IS, GS, vis ) \ SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, vis ) -#define SV_DECL_VARARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis ) \ -SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, vis ) - #define SV_IMPL_VARARR_GEN( nm, AE, AERef )\ -nm::nm( USHORT nInit, BYTE )\ +nm::nm( sal_uInt16 nInit, sal_uInt8 )\ : pData (0),\ nFree (nInit),\ nA (0)\ @@ -242,7 +225,7 @@ nm::nm( USHORT nInit, BYTE )\ \ void nm::_resize (size_t n)\ {\ - USHORT nL = ((n < USHRT_MAX) ? USHORT(n) : USHRT_MAX);\ + sal_uInt16 nL = ((n < USHRT_MAX) ? sal_uInt16(n) : USHRT_MAX);\ AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\ if ((pE != 0) || (nL == 0))\ {\ @@ -251,7 +234,7 @@ void nm::_resize (size_t n)\ }\ }\ \ -void nm::Insert( const AERef aE, USHORT nP )\ +void nm::Insert( const AERef aE, sal_uInt16 nP )\ {\ DBG_ASSERT(nP <= nA && nA < USHRT_MAX, "Ins 1");\ if (nFree < 1)\ @@ -262,7 +245,7 @@ void nm::Insert( const AERef aE, USHORT nP )\ ++nA; --nFree;\ }\ \ -void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ +void nm::Insert( const AE* pE, sal_uInt16 nL, sal_uInt16 nP )\ {\ DBG_ASSERT(nP<=nA && ((long)nA+nL)<USHRT_MAX,"Ins n");\ if (nFree < nL)\ @@ -274,13 +257,13 @@ void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ nA = nA + nL; nFree = nFree - nL;\ }\ \ -void nm::Replace( const AERef aE, USHORT nP )\ +void nm::Replace( const AERef aE, sal_uInt16 nP )\ {\ if( nP < nA )\ *(pData+nP) = (AE&)aE;\ }\ \ -void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\ +void nm::Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP )\ {\ if( pE && nP < nA )\ {\ @@ -294,7 +277,7 @@ void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\ }\ else \ {\ - USHORT nTmpLen = nA + nFree - nP; \ + sal_uInt16 nTmpLen = nA + nFree - nP; \ memcpy( pData + nP, pE, nTmpLen * sizeof( AE ));\ nA = nA + nFree; \ nFree = 0; \ @@ -303,7 +286,7 @@ void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\ }\ }\ \ -void nm::Remove( USHORT nP, USHORT nL )\ +void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\ {\ if( !nL )\ return;\ @@ -315,7 +298,7 @@ void nm::Remove( USHORT nP, USHORT nL )\ _resize (nA);\ }\ \ -void nm::_ForEach( USHORT nStt, USHORT nE, \ +void nm::_ForEach( sal_uInt16 nStt, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\ {\ if( nStt >= nE || nE > nA )\ @@ -328,227 +311,39 @@ _SVVARARR_IMPL_GET_OP_INLINE(nm, AE )\ #define SV_IMPL_VARARR( nm, AE ) \ SV_IMPL_VARARR_GEN( nm, AE, AE & ) -#define SV_IMPL_VARARR_PLAIN( nm, AE ) \ -SV_IMPL_VARARR_GEN( nm, AE, AE ) - -#if defined(PRODUCT) - -#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem )\ -ArrElem& operator[](USHORT nP) const { return *(pData+nP); }\ -\ -void Insert( const nm *pI, USHORT nP,\ - USHORT nS = 0, USHORT nE = USHRT_MAX )\ -{\ - if( USHRT_MAX == nE ) \ - nE = pI->nA; \ - if( nS < nE ) \ - Insert( (const ArrElem*)pI->pData+nS, (USHORT)nE-nS, nP );\ -} - -#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem ) - -#else - -#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem ) \ -ArrElem& operator[](USHORT nP) const;\ -void Insert( const nm *pI, USHORT nP,\ - USHORT nS = 0, USHORT nE = USHRT_MAX ); - -#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem )\ -ArrElem& nm::operator[](USHORT nP) const\ -{\ - DBG_ASSERT( pData && nP < nA,"Op[]");\ - return *(pData+nP);\ -}\ -void nm::Insert( const nm *pI, USHORT nP, USHORT nStt, USHORT nE )\ -{\ - DBG_ASSERT( nP <= nA,"Ins,Ar[Start.End]");\ - if( USHRT_MAX == nE ) \ - nE = pI->nA; \ - if( nStt < nE ) \ - Insert( (const ArrElem*)pI->pData+nStt, (USHORT)nE-nStt, nP );\ -} - -#endif - -#define _SV_DECL_OBJARR(nm, AE, IS, GS)\ -typedef BOOL (*FnForEach_##nm)( const AE&, void* );\ -class nm\ -{\ -protected:\ - AE *pData;\ - USHORT nFree;\ - USHORT nA;\ -\ - void _resize(size_t n);\ - void _destroy();\ -\ -public:\ - nm( USHORT= IS, BYTE= GS );\ - ~nm() { _destroy(); }\ -\ - _SVOBJARR_DEF_GET_OP_INLINE(nm,AE)\ - AE& GetObject(USHORT nP) const { return (*this)[nP]; } \ -\ - void Insert( const AE &aE, USHORT nP );\ - void Insert( const AE *pE, USHORT nL, USHORT nP );\ - void Remove( USHORT nP, USHORT nL = 1 );\ - USHORT Count() const { return nA; }\ - const AE* GetData() const { return (const AE*)pData; }\ -\ - void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ - {\ - _ForEach( 0, nA, fnForEach, pArgs );\ - }\ - void ForEach( USHORT nS, USHORT nE, \ - CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ - {\ - _ForEach( nS, nE, fnForEach, pArgs );\ - }\ -\ - void _ForEach( USHORT nStt, USHORT nE, \ - CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\ -\ - -#define SV_DECL_OBJARR(nm, AE, IS, GS)\ -_SV_DECL_OBJARR(nm, AE, IS, GS)\ -private:\ -nm( const nm& );\ -nm& operator=( const nm& );\ -}; - -#define SV_IMPL_OBJARR( nm, AE )\ -nm::nm( USHORT nInit, BYTE )\ - : pData (0),\ - nFree (nInit),\ - nA (0)\ -{\ - if( nInit )\ - {\ - pData = (AE*)(rtl_allocateMemory(sizeof(AE) * nInit));\ - DBG_ASSERT( pData, "CTOR, allocate");\ - }\ -}\ -\ -void nm::_destroy()\ -{\ - if(pData)\ - {\ - AE* pTmp=pData;\ - for(USHORT n=0; n < nA; n++,pTmp++ )\ - {\ - pTmp->~AE();\ - }\ - rtl_freeMemory(pData);\ - pData = 0;\ - }\ -}\ -\ -void nm::_resize (size_t n)\ -{\ - USHORT nL = ((n < USHRT_MAX) ? USHORT(n) : USHRT_MAX);\ - AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\ - if ((pE != 0) || (nL == 0))\ - {\ - pData = pE;\ - nFree = nL - nA;\ - }\ -}\ -\ -void nm::Insert( const AE &aE, USHORT nP )\ -{\ - DBG_ASSERT( nP <= nA && nA < USHRT_MAX,"Ins 1");\ - if (nFree < 1)\ - _resize (nA + ((nA > 1) ? nA : 1));\ - if( pData && nP < nA )\ - memmove( pData+nP+1, pData+nP, (nA-nP) * sizeof( AE ));\ - AE* pTmp = pData+nP;\ - new( (DummyType*) pTmp ) AE( (AE&)aE );\ - ++nA; --nFree;\ -}\ -\ -void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ -{\ - DBG_ASSERT(nP<=nA && ((long)nA+nL) < USHRT_MAX, "Ins n");\ - if (nFree < nL)\ - _resize (nA + ((nA > nL) ? nA : nL));\ - if( pData && nP < nA )\ - memmove( pData+nP+nL, pData+nP, (nA-nP) * sizeof( AE ));\ - if( pE )\ - {\ - AE* pTmp = pData+nP;\ - for( USHORT n = 0; n < nL; n++, pTmp++, pE++)\ - {\ - new( (DummyType*) pTmp ) AE( (AE&)*pE );\ - }\ - }\ - nA = nA + nL; nFree = nFree - nL;\ -}\ -\ -void nm::Remove( USHORT nP, USHORT nL )\ -{\ - if( !nL )\ - return;\ - DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ - AE* pTmp=pData+nP;\ - USHORT nCtr = nP;\ - for(USHORT n=0; n < nL; n++,pTmp++,nCtr++)\ - {\ - if( nCtr < nA )\ - pTmp->~AE();\ - }\ - if( pData && nP+1 < nA )\ - memmove( pData+nP, pData+nP+nL, (nA-nP-nL) * sizeof( AE ));\ - nA = nA - nL; nFree = nFree + nL;\ - if (nFree > nA) \ - _resize (nA);\ -}\ -\ -void nm::_ForEach( USHORT nStt, USHORT nE, \ - CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\ -{\ - if( nStt >= nE || nE > nA )\ - return;\ - for( ; nStt < nE && (*fnCall)( *(pData+nStt), pArgs ); nStt++)\ - ;\ -}\ -\ -_SVOBJARR_IMPL_GET_OP_INLINE(nm, AE)\ #define _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AERef, vis )\ _SV_DECL_VARARR_GEN( nm, AE, IS, GS, AERef, vis)\ -USHORT GetPos( const AERef aE ) const;\ +sal_uInt16 GetPos( const AERef aE ) const;\ }; #define _SV_DECL_PTRARR_DEF( nm, AE, IS, GS, vis )\ _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE &, vis ) -#define _SV_DECL_PTRARR_DEF_PLAIN( nm, AE, IS, GS, vis )\ -_SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE, vis ) #define SV_DECL_PTRARR_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\ -typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\ class vis nm: public Base \ {\ public:\ - nm( USHORT nIni=IS, BYTE nG=GS )\ + nm( sal_uInt16 nIni=IS, sal_uInt8 nG=GS )\ : Base(nIni,nG) {}\ - void Insert( const nm *pI, USHORT nP, \ - USHORT nS = 0, USHORT nE = USHRT_MAX ) {\ + void Insert( const nm *pI, sal_uInt16 nP, \ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ) {\ Base::Insert((const Base*)pI, nP, nS, nE);\ }\ - void Insert( const AERef aE, USHORT nP ) {\ + void Insert( const AERef aE, sal_uInt16 nP ) {\ Base::Insert( (const VPRef )aE, nP );\ }\ - void Insert( const AE *pE, USHORT nL, USHORT nP ) {\ + void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\ Base::Insert( (const VoidPtr*)pE, nL, nP );\ }\ - void Replace( const AERef aE, USHORT nP ) {\ + void Replace( const AERef aE, sal_uInt16 nP ) {\ Base::Replace( (const VPRef)aE, nP );\ }\ - void Replace( const AE *pE, USHORT nL, USHORT nP ) {\ + void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\ Base::Replace( (const VoidPtr*)pE, nL, nP );\ }\ - void Remove( USHORT nP, USHORT nL = 1) {\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1) {\ Base::Remove(nP,nL);\ }\ const AE* GetData() const {\ @@ -558,20 +353,20 @@ public:\ {\ _ForEach( 0, nA, (FnForEach_##Base)fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, (FnForEach_##Base)fnForEach, pArgs );\ }\ - AE operator[]( USHORT nP )const { \ + AE operator[]( sal_uInt16 nP )const { \ return (AE)Base::operator[](nP); }\ - AE GetObject(USHORT nP) const { \ + AE GetObject(sal_uInt16 nP) const { \ return (AE)Base::GetObject(nP); }\ \ - USHORT GetPos( const AERef aE ) const { \ + sal_uInt16 GetPos( const AERef aE ) const { \ return Base::GetPos((const VPRef)aE);\ }\ - void DeleteAndDestroy( USHORT nP, USHORT nL=1 );\ + void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 );\ private:\ nm( const nm& );\ nm& operator=( const nm& );\ @@ -579,39 +374,35 @@ private:\ #define SV_DECL_PTRARR(nm, AE, IS, GS )\ SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, ) -#define SV_DECL_PTRARR_PLAIN(nm, AE, IS, GS )\ -SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, ) #define SV_DECL_PTRARR_VISIBILITY(nm, AE, IS, GS, vis )\ SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis ) -#define SV_DECL_PTRARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\ -SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis ) #define SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\ -typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\ class vis nm: public Base \ {\ public:\ - nm( USHORT nIni=IS, BYTE nG=GS )\ + nm( sal_uInt16 nIni=IS, sal_uInt8 nG=GS )\ : Base(nIni,nG) {}\ ~nm() { DeleteAndDestroy( 0, Count() ); }\ - void Insert( const nm *pI, USHORT nP, \ - USHORT nS = 0, USHORT nE = USHRT_MAX ) {\ + void Insert( const nm *pI, sal_uInt16 nP, \ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ) {\ Base::Insert((const Base*)pI, nP, nS, nE);\ }\ - void Insert( const AERef aE, USHORT nP ) {\ + void Insert( const AERef aE, sal_uInt16 nP ) {\ Base::Insert((const VPRef)aE, nP );\ }\ - void Insert( const AE *pE, USHORT nL, USHORT nP ) {\ + void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\ Base::Insert( (const VoidPtr *)pE, nL, nP );\ }\ - void Replace( const AERef aE, USHORT nP ) {\ + void Replace( const AERef aE, sal_uInt16 nP ) {\ Base::Replace( (const VPRef)aE, nP );\ }\ - void Replace( const AE *pE, USHORT nL, USHORT nP ) {\ + void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\ Base::Replace( (const VoidPtr*)pE, nL, nP );\ }\ - void Remove( USHORT nP, USHORT nL = 1) {\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1) {\ Base::Remove(nP,nL);\ }\ const AE* GetData() const {\ @@ -621,20 +412,20 @@ public:\ {\ _ForEach( 0, nA, (FnForEach_##Base)fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, (FnForEach_##Base)fnForEach, pArgs );\ }\ - AE operator[]( USHORT nP )const { \ + AE operator[]( sal_uInt16 nP )const { \ return (AE)Base::operator[](nP); }\ - AE GetObject( USHORT nP )const { \ + AE GetObject( sal_uInt16 nP )const { \ return (AE)Base::GetObject(nP); }\ \ - USHORT GetPos( const AERef aE ) const { \ + sal_uInt16 GetPos( const AERef aE ) const { \ return Base::GetPos((const VPRef)aE);\ } \ - void DeleteAndDestroy( USHORT nP, USHORT nL=1 );\ + void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 );\ private:\ nm( const nm& );\ nm& operator=( const nm& );\ @@ -642,20 +433,16 @@ private:\ #define SV_DECL_PTRARR_DEL(nm, AE, IS, GS )\ SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, ) -#define SV_DECL_PTRARR_DEL_PLAIN(nm, AE, IS, GS )\ -SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, ) #define SV_DECL_PTRARR_DEL_VISIBILITY(nm, AE, IS, GS, vis )\ SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis) -#define SV_DECL_PTRARR_DEL_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\ -SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis) #define SV_IMPL_PTRARR_GEN(nm, AE, Base)\ -void nm::DeleteAndDestroy( USHORT nP, USHORT nL )\ +void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )\ { \ if( nL ) {\ DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ - for( USHORT n=nP; n < nP + nL; n++ ) \ + for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ Base::Remove( nP, nL ); \ } \ @@ -663,37 +450,34 @@ void nm::DeleteAndDestroy( USHORT nP, USHORT nL )\ #define SV_IMPL_PTRARR(nm, AE )\ SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarr ) -#define SV_IMPL_PTRARR_PLAIN(nm, AE )\ -SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarrPlain ) typedef void* VoidPtr; _SV_DECL_PTRARR_DEF( SvPtrarr, VoidPtr, 0, 1, SVL_DLLPUBLIC ) -_SV_DECL_PTRARR_DEF_PLAIN( SvPtrarrPlain, VoidPtr, 0, 1, SVL_DLLPUBLIC ) // SORTARR - Begin #define _SORT_CLASS_DEF(nm, AE, IS, GS, vis)\ -typedef BOOL (*FnForEach_##nm)( const AE&, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AE&, void* );\ class vis nm : private nm##_SAR \ {\ public:\ - nm(USHORT nSize = IS, BYTE nG = GS)\ + nm(sal_uInt16 nSize = IS, sal_uInt8 nG = GS)\ : nm##_SAR(nSize,nG) {}\ - void Insert( const nm *pI, USHORT nS=0, USHORT nE=USHRT_MAX );\ - BOOL Insert( const AE& aE );\ - BOOL Insert( const AE& aE, USHORT& rP );\ - void Insert( const AE *pE, USHORT nL );\ - void Remove( USHORT nP, USHORT nL = 1 );\ - void Remove( const AE& aE, USHORT nL = 1 );\ - USHORT Count() const { return nm##_SAR::Count(); }\ + void Insert( const nm *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX );\ + sal_Bool Insert( const AE& aE );\ + sal_Bool Insert( const AE& aE, sal_uInt16& rP );\ + void Insert( const AE *pE, sal_uInt16 nL );\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );\ + void Remove( const AE& aE, sal_uInt16 nL = 1 );\ + sal_uInt16 Count() const { return nm##_SAR::Count(); }\ const AE* GetData() const { return (const AE*)pData; }\ \ /* Das Ende stehe im DECL-Makro !!! */ #define _SV_SEEK_PTR(nm,AE)\ -BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ +sal_Bool nm::Seek_Entry( const AE aE, sal_uInt16* pP ) const\ {\ - register USHORT nO = nm##_SAR::Count(),\ + register sal_uInt16 nO = nm##_SAR::Count(),\ nM, \ nU = 0;\ if( nO > 0 )\ @@ -706,27 +490,27 @@ BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ if( (long)*(pData + nM) == rCmp )\ {\ if( pP ) *pP = nM;\ - return TRUE;\ + return sal_True;\ }\ else if( (long)*(pData+ nM) < (long)aE )\ nU = nM + 1;\ else if( nM == 0 )\ {\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ }\ else\ nO = nM - 1;\ }\ }\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ } #define _SV_SEEK_PTR_TO_OBJECT( nm,AE )\ -BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ +sal_Bool nm::Seek_Entry( const AE aE, sal_uInt16* pP ) const\ {\ - register USHORT nO = nm##_SAR::Count(),\ + register sal_uInt16 nO = nm##_SAR::Count(),\ nM, \ nU = 0;\ if( nO > 0 )\ @@ -738,27 +522,27 @@ BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ if( *(*((AE*)pData + nM)) == *(aE) )\ {\ if( pP ) *pP = nM;\ - return TRUE;\ + return sal_True;\ }\ else if( *(*((AE*)pData + nM)) < *(aE) )\ nU = nM + 1;\ else if( nM == 0 )\ {\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ }\ else\ nO = nM - 1;\ }\ }\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ } #define _SV_SEEK_OBJECT( nm,AE )\ -BOOL nm::Seek_Entry( const AE & aE, USHORT* pP ) const\ +sal_Bool nm::Seek_Entry( const AE & aE, sal_uInt16* pP ) const\ {\ - register USHORT nO = nm##_SAR::Count(),\ + register sal_uInt16 nO = nm##_SAR::Count(),\ nM, \ nU = 0;\ if( nO > 0 )\ @@ -770,29 +554,29 @@ BOOL nm::Seek_Entry( const AE & aE, USHORT* pP ) const\ if( *(pData + nM) == aE )\ {\ if( pP ) *pP = nM;\ - return TRUE;\ + return sal_True;\ }\ else if( *(pData + nM) < aE )\ nU = nM + 1;\ else if( nM == 0 )\ {\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ }\ else\ nO = nM - 1;\ }\ }\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ } #define _SV_IMPL_SORTAR_ALG(nm, AE)\ -void nm::Insert( const nm * pI, USHORT nS, USHORT nE )\ +void nm::Insert( const nm * pI, sal_uInt16 nS, sal_uInt16 nE )\ {\ if( USHRT_MAX == nE )\ nE = pI->Count();\ - USHORT nP;\ + sal_uInt16 nP;\ const AE * pIArr = pI->GetData();\ for( ; nS < nE; ++nS )\ {\ @@ -806,68 +590,68 @@ void nm::Insert( const nm * pI, USHORT nS, USHORT nE )\ }\ }\ \ -BOOL nm::Insert( const AE & aE )\ +sal_Bool nm::Insert( const AE & aE )\ {\ - USHORT nP;\ - BOOL bExist;\ + sal_uInt16 nP;\ + sal_Bool bExist;\ bExist = Seek_Entry( aE, &nP );\ if( ! bExist )\ nm##_SAR::Insert( aE, nP );\ return !bExist;\ }\ -BOOL nm::Insert( const AE & aE, USHORT& rP )\ +sal_Bool nm::Insert( const AE & aE, sal_uInt16& rP )\ {\ - BOOL bExist;\ + sal_Bool bExist;\ bExist = Seek_Entry( aE, &rP );\ if( ! bExist )\ nm##_SAR::Insert( aE, rP );\ return !bExist;\ }\ -void nm::Insert( const AE* pE, USHORT nL)\ +void nm::Insert( const AE* pE, sal_uInt16 nL)\ {\ - USHORT nP;\ - for( USHORT n = 0; n < nL; ++n )\ + sal_uInt16 nP;\ + for( sal_uInt16 n = 0; n < nL; ++n )\ if( ! Seek_Entry( *(pE+n), &nP ))\ nm##_SAR::Insert( *(pE+n), nP );\ }\ -void nm::Remove( USHORT nP, USHORT nL )\ +void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\ {\ if( nL )\ nm##_SAR::Remove( nP, nL);\ }\ \ -void nm::Remove( const AE &aE, USHORT nL )\ +void nm::Remove( const AE &aE, sal_uInt16 nL )\ {\ - USHORT nP;\ + sal_uInt16 nP;\ if( nL && Seek_Entry( aE, &nP ) ) \ nm##_SAR::Remove( nP, nL);\ }\ #define _SORTARR_BLC_CASTS(nm, AE )\ - USHORT GetPos( const AE& aE ) const { \ + sal_uInt16 GetPos( const AE& aE ) const { \ return SvPtrarr::GetPos((const VoidPtr&)aE);\ } #define _SV_DECL_PTRARR_SORT_ALG(nm, AE, IS, GS, vis)\ SV_DECL_PTRARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\ _SORT_CLASS_DEF(nm, AE, IS, GS, vis)\ - AE operator[](USHORT nP) const {\ + AE operator[](sal_uInt16 nP) const {\ return nm##_SAR::operator[]( nP );\ }\ - AE GetObject(USHORT nP) const {\ + AE GetObject(sal_uInt16 nP) const {\ return nm##_SAR::GetObject( nP );\ }\ - BOOL Seek_Entry( const AE aE, USHORT* pP = 0 ) const;\ + sal_Bool Seek_Entry( const AE aE, sal_uInt16* pP = 0 ) const;\ void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( 0, nA, (FnForEach_SvPtrarr)fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, (FnForEach_SvPtrarr)fnForEach, pArgs );\ }\ - void DeleteAndDestroy( USHORT nP, USHORT nL=1 ); \ + void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 ); \ _SORTARR_BLC_CASTS(nm, AE )\ \ /* Das Ende stehe im DECL-Makro !!! */ @@ -903,18 +687,18 @@ _SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS, vis) #define _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis)\ SV_DECL_VARARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\ _SORT_CLASS_DEF(nm, AE, IS, GS, vis) \ - const AE& operator[](USHORT nP) const {\ + const AE& operator[](sal_uInt16 nP) const {\ return nm##_SAR::operator[]( nP );\ }\ - const AE& GetObject(USHORT nP) const {\ + const AE& GetObject(sal_uInt16 nP) const {\ return nm##_SAR::GetObject( nP );\ }\ - BOOL Seek_Entry( const AE & aE, USHORT* pP = 0 ) const;\ + sal_Bool Seek_Entry( const AE & aE, sal_uInt16* pP = 0 ) const;\ void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( 0, nA, (FnForEach_##nm##_SAR)fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, (FnForEach_##nm##_SAR)fnForEach, pArgs );\ @@ -932,10 +716,10 @@ _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis) #define SV_IMPL_PTRARR_SORT( nm,AE )\ _SV_IMPL_SORTAR_ALG( nm,AE )\ - void nm::DeleteAndDestroy( USHORT nP, USHORT nL ) { \ + void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \ if( nL ) {\ DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ - for( USHORT n=nP; n < nP + nL; n++ ) \ + for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ SvPtrarr::Remove( nP, nL ); \ } \ @@ -944,10 +728,10 @@ _SV_SEEK_PTR( nm, AE ) #define SV_IMPL_OP_PTRARR_SORT( nm,AE )\ _SV_IMPL_SORTAR_ALG( nm,AE )\ - void nm::DeleteAndDestroy( USHORT nP, USHORT nL ) { \ + void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \ if( nL ) {\ DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ - for( USHORT n=nP; n < nP + nL; n++ ) \ + for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ SvPtrarr::Remove( nP, nL ); \ } \ @@ -959,69 +743,21 @@ SV_IMPL_VARARR(nm##_SAR, AE)\ _SV_IMPL_SORTAR_ALG( nm,AE )\ _SV_SEEK_OBJECT( nm,AE ) -#define SV_DECL_PTRARR_STACK(nm, AE, IS, GS)\ -class nm: private SvPtrarr \ -{\ -public:\ - nm( USHORT nIni=IS, BYTE nG=GS )\ - : SvPtrarr(nIni,nG) {}\ - void Insert( const nm *pI, USHORT nP,\ - USHORT nS = 0, USHORT nE = USHRT_MAX ) {\ - SvPtrarr::Insert( pI, nP, nS, nE ); \ - }\ - void Remove( USHORT nP, USHORT nL = 1 ) {\ - SvPtrarr::Remove( nP, nL ); \ - }\ - void Push( const AE &aE ) {\ - SvPtrarr::Insert( (const VoidPtr &)aE, SvPtrarr::Count() );\ - }\ - USHORT Count() const { return SvPtrarr::Count(); }\ - AE operator[](USHORT nP) const {\ - return (AE)SvPtrarr::operator[]( nP );\ - }\ - AE GetObject(USHORT nP) const {\ - return (AE)SvPtrarr::GetObject( nP );\ - }\ - AE Pop(){\ - AE pRet = 0;\ - if( SvPtrarr::Count() ){\ - pRet = GetObject( SvPtrarr::Count()-1 );\ - SvPtrarr::Remove(Count()-1);\ - }\ - return pRet;\ - }\ - AE Top() const {\ - AE pRet = 0;\ - if( SvPtrarr::Count() )\ - pRet = GetObject( SvPtrarr::Count()-1 ); \ - return pRet;\ - }\ -}; - #if defined (C40) || defined (C41) || defined (C42) || defined(C50) || defined(C52) #define C40_INSERT( c, p, n) Insert( (c const *) p, n ) -#define C40_PUSH( c, p) Push( (c const *) p ) #define C40_PTR_INSERT( c, p) Insert( (c const *) p ) -#define C40_REMOVE( c, p ) Remove( (c const *) p ) #define C40_REPLACE( c, p, n) Replace( (c const *) p, n ) -#define C40_PTR_REPLACE( c, p) Replace( (c const *) p ) #define C40_GETPOS( c, r) GetPos( (c const *)r ) #else #if defined ICC || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400) #define C40_INSERT( c, p, n ) Insert( (c const *&) p, n ) -#define C40_PUSH( c, p) Push( (c const *&) p ) #define C40_PTR_INSERT( c, p ) Insert( (c const *&) p ) -#define C40_REMOVE( c, p ) Remove( (c const *&) p ) #define C40_REPLACE( c, p, n ) Replace( (c const *&) p, n ) -#define C40_PTR_REPLACE( c, p ) Replace( (c const *&) p ) #define C40_GETPOS( c, r) GetPos( (c const *&) r ) #else #define C40_INSERT( c, p, n ) Insert( p, n ) -#define C40_PUSH( c, p) Push( p ) #define C40_PTR_INSERT( c, p ) Insert( p ) -#define C40_REMOVE( c, p) Remove( p ) #define C40_REPLACE( c, p, n ) Replace( p, n ) -#define C40_PTR_REPLACE( c, p ) Replace( p ) #define C40_GETPOS( c, r) GetPos( r ) #endif #endif diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx index de8601c979d4..d60ef0094723 100644 --- a/svl/inc/svl/svdde.hxx +++ b/svl/inc/svl/svdde.hxx @@ -84,11 +84,11 @@ class SVL_DLLPUBLIC DdeData SVL_DLLPRIVATE void Lock(); - void SetFormat( ULONG nFmt ); + void SetFormat( sal_uLong nFmt ); public: DdeData(); - DdeData( const void*, long, ULONG = FORMAT_STRING ); + DdeData( const void*, long, sal_uLong = FORMAT_STRING ); DdeData( const String& ); DdeData( const DdeData& ); ~DdeData(); @@ -96,12 +96,12 @@ public: operator const void*() const; operator long() const; - ULONG GetFormat() const; + sal_uLong GetFormat() const; DdeData& operator = ( const DdeData& ); - static ULONG GetExternalFormat( ULONG nFmt ); - static ULONG GetInternalFormat( ULONG nFmt ); + static sal_uLong GetExternalFormat( sal_uLong nFmt ); + static sal_uLong GetInternalFormat( sal_uLong nFmt ); }; // ------------------ @@ -112,7 +112,7 @@ class SVL_DLLPUBLIC DdeTransaction { public: virtual void Data( const DdeData* ); - virtual void Done( BOOL bDataValid ); + virtual void Done( sal_Bool bDataValid ); protected: DdeConnection& rDde; DdeData aDdeData; @@ -122,14 +122,14 @@ protected: long nTime; Link aData; Link aDone; - BOOL bBusy; + sal_Bool bBusy; DdeTransaction( DdeConnection&, const String&, long = 0 ); public: virtual ~DdeTransaction(); - BOOL IsBusy() { return bBusy; } + sal_Bool IsBusy() { return bBusy; } const String& GetName() const; void Execute(); @@ -140,8 +140,8 @@ public: void SetDoneHdl( const Link& rLink ) { aDone = rLink; } const Link& GetDoneHdl() const { return aDone; } - void SetFormat( ULONG nFmt ) { aDdeData.SetFormat( nFmt ); } - ULONG GetFormat() const { return aDdeData.GetFormat(); } + void SetFormat( sal_uLong nFmt ) { aDdeData.SetFormat( nFmt ); } + sal_uLong GetFormat() const { return aDdeData.GetFormat(); } long GetError(); @@ -209,7 +209,7 @@ class SVL_DLLPUBLIC DdePoke : public DdeTransaction { public: DdePoke( DdeConnection&, const String&, const char*, long, - ULONG = FORMAT_STRING, long = 0 ); + sal_uLong = FORMAT_STRING, long = 0 ); DdePoke( DdeConnection&, const String&, const DdeData&, long = 0 ); DdePoke( DdeConnection&, const String&, const String&, long = 0 ); }; @@ -246,7 +246,7 @@ public: static const DdeConnections& GetConnections(); - BOOL IsConnected(); + sal_Bool IsConnected(); const String& GetServiceName(); const String& GetTopicName(); @@ -268,11 +268,11 @@ class SVL_DLLPUBLIC DdeItem DdeTopic* pMyTopic; DdeItemImp* pImpData; - void IncMonitor( ULONG ); - void DecMonitor( ULONG ); + void IncMonitor( sal_uLong ); + void DecMonitor( sal_uLong ); protected: - BYTE nType; + sal_uInt8 nType; public: DdeItem( const sal_Unicode* ); @@ -296,9 +296,9 @@ public: DdeGetPutItem( const String& rStr ); DdeGetPutItem( const DdeItem& rItem ); - virtual DdeData* Get( ULONG ); - virtual BOOL Put( const DdeData* ); - virtual void AdviseLoop( BOOL ); // AdviseLoop starten/stoppen + virtual DdeData* Get( sal_uLong ); + virtual sal_Bool Put( const DdeData* ); + virtual void AdviseLoop( sal_Bool ); // AdviseLoop starten/stoppen }; // ------------ @@ -312,16 +312,16 @@ class SVL_DLLPUBLIC DdeTopic public: virtual void Connect( long ); virtual void Disconnect( long ); - virtual DdeData* Get( ULONG ); - virtual BOOL Put( const DdeData* ); - virtual BOOL Execute( const String* ); + virtual DdeData* Get( sal_uLong ); + virtual sal_Bool Put( const DdeData* ); + virtual sal_Bool Execute( const String* ); // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden - virtual BOOL MakeItem( const String& rItem ); + virtual sal_Bool MakeItem( const String& rItem ); // es wird ein Warm-/Hot-Link eingerichtet. Return-Wert // besagt ob es geklappt hat - virtual BOOL StartAdviseLoop(); - virtual BOOL StopAdviseLoop(); + virtual sal_Bool StartAdviseLoop(); + virtual sal_Bool StopAdviseLoop(); private: friend class DdeInternal; @@ -357,7 +357,7 @@ public: const Link& GetExecuteHdl() const { return aExecLink; } void NotifyClient( const String& ); - BOOL IsSystemTopic(); + sal_Bool IsSystemTopic(); void InsertItem( DdeItem* ); // fuer eigene Ableitungen! DdeItem* AddItem( const DdeItem& ); // werden kopiert ! @@ -379,10 +379,10 @@ class SVL_DLLPUBLIC DdeService friend class DdeInternal; public: - virtual BOOL IsBusy(); + virtual sal_Bool IsBusy(); virtual String GetHelp(); // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden - virtual BOOL MakeTopic( const String& rItem ); + virtual sal_Bool MakeTopic( const String& rItem ); protected: virtual String Topics(); @@ -390,7 +390,7 @@ protected: virtual String SysItems(); virtual String Status(); virtual String SysTopicGet( const String& ); - virtual BOOL SysTopicExecute( const String* ); + virtual sal_Bool SysTopicExecute( const String* ); const DdeTopic* GetSysTopic() const { return pSysTopic; } private: @@ -401,7 +401,7 @@ private: ConvList* pConv; short nStatus; - SVL_DLLPRIVATE BOOL HasCbFormat( USHORT ); + SVL_DLLPRIVATE sal_Bool HasCbFormat( sal_uInt16 ); public: DdeService( const String& ); @@ -416,9 +416,9 @@ public: void AddTopic( const DdeTopic& ); void RemoveTopic( const DdeTopic& ); - void AddFormat( ULONG ); - void RemoveFormat( ULONG ); - BOOL HasFormat( ULONG ); + void AddFormat( sal_uLong ); + void RemoveFormat( sal_uLong ); + sal_Bool HasFormat( sal_uLong ); private: // DdeService( const DdeService& ); diff --git a/svl/inc/svl/svldata.hxx b/svl/inc/svl/svldata.hxx index 952f09db75e0..1a869b5a5a1f 100644 --- a/svl/inc/svl/svldata.hxx +++ b/svl/inc/svl/svldata.hxx @@ -62,7 +62,7 @@ class SvtSimpleResId String m_sValue; public: - SvtSimpleResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale) : m_sValue(ImpSvlData::GetSvlData().GetSimpleRM(aLocale)->ReadString(nId)) { }; + SvtSimpleResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale) : m_sValue(ImpSvlData::GetSvlData().GetSimpleRM(aLocale)->ReadString(nId)) { }; operator String () const { return m_sValue; } }; diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx index 6551b63e2c55..3f68af6e9d98 100644 --- a/svl/inc/svl/svstdarr.hxx +++ b/svl/inc/svl/svstdarr.hxx @@ -41,55 +41,56 @@ #include "svl/svldllapi.h" #include <svl/svarray.hxx> +#include <deque> #ifndef _SVSTDARR_ULONGS_DECL -SV_DECL_VARARR_VISIBILITY( SvULongs, ULONG, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_VISIBILITY( SvULongs, sal_uLong, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_ULONGS_DECL #endif #ifndef _SVSTDARR_ULONGSSORT_DECL -SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, ULONG, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, sal_uLong, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_ULONGSSORT_DECL #endif #ifndef _SVSTDARR_USHORTS_DECL -SV_DECL_VARARR_VISIBILITY( SvUShorts, USHORT, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_USHORTS_DECL #endif #ifndef _SVSTDARR_USHORTSSORT_DECL -typedef BOOL (*FnForEach_SvUShortsSort)( const USHORT&, void* ); +typedef sal_Bool (*FnForEach_SvUShortsSort)( const sal_uInt16&, void* ); class SVL_DLLPUBLIC SvUShortsSort : private SvUShorts { public: - SvUShortsSort(BYTE nSize = 1, BYTE nG = 1) + SvUShortsSort(sal_uInt8 nSize = 1, sal_uInt8 nG = 1) : SvUShorts(nSize,nG) {} - void Insert( const SvUShortsSort *pI, USHORT nS=0, USHORT nE=USHRT_MAX ); - BOOL Insert( const USHORT aE ); - BOOL Insert( const USHORT aE, USHORT& rP ); - void Insert( const USHORT *pE, USHORT nL ); + void Insert( const SvUShortsSort *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX ); + sal_Bool Insert( const sal_uInt16 aE ); + sal_Bool Insert( const sal_uInt16 aE, sal_uInt16& rP ); + void Insert( const sal_uInt16 *pE, sal_uInt16 nL ); // remove ab Pos - void RemoveAt( const USHORT nP, USHORT nL = 1 ); + void RemoveAt( const sal_uInt16 nP, sal_uInt16 nL = 1 ); // remove ab dem Eintrag - void Remove( const USHORT nP, USHORT nL = 1 ); - BOOL Seek_Entry( const USHORT aE, USHORT* pP = 0 ) const; + void Remove( const sal_uInt16 nP, sal_uInt16 nL = 1 ); + sal_Bool Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP = 0 ) const; - USHORT Count() const { return SvUShorts::Count(); } - const USHORT* GetData() const { return (const USHORT*)pData; } + sal_uInt16 Count() const { return SvUShorts::Count(); } + const sal_uInt16* GetData() const { return (const sal_uInt16*)pData; } - const USHORT& operator[](USHORT nP) const { + const sal_uInt16& operator[](sal_uInt16 nP) const { return SvUShorts::operator[]( nP ); } - const USHORT& GetObject(USHORT nP) const { + const sal_uInt16& GetObject(sal_uInt16 nP) const { return SvUShorts::GetObject( nP ); } void ForEach( FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) { _ForEach( 0, nA, (FnForEach_SvUShorts)fnForEach, pArgs ); } - void ForEach( USHORT nS, USHORT nE, + void ForEach( sal_uInt16 nS, sal_uInt16 nE, FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) { _ForEach( nS, nE, (FnForEach_SvUShorts)fnForEach, pArgs ); @@ -178,14 +179,5 @@ SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1, #define _SVSTDARR_BYTESTRINGSISORTDTOR_DECL #endif -#ifndef _SVSTDARR_XUB_STRLEN_DECL -SV_DECL_VARARR_VISIBILITY( SvXub_StrLens, xub_StrLen, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_XUB_STRLEN_DECL -#endif - -#ifndef _SVSTDARR_XUB_STRLENSORT_DECL -SV_DECL_VARARR_SORT_VISIBILITY( SvXub_StrLensSort, xub_StrLen, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_XUB_STRLENSORT_DECL -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/szitem.hxx b/svl/inc/svl/szitem.hxx index cd8a40d33e55..b3b78d9e8891 100644 --- a/svl/inc/svl/szitem.hxx +++ b/svl/inc/svl/szitem.hxx @@ -47,8 +47,8 @@ private: public: TYPEINFO(); SfxSizeItem(); - SfxSizeItem( USHORT nWhich, const Size& rVal ); - SfxSizeItem( USHORT nWhich, SvStream & ); + SfxSizeItem( sal_uInt16 nWhich, const Size& rVal ); + SfxSizeItem( sal_uInt16 nWhich, SvStream & ); SfxSizeItem( const SfxSizeItem& ); ~SfxSizeItem() { DBG_DTOR(SfxSizeItem, 0); } @@ -60,13 +60,13 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; const Size& GetValue() const { return aVal; } void SetValue( const Size& rNewVal ) { diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx index aaf3fa3ce60c..e3f964864eb8 100644 --- a/svl/inc/svl/undo.hxx +++ b/svl/inc/svl/undo.hxx @@ -33,6 +33,10 @@ #include <tools/string.hxx> #include <svl/svarray.hxx> +#include <boost/scoped_ptr.hpp> + +#include <vector> + //==================================================================== class SVL_DLLPUBLIC SfxRepeatTarget @@ -44,26 +48,36 @@ public: //==================================================================== +class SVL_DLLPUBLIC SfxUndoContext +{ +public: + virtual ~SfxUndoContext() = 0; +}; + +//==================================================================== + class SVL_DLLPUBLIC SfxUndoAction { - BOOL bLinked; + sal_Bool bLinked; public: TYPEINFO(); SfxUndoAction(); virtual ~SfxUndoAction(); - virtual BOOL IsLinked(); - virtual void SetLinked( BOOL bIsLinked = TRUE ); + virtual sal_Bool IsLinked(); + virtual void SetLinked( sal_Bool bIsLinked = sal_True ); virtual void Undo(); + virtual void UndoWithContext( SfxUndoContext& i_context ); virtual void Redo(); + virtual void RedoWithContext( SfxUndoContext& i_context ); virtual void Repeat(SfxRepeatTarget&); - virtual BOOL CanRepeat(SfxRepeatTarget&) const; + virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); - virtual UniString GetComment() const; - virtual UniString GetRepeatComment(SfxRepeatTarget&) const; - virtual USHORT GetId() const; + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&) const; + virtual sal_uInt16 GetId() const; private: SfxUndoAction& operator=( const SfxUndoAction& ); // n.i.!! @@ -71,19 +85,67 @@ private: //======================================================================== -SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 ) +/// is a mark on the Undo stack +typedef sal_Int32 UndoStackMark; +#define MARK_INVALID ::std::numeric_limits< UndoStackMark >::max() + +//======================================================================== + +struct MarkedUndoAction +{ + SfxUndoAction* pAction; + ::std::vector< UndoStackMark > aMarks; + + MarkedUndoAction( SfxUndoAction* i_action ) + :pAction( i_action ) + ,aMarks() + { + } +}; + +class SfxUndoActions +{ +private: + ::std::vector< MarkedUndoAction > m_aActions; + +public: + SfxUndoActions() + { + } + + bool empty() const { return m_aActions.empty(); } + size_t size() const { return m_aActions.size(); } + + const MarkedUndoAction& operator[]( size_t i ) const { return m_aActions[i]; } + MarkedUndoAction& operator[]( size_t i ) { return m_aActions[i]; } + + void Remove( size_t i_pos ) + { + m_aActions.erase( m_aActions.begin() + i_pos ); + } + + void Remove( size_t i_pos, size_t i_count ) + { + m_aActions.erase( m_aActions.begin() + i_pos, m_aActions.begin() + i_pos + i_count ); + } + + void Insert( SfxUndoAction* i_action, size_t i_pos ) + { + m_aActions.insert( m_aActions.begin() + i_pos, MarkedUndoAction( i_action ) ); + } +}; //==================================================================== -/** do not make use of this implementation details, unless you +/** do not make use of these implementation details, unless you really really have to! */ struct SVL_DLLPUBLIC SfxUndoArray { SfxUndoActions aUndoActions; - USHORT nMaxUndoActions; - USHORT nCurUndoAction; + size_t nMaxUndoActions; + size_t nCurUndoAction; SfxUndoArray *pFatherUndoArray; - SfxUndoArray(USHORT nMax=0): + SfxUndoArray(size_t nMax=0): nMaxUndoActions(nMax), nCurUndoAction(0), pFatherUndoArray(0) {} ~SfxUndoArray(); @@ -91,7 +153,7 @@ struct SVL_DLLPUBLIC SfxUndoArray //========================================================================= -/** do not make use of this implementation details, unless you +/** do not make use of these implementation details, unless you really really have to! */ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArray @@ -110,87 +172,260 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra TYPEINFO(); SfxListUndoAction( const UniString &rComment, - const UniString rRepeatComment, USHORT Id, SfxUndoArray *pFather); + const UniString rRepeatComment, sal_uInt16 Id, SfxUndoArray *pFather); virtual void Undo(); + virtual void UndoWithContext( SfxUndoContext& i_context ); virtual void Redo(); + virtual void RedoWithContext( SfxUndoContext& i_context ); virtual void Repeat(SfxRepeatTarget&); - virtual BOOL CanRepeat(SfxRepeatTarget&) const; + virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); - virtual UniString GetComment() const; - virtual UniString GetRepeatComment(SfxRepeatTarget&) const; - virtual USHORT GetId() const; + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&) const; + virtual sal_uInt16 GetId() const; void SetComment( const UniString& rComment ); private: - USHORT nId; - UniString aComment, aRepeatComment; + sal_uInt16 nId; + UniString aComment; + UniString aRepeatComment; }; //========================================================================= -class SVL_DLLPUBLIC SfxUndoManager +/** is a callback interface for notifications about state changes of an SfxUndoManager +*/ +class SAL_NO_VTABLE SfxUndoListener { - friend class SfxLinkUndoAction; +public: + virtual void actionUndone( const String& i_actionComment ) = 0; + virtual void actionRedone( const String& i_actionComment ) = 0; + virtual void undoActionAdded( const String& i_actionComment ) = 0; + virtual void cleared() = 0; + virtual void clearedRedo() = 0; + virtual void resetAll() = 0; + virtual void listActionEntered( const String& i_comment ) = 0; + virtual void listActionLeft( const String& i_comment ) = 0; + virtual void listActionLeftAndMerged() = 0; + virtual void listActionCancelled() = 0; + virtual void undoManagerDying() = 0; +}; - SfxUndoArray *pUndoArray; - SfxUndoArray *pActUndoArray; - SfxUndoArray *pFatherUndoArray; +//========================================================================= - bool mbUndoEnabled; -public: - SfxUndoManager( USHORT nMaxUndoActionCount = 20 ); - virtual ~SfxUndoManager(); +namespace svl +{ + class SAL_NO_VTABLE IUndoManager + { + public: + enum + { + CurrentLevel = true, + TopLevel = false + }; - virtual void SetMaxUndoActionCount( USHORT nMaxUndoActionCount ); - virtual USHORT GetMaxUndoActionCount() const; - virtual void Clear(); + virtual ~IUndoManager() { }; + + virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ) = 0; + virtual size_t GetMaxUndoActionCount() const = 0; + + virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ) = 0; + + virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0; + virtual sal_uInt16 GetUndoActionId() const = 0; + virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0; + virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const = 0; - virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE ); + virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0; + virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0; - virtual USHORT GetUndoActionCount() const; - virtual USHORT GetUndoActionId(USHORT nNo=0) const; - virtual UniString GetUndoActionComment( USHORT nNo=0 ) const; - /** returns the nNo'th undo action from the top */ - SfxUndoAction* GetUndoAction( USHORT nNo=0 ) const; + virtual sal_Bool Undo() = 0; + virtual sal_Bool Redo() = 0; - virtual BOOL Undo( USHORT nCount=1 ); - virtual void Undo( SfxUndoAction &rAction ); + /** clears both the Redo and the Undo stack. - virtual USHORT GetRedoActionCount() const; - virtual USHORT GetRedoActionId(USHORT nNo=0) const; - virtual UniString GetRedoActionComment( USHORT nNo=0 ) const; + Will assert and bail out when called while within a list action (<member>IsInListAction</member>). + */ + virtual void Clear() = 0; - virtual BOOL Redo( USHORT nCount=1 ); - virtual void Redo( SfxUndoAction &rAction ); + /** clears the Redo stack. + + Will assert and bail out when called while within a list action (<member>IsInListAction</member>). + */ + virtual void ClearRedo() = 0; + + /** leaves any possible open list action (<member>IsInListAction</member>), and clears both the Undo and the + Redo stack. + + Effectively, calling this method is equivalent to <code>while ( IsInListAction() ) LeaveListAction();</code>, + followed by <code>Clear()</code>. The only difference to this calling sequence is that Reset is an + atomar operation, also resulting in only one notification. + */ + virtual void Reset() = 0; + + /** determines whether an Undo or Redo is currently running + */ + virtual bool IsDoing() const = 0; + + virtual size_t GetRepeatActionCount() const = 0; + virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget) const = 0; + virtual sal_Bool Repeat( SfxRepeatTarget &rTarget ) = 0; + virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const = 0; + + virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, sal_uInt16 nId=0) = 0; + + /** leaves the list action entered with EnterListAction + @return the number of the sub actions in the list which has just been left. Note that in case no such + actions exist, the list action does not contribute to the Undo stack, but is silently removed. + */ + virtual size_t LeaveListAction() = 0; + + /** leaves the list action entered with EnterListAction, and forcefully merges the previous + action on the stack into the newly created list action. + + Say you have an Undo action A on the stack, then call EnterListAction, followed by one or more calls to + AddUndoAction, followed by a call to LeaveAndMergeListAction. In opposite to LeaveListAction, your Undo + stack will now still contain one undo action: the newly created list action, whose first child is the + original A, whose other children are those you added via AddUndoAction, and whose comment is the same as + the comment of A. + + Effectively, this means that all actions added between EnterListAction and LeaveAndMergeListAction are + hidden from the user. + + @return the number of the sub actions in the list which has just been left. Note that in case no such + actions exist, the list action does not contribute to the Undo stack, but is silently removed. + */ + virtual size_t LeaveAndMergeListAction() = 0; + + /// determines whether we're within a ListAction context, i.e. a LeaveListAction/LeaveAndMergeListAction call is pending + virtual bool IsInListAction() const = 0; + + /// determines how many nested list actions are currently open + virtual size_t GetListActionDepth() const = 0; + + /** clears the redo stack and removes the top undo action */ + virtual void RemoveLastUndoAction() = 0; + + // enables (true) or disables (false) recording of undo actions + // If undo actions are added while undo is disabled, they are deleted. + // Disabling undo does not clear the current undo buffer! + virtual void EnableUndo( bool bEnable ) = 0; + + // returns true if undo is currently enabled + // This returns false if undo was disabled using EnableUndo( false ) and + // also during the runtime of the Undo() and Redo() methods. + virtual bool IsUndoEnabled() const = 0; + + /// adds a new listener to be notified about changes in the UndoManager's state + virtual void AddUndoListener( SfxUndoListener& i_listener ) = 0; + virtual void RemoveUndoListener( SfxUndoListener& i_listener ) = 0; + }; +} + +//========================================================================= + +namespace svl { namespace undo { namespace impl +{ + class UndoManagerGuard; + class LockGuard; +} } } + +struct SfxUndoManager_Data; +class SVL_DLLPUBLIC SfxUndoManager : public ::svl::IUndoManager +{ + friend class SfxLinkUndoAction; + + ::boost::scoped_ptr< SfxUndoManager_Data > + m_pData; +public: + SfxUndoManager( size_t nMaxUndoActionCount = 20 ); + virtual ~SfxUndoManager(); + + // IUndoManager overridables + virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ); + virtual size_t GetMaxUndoActionCount() const; + virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ); + virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const; + virtual sal_uInt16 GetUndoActionId() const; + virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; + virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const; + virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const; + virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; + virtual sal_Bool Undo(); + virtual sal_Bool Redo(); + virtual void Clear(); virtual void ClearRedo(); + virtual void Reset(); + virtual bool IsDoing() const; + virtual size_t GetRepeatActionCount() const; + virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget) const; + virtual sal_Bool Repeat( SfxRepeatTarget &rTarget ); + virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const; + virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, sal_uInt16 nId=0); + virtual size_t LeaveListAction(); + virtual size_t LeaveAndMergeListAction(); + virtual bool IsInListAction() const; + virtual size_t GetListActionDepth() const; + virtual void RemoveLastUndoAction(); + virtual void EnableUndo( bool bEnable ); + virtual bool IsUndoEnabled() const; + virtual void AddUndoListener( SfxUndoListener& i_listener ); + virtual void RemoveUndoListener( SfxUndoListener& i_listener ); + + /** marks the current top-level element of the Undo stack, and returns a unique ID for it + */ + UndoStackMark MarkTopUndoAction(); + + /** removes a mark given by its ID. + After the call, the mark ID is invalid. + */ + void RemoveMark( UndoStackMark const i_mark ); + + /** determines whether the top action on the Undo stack has a given mark + */ + bool HasTopUndoActionMark( UndoStackMark const i_mark ); + + /** removes the oldest Undo actions from the stack + */ + void RemoveOldestUndoActions( size_t const i_count ); + +protected: + sal_Bool UndoWithContext( SfxUndoContext& i_context ); + sal_Bool RedoWithContext( SfxUndoContext& i_context ); - virtual USHORT GetRepeatActionCount() const; - virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo = 0) const; - virtual BOOL Repeat( SfxRepeatTarget &rTarget, USHORT nFrom=0, USHORT nCount=1 ); - virtual void Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ); - virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo = 0 ) const; - virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const; + void ImplClearRedo_NoLock( bool const i_currentLevel ); - virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0); - virtual void LeaveListAction(); + /** clears all undo actions on the current level, plus all undo actions on superordinate levels, + as soon as those levels are reached. - /** clears the redo stack and removes the top undo action */ - void RemoveLastUndoAction(); + If no list action is active currently, i.e. we're on the top level already, this method is equivalent to + ->Clear. - // enables (true) or disables (false) recording of undo actions - // If undo actions are added while undo is disabled, they are deleted. - // Disabling undo does not clear the current undo buffer! - void EnableUndo( bool bEnable ); + Otherwise, the Undo actions on the current level are removed. Upon leaving the current list action, all + undo actions on the then-current level are removed, too. This is continued until the top level is reached. + */ + void ClearAllLevels(); - // returns true if undo is currently enabled - // This returns false if undo was disabled using EnableUndo( false ) and - // also during the runtime of the Undo() and Redo() methods. - bool IsUndoEnabled() const { return mbUndoEnabled; } +private: + size_t ImplLeaveListAction( const bool i_merge, ::svl::undo::impl::UndoManagerGuard& i_guard ); + bool ImplAddUndoAction_NoNotify( SfxUndoAction* pAction, bool bTryMerge, bool bClearRedo, ::svl::undo::impl::UndoManagerGuard& i_guard ); + void ImplClearRedo( ::svl::undo::impl::UndoManagerGuard& i_guard, bool const i_currentLevel ); + void ImplClearUndo( ::svl::undo::impl::UndoManagerGuard& i_guard ); + void ImplClearCurrentLevel_NoNotify( ::svl::undo::impl::UndoManagerGuard& i_guard ); + size_t ImplGetRedoActionCount_Lock( bool const i_currentLevel = CurrentLevel ) const; + bool ImplIsUndoEnabled_Lock() const; + bool ImplIsInListAction_Lock() const; + void ImplEnableUndo_Lock( bool const i_enable ); + + sal_Bool ImplUndo( SfxUndoContext* i_contextOrNull ); + sal_Bool ImplRedo( SfxUndoContext* i_contextOrNull ); + + friend class ::svl::undo::impl::LockGuard; }; //========================================================================= @@ -214,23 +449,23 @@ class SVL_DLLPUBLIC SfxLinkUndoAction : public SfxUndoAction { public: TYPEINFO(); - SfxLinkUndoAction(SfxUndoManager *pManager); + SfxLinkUndoAction(::svl::IUndoManager *pManager); ~SfxLinkUndoAction(); virtual void Undo(); virtual void Redo(); - virtual BOOL CanRepeat(SfxRepeatTarget& r) const; + virtual sal_Bool CanRepeat(SfxRepeatTarget& r) const; virtual void Repeat(SfxRepeatTarget&r); - virtual UniString GetComment() const; - virtual UniString GetRepeatComment(SfxRepeatTarget&r) const; - virtual USHORT GetId() const; + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&r) const; + virtual sal_uInt16 GetId() const; SfxUndoAction* GetAction() const { return pAction; } protected: - SfxUndoManager *pUndoManager; + ::svl::IUndoManager *pUndoManager; SfxUndoAction *pAction; }; diff --git a/svl/inc/urihelper.hxx b/svl/inc/svl/urihelper.hxx index 3baab37f7896..3baab37f7896 100644 --- a/svl/inc/urihelper.hxx +++ b/svl/inc/svl/urihelper.hxx diff --git a/svl/inc/urlbmk.hxx b/svl/inc/svl/urlbmk.hxx index 8922dbb4feb9..8922dbb4feb9 100644 --- a/svl/inc/urlbmk.hxx +++ b/svl/inc/svl/urlbmk.hxx diff --git a/svl/inc/svl/visitem.hxx b/svl/inc/svl/visitem.hxx index b818376a45db..70f3ce994754 100644 --- a/svl/inc/svl/visitem.hxx +++ b/svl/inc/svl/visitem.hxx @@ -44,14 +44,14 @@ class SVL_DLLPUBLIC SfxVisibilityItem: public SfxPoolItem public: TYPEINFO(); - SfxVisibilityItem(USHORT which = 0, sal_Bool bVisible = sal_True): + SfxVisibilityItem(sal_uInt16 which = 0, sal_Bool bVisible = sal_True): SfxPoolItem(which) { m_nValue.bVisible = bVisible; DBG_CTOR(SfxVisibilityItem, 0); } - SfxVisibilityItem(USHORT which, SvStream & rStream); + SfxVisibilityItem(sal_uInt16 which, SvStream & rStream); SfxVisibilityItem(const SfxVisibilityItem & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -71,24 +71,24 @@ public: const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + sal_uInt8 nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + sal_uInt8 nMemberId = 0 ); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual USHORT GetValueCount() const; + virtual sal_uInt16 GetValueCount() const; - virtual UniString GetValueTextByVal(BOOL bTheValue) const; + virtual UniString GetValueTextByVal(sal_Bool bTheValue) const; - BOOL GetValue() const { return m_nValue.bVisible; } + sal_Bool GetValue() const { return m_nValue.bVisible; } - void SetValue(BOOL bVisible) { m_nValue.bVisible = bVisible; } + void SetValue(sal_Bool bVisible) { m_nValue.bVisible = bVisible; } }; #endif // _SFXVISIBILITYITEM_HXX diff --git a/svl/inc/whiter.hxx b/svl/inc/svl/whiter.hxx index 9e68d24d4e62..bb3936eb6961 100644 --- a/svl/inc/whiter.hxx +++ b/svl/inc/svl/whiter.hxx @@ -43,19 +43,19 @@ class SfxItemSet; class SVL_DLLPUBLIC SfxWhichIter { - const USHORT *pRanges, *pStart; - USHORT nOfst, nFrom, nTo; + const sal_uInt16 *pRanges, *pStart; + sal_uInt16 nOfst, nFrom, nTo; public: - SfxWhichIter( const SfxItemSet& rSet, USHORT nFrom = 0, USHORT nTo = USHRT_MAX ); + SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFrom = 0, sal_uInt16 nTo = USHRT_MAX ); ~SfxWhichIter(); - USHORT GetCurWhich() const { return *pRanges + nOfst; } - USHORT NextWhich(); - USHORT PrevWhich(); + sal_uInt16 GetCurWhich() const { return *pRanges + nOfst; } + sal_uInt16 NextWhich(); + sal_uInt16 PrevWhich(); - USHORT FirstWhich(); - USHORT LastWhich(); + sal_uInt16 FirstWhich(); + sal_uInt16 LastWhich(); }; #endif diff --git a/svl/inc/xmlement.hxx b/svl/inc/svl/xmlement.hxx index 779bad3f3c55..779bad3f3c55 100644 --- a/svl/inc/xmlement.hxx +++ b/svl/inc/svl/xmlement.hxx diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index a5b516fd8d69..25e06a9237e2 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -237,9 +237,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 @@ -252,7 +252,7 @@ private: // nDecimalFormat := 0, 1, 2 // #,##0 or #,##0.00 or #,##0.-- are assigned SVL_DLLPRIVATE void Impl_BuildFormatStringNumChars( String&, - const LocaleDataWrapper&, USHORT nDecimalFormat ) const; + const LocaleDataWrapper&, sal_uInt16 nDecimalFormat ) const; public: @@ -266,11 +266,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. */ @@ -279,43 +279,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); } @@ -361,23 +361,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 @@ -416,7 +416,7 @@ public: nType contains the type of the format. nKey contains the index key of the format. */ - BOOL PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, + sal_Bool PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge = LANGUAGE_DONTKNOW ); bool PutEntry( rtl::OUString& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, @@ -425,7 +425,7 @@ public: /** Same as <method>PutEntry</method> but the format code string is considered to be of language/country eLnge and is converted to language/country eNewLnge */ - BOOL PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, + sal_Bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -433,7 +433,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 ); @@ -471,20 +471,20 @@ public: was empty, could not be converted or has errors, the eLnge locale's standard number format is chosen instead. The index key is guaranteed to represent some valid number format. If - rNewInserted==FALSE and rCheckPos>0 the format code has errors + rNewInserted==sal_False and rCheckPos>0 the format code has errors and/or could not be converted. */ sal_uInt32 GetIndexPuttingAndConverting( String & rString, LanguageType eLnge, LanguageType eSysLnge, short & rType, - BOOL & rNewInserted, + sal_Bool & rNewInserted, xub_StrLen & rCheckPos ); /** Create a format code string using format nIndex as a template and applying other settings (passed from the dialog) */ void GenerateFormat( String& sString, sal_uInt32 nIndex, LanguageType eLnge = LANGUAGE_DONTKNOW, - BOOL bThousand = FALSE, BOOL IsRed = FALSE, - USHORT nPrecision = 0, USHORT nAnzLeading = 1 ); + sal_Bool bThousand = sal_False, sal_Bool IsRed = sal_False, + sal_uInt16 nPrecision = 0, sal_uInt16 nAnzLeading = 1 ); /** Analyze an input string @return @@ -493,7 +493,7 @@ public: returned in fOutNumber <FALSE/> if input is not a number */ - BOOL IsNumberFormat( const String& sString, sal_uInt32& F_Index, double& fOutNumber ); + sal_Bool IsNumberFormat( const String& sString, sal_uInt32& F_Index, double& fOutNumber ); /// Format a number according to a format index, return string and color void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex, @@ -515,13 +515,13 @@ public: <FALSE/> if format code contains an error <TRUE/> else, in which case the string and color are returned. */ - BOOL GetPreviewString( const String& sFormatString, double fPreviewNumber, + sal_Bool GetPreviewString( const String& sFormatString, double fPreviewNumber, String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); /** Same as <method>GetPreviewString</method> but the format code string may be either language/country eLnge or en_US english US */ - BOOL GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber, + sal_Bool GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber, String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); @@ -530,7 +530,7 @@ public: <FALSE/> if format code contains an error <TRUE/> else, in which case the string and color are returned. */ - BOOL GetPreviewString( const String& sFormatString, const String& sPreviewString, + sal_Bool GetPreviewString( const String& sFormatString, const String& sPreviewString, String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); @@ -542,14 +542,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(); @@ -557,11 +557,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 @@ -570,12 +570,12 @@ public: 0 if format code string parsed without errors, otherwise error position (like nCheckPos on <method>PutEntry</method>) */ - sal_uInt32 GetFormatSpecialInfo( const String&, BOOL& bThousand, BOOL& IsRed, - USHORT& nPrecision, USHORT& nAnzLeading, + sal_uInt32 GetFormatSpecialInfo( const String&, sal_Bool& bThousand, sal_Bool& IsRed, + sal_uInt16& nPrecision, sal_uInt16& nAnzLeading, LanguageType eLnge = LANGUAGE_DONTKNOW ); /// Check if format code string may be deleted by user - BOOL IsUserDefined( const String& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW ); + sal_Bool IsUserDefined( const String& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW ); /** Return the format index of the format code string for language/country, or NUMBERFORMAT_ENTRY_NOT_FOUND */ @@ -603,14 +603,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); @@ -621,7 +621,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; @@ -631,7 +631,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. */ @@ -664,12 +664,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); } @@ -734,16 +734,16 @@ public: @return position of default format */ - USHORT GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&, - BOOL bBank ) const; + sal_uInt16 GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&, + sal_Bool bBank ) const; /** Whether nFormat is of type NUMBERFORMAT_CURRENCY and the format code contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn]. If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is returned, even if the format code only contains [$xxx] ! */ - BOOL GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol, - const NfCurrencyEntry** ppEntry = NULL, BOOL* pBank = NULL ) const; + sal_Bool GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol, + const NfCurrencyEntry** ppEntry = NULL, sal_Bool* pBank = NULL ) const; /** Look up the corresponding <type>NfCurrencyEntry</type> matching rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly @@ -781,9 +781,9 @@ public: The matching entry if unique (in which case bFoundBank is set), else <NULL/>. */ - static const NfCurrencyEntry* GetCurrencyEntry( BOOL & bFoundBank, + static const NfCurrencyEntry* GetCurrencyEntry( sal_Bool & bFoundBank, const String& rSymbol, const String& rExtension, - LanguageType eFormatLanguage, BOOL bOnlyStringLanguage = FALSE ); + LanguageType eFormatLanguage, sal_Bool bOnlyStringLanguage = sal_False ); /// Get compatibility ("automatic" old style) currency from I18N locale data void GetCompatibilityCurrency( String& rSymbol, String& rAbbrev ) const; @@ -796,7 +796,7 @@ public: /** Return a keyword for a language/country and <type>NfKeywordIndex</type> for XML import, to generate number format strings. */ - String GetKeyword( LanguageType eLnge, USHORT nIndex ); + String GetKeyword( LanguageType eLnge, sal_uInt16 nIndex ); /** Return the GENERAL keyword in proper case ("General") for a language/country, used in XML import */ @@ -826,7 +826,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; @@ -835,8 +835,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 @@ -847,29 +847,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 @@ -882,7 +882,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 ); @@ -919,16 +919,16 @@ private: // FormatElement group. SVL_DLLPRIVATE sal_Int32 ImpAdjustFormatCodeDefault( ::com::sun::star::i18n::NumberFormatCode * pFormatArr, - sal_Int32 nCount, BOOL bCheckCorrectness = TRUE + sal_Int32 nCount, sal_Bool bCheckCorrectness = sal_True ); // used as a loop body inside of GetNewCurrencySymbolString() and GetCurrencyEntry() #ifndef DBG_UTIL inline #endif - static BOOL ImpLookupCurrencyEntryLoopBody( - const NfCurrencyEntry*& pFoundEntry, BOOL& bFoundBank, - const NfCurrencyEntry* pData, USHORT nPos, const String& rSymbol ); + static sal_Bool ImpLookupCurrencyEntryLoopBody( + const NfCurrencyEntry*& pFoundEntry, sal_Bool& bFoundBank, + const NfCurrencyEntry* pData, sal_uInt16 nPos, const String& rSymbol ); // link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method> DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, void* ); @@ -1011,15 +1011,15 @@ inline sal_uInt32 SvNumberFormatter::GetMergeFmtIndex( sal_uInt32 nOldFmt ) cons return pU ? *pU : nOldFmt; } -inline BOOL SvNumberFormatter::HasMergeFmtTbl() const +inline sal_Bool SvNumberFormatter::HasMergeFmtTbl() const { return pMergeTable && (0 != pMergeTable->Count()); } // static -inline USHORT SvNumberFormatter::ExpandTwoDigitYear( - USHORT nYear, USHORT nTwoDigitYearStart ) +inline sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear( + sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart ) { if ( nYear < 100 ) { diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index a4222a4757c9..aa84528b96d5 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -79,16 +79,16 @@ struct ImpSvNumberformatInfo // Struct for FormatInfo { String* sStrArray; // Array of symbols short* nTypeArray; // Array of infos - USHORT nThousand; // Count of group separator sequences - USHORT nCntPre; // Count of digits before decimal point - USHORT nCntPost; // Count of digits after decimal point - USHORT nCntExp; // Count of exponent digits, or AM/PM + sal_uInt16 nThousand; // Count of group separator sequences + sal_uInt16 nCntPre; // Count of digits before decimal point + sal_uInt16 nCntPost; // Count of digits after decimal point + sal_uInt16 nCntExp; // Count of exponent digits, or AM/PM short eScannedType; // Type determined by scan - BOOL bThousand; // Has group (AKA thousand) separator + sal_Bool bThousand; // Has group (AKA thousand) separator - void Copy( const ImpSvNumberformatInfo& rNumFor, USHORT nAnz ); - void Load(SvStream& rStream, USHORT nAnz); - void Save(SvStream& rStream, USHORT nAnz) const; + void Copy( const ImpSvNumberformatInfo& rNumFor, sal_uInt16 nAnz ); + void Load(SvStream& rStream, sal_uInt16 nAnz); + void Save(SvStream& rStream, sal_uInt16 nAnz) const; }; // NativeNumber, represent numbers using CJK or other digits if nNum>0, @@ -96,32 +96,32 @@ struct ImpSvNumberformatInfo // Struct for FormatInfo class SvNumberNatNum { LanguageType eLang; - BYTE nNum; - BOOL bDBNum :1; // DBNum, to be converted to NatNum - BOOL bDate :1; // Used in date? (needed for DBNum/NatNum mapping) - BOOL bSet :1; // If set, since NatNum0 is possible + sal_uInt8 nNum; + sal_Bool bDBNum :1; // DBNum, to be converted to NatNum + sal_Bool bDate :1; // Used in date? (needed for DBNum/NatNum mapping) + sal_Bool bSet :1; // If set, since NatNum0 is possible public: - static BYTE MapDBNumToNatNum( BYTE nDBNum, LanguageType eLang, BOOL bDate ); - static BYTE MapNatNumToDBNum( BYTE nNatNum, LanguageType eLang, BOOL bDate ); + static sal_uInt8 MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, sal_Bool bDate ); + static sal_uInt8 MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, sal_Bool bDate ); SvNumberNatNum() : eLang( LANGUAGE_DONTKNOW ), nNum(0), bDBNum(0), bDate(0), bSet(0) {} - BOOL IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; } - BYTE GetRawNum() const { return nNum; } - BYTE GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; } - BYTE GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); } + sal_Bool IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; } + sal_uInt8 GetRawNum() const { return nNum; } + sal_uInt8 GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; } + sal_uInt8 GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); } LanguageType GetLang() const { return eLang; } void SetLang( LanguageType e ) { eLang = e; } - void SetNum( BYTE nNumber, BOOL bDBNumber ) + void SetNum( sal_uInt8 nNumber, sal_Bool bDBNumber ) { nNum = nNumber; bDBNum = bDBNumber; - bSet = TRUE; + bSet = sal_True; } - BOOL IsSet() const { return bSet; } - void SetDate( BOOL bDateP ) { bDate = (bDateP != 0); } + sal_Bool IsSet() const { return bSet; } + void SetDate( sal_Bool bDateP ) { bDate = (bDateP != 0); } }; class CharClass; @@ -132,7 +132,7 @@ public: ImpSvNumFor(); // Ctor without filling the Info ~ImpSvNumFor(); - void Enlarge(USHORT nAnz); // Init of arrays to the right size + void Enlarge(sal_uInt16 nAnz); // Init of arrays to the right size void Load( SvStream& rStream, ImpSvNumberformatScan& rSc, String& rLoadedColorName); void Save( SvStream& rStream ) const; @@ -145,7 +145,7 @@ public: const ImpSvNumberformatInfo& Info() const { return aI; } // Get count of substrings (symbols) - USHORT GetCount() const { return nAnzStrings;} + sal_uInt16 GetCount() const { return nAnzStrings;} Color* GetColor() const { return pColor; } void SetColor( Color* pCol, String& rName ) @@ -153,22 +153,22 @@ public: const String& GetColorName() const { return sColorName; } // new SYMBOLTYPE_CURRENCY in subformat? - BOOL HasNewCurrency() const; - BOOL GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; + sal_Bool HasNewCurrency() const; + sal_Bool GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; void SaveNewCurrencyMap( SvStream& rStream ) const; void LoadNewCurrencyMap( SvStream& rStream ); // [NatNum1], [NatNum2], ... - void SetNatNumNum( BYTE nNum, BOOL bDBNum ) { aNatNum.SetNum( nNum, bDBNum ); } + void SetNatNumNum( sal_uInt8 nNum, sal_Bool bDBNum ) { aNatNum.SetNum( nNum, bDBNum ); } void SetNatNumLang( LanguageType eLang ) { aNatNum.SetLang( eLang ); } - void SetNatNumDate( BOOL bDate ) { aNatNum.SetDate( bDate ); } + void SetNatNumDate( sal_Bool bDate ) { aNatNum.SetDate( bDate ); } const SvNumberNatNum& GetNatNum() const { return aNatNum; } private: ImpSvNumberformatInfo aI; // Hilfsstruct fuer die restlichen Infos String sColorName; // color name Color* pColor; // pointer to color of subformat - USHORT nAnzStrings; // count of symbols + sal_uInt16 nAnzStrings; // count of symbols SvNumberNatNum aNatNum; // DoubleByteNumber }; @@ -197,7 +197,7 @@ public: ImpSvNumberInputScan* pISc, xub_StrLen& nCheckPos, LanguageType& eLan, - BOOL bStand = FALSE ); + sal_Bool bStand = sal_False ); // Copy ctor SvNumberformat( SvNumberformat& rFormat ); @@ -215,16 +215,16 @@ public: void SetType(const short eSetType) { eType = eSetType; } // Standard means the I18N defined standard format of this type - void SetStandard() { bStandard = TRUE; } - BOOL IsStandard() const { return bStandard; } + void SetStandard() { bStandard = sal_True; } + sal_Bool IsStandard() const { return bStandard; } // For versions before version nVer it is UserDefined, for newer versions // it is builtin. nVer of SV_NUMBERFORMATTER_VERSION_... - void SetNewStandardDefined( USHORT nVer ) + void SetNewStandardDefined( sal_uInt16 nVer ) { nNewStandardDefined = nVer; eType |= NUMBERFORMAT_DEFINED; } - USHORT GetNewStandardDefined() const { return nNewStandardDefined; } - BOOL IsAdditionalStandardDefined() const + sal_uInt16 GetNewStandardDefined() const { return nNewStandardDefined; } + sal_Bool IsAdditionalStandardDefined() const { return nNewStandardDefined == SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS; } LanguageType GetLanguage() const { return maLocale.meLanguage;} @@ -234,12 +234,12 @@ public: // Build a format string of application defined keywords String GetMappedFormatstring( const NfKeywordTable& rKeywords, const LocaleDataWrapper& rLoc, - BOOL bDontQuote = FALSE ) const; + sal_Bool bDontQuote = sal_False ) const; - void SetUsed(const BOOL b) { bIsUsed = b; } - BOOL GetUsed() const { return bIsUsed; } - BOOL IsStarFormatSupported() const { return bStarFlag; } - void SetStarFormatSupport( BOOL b ) { bStarFlag = b; } + void SetUsed(const sal_Bool b) { bIsUsed = b; } + sal_Bool GetUsed() const { return bIsUsed; } + sal_Bool IsStarFormatSupported() const { return bStarFlag; } + void SetStarFormatSupport( sal_Bool b ) { bStarFlag = b; } NfHackConversion Load( SvStream& rStream, ImpSvNumMultipleReadHeader& rHdr, SvNumberFormatter* pConverter, ImpSvNumberInputScan& rISc ); @@ -255,54 +255,54 @@ public: */ bool GetOutputString( double fNumber, sal_uInt16 nCharCount, String& rOutString ) const; - BOOL GetOutputString( double fNumber, String& OutString, Color** ppColor ); - BOOL GetOutputString( String& sString, String& OutString, Color** ppColor ); + sal_Bool GetOutputString( double fNumber, String& OutString, Color** ppColor ); + sal_Bool GetOutputString( String& sString, String& OutString, Color** ppColor ); // True if type text - BOOL IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; } + sal_Bool IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; } // True if 4th subformat present - BOOL HasTextFormat() const + sal_Bool HasTextFormat() const { return (NumFor[3].GetCount() > 0) || (NumFor[3].Info().eScannedType == NUMBERFORMAT_TEXT); } - void GetFormatSpecialInfo(BOOL& bThousand, - BOOL& IsRed, - USHORT& nPrecision, - USHORT& nAnzLeading) const; + void GetFormatSpecialInfo(sal_Bool& bThousand, + sal_Bool& IsRed, + sal_uInt16& nPrecision, + sal_uInt16& nAnzLeading) const; /// Count of decimal precision - USHORT GetFormatPrecision() const { return NumFor[0].Info().nCntPost; } + sal_uInt16 GetFormatPrecision() const { return NumFor[0].Info().nCntPost; } - //! Read/write access on a special USHORT component, may only be used on the + //! Read/write access on a special sal_uInt16 component, may only be used on the //! standard format 0, 5000, ... and only by the number formatter! - USHORT GetLastInsertKey() const + sal_uInt16 GetLastInsertKey() const { return NumFor[0].Info().nThousand; } - void SetLastInsertKey(USHORT nKey) + void SetLastInsertKey(sal_uInt16 nKey) { NumFor[0].Info().nThousand = nKey; } //! Only onLoad: convert from stored to current system language/country void ConvertLanguage( SvNumberFormatter& rConverter, - LanguageType eConvertFrom, LanguageType eConvertTo, BOOL bSystem = FALSE ); + LanguageType eConvertFrom, LanguageType eConvertTo, sal_Bool bSystem = sal_False ); // Substring of a subformat code nNumFor (0..3) // nPos == 0xFFFF => last substring - // bString==TRUE: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY - const String* GetNumForString( USHORT nNumFor, USHORT nPos, - BOOL bString = FALSE ) const; + // bString==sal_True: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY + const String* GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos, + sal_Bool bString = sal_False ) const; // Subtype of a subformat code nNumFor (0..3) // nPos == 0xFFFF => last substring - // bString==TRUE: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY - short GetNumForType( USHORT nNumFor, USHORT nPos, BOOL bString = FALSE ) const; + // bString==sal_True: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY + short GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, sal_Bool bString = sal_False ) const; /** If the count of string elements (substrings, ignoring [modifiers] and so on) in a subformat code nNumFor (0..3) is equal to the given number. Used by ImpSvNumberInputScan::IsNumberFormatMain() to detect a matched format. */ - BOOL IsNumForStringElementCountEqual( USHORT nNumFor, USHORT nAllCount, - USHORT nNumCount ) const + sal_Bool IsNumForStringElementCountEqual( sal_uInt16 nNumFor, sal_uInt16 nAllCount, + sal_uInt16 nNumCount ) const { if ( nNumFor < 4 ) { @@ -311,19 +311,19 @@ public: // strings of the format were matched and not just the starting // sequence, so we don't have to check if GetnAnz() includes // [modifiers] or anything else if both counts are equal. - USHORT nCnt = NumFor[nNumFor].GetCount(); + sal_uInt16 nCnt = NumFor[nNumFor].GetCount(); if ( nAllCount == nCnt ) - return TRUE; + return sal_True; if ( nAllCount < nCnt ) // check ignoring [modifiers] and so on return ImpGetNumForStringElementCount( nNumFor ) == (nAllCount - nNumCount); } - return FALSE; + return sal_False; } // Whether the second subformat code is really for negative numbers // or another limit set. - BOOL IsNegativeRealNegative() const + sal_Bool IsNegativeRealNegative() const { return fLimit1 == 0.0 && fLimit2 == 0.0 && ( (eOp1 == NUMBERFORMAT_OP_GE && eOp2 == NUMBERFORMAT_OP_NO) || @@ -332,41 +332,41 @@ public: } // Whether the negative format is without a sign or not - BOOL IsNegativeWithoutSign() const; + sal_Bool IsNegativeWithoutSign() const; - BOOL IsNegativeInBracket() const; + sal_Bool IsNegativeInBracket() const; - BOOL HasPositiveBracketPlaceholder() const; + sal_Bool HasPositiveBracketPlaceholder() const; // Whether a new SYMBOLTYPE_CURRENCY is contained in the format - BOOL HasNewCurrency() const; + sal_Bool HasNewCurrency() const; // Build string from NewCurrency for saving it SO50 compatible void Build50Formatstring( String& rStr ) const; // strip [$-yyy] from all [$xxx-yyy] leaving only xxx's, - // if bQuoteSymbol==TRUE the xxx will become "xxx" + // if bQuoteSymbol==sal_True the xxx will become "xxx" static String StripNewCurrencyDelimiters( const String& rStr, - BOOL bQuoteSymbol ); + sal_Bool bQuoteSymbol ); // If a new SYMBOLTYPE_CURRENCY is contained if the format is of type // NUMBERFORMAT_CURRENCY, and if so the symbol xxx and the extension nnn // of [$xxx-nnn] are returned - BOOL GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; + sal_Bool GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; - static BOOL HasStringNegativeSign( const String& rStr ); + static sal_Bool HasStringNegativeSign( const String& rStr ); /** Whether a character at position nPos is somewhere between two matching cQuote or not. - If nPos points to a cQuote, a TRUE is returned on an opening cQuote, - a FALSE is returned on a closing cQuote. + If nPos points to a cQuote, a sal_True is returned on an opening cQuote, + a sal_False is returned on a closing cQuote. A cQuote between quotes may be escaped by a cEscIn, a cQuote outside of quotes may be escaped by a cEscOut. The default '\0' results in no escapement possible. Defaults are set right according to the "unlogic" of the Numberformatter */ - static BOOL IsInQuote( const String& rString, xub_StrLen nPos, + static sal_Bool IsInQuote( const String& rString, xub_StrLen nPos, sal_Unicode cQuote = '"', sal_Unicode cEscIn = '\0', sal_Unicode cEscOut = '\\' ); @@ -418,23 +418,23 @@ public: // used in XML export void GetConditions( SvNumberformatLimitOps& rOper1, double& rVal1, SvNumberformatLimitOps& rOper2, double& rVal2 ) const; - Color* GetColor( USHORT nNumFor ) const; - void GetNumForInfo( USHORT nNumFor, short& rScannedType, - BOOL& bThousand, USHORT& nPrecision, USHORT& nAnzLeading ) const; + Color* GetColor( sal_uInt16 nNumFor ) const; + void GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType, + sal_Bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading ) const; // rAttr.Number not empty if NatNum attributes are to be stored void GetNatNumXml( ::com::sun::star::i18n::NativeNumberXmlAttributes& rAttr, - USHORT nNumFor ) const; + sal_uInt16 nNumFor ) const; /** @returns <TRUE/> if E,EE,R,RR,AAA,AAAA in format code of subformat nNumFor (0..3) and <b>no</b> preceding calendar was specified and the currently loaded calendar is "gregorian". */ - BOOL IsOtherCalendar( USHORT nNumFor ) const + sal_Bool IsOtherCalendar( sal_uInt16 nNumFor ) const { if ( nNumFor < 4 ) return ImpIsOtherCalendar( NumFor[nNumFor] ); - return FALSE; + return sal_False; } /** Switches to the first non-"gregorian" calendar, but only if the current @@ -456,13 +456,13 @@ public: <TRUE/> if a calendar was specified and switched to, <FALSE/> else. */ - BOOL SwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, - USHORT nNumFor ) const + sal_Bool SwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, + sal_uInt16 nNumFor ) const { if ( nNumFor < 4 ) return ImpSwitchToSpecifiedCalendar( rOrgCalendar, fOrgDateTime, NumFor[nNumFor] ); - return FALSE; + return sal_False; } private: @@ -475,17 +475,17 @@ private: LocaleType maLocale; // Language/country of the format, numeral shape and calendar type from Excel. SvNumberformatLimitOps eOp1; // Operator for first condition SvNumberformatLimitOps eOp2; // Operator for second condition - USHORT nNewStandardDefined; // new builtin formats as of version 6 + sal_uInt16 nNewStandardDefined; // new builtin formats as of version 6 short eType; // Type of format - BOOL bStarFlag; // Take *n format as ESC n - BOOL bStandard; // If this is a default standard format - BOOL bIsUsed; // Flag as used for storing + sal_Bool bStarFlag; // Take *n format as ESC n + sal_Bool bStandard; // If this is a default standard format + sal_Bool bIsUsed; // Flag as used for storing - SVL_DLLPRIVATE USHORT ImpGetNumForStringElementCount( USHORT nNumFor ) const; + SVL_DLLPRIVATE sal_uInt16 ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const; - SVL_DLLPRIVATE BOOL ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const; + SVL_DLLPRIVATE sal_Bool ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const; - SVL_DLLPRIVATE BOOL ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, + SVL_DLLPRIVATE sal_Bool ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const; #ifdef _ZFORMAT_CXX // ----- private implementation methods ----- @@ -542,25 +542,25 @@ private: double& fLimit, SvNumberformatLimitOps eOp); - SVL_DLLPRIVATE ULONG ImpGGT(ULONG x, ULONG y); - SVL_DLLPRIVATE ULONG ImpGGTRound(ULONG x, ULONG y); + SVL_DLLPRIVATE sal_uLong ImpGGT(sal_uLong x, sal_uLong y); + SVL_DLLPRIVATE sal_uLong ImpGGTRound(sal_uLong x, sal_uLong y); // Helper function for number strings // append string symbols, insert leading 0 or ' ', or ... - SVL_DLLPRIVATE BOOL ImpNumberFill( String& sStr, + SVL_DLLPRIVATE sal_Bool ImpNumberFill( String& sStr, double& rNumber, xub_StrLen& k, - USHORT& j, - USHORT nIx, + sal_uInt16& j, + sal_uInt16 nIx, short eSymbolType ); // Helper function to fill in the integer part and the group (AKA thousand) separators - SVL_DLLPRIVATE BOOL ImpNumberFillWithThousands( String& sStr, + SVL_DLLPRIVATE sal_Bool ImpNumberFillWithThousands( String& sStr, double& rNumber, xub_StrLen k, - USHORT j, - USHORT nIx, - USHORT nDigCnt ); + sal_uInt16 j, + sal_uInt16 nIx, + sal_uInt16 nDigCnt ); // Hilfsfunktion zum Auffuellen der Vor- // kommazahl auch mit Tausenderpunkt @@ -569,18 +569,18 @@ private: SVL_DLLPRIVATE void ImpDigitFill( String& sStr, xub_StrLen nStart, xub_StrLen& k, - USHORT nIx, + sal_uInt16 nIx, xub_StrLen & nDigitCount, utl::DigitGroupingIterator & ); - SVL_DLLPRIVATE BOOL ImpGetDateOutput( double fNumber, - USHORT nIx, + SVL_DLLPRIVATE sal_Bool ImpGetDateOutput( double fNumber, + sal_uInt16 nIx, String& OutString ); - SVL_DLLPRIVATE BOOL ImpGetTimeOutput( double fNumber, - USHORT nIx, + SVL_DLLPRIVATE sal_Bool ImpGetTimeOutput( double fNumber, + sal_uInt16 nIx, String& OutString ); - SVL_DLLPRIVATE BOOL ImpGetDateTimeOutput( double fNumber, - USHORT nIx, + SVL_DLLPRIVATE sal_Bool ImpGetDateTimeOutput( double fNumber, + sal_uInt16 nIx, String& OutString ); // Switches to the "gregorian" calendar if the current calendar is @@ -588,7 +588,7 @@ private: // know a "before" era (like zh_TW ROC or ja_JP Gengou). If switched and // rOrgCalendar was "gregorian" the string is emptied. If rOrgCalendar was // empty the previous calendar name and date/time are returned. - SVL_DLLPRIVATE BOOL ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ); + SVL_DLLPRIVATE sal_Bool ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ); // Append a "G" short era string of the given calendar. In the case of a // Gengou calendar this is a one character abbreviation, for other @@ -596,8 +596,8 @@ private: SVL_DLLPRIVATE static void ImpAppendEraG( String& OutString, const CalendarWrapper& rCal, sal_Int16 nNatNum ); - SVL_DLLPRIVATE BOOL ImpGetNumberOutput( double fNumber, - USHORT nIx, + SVL_DLLPRIVATE sal_Bool ImpGetNumberOutput( double fNumber, + sal_uInt16 nIx, String& OutString ); SVL_DLLPRIVATE void ImpCopyNumberformat( const SvNumberformat& rFormat ); @@ -605,9 +605,9 @@ private: // normal digits or other digits, depending on ImpSvNumFor.aNatNum, // [NatNum1], [NatNum2], ... SVL_DLLPRIVATE String ImpGetNatNumString( const SvNumberNatNum& rNum, sal_Int32 nVal, - USHORT nMinDigits = 0 ) const; + sal_uInt16 nMinDigits = 0 ) const; - String ImpIntToString( USHORT nIx, sal_Int32 nVal, USHORT nMinDigits = 0 ) const + String ImpIntToString( sal_uInt16 nIx, sal_Int32 nVal, sal_uInt16 nMinDigits = 0 ) const { const SvNumberNatNum& rNum = NumFor[nIx].GetNatNum(); if ( nMinDigits || rNum.IsComplete() ) diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 8d121c7a0cf1..c47d11227077 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,23 +1,3 @@ -sl svl : l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot NULL -sl svl usr1 - all svl_mkout NULL -sl svl\inc nmake - all svl_inc NULL -sl svl\unx\source\svdde nmake - u svl_usdde svl_inc NULL -sl svl\unx\source\svdde nmake - p svl_psdde svl_inc NULL -sl svl\source\config nmake - all svl_conf svl_inc NULL -sl svl\source\filepicker nmake - all svl_filepick svl_inc NULL -sl svl\source\filerec nmake - all svl_file svl_inc NULL -sl svl\source\items nmake - all svl__item svl_inc NULL -sl svl\source\memtools nmake - all svl_mem svl_inc NULL -sl svl\source\misc nmake - all svl__misc svl_inc NULL -sl svl\source\notify nmake - all svl_not svl_inc NULL -sl svl\source\numbers nmake - all svl_num svl_inc NULL -sl svl\source\svdde nmake - all svl__dde svl_inc NULL -sl svl\source\svsql nmake - all svl_sql svl_inc NULL -sl svl\source\undo nmake - all svl_undo svl_inc NULL -sl svl\source\uno nmake - all svl_uno svl_inc NULL -sl svl\util nmake - all svl_util svl_usdde.u svl_psdde.p svl_conf svl_filepick svl_file svl__item svl_mem svl__misc svl_not svl_num svl__dde svl_sql svl_undo svl_uno NULL -sl svl\source\fsstor nmake - all svl_fsstor svl_inc NULL -sl svl\source\passwordcontainer nmake - all svl_passcont svl_inc NULL +sl svl : L10N:l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL +sl svl\prj nmake - all svl_prj NULL sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL - - diff --git a/svl/prj/d.lst b/svl/prj/d.lst index a5c2564e81cd..e69de29bb2d1 100644 --- a/svl/prj/d.lst +++ b/svl/prj/d.lst @@ -1,22 +0,0 @@ -mkdir: %COMMON_DEST%\bin%_EXT%\hid -mkdir: %COMMON_DEST%\res%_EXT% -mkdir: %_DEST%\inc%_EXT%\svl - -..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid -..\%__SRC%\lib\isvl.lib %_DEST%\lib%_EXT%\isvl.lib -..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\* -..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\* -..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\* -..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\* - -..\inc\svl\*.hrc %_DEST%\inc%_EXT%\svl\*.hrc -..\inc\svl\*.hxx %_DEST%\inc%_EXT%\svl\*.hxx -..\inc\svl\*.h %_DEST%\inc%_EXT%\svl\*.h -..\inc\*.hrc %_DEST%\inc%_EXT%\svl\*.hrc -..\inc\*.hxx %_DEST%\inc%_EXT%\svl\*.hxx -..\inc\*.h %_DEST%\inc%_EXT%\svl\*.h - -dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\bmp=%__PRJROOT%\%__SRC%\bin%_EXT%; fi" - -*.xml %_DEST%\xml%_EXT%\*.xml - diff --git a/svl/util/svl.pmk b/svl/prj/makefile.mk index 854fb6d6d453..e312a7ccab65 100644 --- a/svl/util/svl.pmk +++ b/svl/prj/makefile.mk @@ -25,7 +25,16 @@ # #************************************************************************* -# define SVL_DLLIMPLEMENTATION (see @ svldllapi.h) -CDEFS += -DSVL_DLLIMPLEMENTATION +PRJ=.. +TARGET=prj -VISIBILITY_HIDDEN=TRUE +.INCLUDE : settings.mk + +.IF "$(VERBOSE)"!="" +VERBOSEFLAG := +.ELSE +VERBOSEFLAG := -s +.ENDIF + +all: + cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog diff --git a/svl/qa/complex/ConfigItems/CheckConfigItems.java b/svl/qa/complex/ConfigItems/CheckConfigItems.java index 4afa2bf33f55..78141b6b20d4 100644 --- a/svl/qa/complex/ConfigItems/CheckConfigItems.java +++ b/svl/qa/complex/ConfigItems/CheckConfigItems.java @@ -27,20 +27,25 @@ package complex.ConfigItems; -import com.sun.star.beans.*; -import com.sun.star.lang.*; -import com.sun.star.uno.*; -import com.sun.star.task.*; +import com.sun.star.beans.NamedValue; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.task.XJob; +import com.sun.star.uno.UnoRuntime; -import complexlib.*; -import java.lang.*; -import java.util.*; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +// import static org.junit.Assert.*; //----------------------------------------------- /** @short todo document me + * @deprecated this tests seems no longer work as expected. */ -public class CheckConfigItems extends ComplexTestCase +public class CheckConfigItems { //------------------------------------------- // some const @@ -64,43 +69,44 @@ public class CheckConfigItems extends ComplexTestCase @return All test methods. @todo Think about selection of tests from outside ... */ - public String[] getTestMethodNames() - { - return new String[] - { - "checkPicklist", - "checkURLHistory", - "checkHelpBookmarks", - "checkPrintOptions", - "checkAccessibilityOptions", - "checkUserOptions" - }; - } +// public String[] getTestMethodNames() +// { +// return new String[] +// { +// "checkPicklist", +// "checkURLHistory", +// "checkHelpBookmarks", +// "checkPrintOptions", +// "checkAccessibilityOptions", +// "checkUserOptions" +// }; +// } //------------------------------------------- /** @short Create the environment for following tests. - @descr Use either a component loader from desktop or + * @throws java.lang.Exception + * @descr Use either a component loader from desktop or from frame */ - public void before() + @Before public void before() throws java.lang.Exception { // get uno service manager from global test environment - m_xSmgr = (XMultiServiceFactory)param.getMSF(); + m_xSmgr = getMSF(); // TODO register helper service // create module manager - m_xTest = (XJob)UnoRuntime.queryInterface( - XJob.class, - m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest")); + m_xTest = UnoRuntime.queryInterface(XJob.class, m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest")); } //------------------------------------------- - /** @short close the environment. + /** + * @throws java.lang.Exception + * @short close the environment. */ - public void after() + @After public void after() throws java.lang.Exception { // TODO deregister helper service @@ -110,54 +116,66 @@ public class CheckConfigItems extends ComplexTestCase } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkPicklist() + @Test public void checkPicklist() throws java.lang.Exception { impl_triggerTest("checkPicklist"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkURLHistory() + @Test public void checkURLHistory() throws java.lang.Exception { impl_triggerTest("checkURLHistory"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkHelpBookmarks() + @Test public void checkHelpBookmarks() throws java.lang.Exception { impl_triggerTest("checkHelpBookmarks"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkPrintOptions() - throws java.lang.Exception - { - impl_triggerTest("checkPrintOptions"); - } +// @Test public void checkPrintOptions() +// throws java.lang.Exception +// { +// impl_triggerTest("checkPrintOptions"); +// } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkAccessibilityOptions() + @Test public void checkAccessibilityOptions() throws java.lang.Exception { impl_triggerTest("checkAccessibilityOptions"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkUserOptions() + @Test public void checkUserOptions() throws java.lang.Exception { impl_triggerTest("checkUserOptions"); @@ -175,4 +193,27 @@ public class CheckConfigItems extends ComplexTestCase lArgs[0].Value = sTest; m_xTest.execute(lArgs); } + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx index 3f44d5a8dd9c..e1883cc69f0d 100644 --- a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx @@ -27,8 +27,8 @@ ************************************************************************/ #include "HistoryOptTest.hxx" -#include "AccessibilityOptTest.hxx" -#include "PrintOptTest.hxx" +// #include "AccessibilityOptTest.hxx" +// #include "PrintOptTest.hxx" #include "UserOptTest.hxx" #include <com/sun/star/uno/XComponentContext.hpp> @@ -51,8 +51,6 @@ static const ::rtl::OUString PROP_TEST (RTL_CONSTASCII_USTRINGP static const ::rtl::OUString TEST_PICKLIST (RTL_CONSTASCII_USTRINGPARAM("checkPicklist")); static const ::rtl::OUString TEST_URLHISTORY (RTL_CONSTASCII_USTRINGPARAM("checkURLHistory")); static const ::rtl::OUString TEST_HELPBOOKMARKS (RTL_CONSTASCII_USTRINGPARAM("checkHelpBookmarks")); -static const ::rtl::OUString TEST_ACCESSIBILITYOPTIONS (RTL_CONSTASCII_USTRINGPARAM("checkAccessibilityOptions")); -static const ::rtl::OUString TEST_PRINTOPTIONS (RTL_CONSTASCII_USTRINGPARAM("checkPrintOptions")); static const ::rtl::OUString TEST_USEROPTIONS (RTL_CONSTASCII_USTRINGPARAM("checkUserOptions")); //============================================================================= @@ -137,16 +135,16 @@ css::uno::Any SAL_CALL ConfigItemTest::execute(const css::uno::Sequence< css::be HistoryOptTest aOptTest; aOptTest.checkHelpBookmarks(); } - else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS)) - { - AccessibilityOptTest aOptTest; - aOptTest.impl_checkAccessibilityOptions(); - } - else if (sTest.equals(TEST_PRINTOPTIONS)) - { - PrintOptTest aOptTest; - aOptTest.impl_checkPrint(); - } +// else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS)) +// { +// AccessibilityOptTest aOptTest; +// aOptTest.impl_checkAccessibilityOptions(); +// } +// else if (sTest.equals(TEST_PRINTOPTIONS)) +// { +// PrintOptTest aOptTest; +// aOptTest.impl_checkPrint(); +// } else if (sTest.equals(TEST_USEROPTIONS)) { UserOptTest aOptTest; diff --git a/svl/qa/complex/ConfigItems/helper/makefile.mk b/svl/qa/complex/ConfigItems/helper/makefile.mk deleted file mode 100644 index 17c7b81ae9c7..000000000000 --- a/svl/qa/complex/ConfigItems/helper/makefile.mk +++ /dev/null @@ -1,72 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/..$/..$/.. - -PRJNAME= svl -TARGET= ConfigItemTest -USE_DEFFILE= TRUE -ENABLE_EXCEPTIONS= TRUE -NO_BSYMBOLIC= TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Generate ----------------------------------------------------- - -INCPOST += $(PRJ)$/source$/inc - -# --- light services library ---------------------------------------------------- - -SHL1TARGET= svt_$(TARGET) - -SHL1OBJS= \ - $(SLO)$/UserOptTest.obj \ - $(SLO)$/PrintOptTest.obj \ - $(SLO)$/AccessibilityOptTest.obj \ - $(SLO)$/HistoryOptTest.obj \ - $(SLO)$/ConfigItemTest.obj - -SHL1STDLIBS= \ - $(SVLIB) \ - $(SVLLIB) \ - $(UNOTOOLSLIB) \ - $(COMPHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) - -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME= $(SHL1TARGET) - -SHL1VERSIONMAP= $(SOLARENV)/src/component.map - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - diff --git a/svl/qa/complex/ConfigItems/makefile.mk b/svl/qa/complex/ConfigItems/makefile.mk deleted file mode 100644 index 6838cc79a660..000000000000 --- a/svl/qa/complex/ConfigItems/makefile.mk +++ /dev/null @@ -1,83 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ = ..$/..$/.. -TARGET = CheckConfigItems -PRJNAME = svl -PACKAGE = complex$/ConfigItems - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \ - OOoRunner.jar - -JAVAFILES = CheckConfigItems.java - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -SUBDIRS = helper - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF - -# test base is java complex -CT_TESTBASE = -TestBase java_complex - -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) - -# start the runner application -CT_APP = org.openoffice.Runner - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -RUN: run - -run: - java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) - - - diff --git a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java index bf6159ee38c5..8e886f0b8269 100644 --- a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java +++ b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java @@ -36,12 +36,16 @@ public class MasterPasswdHandler extends WeakBase XInteractionSupplyAuthentication xAuthentication = null; for( int i = 0; i < xContinuations.length; ++i ) { - xAuthentication = (XInteractionSupplyAuthentication)UnoRuntime.queryInterface( XInteractionSupplyAuthentication.class, xContinuations[i]); + xAuthentication = UnoRuntime.queryInterface(XInteractionSupplyAuthentication.class, xContinuations[i]); if( xAuthentication != null ) + { break; + } } if( xAuthentication.canSetPassword() ) - xAuthentication.setPassword( "abcdefghijklmnopqrstuvwxyz123456" ); + { + xAuthentication.setPassword("abcdefghijklmnopqrstuvwxyz123456"); + } xAuthentication.select(); } } else { diff --git a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java index 2e3bada4d1bc..ac5c79d134dc 100644 --- a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java +++ b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java @@ -27,47 +27,78 @@ package complex.passwordcontainer; -import complexlib.ComplexTestCase; import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; -public class PasswordContainerUnitTest extends ComplexTestCase { +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public class PasswordContainerUnitTest { private XMultiServiceFactory m_xMSF = null; - public String[] getTestMethodNames() { - return new String[] { - "ExecuteTest01", - "ExecuteTest02", - "ExecuteTest03"}; - } - public String getTestObjectName() { - return "PasswordContainerUnitTest"; - } +//// public String[] getTestMethodNames() { +//// return new String[] { +//// "ExecuteTest01", +//// "ExecuteTest02", +//// "ExecuteTest03"}; +//// } +// public String getTestObjectName() { +// return "PasswordContainerUnitTest"; +// } - public void before() { + @Before public void before() { try { - m_xMSF = (XMultiServiceFactory) param.getMSF(); + m_xMSF = getMSF(); } catch (Exception e) { - failed ("Cannot create service factory!"); + fail ("Cannot create service factory!"); } if (m_xMSF == null) { - failed ("Cannot create service factory!"); + fail ("Cannot create service factory!"); } } - public void after() { + @After public void after() { m_xMSF = null; } - public void ExecuteTest01() { - PasswordContainerTest aTest = new Test01(m_xMSF, log); - assure("Test01 failed!", aTest.test()); + @Test public void ExecuteTest01() + { + PasswordContainerTest aTest = new Test01(m_xMSF); + assertTrue("Test01 failed!", aTest.test()); } - public void ExecuteTest02() { - PasswordContainerTest aTest = new Test02(m_xMSF, log); - assure("Test02 failed!", aTest.test()); + @Test public void ExecuteTest02() { + PasswordContainerTest aTest = new Test02(m_xMSF); + assertTrue("Test02 failed!", aTest.test()); } - public void ExecuteTest03() { - PasswordContainerTest aTest = new Test03(m_xMSF, log); - assure("Test03 failed!", aTest.test()); + @Test public void ExecuteTest03() { + PasswordContainerTest aTest = new Test03(m_xMSF); + assertTrue("Test03 failed!", aTest.test()); } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/svl/qa/complex/passwordcontainer/Test01.java b/svl/qa/complex/passwordcontainer/Test01.java index 1ca17c922669..9367fea4eb7b 100644 --- a/svl/qa/complex/passwordcontainer/Test01.java +++ b/svl/qa/complex/passwordcontainer/Test01.java @@ -36,17 +36,17 @@ import com.sun.star.task.XMasterPasswordHandling; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; +// import share.LogWriter; public class Test01 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test01 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test01: "); + m_aTestHelper = new TestHelper ( "Test01: "); } public boolean test() { @@ -68,9 +68,9 @@ public class Test01 implements PasswordContainerTest { } try { Object oPasswordContainer = m_xMSF.createInstance( "com.sun.star.task.PasswordContainer" ); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance( "com.sun.star.task.InteractionHandler" ); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler( xHandler ); // add a set of users and passwords for the same URL for runtime diff --git a/svl/qa/complex/passwordcontainer/Test02.java b/svl/qa/complex/passwordcontainer/Test02.java index b77b0fe9bf48..3d0123de3179 100644 --- a/svl/qa/complex/passwordcontainer/Test02.java +++ b/svl/qa/complex/passwordcontainer/Test02.java @@ -36,17 +36,16 @@ import com.sun.star.task.UserRecord; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; public class Test02 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test02 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test02 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test02: "); + m_aTestHelper = new TestHelper ( "Test02: "); } public boolean test() { @@ -69,11 +68,11 @@ public class Test02 implements PasswordContainerTest { try { Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer"); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler"); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler); - XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); + XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); // allow the storing of the passwords xMHandling.allowPersistentStoring(true); diff --git a/svl/qa/complex/passwordcontainer/Test03.java b/svl/qa/complex/passwordcontainer/Test03.java index 9e38a55893e0..cf2b3d45cbb0 100644 --- a/svl/qa/complex/passwordcontainer/Test03.java +++ b/svl/qa/complex/passwordcontainer/Test03.java @@ -36,17 +36,17 @@ import com.sun.star.task.XInteractionHandler; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; + public class Test03 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test03 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test03 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test03: "); + m_aTestHelper = new TestHelper ( "Test03: "); } public boolean test() { @@ -68,11 +68,11 @@ public class Test03 implements PasswordContainerTest { try { Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer"); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler"); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler); - XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); + XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); // allow the storing of the passwords xMHandling.allowPersistentStoring(true); diff --git a/svl/qa/complex/passwordcontainer/TestHelper.java b/svl/qa/complex/passwordcontainer/TestHelper.java index 1971b61098f5..c91401e74c91 100644 --- a/svl/qa/complex/passwordcontainer/TestHelper.java +++ b/svl/qa/complex/passwordcontainer/TestHelper.java @@ -29,23 +29,23 @@ package complex.passwordcontainer; import com.sun.star.task.UserRecord; -import share.LogWriter; +// import share.LogWriter; public class TestHelper { - LogWriter m_aLogWriter; + // LogWriter m_aLogWriter; String m_sTestPrefix; - public TestHelper( LogWriter aLogWriter, String sTestPrefix ) { - m_aLogWriter = aLogWriter; + public TestHelper( String sTestPrefix ) { + // m_aLogWriter = aLogWriter; m_sTestPrefix = sTestPrefix; } public void Error( String sError ) { - m_aLogWriter.println( m_sTestPrefix + "Error: " + sError ); + System.out.println( m_sTestPrefix + "Error: " + sError ); } public void Message( String sMessage ) { - m_aLogWriter.println( m_sTestPrefix + sMessage ); + System.out.println( m_sTestPrefix + sMessage ); } public boolean sameLists(UserRecord aUserList1[], UserRecord aUserList2[]) { @@ -60,7 +60,9 @@ public class TestHelper { int j; for(j = 0; j < aUserList2.length; j++) { if(!aUserList1[i].UserName.equals(aUserList2[j].UserName)) + { continue; + } if(aUserList1[i].Passwords[0].equals(aUserList2[j].Passwords[0])) { break; } diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk deleted file mode 100644 index 57fd4d560f8d..000000000000 --- a/svl/qa/complex/passwordcontainer/makefile.mk +++ /dev/null @@ -1,87 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/.. -TARGET = PasswordContainerUnitTest -PRJNAME=svl -PACKAGE = complex$/passwordcontainer - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar - -JAVAFILES =\ - PasswordContainerUnitTest.java\ - PasswordContainerTest.java\ - TestHelper.java\ - Test01.java\ - Test02.java\ - Test03.java\ - MasterPasswdHandler.java - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF - -# test base is java complex -CT_TESTBASE = -TestBase java_complex - -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) - -# start the runner application -CT_APP = org.openoffice.Runner - -# --- Targets ------------------------------------------------------ - -.INCLUDE: target.mk - -RUN: run - -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) - - diff --git a/svl/qa/makefile.mk b/svl/qa/makefile.mk deleted file mode 100644 index ac79b7362f93..000000000000 --- a/svl/qa/makefile.mk +++ /dev/null @@ -1,91 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = .. -PRJNAME=svl -TARGET = qa - -ENABLE_EXCEPTIONS = true - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -SHL1OBJS= \ - $(SLO)$/test_URIHelper.obj - -SHL1TARGET= URIHelper -SHL1STDLIBS=\ - $(CPPULIB) \ - $(CPPUHELPERLIB) \ - $(SALLIB) \ - $(SVLLIB) \ - $(TOOLSLIB) \ - $(UNOTOOLSLIB) \ - $(CPPUNITLIB) - -SHL1IMPLIB=i$(SHL1TARGET) -DEF1NAME=$(SHL1TARGET) -SHL1VERSIONMAP=export.map - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -.IF "$(OS)" == "WNT" -my_file = file:/// -.ELSE -my_file = file:// -.END - -ALLTAR: test - -$(MISC)$/$(TARGET)$/types.rdb .ERRREMOVE : $(SOLARBINDIR)$/types.rdb - $(MKDIRHIER) $(@:d) - $(GNUCOPY) $? $@ - -$(MISC)/$(TARGET)/udkapi.rdb .ERRREMOVE : $(SOLARBINDIR)$/udkapi.rdb - $(MKDIRHIER) $(@:d) - $(GNUCOPY) $? $@ - -#Make a services.rdb with the services we know we need to get up and running -$(MISC)/$(TARGET)/services.rdb .ERRREMOVE : $(MISC)/$(TARGET)/udkapi.rdb makefile.mk - $(MKDIRHIER) $(@:d) - $(REGCOMP) -register -br $(MISC)/$(TARGET)/udkapi.rdb -r $@ -wop \ - -c $(DLLPRE)ucb1$(DLLPOST) \ - -c stocservices.uno$(DLLPOST) - -test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/services.rdb $(MISC)$/$(TARGET)$/types.rdb $(MISC)/$(TARGET)/udkapi.rdb - @echo ---------------------------------------------------------- - @echo - start unit test \#1 on library $(SHL1TARGETN) - @echo ---------------------------------------------------------- - $(CPPUNITTESTER) $(SHL1TARGETN) -headless -invisible \ - -env:UNO_SERVICES=$(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb \ - -env:UNO_TYPES="$(my_file)$(PWD)/$(MISC)/$(TARGET)/types.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/udkapi.rdb" \ - -env:OOO_BASE_DIR="$(my_file)$(PWD)/$(MISC)/$(TARGET)" \ - -env:BRAND_BASE_DIR="$(my_file)$(PWD)/$(MISC)/$(TARGET)" \ - -env:UNO_USER_PACKAGES_CACHE="$(my_file)$(PWD)/$(MISC)/$(TARGET)" diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx index 9a84199e366e..8ba0593b6c7f 100644 --- a/svl/source/config/languageoptions.cxx +++ b/svl/source/config/languageoptions.cxx @@ -203,7 +203,7 @@ sal_uInt16 SvtLanguageOptions::GetScriptTypeOfLanguage( sal_uInt16 nLang ) nLang = SvtSysLocale().GetLanguage(); sal_Int16 nScriptType = MsLangId::getScriptType( nLang ); - USHORT nScript; + sal_uInt16 nScript; switch (nScriptType) { case ::com::sun::star::i18n::ScriptType::ASIAN: diff --git a/svl/source/config/makefile.mk b/svl/source/config/makefile.mk deleted file mode 100644 index beb696c0feaf..000000000000 --- a/svl/source/config/makefile.mk +++ /dev/null @@ -1,52 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/.. - -PRJNAME=svl -TARGET=config - -ENABLE_EXCEPTIONS := TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES= \ - $(SLO)$/asiancfg.obj \ - $(SLO)$/cjkoptions.obj \ - $(SLO)$/ctloptions.obj \ - $(SLO)$/srchcfg.obj \ - $(SLO)$/itemholder2.obj \ - $(SLO)$/languageoptions.obj - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - diff --git a/svl/source/filepicker/pickerhelper.cxx b/svl/source/filepicker/pickerhelper.cxx deleted file mode 100644 index b241ea95492e..000000000000 --- a/svl/source/filepicker/pickerhelper.cxx +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#include "pickerhelper.hxx" -#include "rtl/ustring.hxx" -#include "com/sun/star/ui/dialogs/XFilePicker.hpp" -#include "com/sun/star/ui/dialogs/XFolderPicker.hpp" -#include "com/sun/star/beans/XPropertySet.hpp" -#include "com/sun/star/beans/XPropertySetInfo.hpp" -#include "com/sun/star/uno/Any.hxx" -#include "tools/debug.hxx" - -namespace css = com::sun::star; - -using css::uno::Reference; -using rtl::OUString; - -namespace svt -{ - void SetDialogHelpId( - Reference < css::ui::dialogs::XFilePicker > _mxFileDlg, sal_Int32 _nHelpId ) - { - try - { - // does the dialog haver a help URL property? - Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY ); - Reference< css::beans::XPropertySetInfo > xInfo; - if( xDialogProps.is() ) - xInfo = xDialogProps->getPropertySetInfo( ); - - const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) ); - - if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) ) - { // yep - OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sId += OUString::valueOf( _nHelpId ); - xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); - } - } - catch( const css::uno::Exception& ) - { - OSL_FAIL( "svt::SetDialogHelpId(): caught an exception while setting the help id!" ); - } - } - - void SetDialogHelpId( - Reference< css::ui::dialogs::XFolderPicker > _mxFileDlg, sal_Int32 _nHelpId ) - { - try - { - // does the dialog haver a help URL property? - Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY ); - Reference< css::beans::XPropertySetInfo > xInfo; - if( xDialogProps.is() ) - xInfo = xDialogProps->getPropertySetInfo( ); - - const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) ); - - if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) ) - { // yep - OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sId += OUString::valueOf( _nHelpId ); - xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); - } - } - catch( const css::uno::Exception& ) - { - OSL_FAIL( "svt::SetDialogHelpId(): caught an exception while setting the help id!" ); - } - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/filepicker/pickerhistory.cxx b/svl/source/filepicker/pickerhistory.cxx index 0ccbaa94d6bc..75cd4bc9b48d 100644 --- a/svl/source/filepicker/pickerhistory.cxx +++ b/svl/source/filepicker/pickerhistory.cxx @@ -28,8 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "pickerhistory.hxx" -#include "pickerhistoryaccess.hxx" +#include <svl/pickerhistory.hxx> +#include <svl/pickerhistoryaccess.hxx> #include <cppuhelper/weakref.hxx> #include <vector> diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx index e8f4b05603ad..def16ac62d8b 100644 --- a/svl/source/filerec/filerec.cxx +++ b/svl/source/filerec/filerec.cxx @@ -33,12 +33,12 @@ //======================================================================== -SV_IMPL_VARARR( SfxUINT32s, UINT32 ); +SV_IMPL_VARARR( SfxUINT32s, sal_uInt32 ); //======================================================================== -/* Die folgenden Makros extrahieren Teilbereiche aus einem UINT32 Wert. - Diese UINT32-Werte werden anstelle der einzelnen Werte gestreamt, +/* Die folgenden Makros extrahieren Teilbereiche aus einem sal_uInt32 Wert. + Diese sal_uInt32-Werte werden anstelle der einzelnen Werte gestreamt, um Calls zu sparen. */ @@ -53,33 +53,33 @@ SV_IMPL_VARARR( SfxUINT32s, UINT32 ); //------------------------------------------------------------------------- -/* Die folgenden Makros setzen Teilbereiche zu einem UINT32 Wert zusammen. - Diese UINT32-Werte werden anstelle der einzelnen Werte gestreamt, +/* Die folgenden Makros setzen Teilbereiche zu einem sal_uInt32 Wert zusammen. + Diese sal_uInt32-Werte werden anstelle der einzelnen Werte gestreamt, um Calls zu sparen. */ #define SFX_REC_MINI_HEADER(nPreTag,nStartPos,nEndPos) \ - ( UINT32(nPreTag) | \ - UINT32(nEndPos-nStartPos-SFX_REC_HEADERSIZE_MINI) << 8 ) + ( sal_uInt32(nPreTag) | \ + sal_uInt32(nEndPos-nStartPos-SFX_REC_HEADERSIZE_MINI) << 8 ) #define SFX_REC_HEADER(nRecType,nContentTag,nContentVer) \ - ( UINT32(nRecType) | \ - ( UINT32(nContentVer) << 8 ) | \ - ( UINT32(nContentTag) << 16 ) ) + ( sal_uInt32(nRecType) | \ + ( sal_uInt32(nContentVer) << 8 ) | \ + ( sal_uInt32(nContentTag) << 16 ) ) #define SFX_REC_CONTENT_HEADER(nContentVer,n1StStartPos,nCurStartPos) \ - ( UINT32(nContentVer) | \ - UINT32( nCurStartPos - n1StStartPos ) << 8 ) + ( sal_uInt32(nContentVer) | \ + sal_uInt32( nCurStartPos - n1StStartPos ) << 8 ) //========================================================================= -UINT32 SfxMiniRecordWriter::Close +sal_uInt32 SfxMiniRecordWriter::Close ( - bool bSeekToEndOfRec /* TRUE (default) + bool bSeekToEndOfRec /* true (default) Der Stream wird an das Ende des Records positioniert. - FALSE + false Der Stream wird an den Anfang des Contents (also hinter den Header) positioniert. @@ -96,9 +96,9 @@ UINT32 SfxMiniRecordWriter::Close [R"uckgabewert] - UINT32 != 0 + sal_uInt32 != 0 Position im Stream, die direkt hinter dem Record liegt. - 'bSeekToEndOfRecord==TRUE' + 'bSeekToEndOfRecord==sal_True' => R"uckgabewert == aktuelle Stream-Position nach Aufruf == 0 @@ -110,7 +110,7 @@ UINT32 SfxMiniRecordWriter::Close if ( !_bHeaderOk ) { // Header an den Anfang des Records schreiben - UINT32 nEndPos = _pStream->Tell(); + sal_uInt32 nEndPos = _pStream->Tell(); _pStream->Seek( _nStartPos ); *_pStream << SFX_REC_MINI_HEADER( _nPreTag, _nStartPos, nEndPos ); @@ -129,7 +129,7 @@ UINT32 SfxMiniRecordWriter::Close //========================================================================= -USHORT SfxMiniRecordReader::ScanRecordType +sal_uInt16 SfxMiniRecordReader::ScanRecordType ( SvStream* pStream /* <SvStream> an dessen aktueller Position ein Record liegt, dessen Typ erkannt werden @@ -159,7 +159,7 @@ USHORT SfxMiniRecordReader::ScanRecordType [R"uckgabewert] - USHORT SFX_REC_TYPE_EOR + sal_uInt16 SFX_REC_TYPE_EOR An der aktuellen Position des Streams steht eine End-Of-Records-Kennung. @@ -208,7 +208,7 @@ USHORT SfxMiniRecordReader::ScanRecordType *pStream >> nHeader; // k"onnte es sich um einen extended-Record handeln? - USHORT nPreTag = sal::static_int_cast< USHORT >(SFX_REC_PRE(nHeader)); + sal_uInt16 nPreTag = sal::static_int_cast< sal_uInt16 >(SFX_REC_PRE(nHeader)); if ( SFX_REC_PRETAG_EXT == nPreTag ) { // die n"achsten 4 Bytes als extended-Header lesen @@ -218,7 +218,7 @@ USHORT SfxMiniRecordReader::ScanRecordType pStream->SeekRel(-8); // liegt eine g"ultige Record-Kennung vor? - USHORT nType = sal::static_int_cast< USHORT >(SFX_REC_TYP(nHeader)); + sal_uInt16 nType = sal::static_int_cast< sal_uInt16 >(SFX_REC_TYP(nHeader)); if ( nType >= SFX_REC_TYPE_FIRST && nType <= SFX_REC_TYPE_LAST ) // entsprechenden extended-Record-Typ zur"uckliefern return nType; @@ -235,7 +235,7 @@ USHORT SfxMiniRecordReader::ScanRecordType return nPreTag; // liegt ein Drawin-Engine-Record vor? - if ( nHeader == UINT32(*"DRMD") || nHeader == UINT32(*"DRVW") ) + if ( nHeader == sal_uInt32(*"DRMD") || nHeader == sal_uInt32(*"DRVW") ) return SFX_REC_TYPE_DRAWENG; // alle anderen sind grunds"atzlich g"ultige Mini-Records @@ -244,13 +244,13 @@ USHORT SfxMiniRecordReader::ScanRecordType //------------------------------------------------------------------------- -bool SfxMiniRecordReader::SetHeader_Impl( UINT32 nHeader ) +bool SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader ) /* [Beschreibung] Interne Methode zum nachtr"aglichen Verarbeiten eines extern gelesenen Headers. Falls der Header eine End-Of-Records-Kennung darstellt, - wird am Stream ein Errorcode gesetzt und FALSE zur"uckgeliefert. Im + wird am Stream ein Errorcode gesetzt und sal_False zur"uckgeliefert. Im Fehlerfall wird der Stream jedoch nicht auf den Record-Anfang zur"uck- gesetzt. */ @@ -260,7 +260,7 @@ bool SfxMiniRecordReader::SetHeader_Impl( UINT32 nHeader ) // Record-Ende und Pre-Tag aus dem Header ermitteln _nEofRec = _pStream->Tell() + SFX_REC_OFS(nHeader); - _nPreTag = sal::static_int_cast< BYTE >(SFX_REC_PRE(nHeader)); + _nPreTag = sal::static_int_cast< sal_uInt8 >(SFX_REC_PRE(nHeader)); // wenn End-Of-Record-Kennung, dann Fehler if ( _nPreTag == SFX_REC_PRETAG_EOR ) @@ -293,12 +293,12 @@ SfxMiniRecordReader::SfxMiniRecordReader */ : _pStream( pStream ), - _bSkipped( FALSE ) + _bSkipped( sal_False ) { // Header einlesen - UINT32 nStartPos = pStream->Tell(); // um im Fehlerfall zur"uck zu-seeken + sal_uInt32 nStartPos = pStream->Tell(); // um im Fehlerfall zur"uck zu-seeken DBG( DbgOutf( "SfxFileRec: reading record at %ul", nStartPos ) ); - UINT32 nHeader; + sal_uInt32 nHeader; *pStream >> nHeader; // Headerdaten extrahieren @@ -321,7 +321,7 @@ SfxMiniRecordReader::SfxMiniRecordReader Position sich ein <SfxMiniRecord> befindet. */ - BYTE nTag // Pre-Tag des gew"unschten Records + sal_uInt8 nTag // Pre-Tag des gew"unschten Records ) /* [Beschreibung] @@ -334,13 +334,13 @@ SfxMiniRecordReader::SfxMiniRecordReader Wird das Ende des Streams oder die Kennung SFX_REC_PRETAG_EOR erreicht, bevor ein Record mit dem ge"unschten Pre-Tag gefunden wird, - ist die erzeugte Instanz ung"ultig ('IsValid() == FALSE'). Ein ent- + ist die erzeugte Instanz ung"ultig ('IsValid() == sal_False'). Ein ent- sprechender Error-Code (ERRCODE_IO_EOF bzw. ERRCODE_IO_WRONGFORMAT) ist dann am Stream gesetzt, dessen Position ist dann au\serdem unver- "andert. Bei 'nTag==SFX_FILEREC_PRETAG_EOR' wird nicht versucht, einen Record - zu lesen, es wird sofort 'IsValid()' auf FALSE gesetzt und kein Error-Code + zu lesen, es wird sofort 'IsValid()' auf sal_False gesetzt und kein Error-Code am Stream gesetzt. Dies ist dauzu gedacht, ohne 'new' und 'delete' abw"rtskompatibel SfxMiniRecords einbauen zu k"onnen. Siehe dazu <SfxItemSet::Load()>. @@ -368,14 +368,14 @@ SfxMiniRecordReader::SfxMiniRecordReader } // StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen - UINT32 nStartPos = pStream->Tell(); + sal_uInt32 nStartPos = pStream->Tell(); // passenden Record suchen - while(TRUE) + while(sal_True) { // Header lesen DBG( DbgOutf( "SfxFileRec: searching record at %ul", pStream->Tell() ) ); - UINT32 nHeader; + sal_uInt32 nHeader; *pStream >> nHeader; // Headerdaten von Basisklasse extrahieren lassen @@ -407,10 +407,10 @@ SfxMiniRecordReader::SfxMiniRecordReader SfxSingleRecordWriter::SfxSingleRecordWriter ( - BYTE nRecordType, // f"ur Subklassen + sal_uInt8 nRecordType, // f"ur Subklassen SvStream* pStream, // Stream, in dem der Record angelegt wird - UINT16 nContentTag, // Inhalts-Art-Kennung - BYTE nContentVer // Inhalts-Versions-Kennung + sal_uInt16 nContentTag, // Inhalts-Art-Kennung + sal_uInt8 nContentVer // Inhalts-Versions-Kennung ) /* [Beschreibung] @@ -429,8 +429,8 @@ SfxSingleRecordWriter::SfxSingleRecordWriter SfxSingleRecordWriter::SfxSingleRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - UINT16 nContentTag, // Inhalts-Art-Kennung - BYTE nContentVer // Inhalts-Versions-Kennung + sal_uInt16 nContentTag, // Inhalts-Art-Kennung + sal_uInt8 nContentVer // Inhalts-Versions-Kennung ) /* [Beschreibung] @@ -451,9 +451,9 @@ SfxSingleRecordWriter::SfxSingleRecordWriter SfxSingleRecordWriter::SfxSingleRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - UINT16 nContentTag, // Inhalts-Art-Kennung - BYTE nContentVer, // Inhalts-Versions-Kennung - UINT32 nContentSize // Gr"o\se des Inhalts in Bytes + sal_uInt16 nContentTag, // Inhalts-Art-Kennung + sal_uInt8 nContentVer, // Inhalts-Versions-Kennung + sal_uInt32 nContentSize // Gr"o\se des Inhalts in Bytes ) /* [Beschreibung] @@ -471,7 +471,7 @@ SfxSingleRecordWriter::SfxSingleRecordWriter //========================================================================= -inline bool SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes ) +inline bool SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes ) /* [Beschreibung] @@ -485,7 +485,7 @@ inline bool SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes ) bool bRet; // Basisklassen-Header einlesen - UINT32 nHeader=0; + sal_uInt32 nHeader=0; *_pStream >> nHeader; if ( !SetHeader_Impl( nHeader ) ) bRet = false; @@ -493,11 +493,11 @@ inline bool SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes ) { // eigenen Header einlesen *_pStream >> nHeader; - _nRecordVer = sal::static_int_cast< BYTE >(SFX_REC_VER(nHeader)); - _nRecordTag = sal::static_int_cast< UINT16 >(SFX_REC_TAG(nHeader)); + _nRecordVer = sal::static_int_cast< sal_uInt8 >(SFX_REC_VER(nHeader)); + _nRecordTag = sal::static_int_cast< sal_uInt16 >(SFX_REC_TAG(nHeader)); // falscher Record-Typ? - _nRecordType = sal::static_int_cast< BYTE >(SFX_REC_TYP(nHeader)); + _nRecordType = sal::static_int_cast< sal_uInt8 >(SFX_REC_TYP(nHeader)); bRet = 0 != ( nTypes & _nRecordType); } return bRet; @@ -510,7 +510,7 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream ) { // Startposition merken, um im Fehlerfall zur"uck-seeken zu k"onnen #ifdef DBG_UTIL - UINT32 nStartPos = pStream->Tell(); + sal_uInt32 nStartPos = pStream->Tell(); DBG( DbgOutf( "SfxFileRec: reading record at %ul", nStartPos ) ); #endif @@ -528,10 +528,10 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream ) //------------------------------------------------------------------------- -SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, USHORT nTag ) +SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, sal_uInt16 nTag ) { // StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen - UINT32 nStartPos = pStream->Tell(); + sal_uInt32 nStartPos = pStream->Tell(); // richtigen Record suchen, ggf. Error-Code setzen und zur"uck-seeken Construct_Impl( pStream ); @@ -547,8 +547,8 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, USHORT nTag ) bool SfxSingleRecordReader::FindHeader_Impl ( - UINT16 nTypes, // arithm. Veroderung erlaubter Record-Typen - UINT16 nTag // zu findende Record-Art-Kennung + sal_uInt16 nTypes, // arithm. Veroderung erlaubter Record-Typen + sal_uInt16 nTag // zu findende Record-Art-Kennung ) /* [Beschreibung] @@ -558,18 +558,18 @@ bool SfxSingleRecordReader::FindHeader_Impl gekennzeichnet ist. Kann ein solcher Record nicht gefunden werden, wird am Stream ein - Errorcode gesetzt, zur"uck-geseekt und FALSE zur"uckgeliefert. + Errorcode gesetzt, zur"uck-geseekt und sal_False zur"uckgeliefert. */ { // StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen - UINT32 nStartPos = _pStream->Tell(); + sal_uInt32 nStartPos = _pStream->Tell(); // richtigen Record suchen while ( !_pStream->IsEof() ) { // Header lesen - UINT32 nHeader; + sal_uInt32 nHeader; DBG( DbgOutf( "SfxFileRec: searching record at %ul", _pStream->Tell() ) ); *_pStream >> nHeader; if ( !SetHeader_Impl( nHeader ) ) @@ -581,17 +581,17 @@ bool SfxSingleRecordReader::FindHeader_Impl { // Extended Header lesen *_pStream >> nHeader; - _nRecordTag = sal::static_int_cast< UINT16 >(SFX_REC_TAG(nHeader)); + _nRecordTag = sal::static_int_cast< sal_uInt16 >(SFX_REC_TAG(nHeader)); // richtigen Record gefunden? if ( _nRecordTag == nTag ) { // gefundener Record-Typ passend? - _nRecordType = sal::static_int_cast< BYTE >( + _nRecordType = sal::static_int_cast< sal_uInt8 >( SFX_REC_TYP(nHeader)); if ( nTypes & _nRecordType ) // ==> gefunden - return TRUE; + return sal_True; // error => Such-Schleife abbrechen break; @@ -606,18 +606,18 @@ bool SfxSingleRecordReader::FindHeader_Impl // Fehler setzen und zur"uck-seeken _pStream->SetError( ERRCODE_IO_WRONGFORMAT ); _pStream->Seek( nStartPos ); - return FALSE; + return sal_False; } //========================================================================= SfxMultiFixRecordWriter::SfxMultiFixRecordWriter ( - BYTE nRecordType, // Subklassen Record-Kennung + sal_uInt8 nRecordType, // Subklassen Record-Kennung SvStream* pStream, // Stream, in dem der Record angelegt wird - UINT16 nContentTag, // Content-Art-Kennung - BYTE nContentVer, // Content-Versions-Kennung - UINT32 // Gr"o\se jedes einzelnen Contents in Bytes + sal_uInt16 nContentTag, // Content-Art-Kennung + sal_uInt8 nContentVer, // Content-Versions-Kennung + sal_uInt32 // Gr"o\se jedes einzelnen Contents in Bytes ) /* [Beschreibung] @@ -637,9 +637,9 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter SfxMultiFixRecordWriter::SfxMultiFixRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - UINT16 nContentTag, // Content-Art-Kennung - BYTE nContentVer, // Content-Versions-Kennung - UINT32 // Gr"o\se jedes einzelnen Contents in Bytes + sal_uInt16 nContentTag, // Content-Art-Kennung + sal_uInt8 nContentVer, // Content-Versions-Kennung + sal_uInt32 // Gr"o\se jedes einzelnen Contents in Bytes ) /* [Beschreibung] @@ -658,7 +658,7 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter //------------------------------------------------------------------------ -UINT32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec ) +sal_uInt32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec ) // siehe <SfxMiniRecordWriter> @@ -667,7 +667,7 @@ UINT32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec ) if ( !_bHeaderOk ) { // Position hinter Record merken, um sie restaurieren zu k"onnen - UINT32 nEndPos = SfxSingleRecordWriter::Close( FALSE ); + sal_uInt32 nEndPos = SfxSingleRecordWriter::Close( sal_False ); // gegen"uber SfxSingleRecord erweiterten Header schreiben *_pStream << _nContentCount; @@ -687,10 +687,10 @@ UINT32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec ) SfxMultiVarRecordWriter::SfxMultiVarRecordWriter ( - BYTE nRecordType, // Record-Kennung der Subklasse + sal_uInt8 nRecordType, // Record-Kennung der Subklasse SvStream* pStream, // Stream, in dem der Record angelegt wird - UINT16 nRecordTag, // Gesamt-Art-Kennung - BYTE nRecordVer // Gesamt-Versions-Kennung + sal_uInt16 nRecordTag, // Gesamt-Art-Kennung + sal_uInt8 nRecordVer // Gesamt-Versions-Kennung ) /* [Beschreibung] @@ -708,8 +708,8 @@ SfxMultiVarRecordWriter::SfxMultiVarRecordWriter SfxMultiVarRecordWriter::SfxMultiVarRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - UINT16 nRecordTag, // Gesamt-Art-Kennung - BYTE nRecordVer // Gesamt-Versions-Kennung + sal_uInt16 nRecordTag, // Gesamt-Art-Kennung + sal_uInt8 nRecordVer // Gesamt-Versions-Kennung ) /* [Beschreibung] @@ -783,7 +783,7 @@ void SfxMultiVarRecordWriter::NewContent() //------------------------------------------------------------------------- -UINT32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec ) +sal_uInt32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec ) // siehe <SfxMiniRecordWriter> @@ -796,24 +796,24 @@ UINT32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec ) FlushContent_Impl(); // Content-Offset-Tabelle schreiben - UINT32 nContentOfsPos = _pStream->Tell(); + sal_uInt32 nContentOfsPos = _pStream->Tell(); //! darf man das so einr"ucken? #if defined(OSL_LITENDIAN) _pStream->Write( _aContentOfs.GetData(), - sizeof(UINT32)*_nContentCount ); + sizeof(sal_uInt32)*_nContentCount ); #else - for ( USHORT n = 0; n < _nContentCount; ++n ) - *_pStream << UINT32(_aContentOfs[n]); + for ( sal_uInt16 n = 0; n < _nContentCount; ++n ) + *_pStream << sal_uInt32(_aContentOfs[n]); #endif // SfxMultiFixRecordWriter::Close() "uberspringen! - UINT32 nEndPos = SfxSingleRecordWriter::Close( FALSE ); + sal_uInt32 nEndPos = SfxSingleRecordWriter::Close( sal_False ); // eigenen Header schreiben *_pStream << _nContentCount; if ( SFX_REC_TYPE_VARSIZE_RELOC == _nPreTag || SFX_REC_TYPE_MIXTAGS_RELOC == _nPreTag ) - *_pStream << static_cast<UINT32>(nContentOfsPos - ( _pStream->Tell() + sizeof(UINT32) )); + *_pStream << static_cast<sal_uInt32>(nContentOfsPos - ( _pStream->Tell() + sizeof(sal_uInt32) )); else *_pStream << nContentOfsPos; @@ -831,8 +831,8 @@ UINT32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec ) void SfxMultiMixRecordWriter::NewContent ( - UINT16 nContentTag, // Kennung f"ur die Art des Contents - BYTE nContentVer // Kennung f"ur die Version des Contents + sal_uInt16 nContentTag, // Kennung f"ur die Art des Contents + sal_uInt8 nContentVer // Kennung f"ur die Version des Contents ) /* [Beschreibung] @@ -875,18 +875,18 @@ bool SfxMultiRecordReader::ReadHeader_Impl() if ( _nRecordType != SFX_REC_TYPE_FIXSIZE ) { // Tabelle aus dem Stream einlesen - UINT32 nContentPos = _pStream->Tell(); + sal_uInt32 nContentPos = _pStream->Tell(); if ( _nRecordType == SFX_REC_TYPE_VARSIZE_RELOC || _nRecordType == SFX_REC_TYPE_MIXTAGS_RELOC ) _pStream->SeekRel( + _nContentSize ); else _pStream->Seek( _nContentSize ); - _pContentOfs = new UINT32[_nContentCount]; + _pContentOfs = new sal_uInt32[_nContentCount]; //! darf man jetzt so einr"ucken #if defined(OSL_LITENDIAN) - _pStream->Read( _pContentOfs, sizeof(UINT32)*_nContentCount ); + _pStream->Read( _pContentOfs, sizeof(sal_uInt32)*_nContentCount ); #else - for ( USHORT n = 0; n < _nContentCount; ++n ) + for ( sal_uInt16 n = 0; n < _nContentCount; ++n ) *_pStream >> _pContentOfs[n]; #endif _pStream->Seek( nContentPos ); @@ -918,7 +918,7 @@ SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream ) //------------------------------------------------------------------------- -SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream, UINT16 nTag ) +SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag ) : _nContentNo(0) { // Position im Stream merken, um im Fehlerfall zur"uck-seeken zu k"onnen @@ -955,8 +955,8 @@ bool SfxMultiRecordReader::GetContent() auf den Anfang des ersten Contents im Record und liest ggf. dessen Header ein. - Liegt laut Record-Header kein Content mehr vor, wird FALSE zur"uck- - gegeben. Trotz einem TRUE-Returnwert kann am Stream ein Fehlercode + Liegt laut Record-Header kein Content mehr vor, wird sal_False zur"uck- + gegeben. Trotz einem sal_True-Returnwert kann am Stream ein Fehlercode gesetzt sein, z.B. falls er unvorhergesehenerweise (kaputtes File) zuende ist. */ @@ -966,10 +966,10 @@ bool SfxMultiRecordReader::GetContent() if ( _nContentNo < _nContentCount ) { // den Stream an den Anfang des Contents positionieren - UINT32 nOffset = _nRecordType == SFX_REC_TYPE_FIXSIZE + sal_uInt32 nOffset = _nRecordType == SFX_REC_TYPE_FIXSIZE ? _nContentNo * _nContentSize : SFX_REC_CONTENT_OFS(_pContentOfs[_nContentNo]); - UINT32 nNewPos = _nStartPos + nOffset; + sal_uInt32 nNewPos = _nStartPos + nOffset; DBG_ASSERT( nNewPos >= _pStream->Tell(), "SfxMultiRecordReader::GetContent() - New position before current, to much data red!" ); // #99366#: correct stream pos in every case; @@ -984,17 +984,17 @@ bool SfxMultiRecordReader::GetContent() if ( _nRecordType == SFX_REC_TYPE_MIXTAGS || _nRecordType == SFX_REC_TYPE_MIXTAGS_RELOC ) { - _nContentVer = sal::static_int_cast< BYTE >( + _nContentVer = sal::static_int_cast< sal_uInt8 >( SFX_REC_CONTENT_VER(_pContentOfs[_nContentNo])); *_pStream >> _nContentTag; } // ContentNo weiterz"ahlen ++_nContentNo; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index c596113f1658..fe5ecebf79e6 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -241,30 +241,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) - { - uno::Reference< registry::XRegistryKey > xRegistryKey ( - reinterpret_cast< registry::XRegistryKey*>(pRegistryKey)); - - uno::Reference< registry::XRegistryKey > xNewKey; - xNewKey = xRegistryKey->createKey( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - FSStorageFactory::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES"))); - - const uno::Sequence< ::rtl::OUString > aServices ( - FSStorageFactory::impl_staticGetSupportedServiceNames()); - for( sal_Int32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component new file mode 100644 index 000000000000..3ef0be825972 --- /dev/null +++ b/svl/source/fsstor/fsstorage.component @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.embed.FileSystemStorageFactory"> + <service name="com.sun.star.comp.embed.FileSystemStorageFactory"/> + <service name="com.sun.star.embed.FileSystemStorageFactory"/> + </implementation> +</component> diff --git a/svl/source/fsstor/makefile.mk b/svl/source/fsstor/makefile.mk deleted file mode 100644 index dc91814772f9..000000000000 --- a/svl/source/fsstor/makefile.mk +++ /dev/null @@ -1,66 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=svl -TARGET=fsstorage.uno -LIBTARGET=NO -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ---------------------------------- - -.INCLUDE : settings.mk -DLLPRE= - -# --- Files ------------------------------------- - -SLOFILES=\ - $(SLO)$/fsfactory.obj \ - $(SLO)$/fsstorage.obj \ - $(SLO)$/oinputstreamcontainer.obj \ - $(SLO)$/ostreamcontainer.obj - -SHL1TARGET= $(TARGET) -SHL1IMPLIB= i$(TARGET) -SHL1OBJS= $(SLOFILES) -SHL1STDLIBS=\ - $(UNOTOOLSLIB) \ - $(TOOLSLIB) \ - $(COMPHELPERLIB) \ - $(UCBHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) - -SHL1VERSIONMAP=$(SOLARENV)/src/component.map -SHL1DEF= $(MISC)$/$(SHL1TARGET).def -DEF1NAME= $(SHL1TARGET) - -# --- Targets ---------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/inc/passwordcontainer.hxx b/svl/source/inc/passwordcontainer.hxx index 90a367814202..bcbd51b1360e 100644 --- a/svl/source/inc/passwordcontainer.hxx +++ b/svl/source/inc/passwordcontainer.hxx @@ -412,13 +412,13 @@ public: class RW_SvMemoryStream : public SvMemoryStream { public: - RW_SvMemoryStream( void* Buf, ULONG Size, StreamMode eMode ): + RW_SvMemoryStream( void* Buf, sal_uLong Size, StreamMode eMode ): SvMemoryStream( Buf, Size, eMode){} - RW_SvMemoryStream( ULONG InitSize=512, ULONG Resize=64 ): + RW_SvMemoryStream( sal_uLong InitSize=512, sal_uLong Resize=64 ): SvMemoryStream( InitSize, Resize ){} - ULONG getActualSize(){ return nEndOfData; } + sal_uLong getActualSize(){ return nEndOfData; } }; diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index 11be49104a5e..a42f8e2a6e46 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.hxx @@ -26,7 +26,8 @@ * ************************************************************************/ #include <svl/brdcst.hxx> - +#include <boost/shared_ptr.hpp> +#include <deque> #ifndef DELETEZ #define DELETEZ(pPtr) { delete pPtr; pPtr = 0; } @@ -35,12 +36,12 @@ struct SfxPoolVersion_Impl { - USHORT _nVer; - USHORT _nStart, _nEnd; - USHORT* _pMap; + sal_uInt16 _nVer; + sal_uInt16 _nStart, _nEnd; + sal_uInt16* _pMap; - SfxPoolVersion_Impl( USHORT nVer, USHORT nStart, USHORT nEnd, - USHORT *pMap ) + SfxPoolVersion_Impl( sal_uInt16 nVer, sal_uInt16 nStart, sal_uInt16 nEnd, + sal_uInt16 *pMap ) : _nVer( nVer ), _nStart( nStart ), _nEnd( nEnd ), @@ -54,16 +55,17 @@ struct SfxPoolVersion_Impl {} }; -SV_DECL_PTRARR( SfxPoolItemArrayBase_Impl, SfxPoolItem*, 0, 5 ) -SV_DECL_PTRARR_DEL( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl*, 0, 2 ) +typedef std::deque<SfxPoolItem*> SfxPoolItemArrayBase_Impl; + +typedef boost::shared_ptr< SfxPoolVersion_Impl > SfxPoolVersion_ImplPtr; +typedef std::deque< SfxPoolVersion_ImplPtr > SfxPoolVersionArr_Impl; struct SfxPoolItemArray_Impl: public SfxPoolItemArrayBase_Impl { - USHORT nFirstFree; + size_t nFirstFree; - SfxPoolItemArray_Impl (USHORT nInitSize = 0) - : SfxPoolItemArrayBase_Impl( nInitSize ), - nFirstFree( 0 ) + SfxPoolItemArray_Impl () + : nFirstFree( 0 ) {} }; @@ -74,17 +76,17 @@ struct SfxItemPool_Impl SfxBroadcaster aBC; SfxPoolItemArray_Impl** ppPoolItems; SfxPoolVersionArr_Impl aVersions; - USHORT nVersion; - USHORT nLoadingVersion; - USHORT nInitRefCount; // 1, beim Laden ggf. 2 - USHORT nVerStart, nVerEnd; // WhichRange in Versions - USHORT nStoringStart, nStoringEnd; // zu speichernder Range - BYTE nMajorVer, nMinorVer; // Pool selbst + sal_uInt16 nVersion; + sal_uInt16 nLoadingVersion; + sal_uInt16 nInitRefCount; // 1, beim Laden ggf. 2 + sal_uInt16 nVerStart, nVerEnd; // WhichRange in Versions + sal_uInt16 nStoringStart, nStoringEnd; // zu speichernder Range + sal_uInt8 nMajorVer, nMinorVer; // Pool selbst SfxMapUnit eDefMetric; bool bInSetItem; bool bStreaming; // in Load() bzw. Store() - SfxItemPool_Impl( USHORT nStart, USHORT nEnd ) + SfxItemPool_Impl( sal_uInt16 nStart, sal_uInt16 nEnd ) : ppPoolItems (new SfxPoolItemArray_Impl*[ nEnd - nStart + 1]) { memset( ppPoolItems, 0, sizeof( SfxPoolItemArray_Impl* ) * ( nEnd - nStart + 1) ); @@ -97,7 +99,8 @@ struct SfxItemPool_Impl void DeleteItems() { - delete[] ppPoolItems; ppPoolItems = 0; + delete[] ppPoolItems; + ppPoolItems = 0; } }; @@ -124,76 +127,76 @@ struct SfxItemPool_Impl #endif #define CHECK_FILEFORMAT( rStream, nTag ) \ - { USHORT nFileTag; \ + { sal_uInt16 nFileTag; \ rStream >> nFileTag; \ if ( nTag != nFileTag ) \ { \ 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 2b541c9c68dc..e45c6acbaa26 100644 --- a/svl/source/items/aeitem.cxx +++ b/svl/source/items/aeitem.cxx @@ -46,7 +46,7 @@ TYPEINIT1_AUTOFACTORY(SfxAllEnumItem, SfxEnumItem) struct SfxAllEnumValue_Impl { - USHORT nValue; + sal_uInt16 nValue; XubString aText; }; @@ -62,7 +62,7 @@ SfxAllEnumItem::SfxAllEnumItem() : { } -SfxAllEnumItem::SfxAllEnumItem( USHORT which, USHORT nVal, const XubString &rText ): +SfxAllEnumItem::SfxAllEnumItem( sal_uInt16 which, sal_uInt16 nVal, const XubString &rText ): SfxEnumItem(which, nVal), pValues( 0 ), pDisabledValues( 0 ) @@ -73,7 +73,7 @@ SfxAllEnumItem::SfxAllEnumItem( USHORT which, USHORT nVal, const XubString &rTex // ----------------------------------------------------------------------- -SfxAllEnumItem::SfxAllEnumItem(USHORT which, USHORT nVal): +SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which, sal_uInt16 nVal): SfxEnumItem(which, nVal), pValues( 0 ), pDisabledValues( 0 ) @@ -84,7 +84,7 @@ SfxAllEnumItem::SfxAllEnumItem(USHORT which, USHORT nVal): // ----------------------------------------------------------------------- -SfxAllEnumItem::SfxAllEnumItem( USHORT which, SvStream &rStream ): +SfxAllEnumItem::SfxAllEnumItem( sal_uInt16 which, SvStream &rStream ): SfxEnumItem(which, rStream), pValues( 0 ), pDisabledValues( 0 ) @@ -96,7 +96,7 @@ SfxAllEnumItem::SfxAllEnumItem( USHORT which, SvStream &rStream ): // ----------------------------------------------------------------------- -SfxAllEnumItem::SfxAllEnumItem(USHORT which): +SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which): SfxEnumItem(which, 0), pValues( 0 ), pDisabledValues( 0 ) @@ -118,7 +118,7 @@ SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy): pValues = new SfxAllEnumValueArr; - for ( USHORT nPos = 0; nPos < rCopy.pValues->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < rCopy.pValues->Count(); ++nPos ) { SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl; pVal->nValue = rCopy.pValues->GetObject(nPos)->nValue; @@ -130,7 +130,7 @@ SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy): if( rCopy.pDisabledValues ) { pDisabledValues = new SvUShorts; - for ( USHORT nPos = 0; nPos < rCopy.pDisabledValues->Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < rCopy.pDisabledValues->Count(); ++nPos ) { pDisabledValues->Insert( rCopy.pDisabledValues->GetObject(nPos), nPos ); @@ -149,7 +149,7 @@ SfxAllEnumItem::~SfxAllEnumItem() // ----------------------------------------------------------------------- -USHORT SfxAllEnumItem::GetValueCount() const +sal_uInt16 SfxAllEnumItem::GetValueCount() const { DBG_CHKTHIS(SfxAllEnumItem, 0); return pValues ? pValues->Count() : 0; @@ -157,7 +157,7 @@ USHORT SfxAllEnumItem::GetValueCount() const // ----------------------------------------------------------------------- -XubString SfxAllEnumItem::GetValueTextByPos( USHORT nPos ) const +XubString SfxAllEnumItem::GetValueTextByPos( sal_uInt16 nPos ) const { DBG_CHKTHIS(SfxAllEnumItem, 0); DBG_ASSERT( pValues && nPos < pValues->Count(), "enum overflow" ); @@ -166,7 +166,7 @@ XubString SfxAllEnumItem::GetValueTextByPos( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT SfxAllEnumItem::GetValueByPos( USHORT nPos ) const +sal_uInt16 SfxAllEnumItem::GetValueByPos( sal_uInt16 nPos ) const { DBG_CHKTHIS(SfxAllEnumItem, 0); DBG_ASSERT( pValues && nPos < pValues->Count(), "enum overflow" ); @@ -183,7 +183,7 @@ SfxPoolItem* SfxAllEnumItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SfxPoolItem* SfxAllEnumItem::Create( SvStream & rStream, USHORT ) const +SfxPoolItem* SfxAllEnumItem::Create( SvStream & rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxAllEnumItem, 0); return new SfxAllEnumItem( Which(), rStream ); @@ -192,11 +192,11 @@ SfxPoolItem* SfxAllEnumItem::Create( SvStream & rStream, USHORT ) const // ----------------------------------------------------------------------- -USHORT SfxAllEnumItem::_GetPosByValue( USHORT nVal ) const +sal_uInt16 SfxAllEnumItem::_GetPosByValue( sal_uInt16 nVal ) const /* [Beschreibung] - Im Ggs. zu <SfxEnumItemInterface::GetPosByValue(USHORT)const> liefert + Im Ggs. zu <SfxEnumItemInterface::GetPosByValue(sal_uInt16)const> liefert diese interne Methode bei nicht vorhandenen Values die Position, an der der Wert liegen w"urde. */ @@ -208,7 +208,7 @@ USHORT SfxAllEnumItem::_GetPosByValue( USHORT nVal ) const return 0; //!O: binaere Suche oder SortArray verwenden - USHORT nPos; + sal_uInt16 nPos; for ( nPos = 0; nPos < pValues->Count(); ++nPos ) if ( pValues->GetObject(nPos)->nValue >= nVal ) return nPos; @@ -217,11 +217,11 @@ USHORT SfxAllEnumItem::_GetPosByValue( USHORT nVal ) const // ----------------------------------------------------------------------- -USHORT SfxAllEnumItem::GetPosByValue( USHORT nValue ) const +sal_uInt16 SfxAllEnumItem::GetPosByValue( sal_uInt16 nValue ) const /* [Beschreibung] - Liefert im Gegensatz zu <SfxEnumItemInterface::GetPosByValue(USHORT)const> + Liefert im Gegensatz zu <SfxEnumItemInterface::GetPosByValue(sal_uInt16)const> immer nValue zur"uck, solange nicht mindestens ein Wert mit einer der Methoden <SfxAllEnumItem::InsertValue()> eingef"ugt wurde. */ @@ -237,7 +237,7 @@ USHORT SfxAllEnumItem::GetPosByValue( USHORT nValue ) const // ----------------------------------------------------------------------- -void SfxAllEnumItem::InsertValue( USHORT nValue, const XubString &rValue ) +void SfxAllEnumItem::InsertValue( sal_uInt16 nValue, const XubString &rValue ) { DBG_CHKTHIS(SfxAllEnumItem, 0); SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl; @@ -255,7 +255,7 @@ void SfxAllEnumItem::InsertValue( USHORT nValue, const XubString &rValue ) // ----------------------------------------------------------------------- -void SfxAllEnumItem::InsertValue( USHORT nValue ) +void SfxAllEnumItem::InsertValue( sal_uInt16 nValue ) { DBG_CHKTHIS(SfxAllEnumItem, 0); SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl; @@ -268,7 +268,7 @@ void SfxAllEnumItem::InsertValue( USHORT nValue ) pValues->Insert( pTemp, _GetPosByValue(nValue) ); //! doppelte?! } -void SfxAllEnumItem::DisableValue( USHORT nValue ) +void SfxAllEnumItem::DisableValue( sal_uInt16 nValue ) { DBG_CHKTHIS(SfxAllEnumItem, 0); if ( !pDisabledValues ) @@ -277,24 +277,24 @@ void SfxAllEnumItem::DisableValue( USHORT nValue ) pDisabledValues->Insert( nValue, pDisabledValues->Count() ); } -BOOL SfxAllEnumItem::IsEnabled( USHORT nValue ) const +sal_Bool SfxAllEnumItem::IsEnabled( sal_uInt16 nValue ) const { if ( pDisabledValues ) { - for ( USHORT i=0; i<pDisabledValues->Count(); i++ ) + for ( sal_uInt16 i=0; i<pDisabledValues->Count(); i++ ) if ( (*pDisabledValues)[i] == nValue ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -void SfxAllEnumItem::RemoveValue( USHORT nValue ) +void SfxAllEnumItem::RemoveValue( sal_uInt16 nValue ) { DBG_CHKTHIS(SfxAllEnumItem, 0); - USHORT nPos = GetPosByValue(nValue); + sal_uInt16 nPos = GetPosByValue(nValue); DBG_ASSERT( nPos != USHRT_MAX, "removing value not in enum" ); pValues->Remove( nPos ); } diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx index 61128f3bce55..1c302f962431 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.cxx @@ -33,7 +33,7 @@ #include <svl/cenumitm.hxx> #include <whassert.hxx> -#include <cppuhelper/extract.hxx> +#include <comphelper/extract.hxx> //============================================================================ // @@ -69,7 +69,7 @@ SfxEnumItemInterface::GetPresentation(SfxItemPresentation, SfxMapUnit, //============================================================================ // virtual -bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, BYTE) +bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= sal_Int32(GetEnumValue()); @@ -79,13 +79,13 @@ bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, BYTE) //============================================================================ // virtual bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, - BYTE) + sal_uInt8) { sal_Int32 nTheValue = 0; if ( ::cppu::enum2int( nTheValue, rVal ) ) { - SetEnumValue(USHORT(nTheValue)); + SetEnumValue(sal_uInt16(nTheValue)); return true; } OSL_FAIL("SfxEnumItemInterface::PutValue(): Wrong type"); @@ -93,7 +93,7 @@ bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, } //============================================================================ -XubString SfxEnumItemInterface::GetValueTextByPos(USHORT) const +XubString SfxEnumItemInterface::GetValueTextByPos(sal_uInt16) const { DBG_WARNING("SfxEnumItemInterface::GetValueTextByPos(): Pure virtual"); return XubString(); @@ -101,25 +101,25 @@ XubString SfxEnumItemInterface::GetValueTextByPos(USHORT) const //============================================================================ // virtual -USHORT SfxEnumItemInterface::GetValueByPos(USHORT nPos) const +sal_uInt16 SfxEnumItemInterface::GetValueByPos(sal_uInt16 nPos) const { return nPos; } //============================================================================ // virtual -USHORT SfxEnumItemInterface::GetPosByValue(USHORT nValue) const +sal_uInt16 SfxEnumItemInterface::GetPosByValue(sal_uInt16 nValue) const { - USHORT nCount = GetValueCount(); - for (USHORT i = 0; i < nCount; ++i) + sal_uInt16 nCount = GetValueCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) if (GetValueByPos(i) == nValue) return i; return USHRT_MAX; } -BOOL SfxEnumItemInterface::IsEnabled(USHORT) const +sal_Bool SfxEnumItemInterface::IsEnabled(sal_uInt16) const { - return TRUE; + return sal_True; } //============================================================================ @@ -131,14 +131,14 @@ int SfxEnumItemInterface::HasBoolValue() const //============================================================================ // virtual -BOOL SfxEnumItemInterface::GetBoolValue() const +sal_Bool SfxEnumItemInterface::GetBoolValue() const { return false; } //============================================================================ // virtual -void SfxEnumItemInterface::SetBoolValue(BOOL) +void SfxEnumItemInterface::SetBoolValue(sal_Bool) {} //============================================================================ @@ -150,7 +150,7 @@ void SfxEnumItemInterface::SetBoolValue(BOOL) DBG_NAME(CntEnumItem) //============================================================================ -CntEnumItem::CntEnumItem(USHORT which, SvStream & rStream): +CntEnumItem::CntEnumItem(sal_uInt16 which, SvStream & rStream): SfxEnumItemInterface(which) { m_nValue = 0; @@ -162,7 +162,7 @@ TYPEINIT1(CntEnumItem, SfxEnumItemInterface) //============================================================================ // virtual -SvStream & CntEnumItem::Store(SvStream & rStream, USHORT) const +SvStream & CntEnumItem::Store(SvStream & rStream, sal_uInt16) const { rStream << m_nValue; return rStream; @@ -170,14 +170,14 @@ SvStream & CntEnumItem::Store(SvStream & rStream, USHORT) const //============================================================================ // virtual -USHORT CntEnumItem::GetEnumValue() const +sal_uInt16 CntEnumItem::GetEnumValue() const { return GetValue(); } //============================================================================ // virtual -void CntEnumItem::SetEnumValue(USHORT nTheValue) +void CntEnumItem::SetEnumValue(sal_uInt16 nTheValue) { SetValue(nTheValue); } @@ -194,7 +194,7 @@ DBG_NAME(CntBoolItem) TYPEINIT1_AUTOFACTORY(CntBoolItem, SfxPoolItem) //============================================================================ -CntBoolItem::CntBoolItem(USHORT which, SvStream & rStream): +CntBoolItem::CntBoolItem(sal_uInt16 which, SvStream & rStream): SfxPoolItem(which) { m_bValue = false; @@ -232,7 +232,7 @@ SfxItemPresentation CntBoolItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const +bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= sal_Bool(m_bValue); return true; @@ -240,7 +240,7 @@ bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const //============================================================================ // virtual -bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, BYTE) +bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Bool bTheValue = sal_Bool(); if (rVal >>= bTheValue) @@ -254,14 +254,14 @@ bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, BYTE) //============================================================================ // virtual -SfxPoolItem * CntBoolItem::Create(SvStream & rStream, USHORT) const +SfxPoolItem * CntBoolItem::Create(SvStream & rStream, sal_uInt16) const { return new CntBoolItem(Which(), rStream); } //============================================================================ // virtual -SvStream & CntBoolItem::Store(SvStream & rStream, USHORT) const +SvStream & CntBoolItem::Store(SvStream & rStream, sal_uInt16) const { rStream << m_bValue; return rStream; @@ -276,19 +276,19 @@ SfxPoolItem * CntBoolItem::Clone(SfxItemPool *) const //============================================================================ // virtual -USHORT CntBoolItem::GetValueCount() const +sal_uInt16 CntBoolItem::GetValueCount() const { return 2; } //============================================================================ // virtual -UniString CntBoolItem::GetValueTextByVal(BOOL bTheValue) const +UniString CntBoolItem::GetValueTextByVal(sal_Bool bTheValue) const { return bTheValue ? - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) : - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE")); + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) : + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False")); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cintitem.cxx b/svl/source/items/cintitem.cxx index f74463a32a12..1f949babf9dc 100644 --- a/svl/source/items/cintitem.cxx +++ b/svl/source/items/cintitem.cxx @@ -44,7 +44,7 @@ DBG_NAME(CntByteItem) TYPEINIT1_AUTOFACTORY(CntByteItem, SfxPoolItem); //============================================================================ -CntByteItem::CntByteItem(USHORT which, SvStream & rStream): +CntByteItem::CntByteItem(sal_uInt16 which, SvStream & rStream): SfxPoolItem(which) { DBG_CTOR(CntByteItem, 0); @@ -88,7 +88,7 @@ SfxItemPresentation CntByteItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int8 nValue = m_nValue; rVal <<= nValue; @@ -97,7 +97,7 @@ bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const //============================================================================ // virtual -bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int8 nValue = sal_Int8(); if (rVal >>= nValue) @@ -112,17 +112,17 @@ bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE) //============================================================================ // virtual -SfxPoolItem * CntByteItem::Create(SvStream & rStream, USHORT) const +SfxPoolItem * CntByteItem::Create(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(CntByteItem, 0); short nTheValue = 0; rStream >> nTheValue; - return new CntByteItem(Which(), BYTE(nTheValue)); + return new CntByteItem(Which(), sal_uInt8(nTheValue)); } //============================================================================ // virtual -SvStream & CntByteItem::Store(SvStream & rStream, USHORT) const +SvStream & CntByteItem::Store(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(CntByteItem, 0); rStream << short(m_nValue); @@ -139,7 +139,7 @@ SfxPoolItem * CntByteItem::Clone(SfxItemPool *) const //============================================================================ // virtual -BYTE CntByteItem::GetMin() const +sal_uInt8 CntByteItem::GetMin() const { DBG_CHKTHIS(CntByteItem, 0); return 0; @@ -147,7 +147,7 @@ BYTE CntByteItem::GetMin() const //============================================================================ // virtual -BYTE CntByteItem::GetMax() const +sal_uInt8 CntByteItem::GetMax() const { DBG_CHKTHIS(CntByteItem, 0); return 255; @@ -173,11 +173,11 @@ DBG_NAME(CntUInt16Item); TYPEINIT1_AUTOFACTORY(CntUInt16Item, SfxPoolItem); //============================================================================ -CntUInt16Item::CntUInt16Item(USHORT which, SvStream & rStream) : +CntUInt16Item::CntUInt16Item(sal_uInt16 which, SvStream & rStream) : SfxPoolItem(which) { DBG_CTOR(CntUInt16Item, 0); - USHORT nTheValue = 0; + sal_uInt16 nTheValue = 0; rStream >> nTheValue; m_nValue = nTheValue; } @@ -223,7 +223,7 @@ SfxItemPresentation CntUInt16Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; rVal <<= nValue; @@ -232,7 +232,7 @@ bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const //============================================================================ // virtual -bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) @@ -248,7 +248,7 @@ bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) //============================================================================ // virtual -SfxPoolItem * CntUInt16Item::Create(SvStream & rStream, USHORT) const +SfxPoolItem * CntUInt16Item::Create(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(CntUInt16Item, 0); return new CntUInt16Item(Which(), rStream); @@ -256,10 +256,10 @@ SfxPoolItem * CntUInt16Item::Create(SvStream & rStream, USHORT) const //============================================================================ // virtual -SvStream & CntUInt16Item::Store(SvStream &rStream, USHORT) const +SvStream & CntUInt16Item::Store(SvStream &rStream, sal_uInt16) const { DBG_CHKTHIS(CntUInt16Item, 0); - rStream << USHORT(m_nValue); + rStream << sal_uInt16(m_nValue); return rStream; } @@ -273,7 +273,7 @@ SfxPoolItem * CntUInt16Item::Clone(SfxItemPool *) const //============================================================================ // virtual -UINT16 CntUInt16Item::GetMin() const +sal_uInt16 CntUInt16Item::GetMin() const { DBG_CHKTHIS(CntUInt16Item, 0); return 0; @@ -281,7 +281,7 @@ UINT16 CntUInt16Item::GetMin() const //============================================================================ // virtual -UINT16 CntUInt16Item::GetMax() const +sal_uInt16 CntUInt16Item::GetMax() const { DBG_CHKTHIS(CntUInt16Item, 0); return 65535; @@ -307,7 +307,7 @@ DBG_NAME(CntInt32Item); TYPEINIT1_AUTOFACTORY(CntInt32Item, SfxPoolItem); //============================================================================ -CntInt32Item::CntInt32Item(USHORT which, SvStream & rStream) : +CntInt32Item::CntInt32Item(sal_uInt16 which, SvStream & rStream) : SfxPoolItem(which) { DBG_CTOR(CntInt32Item, 0); @@ -355,7 +355,7 @@ SfxItemPresentation CntInt32Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; rVal <<= nValue; @@ -364,7 +364,7 @@ bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const //============================================================================ // virtual -bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) @@ -379,7 +379,7 @@ bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) //============================================================================ // virtual -SfxPoolItem * CntInt32Item::Create(SvStream & rStream, USHORT) const +SfxPoolItem * CntInt32Item::Create(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(CntInt32Item, 0); return new CntInt32Item(Which(), rStream); @@ -387,7 +387,7 @@ SfxPoolItem * CntInt32Item::Create(SvStream & rStream, USHORT) const //============================================================================ // virtual -SvStream & CntInt32Item::Store(SvStream &rStream, USHORT) const +SvStream & CntInt32Item::Store(SvStream &rStream, sal_uInt16) const { DBG_CHKTHIS(CntInt32Item, 0); rStream << long(m_nValue); @@ -404,15 +404,15 @@ SfxPoolItem * CntInt32Item::Clone(SfxItemPool *) const //============================================================================ // virtual -INT32 CntInt32Item::GetMin() const +sal_Int32 CntInt32Item::GetMin() const { DBG_CHKTHIS(CntInt32Item, 0); - return INT32(0x80000000); + return sal_Int32(0x80000000); } //============================================================================ // virtual -INT32 CntInt32Item::GetMax() const +sal_Int32 CntInt32Item::GetMax() const { DBG_CHKTHIS(CntInt32Item, 0); return 0x7FFFFFFF; @@ -438,7 +438,7 @@ DBG_NAME(CntUInt32Item); TYPEINIT1_AUTOFACTORY(CntUInt32Item, SfxPoolItem); //============================================================================ -CntUInt32Item::CntUInt32Item(USHORT which, SvStream & rStream) : +CntUInt32Item::CntUInt32Item(sal_uInt16 which, SvStream & rStream) : SfxPoolItem(which) { DBG_CTOR(CntUInt32Item, 0); @@ -488,7 +488,7 @@ SfxItemPresentation CntUInt32Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; DBG_ASSERT( nValue>=0, "Overflow in UInt32 value!"); @@ -498,7 +498,7 @@ bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const //============================================================================ // virtual -bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) @@ -514,7 +514,7 @@ bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE) //============================================================================ // virtual -SfxPoolItem * CntUInt32Item::Create(SvStream & rStream, USHORT) const +SfxPoolItem * CntUInt32Item::Create(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(CntUInt32Item, 0); return new CntUInt32Item(Which(), rStream); @@ -522,7 +522,7 @@ SfxPoolItem * CntUInt32Item::Create(SvStream & rStream, USHORT) const //============================================================================ // virtual -SvStream & CntUInt32Item::Store(SvStream &rStream, USHORT) const +SvStream & CntUInt32Item::Store(SvStream &rStream, sal_uInt16) const { DBG_CHKTHIS(CntUInt32Item, 0); rStream << static_cast<sal_uInt32>(m_nValue); @@ -539,7 +539,7 @@ SfxPoolItem * CntUInt32Item::Clone(SfxItemPool *) const //============================================================================ // virtual -UINT32 CntUInt32Item::GetMin() const +sal_uInt32 CntUInt32Item::GetMin() const { DBG_CHKTHIS(CntUInt32Item, 0); return 0; @@ -547,7 +547,7 @@ UINT32 CntUInt32Item::GetMin() const //============================================================================ // virtual -UINT32 CntUInt32Item::GetMax() const +sal_uInt32 CntUInt32Item::GetMax() const { DBG_CHKTHIS(CntUInt32Item, 0); return 0xFFFFFFFF; diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index 06269f945315..22cd8a77904c 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.cxx @@ -36,22 +36,22 @@ #include <svl/cntwall.hxx> -#define CNTWALLPAPERITEM_STREAM_MAGIC ( (UINT32)0xfefefefe ) -#define CNTWALLPAPERITEM_STREAM_SEEKREL (-( (long)( sizeof( UINT32 ) ) ) ) +#define CNTWALLPAPERITEM_STREAM_MAGIC ( (sal_uInt32)0xfefefefe ) +#define CNTWALLPAPERITEM_STREAM_SEEKREL (-( (long)( sizeof( sal_uInt32 ) ) ) ) TYPEINIT1( CntWallpaperItem, SfxPoolItem ); // ----------------------------------------------------------------------- -CntWallpaperItem::CntWallpaperItem( USHORT which ) +CntWallpaperItem::CntWallpaperItem( sal_uInt16 which ) : SfxPoolItem( which ), _nColor( COL_TRANSPARENT ), _nStyle( 0 ) { } // ----------------------------------------------------------------------- -CntWallpaperItem::CntWallpaperItem( USHORT which, SvStream& rStream, USHORT nVersion ) +CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uInt16 nVersion ) : SfxPoolItem( which ), _nColor( COL_TRANSPARENT ), _nStyle( 0 ) { - UINT32 nMagic = 0; + sal_uInt32 nMagic = 0; rStream >> nMagic; if ( nMagic == CNTWALLPAPERITEM_STREAM_MAGIC ) { @@ -60,7 +60,7 @@ CntWallpaperItem::CntWallpaperItem( USHORT which, SvStream& rStream, USHORT nVer readUnicodeString(rStream, _aURL, nVersion >= 1); // !!! Color stream operators do not work - they discard any // transparency info !!! - _nColor.Read( rStream, TRUE ); + _nColor.Read( rStream, sal_True ); rStream >> _nStyle; } else @@ -111,33 +111,33 @@ int CntWallpaperItem::operator==( const SfxPoolItem& rItem ) const if( ( rWallItem._nStyle == _nStyle ) && ( rWallItem._nColor == _nColor ) && ( rWallItem._aURL == _aURL ) ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } //============================================================================ // virtual -USHORT CntWallpaperItem::GetVersion(USHORT) const +sal_uInt16 CntWallpaperItem::GetVersion(sal_uInt16) const { return 1; // because it uses SfxPoolItem::read/writeUnicodeString() } // ----------------------------------------------------------------------- -SfxPoolItem* CntWallpaperItem::Create( SvStream& rStream, USHORT nVersion) const +SfxPoolItem* CntWallpaperItem::Create( SvStream& rStream, sal_uInt16 nVersion) const { return new CntWallpaperItem( Which(), rStream, nVersion ); } // ----------------------------------------------------------------------- -SvStream& CntWallpaperItem::Store( SvStream& rStream, USHORT ) const +SvStream& CntWallpaperItem::Store( SvStream& rStream, sal_uInt16 ) const { rStream << CNTWALLPAPERITEM_STREAM_MAGIC; writeUnicodeString(rStream, _aURL); // !!! Color stream operators do not work - they discard any // transparency info !!! // ??? Why the hell Color::Write(...) isn't const ??? - SAL_CONST_CAST( CntWallpaperItem*, this )->_nColor.Write( rStream, TRUE ); + SAL_CONST_CAST( CntWallpaperItem*, this )->_nColor.Write( rStream, sal_True ); rStream << _nStyle; return rStream; @@ -151,7 +151,7 @@ SfxPoolItem* CntWallpaperItem::Clone( SfxItemPool* ) const //---------------------------------------------------------------------------- // virtual -bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&,BYTE ) const +bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8) const { OSL_FAIL("Not implemented!"); return false; @@ -159,7 +159,7 @@ bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&,BYTE ) const //---------------------------------------------------------------------------- // virtual -bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&,BYTE ) +bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8) { OSL_FAIL("Not implemented!"); return false; diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx index bd1b04a6e1dd..d1fe8b9461f9 100644 --- a/svl/source/items/ctypeitm.cxx +++ b/svl/source/items/ctypeitm.cxx @@ -36,8 +36,8 @@ //============================================================================ // The following defines are copied from chaos/source/items/cstritem.cxx: -#define CNTSTRINGITEM_STREAM_MAGIC ( (UINT32)0xfefefefe ) -#define CNTSTRINGITEM_STREAM_SEEKREL (-( (long)( sizeof( UINT32 ) ) ) ) +#define CNTSTRINGITEM_STREAM_MAGIC ( (sal_uInt32)0xfefefefe ) +#define CNTSTRINGITEM_STREAM_SEEKREL (-( (long)( sizeof( sal_uInt32 ) ) ) ) //============================================================================ // @@ -57,14 +57,14 @@ CntContentTypeItem::CntContentTypeItem() } //---------------------------------------------------------------------------- -CntContentTypeItem::CntContentTypeItem( USHORT which, const XubString& rType ) +CntContentTypeItem::CntContentTypeItem( sal_uInt16 which, const XubString& rType ) : CntUnencodedStringItem( which, rType ), _eType( CONTENT_TYPE_NOT_INIT ) { } //---------------------------------------------------------------------------- -CntContentTypeItem::CntContentTypeItem( USHORT which, +CntContentTypeItem::CntContentTypeItem( sal_uInt16 which, const INetContentType eType ) : CntUnencodedStringItem( which, INetContentTypes::GetContentType( eType ) ), _eType( eType ) @@ -81,7 +81,7 @@ CntContentTypeItem::CntContentTypeItem( const CntContentTypeItem& rOrig ) //============================================================================ // virtual -USHORT CntContentTypeItem::GetVersion(USHORT) const +sal_uInt16 CntContentTypeItem::GetVersion(sal_uInt16) const { return 1; // because it uses SfxPoolItem::read/writeUnicodeString() } @@ -89,17 +89,17 @@ USHORT CntContentTypeItem::GetVersion(USHORT) const //---------------------------------------------------------------------------- // virtual SfxPoolItem* CntContentTypeItem::Create( SvStream& rStream, - USHORT nItemVersion ) const + sal_uInt16 nItemVersion ) const { // CntContentTypeItem used to be derived from CntStringItem, so take that // into account: UniString aValue; readUnicodeString(rStream, aValue, nItemVersion >= 1); - UINT32 nMagic = 0; + sal_uInt32 nMagic = 0; rStream >> nMagic; if (nMagic == CNTSTRINGITEM_STREAM_MAGIC) { - BOOL bEncrypted = FALSE; + sal_Bool bEncrypted = sal_False; rStream >> bEncrypted; DBG_ASSERT(!bEncrypted, "CntContentTypeItem::Create() reads encrypted data"); @@ -112,12 +112,12 @@ SfxPoolItem* CntContentTypeItem::Create( SvStream& rStream, //---------------------------------------------------------------------------- // virtual -SvStream & CntContentTypeItem::Store(SvStream & rStream, USHORT) const +SvStream & CntContentTypeItem::Store(SvStream & rStream, sal_uInt16) const { // CntContentTypeItem used to be derived from CntStringItem, so take that // into account: writeUnicodeString(rStream, GetValue()); - rStream << CNTSTRINGITEM_STREAM_MAGIC << BOOL(FALSE); + rStream << CNTSTRINGITEM_STREAM_MAGIC << sal_Bool(sal_False); return rStream; } @@ -224,7 +224,7 @@ void CntContentTypeItem::SetValue( const INetContentType eType ) //---------------------------------------------------------------------------- // virtual -bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const +bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= rtl::OUString(GetValue()); return true; @@ -232,7 +232,7 @@ bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const //---------------------------------------------------------------------------- // virtual -bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal,BYTE ) +bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8) { rtl::OUString aValue; if ( rVal >>= aValue ) diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx index 4d03130e03d3..e64f47ec2a3e 100644 --- a/svl/source/items/custritm.cxx +++ b/svl/source/items/custritm.cxx @@ -107,7 +107,7 @@ CntUnencodedStringItem::GetPresentation(SfxItemPresentation, SfxMapUnit, //============================================================================ // virtual -bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) +bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= rtl::OUString(m_aValue); @@ -117,7 +117,7 @@ bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) //============================================================================ // virtual bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, - BYTE) + sal_uInt8) { rtl::OUString aTheValue; if (rVal >>= aTheValue) diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx index 83b86418545a..e4c05f0abce0 100644 --- a/svl/source/items/dateitem.cxx +++ b/svl/source/items/dateitem.cxx @@ -57,7 +57,7 @@ TYPEINIT1(SfxDateTimeItem, SfxPoolItem); // ----------------------------------------------------------------------- -SfxDateTimeItem::SfxDateTimeItem( USHORT which ) : +SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which ) : SfxPoolItem( which ) { DBG_CTOR(SfxDateTimeItem, 0); @@ -65,7 +65,7 @@ SfxDateTimeItem::SfxDateTimeItem( USHORT which ) : // ----------------------------------------------------------------------- -SfxDateTimeItem::SfxDateTimeItem( USHORT which, const DateTime& rDT ) : +SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which, const DateTime& rDT ) : SfxPoolItem( which ), aDateTime( rDT ) @@ -110,7 +110,7 @@ int SfxDateTimeItem::Compare( const SfxPoolItem& rItem ) const // ----------------------------------------------------------------------- -SfxPoolItem* SfxDateTimeItem::Create( SvStream& rStream, USHORT ) const +SfxPoolItem* SfxDateTimeItem::Create( SvStream& rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxDateTimeItem, 0); sal_uInt32 nDate = 0; @@ -123,7 +123,7 @@ SfxPoolItem* SfxDateTimeItem::Create( SvStream& rStream, USHORT ) const // ----------------------------------------------------------------------- -SvStream& SfxDateTimeItem::Store( SvStream& rStream, USHORT ) const +SvStream& SfxDateTimeItem::Store( SvStream& rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxDateTimeItem, 0); rStream << aDateTime.GetDate(); @@ -176,7 +176,7 @@ SfxItemPresentation SfxDateTimeItem::GetPresentation //---------------------------------------------------------------------------- // virtual bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) + sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; com::sun::star::util::DateTime aValue; @@ -199,7 +199,7 @@ bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, //---------------------------------------------------------------------------- // virtual bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId ) const + sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; com::sun::star::util::DateTime aValue( aDateTime.Get100Sec(), @@ -220,11 +220,11 @@ bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, TYPEINIT1(SfxColumnDateTimeItem, SfxDateTimeItem); -SfxColumnDateTimeItem::SfxColumnDateTimeItem( USHORT which ) : +SfxColumnDateTimeItem::SfxColumnDateTimeItem( sal_uInt16 which ) : SfxDateTimeItem( which ) {} -SfxColumnDateTimeItem::SfxColumnDateTimeItem( USHORT which, const DateTime& rDT ) : +SfxColumnDateTimeItem::SfxColumnDateTimeItem( sal_uInt16 which, const DateTime& rDT ) : SfxDateTimeItem( which, rDT ) {} diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx index 4bf226a4d6b4..a151d430cd0d 100644 --- a/svl/source/items/flagitem.cxx +++ b/svl/source/items/flagitem.cxx @@ -37,7 +37,7 @@ DBG_NAME(SfxFlagItem) -USHORT nSfxFlagVal[16] = +sal_uInt16 nSfxFlagVal[16] = { 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, @@ -52,7 +52,7 @@ TYPEINIT1(SfxFlagItem, SfxPoolItem); // ----------------------------------------------------------------------- -SfxFlagItem::SfxFlagItem( USHORT nW, USHORT nV ) : +SfxFlagItem::SfxFlagItem( sal_uInt16 nW, sal_uInt16 nV ) : SfxPoolItem( nW ), nVal(nV) { @@ -61,7 +61,7 @@ SfxFlagItem::SfxFlagItem( USHORT nW, USHORT nV ) : // ----------------------------------------------------------------------- -SfxFlagItem::SfxFlagItem( USHORT nW, SvStream &rStream) : +SfxFlagItem::SfxFlagItem( sal_uInt16 nW, SvStream &rStream) : SfxPoolItem( nW ) { DBG_CTOR(SfxFlagItem, 0); @@ -79,7 +79,7 @@ SfxFlagItem::SfxFlagItem( const SfxFlagItem& rItem ) : // ----------------------------------------------------------------------- -SvStream& SfxFlagItem::Store(SvStream &rStream, USHORT) const +SvStream& SfxFlagItem::Store(SvStream &rStream, sal_uInt16) const { DBG_CHKTHIS(SfxFlagItem, 0); rStream << nVal; @@ -99,32 +99,32 @@ SfxItemPresentation SfxFlagItem::GetPresentation { DBG_CHKTHIS(SfxFlagItem, 0); rText.Erase(); - for ( BYTE nFlag = 0; nFlag < GetFlagCount(); ++nFlag ) + for ( sal_uInt8 nFlag = 0; nFlag < GetFlagCount(); ++nFlag ) rText += XubString::CreateFromInt32( GetFlag(nFlag) ); return SFX_ITEM_PRESENTATION_NAMELESS; } // ----------------------------------------------------------------------- -XubString SfxFlagItem::GetFlagText( BYTE ) const +XubString SfxFlagItem::GetFlagText( sal_uInt8 ) const { DBG_CHKTHIS(SfxFlagItem, 0); - DBG_WARNING( "calling GetValueText(USHORT) on SfxFlagItem -- overload!" ); + DBG_WARNING( "calling GetValueText(sal_uInt16) on SfxFlagItem -- overload!" ); return XubString(); } // ----------------------------------------------------------------------- -BYTE SfxFlagItem::GetFlagCount() const +sal_uInt8 SfxFlagItem::GetFlagCount() const { DBG_CHKTHIS(SfxFlagItem, 0); - DBG_WARNING( "calling GetValueText(USHORT) on SfxFlagItem -- overload!" ); + DBG_WARNING( "calling GetValueText(sal_uInt16) on SfxFlagItem -- overload!" ); return 0; } // ----------------------------------------------------------------------- -SfxPoolItem* SfxFlagItem::Create(SvStream &, USHORT) const +SfxPoolItem* SfxFlagItem::Create(SvStream &, sal_uInt16) const { DBG_CHKTHIS(SfxFlagItem, 0); DBG_WARNING( "calling Create() on SfxFlagItem -- overload!" ); @@ -142,7 +142,7 @@ int SfxFlagItem::operator==( const SfxPoolItem& rItem ) const // ----------------------------------------------------------------------- -void SfxFlagItem::SetFlag( BYTE nFlag, int bVal ) +void SfxFlagItem::SetFlag( sal_uInt8 nFlag, int bVal ) { if ( bVal ) nVal |= nSfxFlagVal[nFlag]; diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx index 2e4c53a9d3c3..aa36b0afa30c 100644 --- a/svl/source/items/globalnameitem.cxx +++ b/svl/source/items/globalnameitem.cxx @@ -53,7 +53,7 @@ SfxGlobalNameItem::SfxGlobalNameItem() // ----------------------------------------------------------------------- -SfxGlobalNameItem::SfxGlobalNameItem( USHORT nW, const SvGlobalName& rName ) +SfxGlobalNameItem::SfxGlobalNameItem( sal_uInt16 nW, const SvGlobalName& rName ) : SfxPoolItem( nW ), m_aName( rName ) { @@ -81,7 +81,7 @@ SfxPoolItem* SfxGlobalNameItem::Clone(SfxItemPool *) const //---------------------------------------------------------------------------- // virtual -bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) +bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Reference < com::sun::star::script::XTypeConverter > xConverter ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), @@ -104,7 +104,7 @@ bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) //---------------------------------------------------------------------------- // virtual -bool SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const +bool SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 ); void* pData = ( void* ) &m_aName.GetCLSID(); diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index 61917ffa63b5..f8d575b52175 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.cxx @@ -44,11 +44,11 @@ SfxIntegerListItem::SfxIntegerListItem() { } -SfxIntegerListItem::SfxIntegerListItem( USHORT which, const SvULongs& rList ) +SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const SvULongs& rList ) : SfxPoolItem( which ) { m_aList.realloc( rList.Count() ); - for ( USHORT n=0; n<rList.Count(); n++ ) + for ( sal_uInt16 n=0; n<rList.Count(); n++ ) m_aList[n] = rList[n]; } @@ -65,7 +65,7 @@ SfxIntegerListItem::~SfxIntegerListItem() int SfxIntegerListItem::operator==( const SfxPoolItem& rPoolItem ) const { if ( !rPoolItem.ISA( SfxIntegerListItem ) ) - return FALSE; + return sal_False; const SfxIntegerListItem rItem = (const SfxIntegerListItem&) rPoolItem; return rItem.m_aList == m_aList; @@ -76,7 +76,7 @@ SfxPoolItem* SfxIntegerListItem::Clone( SfxItemPool * ) const return new SfxIntegerListItem( *this ); } -bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, BYTE ) +bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { ::com::sun::star::uno::Reference < ::com::sun::star::script::XTypeConverter > xConverter ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), @@ -91,7 +91,7 @@ bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, BYTE return ( aNew >>= m_aList ); } -bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const +bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { rVal <<= m_aList; return true; @@ -100,7 +100,7 @@ bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) cons void SfxIntegerListItem::GetList( SvULongs& rList ) const { for ( sal_Int32 n=0; n<m_aList.getLength(); n++ ) - rList.Insert( m_aList[n], sal::static_int_cast< USHORT >(n) ); + rList.Insert( m_aList[n], sal::static_int_cast< sal_uInt16 >(n) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx index f689415f52e4..4daa24f2a442 100644 --- a/svl/source/items/imageitm.cxx +++ b/svl/source/items/imageitm.cxx @@ -38,27 +38,27 @@ struct SfxImageItem_Impl { String aURL; long nAngle; - BOOL bMirrored; + sal_Bool bMirrored; int operator == ( const SfxImageItem_Impl& rOther ) const { return nAngle == rOther.nAngle && bMirrored == rOther.bMirrored; } }; //--------------------------------------------------------- -SfxImageItem::SfxImageItem( USHORT which, UINT16 nImage ) +SfxImageItem::SfxImageItem( sal_uInt16 which, sal_uInt16 nImage ) : SfxInt16Item( which, nImage ) { pImp = new SfxImageItem_Impl; pImp->nAngle = 0; - pImp->bMirrored = FALSE; + pImp->bMirrored = sal_False; } -SfxImageItem::SfxImageItem( USHORT which, const String& rURL ) +SfxImageItem::SfxImageItem( sal_uInt16 which, const String& rURL ) : SfxInt16Item( which, 0 ) { pImp = new SfxImageItem_Impl; pImp->nAngle = 0; - pImp->bMirrored = FALSE; + pImp->bMirrored = sal_False; pImp->aURL = rURL; } @@ -88,7 +88,7 @@ int SfxImageItem::operator==( const SfxPoolItem& rItem ) const return( ((SfxImageItem&) rItem).GetValue() == GetValue() && (*pImp == *(((SfxImageItem&)rItem).pImp) ) ); } -bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const +bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq( 4 ); aSeq[0] = ::com::sun::star::uno::makeAny( GetValue() ); @@ -100,7 +100,7 @@ bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const return true; } -bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) +bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq; if (( rVal >>= aSeq ) && ( aSeq.getLength() == 4 )) @@ -129,12 +129,12 @@ long SfxImageItem::GetRotation() const return pImp->nAngle; } -void SfxImageItem::SetMirrored( BOOL bSet ) +void SfxImageItem::SetMirrored( sal_Bool bSet ) { pImp->bMirrored = bSet; } -BOOL SfxImageItem::IsMirrored() const +sal_Bool SfxImageItem::IsMirrored() const { return pImp->bMirrored; } diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx index 3c6f63abb638..85f9d309f435 100644 --- a/svl/source/items/intitem.cxx +++ b/svl/source/items/intitem.cxx @@ -45,11 +45,11 @@ TYPEINIT1_AUTOFACTORY(SfxByteItem, CntByteItem); //============================================================================ // virtual -SfxPoolItem * SfxByteItem::Create(SvStream & rStream, USHORT) const +SfxPoolItem * SfxByteItem::Create(SvStream & rStream, sal_uInt16) const { short nValue = 0; rStream >> nValue; - return new SfxByteItem(Which(), BYTE(nValue)); + return new SfxByteItem(Which(), sal_uInt8(nValue)); } //============================================================================ @@ -64,7 +64,7 @@ DBG_NAME(SfxInt16Item); TYPEINIT1_AUTOFACTORY(SfxInt16Item, SfxPoolItem); //============================================================================ -SfxInt16Item::SfxInt16Item(USHORT which, SvStream & rStream): +SfxInt16Item::SfxInt16Item(sal_uInt16 which, SvStream & rStream): SfxPoolItem(which) { DBG_CTOR(SfxInt16Item, 0); @@ -112,7 +112,7 @@ SfxItemPresentation SfxInt16Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const +bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int16 nValue = m_nValue; rVal <<= nValue; @@ -121,7 +121,7 @@ bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const //============================================================================ // virtual -bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, BYTE ) +bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 ) { sal_Int16 nValue = sal_Int16(); if (rVal >>= nValue) @@ -136,7 +136,7 @@ bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, BYTE ) //============================================================================ // virtual -SfxPoolItem * SfxInt16Item::Create(SvStream & rStream, USHORT) const +SfxPoolItem * SfxInt16Item::Create(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(SfxInt16Item, 0); return new SfxInt16Item(Which(), rStream); @@ -144,7 +144,7 @@ SfxPoolItem * SfxInt16Item::Create(SvStream & rStream, USHORT) const //============================================================================ // virtual -SvStream & SfxInt16Item::Store(SvStream & rStream, USHORT) const +SvStream & SfxInt16Item::Store(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(SfxInt16Item, 0); rStream << short(m_nValue); @@ -159,14 +159,14 @@ SfxPoolItem * SfxInt16Item::Clone(SfxItemPool *) const } //============================================================================ -INT16 SfxInt16Item::GetMin() const +sal_Int16 SfxInt16Item::GetMin() const { DBG_CHKTHIS(SfxInt16Item, 0); return -32768; } //============================================================================ -INT16 SfxInt16Item::GetMax() const +sal_Int16 SfxInt16Item::GetMax() const { DBG_CHKTHIS(SfxInt16Item, 0); return 32767; @@ -218,14 +218,14 @@ DBG_NAME(SfxMetricItem); TYPEINIT1_AUTOFACTORY(SfxMetricItem, SfxInt32Item); //============================================================================ -SfxMetricItem::SfxMetricItem(USHORT which, UINT32 nValue): +SfxMetricItem::SfxMetricItem(sal_uInt16 which, sal_uInt32 nValue): SfxInt32Item(which, nValue) { DBG_CTOR(SfxMetricItem, 0); } //============================================================================ -SfxMetricItem::SfxMetricItem(USHORT which, SvStream & rStream): +SfxMetricItem::SfxMetricItem(sal_uInt16 which, SvStream & rStream): SfxInt32Item(which, rStream) { DBG_CTOR(SfxMetricItem, 0); diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 942c4385776c..6d9346a3ac5c 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -37,14 +37,6 @@ #include <svl/brdcst.hxx> #include <svl/smplhint.hxx> #include "poolio.hxx" -#include <algorithm> - -// STATIC DATA ----------------------------------------------------------- - - -//======================================================================== - -SV_IMPL_PTRARR( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl* ); //======================================================================== @@ -63,7 +55,7 @@ void SfxItemPool::RemoveSfxItemPoolUser(SfxItemPoolUser& rOldUser) } } -const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( USHORT nWhich ) const +const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( sal_uInt16 nWhich ) const { DBG_CHKTHIS(SfxItemPool, 0); const SfxPoolItem* pRet; @@ -81,15 +73,15 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( USHORT nWhich ) const // ----------------------------------------------------------------------- -inline bool SfxItemPool::IsItemFlag_Impl( USHORT nPos, USHORT nFlag ) const +inline bool SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag ) const { - USHORT nItemFlag = pItemInfos[nPos]._nFlags; + sal_uInt16 nItemFlag = pItemInfos[nPos]._nFlags; return nFlag == (nItemFlag & nFlag); } // ----------------------------------------------------------------------- -bool SfxItemPool::IsItemFlag( USHORT nWhich, USHORT nFlag ) const +bool SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const { for ( const SfxItemPool *pPool = this; pPool; pPool = pPool->pSecondary ) { @@ -97,7 +89,7 @@ bool SfxItemPool::IsItemFlag( USHORT nWhich, USHORT nFlag ) const return pPool->IsItemFlag_Impl( pPool->GetIndex_Impl(nWhich), nFlag); } DBG_ASSERT( !IsWhich(nWhich), "unknown which-id" ); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -114,8 +106,8 @@ SfxItemPool::SfxItemPool ( UniString const & rName, /* Name des Pools zur Idetifikation im File-Format */ - USHORT nStartWhich, /* erste Which-Id des Pools */ - USHORT nEndWhich, /* letzte Which-Id des Pools */ + sal_uInt16 nStartWhich, /* erste Which-Id des Pools */ + sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */ #ifdef TF_POOLABLE const SfxItemInfo* pInfos, /* SID-Map und Item-Flags */ #endif @@ -123,7 +115,7 @@ SfxItemPool::SfxItemPool wird direkt vom Pool referenziert, jedoch kein Eigent"umer"ubergang */ #ifndef TF_POOLABLE - USHORT* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */ + sal_uInt16* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */ #endif bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ ) @@ -155,8 +147,8 @@ SfxItemPool::SfxItemPool [Querverweise] <SfxItemPool::SetDefaults(SfxItemPool**)> - <SfxItemPool::ReleaseDefaults(SfxPoolItem**,USHORT,BOOL)> - <SfxItemPool::ReldaseDefaults(BOOL)> + <SfxItemPool::ReleaseDefaults(SfxPoolItem**,sal_uInt16,sal_Bool)> + <SfxItemPool::ReldaseDefaults(sal_Bool)> */ : aName(rName), @@ -181,7 +173,7 @@ SfxItemPool::SfxItemPool pImp->eDefMetric = SFX_MAPUNIT_TWIP; pImp->nVersion = 0; - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; pImp->nLoadingVersion = 0; pImp->nInitRefCount = 1; pImp->nVerStart = nStart; @@ -202,10 +194,10 @@ SfxItemPool::SfxItemPool SfxItemPool::SfxItemPool ( const SfxItemPool& rPool, // von dieser Instanz kopieren - BOOL bCloneStaticDefaults /* TRUE + sal_Bool bCloneStaticDefaults /* sal_True statische Defaults kopieren - FALSE + sal_False statische Defaults "ubernehehmen */ ) @@ -240,7 +232,7 @@ SfxItemPool::SfxItemPool DBG_CTOR(SfxItemPool, 0); pImp->eDefMetric = rPool.pImp->eDefMetric; pImp->nVersion = rPool.pImp->nVersion; - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; pImp->nLoadingVersion = 0; pImp->nInitRefCount = 1; pImp->nVerStart = rPool.pImp->nVerStart; @@ -255,7 +247,7 @@ SfxItemPool::SfxItemPool if ( bCloneStaticDefaults ) { SfxPoolItem **ppDefaults = new SfxPoolItem*[nEnd-nStart+1]; - for ( USHORT n = 0; n <= nEnd - nStart; ++n ) + for ( sal_uInt16 n = 0; n <= nEnd - nStart; ++n ) { (*( ppDefaults + n )) = (*( rPool.ppStaticDefaults + n ))->Clone(this); (*( ppDefaults + n ))->SetKind( SFX_ITEMS_STATICDEFAULT ); @@ -267,20 +259,19 @@ SfxItemPool::SfxItemPool SetDefaults( rPool.ppStaticDefaults ); // Pool Defaults kopieren - for ( USHORT n = 0; n <= nEnd - nStart; ++n ) + for ( sal_uInt16 n = 0; n <= nEnd - nStart; ++n ) if ( (*( rPool.ppPoolDefaults + n )) ) { (*( ppPoolDefaults + n )) = (*( rPool.ppPoolDefaults + n ))->Clone(this); (*( ppPoolDefaults + n ))->SetKind( SFX_ITEMS_POOLDEFAULT ); } - // Version-Map kopieren - USHORT nVerCount = rPool.pImp->aVersions.Count(); - for ( USHORT nVer = 0; nVer < nVerCount; ++nVer ) + // Copy Version-Map + for ( size_t nVer = 0; nVer < rPool.pImp->aVersions.size(); ++nVer ) { - const SfxPoolVersion_Impl *pOld = rPool.pImp->aVersions.GetObject(nVer); - const SfxPoolVersion_Impl *pNew = new SfxPoolVersion_Impl( *pOld ); - pImp->aVersions.Insert( pNew, nVer ); + const SfxPoolVersion_ImplPtr pOld = rPool.pImp->aVersions[nVer]; + SfxPoolVersion_ImplPtr pNew = SfxPoolVersion_ImplPtr( new SfxPoolVersion_Impl( *pOld ) ); + pImp->aVersions.push_back( pNew ); } // Verkettung wiederherstellen @@ -303,7 +294,7 @@ void SfxItemPool::SetDefaults( SfxPoolItem **pDefaults ) DBG_ASSERT( (*ppStaticDefaults)->GetRefCount() == 0 || IsDefaultItem( (*ppStaticDefaults) ), "das sind keine statics" ); - for ( USHORT n = 0; n <= nEnd - nStart; ++n ) + for ( sal_uInt16 n = 0; n <= nEnd - nStart; ++n ) { SFX_ASSERT( (*( ppStaticDefaults + n ))->Which() == n + nStart, n + nStart, "static defaults not sorted" ); @@ -317,11 +308,11 @@ void SfxItemPool::SetDefaults( SfxPoolItem **pDefaults ) void SfxItemPool::ReleaseDefaults ( - BOOL bDelete /* TRUE + sal_Bool bDelete /* sal_True l"oscht sowohl das Array als auch die einzelnen statischen Defaults - FALSE + sal_False l"oscht weder das Array noch die einzelnen statischen Defaults */ ) @@ -340,7 +331,7 @@ void SfxItemPool::ReleaseDefaults ReleaseDefaults( ppStaticDefaults, nEnd - nStart + 1, bDelete ); // KSO (22.10.98): ppStaticDefaults zeigt auf geloeschten Speicher, - // wenn bDelete == TRUE. + // wenn bDelete == sal_True. if ( bDelete ) ppStaticDefaults = 0; } @@ -351,13 +342,13 @@ void SfxItemPool::ReleaseDefaults ( SfxPoolItem** pDefaults, /* freizugebende statische Defaults */ - USHORT nCount, /* Anzahl der statischen Defaults */ + sal_uInt16 nCount, /* Anzahl der statischen Defaults */ - BOOL bDelete /* TRUE + sal_Bool bDelete /* sal_True l"oscht sowohl das Array als auch die einzelnen statischen Defaults - FALSE + sal_False l"oscht weder das Array noch die einzelnen statischen Defaults */ ) @@ -375,7 +366,7 @@ void SfxItemPool::ReleaseDefaults { DBG_ASSERT( pDefaults, "erst wollen, dann nichts geben..." ); - for ( USHORT n = 0; n < nCount; ++n ) + for ( sal_uInt16 n = 0; n < nCount; ++n ) { SFX_ASSERT( IsStaticDefaultItem( *(pDefaults+n) ), n, "das ist kein static-default" ); @@ -439,13 +430,13 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) if ( pImp->ppPoolItems && pSecondary->pImp->ppPoolItems ) { // hat der master SetItems? - BOOL bHasSetItems = FALSE; - for ( USHORT i = 0; !bHasSetItems && i < nEnd-nStart; ++i ) + sal_Bool bHasSetItems = sal_False; + for ( sal_uInt16 i = 0; !bHasSetItems && i < nEnd-nStart; ++i ) bHasSetItems = ppStaticDefaults[i]->ISA(SfxSetItem); // abgehaengte Pools muessen leer sein - BOOL bOK = bHasSetItems; - for ( USHORT n = 0; + sal_Bool bOK = bHasSetItems; + for ( sal_uInt16 n = 0; bOK && n <= pSecondary->nEnd - pSecondary->nStart; ++n ) { @@ -453,13 +444,12 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) pSecondary->pImp->ppPoolItems + n; if ( *ppItemArr ) { - SfxPoolItem** ppHtArr = - (SfxPoolItem**)(*ppItemArr)->GetData(); - for( USHORT i = (*ppItemArr)->Count(); i; ++ppHtArr, --i ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for( size_t i = (*ppItemArr)->size(); i; ++ppHtArr, --i ) if ( !(*ppHtArr) ) { OSL_FAIL( "old secondary pool must be empty" ); - bOK = FALSE; + bOK = sal_False; break; } } @@ -485,7 +475,7 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) // ----------------------------------------------------------------------- -SfxMapUnit SfxItemPool::GetMetric( USHORT ) const +SfxMapUnit SfxItemPool::GetMetric( sal_uInt16 ) const { DBG_CHKTHIS(SfxItemPool, 0); @@ -564,7 +554,7 @@ void SfxItemPool::Delete() SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems; SfxPoolItem** ppDefaultItem = ppPoolDefaults; SfxPoolItem** ppStaticDefaultItem = ppStaticDefaults; - USHORT nArrCnt; + sal_uInt16 nArrCnt; //Erst die SetItems abraeumen HACK( "fuer Image, dort gibt es derzeit keine Statics - Bug" ) @@ -581,8 +571,8 @@ void SfxItemPool::Delete() { if ( *ppItemArr ) { - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -613,8 +603,8 @@ void SfxItemPool::Delete() { if ( *ppItemArr ) { - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -648,7 +638,7 @@ void SfxItemPool::Cleanup() SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems; SfxPoolItem** ppDefaultItem = ppPoolDefaults; SfxPoolItem** ppStaticDefaultItem = ppStaticDefaults; - USHORT nArrCnt; + sal_uInt16 nArrCnt; HACK( "fuer Image, dort gibt es derzeit keine Statics - Bug" ) if ( ppStaticDefaults ) //HACK fuer Image, dort gibt es keine Statics!! @@ -662,8 +652,8 @@ void SfxItemPool::Cleanup() ((*ppDefaultItem && (*ppDefaultItem)->ISA(SfxSetItem)) || (*ppStaticDefaultItem)->ISA(SfxSetItem)) ) { - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if ( *ppHtArr && !(*ppHtArr)->GetRefCount() ) { DELETEZ(*ppHtArr); @@ -680,8 +670,8 @@ void SfxItemPool::Cleanup() { if ( *ppItemArr ) { - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if ( *ppHtArr && !(*ppHtArr)->GetRefCount() ) DELETEZ( *ppHtArr ); } @@ -718,7 +708,7 @@ void SfxItemPool::SetPoolDefaultItem(const SfxPoolItem &rItem) * Resets the default of the given <Which-Id> back to the static default. * If a pool default exists it is removed. */ -void SfxItemPool::ResetPoolDefaultItem( USHORT nWhichId ) +void SfxItemPool::ResetPoolDefaultItem( sal_uInt16 nWhichId ) { DBG_CHKTHIS(SfxItemPool, 0); if ( IsInRange(nWhichId) ) @@ -741,7 +731,7 @@ void SfxItemPool::ResetPoolDefaultItem( USHORT nWhichId ) // ----------------------------------------------------------------------- -const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) +const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich ) { DBG_ASSERT( !rItem.ISA(SfxSetItem) || 0 != &((const SfxSetItem&)rItem).GetItemSet(), @@ -752,7 +742,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) nWhich = rItem.Which(); // richtigen Secondary-Pool finden - BOOL bSID = nWhich > SFX_WHICH_MAX; + sal_Bool bSID = nWhich > SFX_WHICH_MAX; if ( !bSID && !IsInRange(nWhich) ) { if ( pSecondary ) @@ -761,7 +751,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) } // SID oder nicht poolable (neue Definition)? - USHORT nIndex = bSID ? USHRT_MAX : GetIndex_Impl(nWhich); + sal_uInt16 nIndex = bSID ? USHRT_MAX : GetIndex_Impl(nWhich); if ( USHRT_MAX == nIndex || IsItemFlag_Impl( nIndex, SFX_ITEM_NOT_POOLABLE ) ) { @@ -781,15 +771,16 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) if( !*ppItemArr ) *ppItemArr = new SfxPoolItemArray_Impl; - SfxPoolItem **ppFree = 0; - SfxPoolItem** ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData(); + SfxPoolItemArrayBase_Impl::iterator ppFree; + sal_Bool ppFreeIsSet = sal_False; + SfxPoolItemArrayBase_Impl::iterator ppHtArray = (*ppItemArr)->begin(); if ( IsItemFlag_Impl( nIndex, SFX_ITEM_POOLABLE ) ) { // wenn es ueberhaupt gepoolt ist, koennte es schon drin sein if ( IsPooledItem(&rItem) ) { // 1. Schleife: teste ob der Pointer vorhanden ist. - for( USHORT n = (*ppItemArr)->Count(); n; ++ppHtArray, --n ) + for( size_t n = (*ppItemArr)->size(); n; ++ppHtArray, --n ) if( &rItem == (*ppHtArray) ) { AddRef( **ppHtArray ); @@ -798,8 +789,8 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) } // 2. Schleife: dann muessen eben die Attribute verglichen werden - USHORT n; - for ( n = (*ppItemArr)->Count(), ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData(); + size_t n; + for ( n = (*ppItemArr)->size(), ppHtArray = (*ppItemArr)->begin(); n; ++ppHtArray, --n ) { if ( *ppHtArray ) @@ -811,22 +802,26 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) } } else - if ( !ppFree ) + if ( ppFreeIsSet == sal_False ) + { ppFree = ppHtArray; + ppFreeIsSet = sal_True; + } } } else { // freien Platz suchen - SfxPoolItem** ppHtArr; - USHORT n, nCount = (*ppItemArr)->Count(); + SfxPoolItemArrayBase_Impl::iterator ppHtArr; + size_t n, nCount = (*ppItemArr)->size(); for ( n = (*ppItemArr)->nFirstFree, - ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData() + n; + ppHtArr = (*ppItemArr)->begin() + n; n < nCount; ++ppHtArr, ++n ) if ( !*ppHtArr ) { ppFree = ppHtArr; + ppFreeIsSet = sal_True; break; } @@ -852,9 +847,9 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich ) #endif #endif AddRef( *pNewItem, pImp->nInitRefCount ); - const SfxPoolItem* pTemp = pNewItem; - if ( !ppFree ) - (*ppItemArr)->Insert( pTemp, (*ppItemArr)->Count() ); + SfxPoolItem* pTemp = pNewItem; + if ( ppFreeIsSet == sal_False ) + (*ppItemArr)->push_back( pTemp ); else { DBG_ASSERT( *ppFree == 0, "using surrogate in use" ); @@ -877,8 +872,8 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) "wo kommt denn hier ein Pool-Default her" ); // richtigen Secondary-Pool finden - const USHORT nWhich = rItem.Which(); - BOOL bSID = nWhich > SFX_WHICH_MAX; + const sal_uInt16 nWhich = rItem.Which(); + sal_Bool bSID = nWhich > SFX_WHICH_MAX; if ( !bSID && !IsInRange(nWhich) ) { if ( pSecondary ) @@ -890,7 +885,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) } // SID oder nicht poolable (neue Definition)? - USHORT nIndex = bSID ? USHRT_MAX : GetIndex_Impl(nWhich); + sal_uInt16 nIndex = bSID ? USHRT_MAX : GetIndex_Impl(nWhich); if ( bSID || IsItemFlag_Impl( nIndex, SFX_ITEM_NOT_POOLABLE ) ) { SFX_ASSERT( USHRT_MAX != nIndex || @@ -914,8 +909,8 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) // Item im eigenen Pool suchen SfxPoolItemArray_Impl** ppItemArr = (pImp->ppPoolItems + nIndex); SFX_ASSERT( *ppItemArr, rItem.Which(), "removing Item not in Pool" ); - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for( USHORT n = (*ppItemArr)->Count(); n; ++ppHtArr, --n ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for( size_t n = (*ppItemArr)->size(); n; ++ppHtArr, --n ) if( *ppHtArr == &rItem ) { if ( (*ppHtArr)->GetRefCount() ) //! @@ -927,7 +922,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) } // ggf. kleinstmoegliche freie Position merken - USHORT nPos = (*ppItemArr)->Count() - n; + size_t nPos = (*ppItemArr)->size() - n; if ( (*ppItemArr)->nFirstFree > nPos ) (*ppItemArr)->nFirstFree = nPos; @@ -945,7 +940,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) // ----------------------------------------------------------------------- -const SfxPoolItem& SfxItemPool::GetDefaultItem( USHORT nWhich ) const +const SfxPoolItem& SfxItemPool::GetDefaultItem( sal_uInt16 nWhich ) const { DBG_CHKTHIS(SfxItemPool, 0); @@ -957,7 +952,7 @@ const SfxPoolItem& SfxItemPool::GetDefaultItem( USHORT nWhich ) const } DBG_ASSERT( ppStaticDefaults, "no defaults known - dont ask me for defaults" ); - USHORT nPos = GetIndex_Impl(nWhich); + sal_uInt16 nPos = GetIndex_Impl(nWhich); SfxPoolItem *pDefault = *(ppPoolDefaults + nPos); if ( pDefault ) return *pDefault; @@ -985,17 +980,17 @@ void SfxItemPool::FreezeIdRanges() // ----------------------------------------------------------------------- -void SfxItemPool::FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const +void SfxItemPool::FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const { DBG_CHKTHIS(SfxItemPool, 0); DBG_ASSERT( !_pPoolRanges, "GetFrozenRanges() would be faster!" ); const SfxItemPool *pPool; - USHORT nLevel = 0; + sal_uInt16 nLevel = 0; for( pPool = this; pPool; pPool = pPool->pSecondary ) ++nLevel; - pWhichRanges = new USHORT[ 2*nLevel + 1 ]; + pWhichRanges = new sal_uInt16[ 2*nLevel + 1 ]; nLevel = 0; for( pPool = this; pPool; pPool = pPool->pSecondary ) @@ -1008,24 +1003,24 @@ void SfxItemPool::FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const // ----------------------------------------------------------------------- -const SfxPoolItem *SfxItemPool::GetItem(USHORT nWhich, USHORT nOfst) const +const SfxPoolItem *SfxItemPool::GetItem2(sal_uInt16 nWhich, sal_uInt32 nOfst) const { DBG_CHKTHIS(SfxItemPool, 0); if ( !IsInRange(nWhich) ) { if ( pSecondary ) - return pSecondary->GetItem( nWhich, nOfst ); + return pSecondary->GetItem2( nWhich, nOfst ); SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" ); return 0; } // dflt-Attribut? - if ( nOfst == SFX_ITEMS_STATICDEFAULT ) + if ( nOfst == SFX_ITEMS_DEFAULT ) return *(ppStaticDefaults + GetIndex_Impl(nWhich)); SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(nWhich)); - if( pItemArr && nOfst < pItemArr->Count() ) + if( pItemArr && nOfst < pItemArr->size() ) return (*pItemArr)[nOfst]; return 0; @@ -1033,41 +1028,41 @@ const SfxPoolItem *SfxItemPool::GetItem(USHORT nWhich, USHORT nOfst) const // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetItemCount(USHORT nWhich) const +sal_uInt32 SfxItemPool::GetItemCount2(sal_uInt16 nWhich) const { DBG_CHKTHIS(SfxItemPool, 0); if ( !IsInRange(nWhich) ) { if ( pSecondary ) - return pSecondary->GetItemCount( nWhich ); + return pSecondary->GetItemCount2( nWhich ); SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" ); return 0; } SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(nWhich)); if ( pItemArr ) - return pItemArr->Count(); + return pItemArr->size(); return 0; } // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetWhich( USHORT nSlotId, BOOL bDeep ) const +sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const { if ( !IsSlot(nSlotId) ) return nSlotId; #ifdef TF_POOLABLE - USHORT nCount = nEnd - nStart + 1; - for ( USHORT nOfs = 0; nOfs < nCount; ++nOfs ) + sal_uInt16 nCount = nEnd - nStart + 1; + for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs ) if ( pItemInfos[nOfs]._nSID == nSlotId ) return nOfs + nStart; #else if ( pSlotIds ) { - USHORT nCount = nEnd - nStart + 1; - for ( USHORT nOfs = 0; nOfs < nCount; ++nOfs ) + sal_uInt16 nCount = nEnd - nStart + 1; + for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs ) if ( pSlotIds[nOfs] == nSlotId ) return nOfs + nStart; } @@ -1079,7 +1074,7 @@ USHORT SfxItemPool::GetWhich( USHORT nSlotId, BOOL bDeep ) const // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetSlotId( USHORT nWhich, BOOL bDeep ) const +sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const { if ( !IsWhich(nWhich) ) return nWhich; @@ -1093,7 +1088,7 @@ USHORT SfxItemPool::GetSlotId( USHORT nWhich, BOOL bDeep ) const } #ifdef TF_POOLABLE - USHORT nSID = pItemInfos[nWhich - nStart]._nSID; + sal_uInt16 nSID = pItemInfos[nWhich - nStart]._nSID; return nSID ? nSID : nWhich; #else else if ( pSlotIds ) @@ -1104,21 +1099,21 @@ USHORT SfxItemPool::GetSlotId( USHORT nWhich, BOOL bDeep ) const // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetTrueWhich( USHORT nSlotId, BOOL bDeep ) const +sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const { if ( !IsSlot(nSlotId) ) return 0; #ifdef TF_POOLABLE - USHORT nCount = nEnd - nStart + 1; - for ( USHORT nOfs = 0; nOfs < nCount; ++nOfs ) + sal_uInt16 nCount = nEnd - nStart + 1; + for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs ) if ( pItemInfos[nOfs]._nSID == nSlotId ) return nOfs + nStart; #else if ( pSlotIds ) { - USHORT nCount = nEnd - nStart + 1; - for ( USHORT nOfs = 0; nOfs < nCount; ++nOfs ) + sal_uInt16 nCount = nEnd - nStart + 1; + for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs ) if ( pSlotIds[nOfs] == nSlotId ) return nOfs + nStart; } @@ -1130,7 +1125,7 @@ USHORT SfxItemPool::GetTrueWhich( USHORT nSlotId, BOOL bDeep ) const // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetTrueSlotId( USHORT nWhich, BOOL bDeep ) const +sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const { if ( !IsWhich(nWhich) ) return 0; @@ -1152,7 +1147,7 @@ USHORT SfxItemPool::GetTrueSlotId( USHORT nWhich, BOOL bDeep ) const #endif } // ----------------------------------------------------------------------- -void SfxItemPool::SetFileFormatVersion( USHORT nFileFormatVersion ) +void SfxItemPool::SetFileFormatVersion( sal_uInt16 nFileFormatVersion ) /* [Description] diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index ac2e2d4ef322..95ae5f4e71ec 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -185,9 +185,9 @@ SfxItemPropertySet::~SfxItemPropertySet() { } -BOOL SfxItemPropertySet::FillItem(SfxItemSet&, USHORT, BOOL) const +sal_Bool SfxItemPropertySet::FillItem(SfxItemSet&, sal_uInt16, sal_Bool) const { - return FALSE; + return sal_False; } void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEntry, @@ -196,7 +196,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn { // get the SfxPoolItem const SfxPoolItem* pItem = 0; - SfxItemState eState = rSet.GetItemState( rEntry.nWID, TRUE, &pItem ); + SfxItemState eState = rSet.GetItemState( rEntry.nWID, sal_True, &pItem ); if(SFX_ITEM_SET != eState && SFX_WHICH_MAX > rEntry.nWID ) pItem = &rSet.GetPool()->GetDefaultItem(rEntry.nWID); // return item values as uno::Any @@ -207,7 +207,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn else { SfxItemSet aSet(*rSet.GetPool(), rEntry.nWID, rEntry.nWID); - if(FillItem(aSet, rEntry.nWID, TRUE)) + if(FillItem(aSet, rEntry.nWID, sal_True)) { const SfxPoolItem& rItem = aSet.Get(rEntry.nWID); rItem.QueryValue( rAny, rEntry.nMemberId ); @@ -221,7 +221,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn if( rEntry.pType && TypeClass_ENUM == rEntry.pType->getTypeClass() && rAny.getValueTypeClass() == TypeClass_LONG ) { - INT32 nTmp = *(INT32*)rAny.getValue(); + sal_Int32 nTmp = *(sal_Int32*)rAny.getValue(); rAny.setValue( &nTmp, *rEntry.pType ); } } @@ -255,14 +255,14 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEn // get the SfxPoolItem const SfxPoolItem* pItem = 0; SfxPoolItem *pNewItem = 0; - SfxItemState eState = rSet.GetItemState( rEntry.nWID, TRUE, &pItem ); + SfxItemState eState = rSet.GetItemState( rEntry.nWID, sal_True, &pItem ); if(SFX_ITEM_SET != eState && SFX_WHICH_MAX > rEntry.nWID ) pItem = &rSet.GetPool()->GetDefaultItem(rEntry.nWID); //maybe there's another way to find an Item if(eState < SFX_ITEM_DEFAULT) { SfxItemSet aSet(*rSet.GetPool(), rEntry.nWID, rEntry.nWID); - if(FillItem(aSet, rEntry.nWID, FALSE)) + if(FillItem(aSet, rEntry.nWID, sal_False)) { const SfxPoolItem &rItem = aSet.Get(rEntry.nWID); pNewItem = rItem.Clone(); @@ -304,10 +304,10 @@ PropertyState SfxItemPropertySet::getPropertyState(const SfxItemPropertySimpleEn throw() { PropertyState eRet = PropertyState_DIRECT_VALUE; - USHORT nWhich = rEntry.nWID; + sal_uInt16 nWhich = rEntry.nWID; // item state holen - SfxItemState eState = rSet.GetItemState( nWhich, FALSE ); + SfxItemState eState = rSet.GetItemState( nWhich, sal_False ); // item-Wert als UnoAny zurueckgeben if(eState == SFX_ITEM_DEFAULT) eRet = PropertyState_DEFAULT_VALUE; @@ -327,11 +327,11 @@ PropertyState SfxItemPropertySet::getPropertyState( { throw UnknownPropertyException(); } - USHORT nWhich = pEntry->nWID; + sal_uInt16 nWhich = pEntry->nWID; // item holen const SfxPoolItem* pItem = 0; - SfxItemState eState = rSet.GetItemState( nWhich, FALSE, &pItem ); + SfxItemState eState = rSet.GetItemState( nWhich, sal_False, &pItem ); if(!pItem && nWhich != rSet.GetPool()->GetSlotId(nWhich)) pItem = &rSet.GetPool()->GetDefaultItem(nWhich); // item-Wert als UnoAny zurueckgeben diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index c90560891588..aab2fdcfbaaf 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -32,7 +32,6 @@ #include <string.h> #include <cstdarg> - #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS @@ -40,7 +39,7 @@ #include <svl/itemset.hxx> #include <svl/itempool.hxx> #include <svl/itemiter.hxx> -#include "whiter.hxx" +#include <svl/whiter.hxx> #include <svl/nranges.hxx> #include "whassert.hxx" @@ -49,16 +48,16 @@ // STATIC DATA ----------------------------------------------------------- -static const USHORT nInitCount = 10; // einzelne USHORTs => 5 Paare ohne '0' +static const sal_uInt16 nInitCount = 10; // einzelne USHORTs => 5 Paare ohne '0' #ifdef DBG_UTIL -static ULONG nRangesCopyCount = 0; // wie oft wurden Ranges kopiert +static sal_uLong nRangesCopyCount = 0; // wie oft wurden Ranges kopiert #endif DBG_NAME(SfxItemSet) //======================================================================== -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SvNums SvUShorts #define SfxNumRanges SfxUShortRanges #include "nranges.cxx" @@ -66,7 +65,7 @@ DBG_NAME(SfxItemSet) #undef SvNums #undef SfxNumRanges -#define NUMTYPE ULONG +#define NUMTYPE sal_uLong #define SvNums SvULongs #define SfxNumRanges SfxULongRanges #include "nranges.cxx" @@ -83,8 +82,8 @@ const sal_Char *DbgCheckItemSet( const void* pVoid ) { const SfxItemSet *pSet = (const SfxItemSet*) pVoid; SfxWhichIter aIter( *pSet ); - USHORT nCount = 0, n = 0; - for ( USHORT nWh = aIter.FirstWhich(); nWh; nWh = aIter.NextWhich(), ++n ) + sal_uInt16 nCount = 0, n = 0; + for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh; nWh = aIter.NextWhich(), ++n ) { const SfxPoolItem *pItem = pSet->_aItems[n]; if ( pItem ) @@ -114,12 +113,12 @@ SfxItemSet::SfxItemSet SfxItemPool& rPool, /* der Pool, in dem die SfxPoolItems, welche in dieses SfxItemSet gelangen, aufgenommen werden sollen */ - BOOL + sal_Bool #ifdef DBG_UTIL #ifdef SFX_ITEMSET_NO_DEFAULT_CTOR bTotalRanges /* komplette Pool-Ranges uebernehmen, - muss auf TRUE gesetzt werden */ + muss auf sal_True gesetzt werden */ #endif #endif ) @@ -151,19 +150,19 @@ SfxItemSet::SfxItemSet #endif #endif - _pWhichRanges = (USHORT*) _pPool->GetFrozenIdRanges(); + _pWhichRanges = (sal_uInt16*) _pPool->GetFrozenIdRanges(); DBG_ASSERT( _pWhichRanges, "don't create ItemSets with full range before FreezeIdRanges()" ); if ( !_pWhichRanges ) _pPool->FillItemIdRanges_Impl( _pWhichRanges ); - const USHORT nSize = TotalCount(); + const sal_uInt16 nSize = TotalCount(); _aItems = new const SfxPoolItem* [ nSize ]; memset( (void*) _aItems, 0, nSize * sizeof( SfxPoolItem* ) ); } // ----------------------------------------------------------------------- -SfxItemSet::SfxItemSet( SfxItemPool& rPool, USHORT nWhich1, USHORT nWhich2 ): +SfxItemSet::SfxItemSet( SfxItemPool& rPool, sal_uInt16 nWhich1, sal_uInt16 nWhich2 ): _pPool( &rPool ), _pParent( 0 ), _nCount( 0 ) @@ -178,25 +177,25 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, USHORT nWhich1, USHORT nWhich2 ): // ----------------------------------------------------------------------- -void SfxItemSet::InitRanges_Impl(USHORT nWh1, USHORT nWh2) +void SfxItemSet::InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2) { DBG_CHKTHIS(SfxItemSet, 0); - _pWhichRanges = new USHORT[ 3 ]; + _pWhichRanges = new sal_uInt16[ 3 ]; *(_pWhichRanges+0) = nWh1; *(_pWhichRanges+1) = nWh2; *(_pWhichRanges+2) = 0; - const USHORT nRg = nWh2 - nWh1 + 1; + const sal_uInt16 nRg = nWh2 - nWh1 + 1; _aItems = new const SfxPoolItem* [ nRg ]; memset( (void*) _aItems, 0, nRg * sizeof( SfxPoolItem* ) ); } // ----------------------------------------------------------------------- -void SfxItemSet::InitRanges_Impl(va_list pArgs, USHORT nWh1, USHORT nWh2, USHORT nNull) +void SfxItemSet::InitRanges_Impl(va_list pArgs, sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull) { DBG_CHKTHIS(SfxItemSet, 0); - USHORT nSize = InitializeRanges_Impl( _pWhichRanges, pArgs, nWh1, nWh2, nNull ); + sal_uInt16 nSize = InitializeRanges_Impl( _pWhichRanges, pArgs, nWh1, nWh2, nNull ); _aItems = new const SfxPoolItem* [ nSize ]; memset( (void*) _aItems, 0, sizeof( SfxPoolItem* ) * nSize ); } @@ -217,27 +216,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; @@ -248,14 +247,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), @@ -283,8 +282,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; @@ -295,7 +294,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 @@ -316,8 +315,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); } // ----------------------------------------------------------------------- @@ -329,11 +328,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() ) @@ -363,7 +362,7 @@ SfxItemSet::~SfxItemSet() // ----------------------------------------------------------------------- -USHORT SfxItemSet::ClearItem( USHORT nWhich ) +sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich ) // einzelnes Item oder alle Items (nWhich==0) l"oschen @@ -372,12 +371,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? @@ -397,7 +396,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 ); @@ -419,7 +418,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 ) @@ -435,7 +434,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 ); @@ -463,15 +462,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; @@ -479,7 +478,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; @@ -502,8 +501,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); @@ -513,7 +512,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 ) @@ -559,7 +558,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) || @@ -568,7 +567,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) ) @@ -620,7 +619,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 ); } @@ -639,17 +638,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 ) ) @@ -701,10 +700,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 ) ) @@ -759,7 +758,7 @@ void SfxItemSet::PutExtended // ----------------------------------------------------------------------- -void SfxItemSet::MergeRange( USHORT nFrom, USHORT nTo ) +void SfxItemSet::MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo ) /** <H3>Description</H3> Expands the ranges of settable items by 'nFrom' to 'nTo'. Keeps state of @@ -767,8 +766,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 @@ -779,7 +778,7 @@ void SfxItemSet::MergeRange( USHORT nFrom, USHORT nTo ) // ----------------------------------------------------------------------- -void SfxItemSet::SetRanges( const USHORT *pNewRanges ) +void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges ) /** <H3>Description</H3> @@ -791,8 +790,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 ) @@ -801,20 +800,20 @@ void SfxItemSet::SetRanges( const USHORT *pNewRanges ) } // create new item-array (by iterating through all new ranges) - ULONG nSize = Capacity_Impl(pNewRanges); + sal_uLong nSize = Capacity_Impl(pNewRanges); SfxItemArray aNewItems = new const SfxPoolItem* [ nSize ]; - USHORT n = 0, nNewCount = 0; + sal_uInt16 n = 0, nNewCount = 0; if ( _nCount == 0 ) memset( aNewItems, 0, nSize * sizeof( SfxPoolItem* ) ); else { - for ( const USHORT *pRange = pNewRanges; *pRange; pRange += 2 ) + for ( const sal_uInt16 *pRange = pNewRanges; *pRange; pRange += 2 ) { // iterate through all ids in the range - for ( USHORT nWID = *pRange; nWID <= pRange[1]; ++nWID, ++n ) + for ( sal_uInt16 nWID = *pRange; nWID <= pRange[1]; ++nWID, ++n ) { // direct move of pointer (not via pool) - SfxItemState eState = GetItemState( nWID, FALSE, aNewItems+n ); + SfxItemState eState = GetItemState( nWID, sal_False, aNewItems+n ); if ( SFX_ITEM_SET == eState ) { // increment new item count and possibly increment ref count @@ -840,8 +839,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() ) @@ -857,15 +856,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 ); } } @@ -876,12 +875,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 */ ) @@ -894,16 +893,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 @@ -914,23 +913,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; } @@ -939,8 +938,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 @@ -957,9 +956,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 && @@ -983,7 +982,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: @@ -993,7 +992,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) ) @@ -1049,11 +1048,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; @@ -1080,16 +1079,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 ) @@ -1109,11 +1108,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 ); @@ -1128,12 +1127,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; @@ -1151,16 +1150,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 ) @@ -1180,11 +1179,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 ); @@ -1199,12 +1198,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; @@ -1224,79 +1223,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" ); @@ -1309,11 +1308,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 ) @@ -1329,7 +1328,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; } @@ -1340,8 +1339,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; } @@ -1361,23 +1360,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 ) @@ -1397,11 +1396,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 @@ -1419,12 +1418,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? @@ -1441,11 +1440,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) ) @@ -1475,11 +1474,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; @@ -1488,7 +1487,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; } @@ -1503,16 +1502,16 @@ SvStream &SfxItemSet::Store /* [Beschreibung] Speichert die <SfxItemSet>-Instanz in den angegebenen Stream. Dabei - werden die Surrorage der gesetzten <SfxPoolItem>s bzw. ('bDirect==TRUE') + werden die Surrorage der gesetzten <SfxPoolItem>s bzw. ('bDirect==sal_True') die gesetzten Items selbst wie folgt im Stream abgelegt: - USHORT (Count) Anzahl der gesetzten Items + sal_uInt16 (Count) Anzahl der gesetzten Items Count* _pPool->StoreItem() siehe <SfxItemPool::StoreItem()const> [Querverweise] - <SfxItemSet::Load(SvStream&,BOOL,const SfxItemPool*)> + <SfxItemSet::Load(SvStream&,sal_Bool,const SfxItemPool*)> */ { @@ -1521,14 +1520,14 @@ SvStream &SfxItemSet::Store DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" ); // Position des Counts merken, um ggf. zu korrigieren - ULONG nCountPos = rStream.Tell(); + sal_uLong nCountPos = rStream.Tell(); rStream << _nCount; // wenn nichts zu speichern ist, auch keinen ItemIter aufsetzen! if ( _nCount ) { // mitz"ahlen wieviel Items tats"achlich gespeichert werden - USHORT nWrittenCount = 0; // Anzahl in 'rStream' gestreamter Items + sal_uInt16 nWrittenCount = 0; // Anzahl in 'rStream' gestreamter Items // "uber alle gesetzten Items iterieren SfxItemIter aIter(*this); @@ -1548,7 +1547,7 @@ SvStream &SfxItemSet::Store if ( nWrittenCount != _nCount ) { // tats"achlichen Count im Stream ablegen - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); rStream.Seek( nCountPos ); rStream << nWrittenCount; rStream.Seek( nPos ); @@ -1568,7 +1567,7 @@ SvStream &SfxItemSet::Load Items werden direkt aus dem Stream gelesen, nicht "uber Surrogate - FALSE (default) + sal_False (default) Items werden "uber Surrogate gelesen */ const SfxItemPool* pRefPool /* Pool, der die Surrogate aufl"osen kann @@ -1584,7 +1583,7 @@ SvStream &SfxItemSet::Load [Querverweise] - <SfxItemSet::Store(Stream&,BOOL)const> + <SfxItemSet::Store(Stream&,sal_Bool)const> */ { @@ -1597,9 +1596,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 = @@ -1609,9 +1608,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? @@ -1646,48 +1645,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 @@ -1696,18 +1695,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 ) @@ -1716,11 +1715,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(); } @@ -1739,8 +1738,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 @@ -1755,7 +1754,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 @@ -1771,18 +1770,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) { @@ -1790,8 +1789,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) ); } @@ -1823,12 +1822,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. @@ -1838,13 +1837,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; @@ -1854,7 +1853,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 @@ -1892,17 +1891,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? @@ -1985,15 +1984,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; } @@ -2021,7 +2020,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 ); @@ -2030,7 +2029,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 ); @@ -2038,7 +2037,7 @@ void SfxItemSet::DisableItem(USHORT nWhich) // ----------------------------------------------------------------------- -SfxItemSet *SfxAllItemSet::Clone(BOOL bItems, SfxItemPool *pToPool ) const +SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const { DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet); if ( pToPool && pToPool != _pPool ) diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx index 93aa8fe7a2aa..872420a35322 100644 --- a/svl/source/items/lckbitem.cxx +++ b/svl/source/items/lckbitem.cxx @@ -51,7 +51,7 @@ SfxLockBytesItem::SfxLockBytesItem() // ----------------------------------------------------------------------- -SfxLockBytesItem::SfxLockBytesItem( USHORT nW, SvLockBytes *pLockBytes ) +SfxLockBytesItem::SfxLockBytesItem( sal_uInt16 nW, SvLockBytes *pLockBytes ) : SfxPoolItem( nW ), _xVal( pLockBytes ) { @@ -59,11 +59,11 @@ SfxLockBytesItem::SfxLockBytesItem( USHORT nW, SvLockBytes *pLockBytes ) // ----------------------------------------------------------------------- -SfxLockBytesItem::SfxLockBytesItem( USHORT nW, SvStream &rStream ) +SfxLockBytesItem::SfxLockBytesItem( sal_uInt16 nW, SvStream &rStream ) : SfxPoolItem( nW ) { rStream.Seek( 0L ); - _xVal = new SvLockBytes( new SvCacheStream(), TRUE ); + _xVal = new SvLockBytes( new SvCacheStream(), sal_True ); SvStream aLockBytesStream( _xVal ); rStream >> aLockBytesStream; @@ -101,16 +101,16 @@ SfxPoolItem* SfxLockBytesItem::Clone(SfxItemPool *) const #define MAX_BUF 32000 -SfxPoolItem* SfxLockBytesItem::Create( SvStream &rStream, USHORT ) const +SfxPoolItem* SfxLockBytesItem::Create( SvStream &rStream, sal_uInt16 ) const { sal_uInt32 nSize = 0; - ULONG nActRead = 0; + sal_uLong nActRead = 0; sal_Char cTmpBuf[MAX_BUF]; SvMemoryStream aNewStream; rStream >> nSize; do { - ULONG nToRead; + sal_uLong nToRead; if( (nSize - nActRead) > MAX_BUF ) nToRead = MAX_BUF; else @@ -124,7 +124,7 @@ SfxPoolItem* SfxLockBytesItem::Create( SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- -SvStream& SfxLockBytesItem::Store(SvStream &rStream, USHORT ) const +SvStream& SfxLockBytesItem::Store(SvStream &rStream, sal_uInt16 ) const { SvStream aLockBytesStream( _xVal ); sal_uInt32 nSize = aLockBytesStream.Seek( STREAM_SEEK_TO_END ); @@ -138,7 +138,7 @@ SvStream& SfxLockBytesItem::Store(SvStream &rStream, USHORT ) const //---------------------------------------------------------------------------- // virtual -bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) +bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Sequence< sal_Int8 > aSeq; if ( rVal >>= aSeq ) @@ -149,7 +149,7 @@ bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) pStream->Write( (void*)aSeq.getConstArray(), aSeq.getLength() ); pStream->Seek(0); - _xVal = new SvLockBytes( pStream, TRUE ); + _xVal = new SvLockBytes( pStream, sal_True ); } else _xVal = NULL; @@ -163,7 +163,7 @@ bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) //---------------------------------------------------------------------------- // virtual -bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const +bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { if ( _xVal.Is() ) { @@ -175,7 +175,7 @@ bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const else return false; - ULONG nRead = 0; + sal_uLong nRead = 0; com::sun::star::uno::Sequence< sal_Int8 > aSeq( nLen ); _xVal->ReadAt( 0, aSeq.getArray(), nLen, &nRead ); diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index bd0cfd77125d..b9c6ddc79cec 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -119,7 +119,7 @@ SvxMacroTableDtor& SvxMacroTableDtor::operator=( const SvxMacroTableDtor& rTbl ) } -SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, USHORT nVersion ) +SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, sal_uInt16 nVersion ) { if( SVX_MACROTBL_VERSION40 <= nVersion ) rStrm >> nVersion; @@ -128,7 +128,7 @@ SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, USHORT nVersion ) for( short i = 0; i < nMacro; ++i ) { - USHORT nCurKey, eType = STARBASIC; + sal_uInt16 nCurKey, eType = STARBASIC; String aLibName, aMacName; rStrm >> nCurKey; SfxPoolItem::readByteString(rStrm, aLibName); @@ -154,14 +154,14 @@ SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, USHORT nVersion ) SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const { - USHORT nVersion = SOFFICE_FILEFORMAT_31 == rStream.GetVersion() + sal_uInt16 nVersion = SOFFICE_FILEFORMAT_31 == rStream.GetVersion() ? SVX_MACROTBL_VERSION31 : SVX_MACROTBL_AKTVERSION; if( SVX_MACROTBL_VERSION40 <= nVersion ) rStream << nVersion; - rStream << (USHORT)Count(); + rStream << (sal_uInt16)Count(); SvxMacro* pMac = ((SvxMacroTableDtor*)this)->First(); while( pMac && rStream.GetError() == SVSTREAM_OK ) @@ -171,7 +171,7 @@ SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const SfxPoolItem::writeByteString(rStream, pMac->GetMacName()); if( SVX_MACROTBL_VERSION40 <= nVersion ) - rStream << (USHORT)pMac->GetScriptType(); + rStream << (sal_uInt16)pMac->GetScriptType(); pMac = ((SvxMacroTableDtor*)this)->Next(); } return rStream; @@ -201,20 +201,20 @@ int SvxMacroItem::operator==( const SfxPoolItem& rAttr ) const // Anzahl unterschiedlich => auf jeden Fall ungleich if ( rOwn.Count() != rOther.Count() ) - return FALSE; + return sal_False; // einzeln verleichen; wegen Performance ist die Reihenfolge wichtig - for ( USHORT nNo = 0; nNo < rOwn.Count(); ++nNo ) + for ( sal_uInt16 nNo = 0; nNo < rOwn.Count(); ++nNo ) { const SvxMacro *pOwnMac = rOwn.GetObject(nNo); const SvxMacro *pOtherMac = rOther.GetObject(nNo); if ( rOwn.GetKey(pOwnMac) != rOther.GetKey(pOtherMac) || pOwnMac->GetLibName() != pOtherMac->GetLibName() || pOwnMac->GetMacName() != pOtherMac->GetMacName() ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -255,14 +255,14 @@ SfxItemPresentation SvxMacroItem::GetPresentation // ----------------------------------------------------------------------- -SvStream& SvxMacroItem::Store( SvStream& rStrm , USHORT ) const +SvStream& SvxMacroItem::Store( SvStream& rStrm , sal_uInt16 ) const { return aMacroTable.Write( rStrm ); } // ----------------------------------------------------------------------- -SfxPoolItem* SvxMacroItem::Create( SvStream& rStrm, USHORT nVersion ) const +SfxPoolItem* SvxMacroItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) const { SvxMacroItem* pAttr = new SvxMacroItem( Which() ); pAttr->aMacroTable.Read( rStrm, nVersion ); @@ -271,7 +271,7 @@ SfxPoolItem* SvxMacroItem::Create( SvStream& rStrm, USHORT nVersion ) const // ----------------------------------------------------------------------- -void SvxMacroItem::SetMacro( USHORT nEvent, const SvxMacro& rMacro ) +void SvxMacroItem::SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro ) { SvxMacro *pMacro; if ( 0 != (pMacro=aMacroTable.Get(nEvent)) ) @@ -285,7 +285,7 @@ void SvxMacroItem::SetMacro( USHORT nEvent, const SvxMacro& rMacro ) // ----------------------------------------------------------------------- -USHORT SvxMacroItem::GetVersion( USHORT nFileFormatVersion ) const +sal_uInt16 SvxMacroItem::GetVersion( sal_uInt16 nFileFormatVersion ) const { return SOFFICE_FILEFORMAT_31 == nFileFormatVersion ? 0 : aMacroTable.GetVersion(); diff --git a/svl/source/items/makefile.mk b/svl/source/items/makefile.mk deleted file mode 100644 index da602391239a..000000000000 --- a/svl/source/items/makefile.mk +++ /dev/null @@ -1,84 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=svl -TARGET=items -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES=\ - $(SLO)$/aeitem.obj \ - $(SLO)$/cenumitm.obj \ - $(SLO)$/cintitem.obj \ - $(SLO)$/cntwall.obj \ - $(SLO)$/ctypeitm.obj \ - $(SLO)$/custritm.obj \ - $(SLO)$/dateitem.obj \ - $(SLO)$/eitem.obj \ - $(SLO)$/flagitem.obj \ - $(SLO)$/globalnameitem.obj \ - $(SLO)$/ilstitem.obj \ - $(SLO)$/imageitm.obj \ - $(SLO)$/intitem.obj \ - $(SLO)$/itemiter.obj \ - $(SLO)$/itempool.obj \ - $(SLO)$/itemprop.obj \ - $(SLO)$/itemset.obj \ - $(SLO)$/lckbitem.obj \ - $(SLO)$/macitem.obj \ - $(SLO)$/poolcach.obj \ - $(SLO)$/poolio.obj \ - $(SLO)$/poolitem.obj \ - $(SLO)$/ptitem.obj \ - $(SLO)$/rectitem.obj \ - $(SLO)$/rngitem.obj \ - $(SLO)$/sfontitm.obj \ - $(SLO)$/sitem.obj \ - $(SLO)$/slstitm.obj \ - $(SLO)$/srchitem.obj \ - $(SLO)$/stritem.obj \ - $(SLO)$/style.obj \ - $(SLO)$/stylepool.obj \ - $(SLO)$/szitem.obj \ - $(SLO)$/visitem.obj \ - $(SLO)$/whiter.obj - -SRS1NAME=$(TARGET) -SRC1FILES=\ - cstitem.src - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx index c4cbd4fdb865..db0dc169c9dc 100644 --- a/svl/source/items/nranges.cxx +++ b/svl/source/items/nranges.cxx @@ -64,7 +64,7 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *&rpRanges, va_list pArgs, /** <H3>Description</H3> - Creates an USHORT-ranges-array in 'rpRanges' using 'nWh1' and 'nWh2' as + Creates an sal_uInt16-ranges-array in 'rpRanges' using 'nWh1' and 'nWh2' as first range, 'nNull' as terminator or start of 2nd range and 'pArgs' as remaider. @@ -74,7 +74,7 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *&rpRanges, va_list pArgs, { NUMTYPE nSize = 0, nIns = 0; - USHORT nCnt = 0; + sal_uInt16 nCnt = 0; SvNums aNumArr( 11, 8 ); aNumArr.Insert( nWh1, nCnt++ ); aNumArr.Insert( nWh2, nCnt++ ); @@ -233,20 +233,20 @@ SfxNumRanges::SfxNumRanges( const NUMTYPE* pArr ) //------------------------------------------------------------------------ -BOOL SfxNumRanges::operator==( const SfxNumRanges &rOther ) const +sal_Bool SfxNumRanges::operator==( const SfxNumRanges &rOther ) const { // Object pointers equal? if ( this == &rOther ) - return TRUE; + return sal_True; // Ranges pointers equal? if ( _pRanges == rOther._pRanges ) - return TRUE; + return sal_True; // Counts equal? NUMTYPE nCount = Count(); if ( nCount != rOther.Count() ) - return FALSE; + return sal_False; // Check arrays. NUMTYPE n = 0; @@ -254,12 +254,12 @@ BOOL SfxNumRanges::operator==( const SfxNumRanges &rOther ) const { // Elements at current position equal? if ( _pRanges[ n ] != rOther._pRanges[ n ] ) - return FALSE; + return sal_False; ++n; } - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -719,21 +719,21 @@ SfxNumRanges& SfxNumRanges::operator /= //------------------------------------------------------------------------ -BOOL SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const +sal_Bool SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const /** <H3>Description</H3> Determines if at least one range in 'rRanges' intersects with one range in '*this'. - TRUE, if there is at least one with: + sal_True, if there is at least one with: this->Contains( n ) && rRanges.Contains( n ) */ { // special cases: one is empty if ( rRanges.IsEmpty() || IsEmpty() ) - return FALSE; + return sal_False; // find at least one intersecting range const NUMTYPE *pRange1 = _pRanges; @@ -753,12 +753,12 @@ BOOL SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const // the ranges are overlappung else - return TRUE; + return sal_True; } while ( *pRange2 ); // no intersection found - return FALSE; + return sal_False; } //------------------------------------------------------------------------ @@ -777,7 +777,7 @@ NUMTYPE SfxNumRanges::Count() const //------------------------------------------------------------------------ -BOOL SfxNumRanges::Contains( NUMTYPE n ) const +sal_Bool SfxNumRanges::Contains( NUMTYPE n ) const /** <H3>Description</H3> @@ -787,8 +787,8 @@ BOOL SfxNumRanges::Contains( NUMTYPE n ) const { for ( NUMTYPE *pRange = _pRanges; *pRange && *pRange <= n; pRange += 2 ) if ( pRange[0] <= n && n <= pRange[1] ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx index 07b0f1a6ddac..9a2b109682b5 100644 --- a/svl/source/items/poolcach.cxx +++ b/svl/source/items/poolcach.cxx @@ -33,24 +33,12 @@ #include <svl/itempool.hxx> #include <svl/itemset.hxx> -#include "poolcach.hxx" +#include <svl/poolcach.hxx> // STATIC DATA ----------------------------------------------------------- DBG_NAME(SfxItemPoolCache) - -//------------------------------------------------------------------------ - -struct SfxItemModifyImpl -{ - const SfxSetItem *pOrigItem; - SfxSetItem *pPoolItem; -}; - -SV_DECL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl, 8, 8 ) -SV_IMPL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl); - //------------------------------------------------------------------------ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool, @@ -82,7 +70,7 @@ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool, SfxItemPoolCache::~SfxItemPoolCache() { DBG_DTOR(SfxItemPoolCache, 0); - for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos ) { + for ( size_t nPos = 0; nPos < pCache->size(); ++nPos ) { pPool->Remove( *(*pCache)[nPos].pPoolItem ); pPool->Remove( *(*pCache)[nPos].pOrigItem ); } @@ -94,15 +82,15 @@ SfxItemPoolCache::~SfxItemPoolCache() //------------------------------------------------------------------------ -const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, BOOL bNew ) +const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, sal_Bool bNew ) { DBG_CHKTHIS(SfxItemPoolCache, 0); DBG_ASSERT( pPool == rOrigItem.GetItemSet().GetPool(), "invalid Pool" ); DBG_ASSERT( IsDefaultItem( &rOrigItem ) || IsPooledItem( &rOrigItem ), "original not in pool" ); - // Suchen, ob diese Transformations schon einmal vorkam - for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos ) + // Find whether this Transformations ever occurred + for ( size_t nPos = 0; nPos < pCache->size(); ++nPos ) { SfxItemModifyImpl &rMapEntry = (*pCache)[nPos]; if ( rMapEntry.pOrigItem == &rOrigItem ) @@ -141,7 +129,7 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, BOOL b SfxItemModifyImpl aModify; aModify.pOrigItem = &rOrigItem; aModify.pPoolItem = (SfxSetItem*) pNewPoolItem; - pCache->Insert( aModify, pCache->Count() ); + pCache->push_back( aModify ); DBG_ASSERT( !pItemToPut || &pNewPoolItem->GetItemSet().Get( pItemToPut->Which() ) == pItemToPut, diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index 81b1045ec970..f9ddc18a2318 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -97,43 +97,43 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const ;zun"achst ein Kompatiblit"ats-Header-Block Start: 0x1111 SFX_ITEMPOOL_TAG_STARTPOOLS(_4/_5) - BYTE MAJOR_VER ;SfxItemPool-Version - BYTE MINOR_VER ;" + sal_uInt8 MAJOR_VER ;SfxItemPool-Version + sal_uInt8 MINOR_VER ;" 0xFFFF SFX_ITEMPOOL_TAG_TRICK4OLD ;ex. GetVersion() - USHORT 0x0000 ;Pseudo-StyleSheetPool - USHORT 0x0000 ;Pseudo-StyleSheetPool + sal_uInt16 0x0000 ;Pseudo-StyleSheetPool + sal_uInt16 0x0000 ;Pseudo-StyleSheetPool ;den ganzen Pool in einen Record record SfxMiniRecod(SFX_ITEMPOOL_REC) ;je ein Header vorweg Header: record SfxMiniRecord(SFX_ITEMPOOL_REC_HEADER) - USHORT GetVersion() ;Which-Ranges etc. + sal_uInt16 GetVersion() ;Which-Ranges etc. String GetName() ;Pool-Name ;die Versions-Map, um WhichIds neuer File-Versionen mappen zu k"onnen Versions: record SfxMultiRecord(SFX_ITEMPOOL_REC_VERSIONS, 0) - USHORT OldVersion - USHORT OldStartWhich - USHORT OldEndWhich - USHORT[] NewWhich (OldEndWhich-OldStartWhich+1) + sal_uInt16 OldVersion + sal_uInt16 OldStartWhich + sal_uInt16 OldEndWhich + sal_uInt16[] NewWhich (OldEndWhich-OldStartWhich+1) ;jetzt die gepoolten Items (zuerst nicht-SfxSetItems) Items: record SfxMultiRecord(SFX_ITEMPOOL_REC_WHICHIDS, 0) content SlotId, 0 - USHORT WhichId - USHORT pItem->GetVersion() - USHORT Array-Size + sal_uInt16 WhichId + sal_uInt16 pItem->GetVersion() + sal_uInt16 Array-Size record SfxMultiRecord(SFX_, 0) content Surrogate - USHORT RefCount + sal_uInt16 RefCount unknown pItem->Store() ;jetzt die gesetzten Pool-Defaults Defaults: record SfxMultiRecord(SFX_ITEMPOOL_REC_DEFAULTS, 0) content SlotId, 0 - USHORT WhichId - USHORT pPoolDef->GetVersion() + sal_uInt16 WhichId + sal_uInt16 pPoolDef->GetVersion() unknown pPoolDef->Store(); ;dahinter folgt ggf. der Secondary ohne Kompatiblit"ats-Header-Block @@ -148,7 +148,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const pStoreMaster = pStoreMaster->pSecondary; // Alter-Header (Version des Pools an sich und Inhalts-Version 0xffff) - pImp->bStreaming = TRUE; + pImp->bStreaming = sal_True; if ( !pStoreMaster ) { rStream << ( rStream.GetVersion() >= SOFFICE_FILEFORMAT_50 @@ -158,8 +158,8 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const rStream << SFX_ITEMPOOL_TAG_TRICK4OLD; // SfxStyleSheet-Bug umgehen - rStream << UINT16(0); // Version - rStream << UINT16(0); // Count (2. Schleife f"allt sonst auf die Fresse) + rStream << sal_uInt16(0); // Version + rStream << sal_uInt16(0); // Count (2. Schleife f"allt sonst auf die Fresse) } // jeder Pool ist als ganzes ein Record @@ -176,14 +176,14 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const // Version-Maps { SfxMultiVarRecordWriter aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP, 0 ); - for ( USHORT nVerNo = 0; nVerNo < pImp->aVersions.Count(); ++nVerNo ) + for ( size_t nVerNo = 0; nVerNo < pImp->aVersions.size(); ++nVerNo ) { aVerRec.NewContent(); - SfxPoolVersion_Impl *pVer = pImp->aVersions[nVerNo]; + SfxPoolVersion_ImplPtr pVer = pImp->aVersions[nVerNo]; rStream << pVer->_nVer << pVer->_nStart << pVer->_nEnd; - USHORT nCount = pVer->_nEnd - pVer->_nStart + 1; - USHORT nNewWhich = 0; - for ( USHORT n = 0; n < nCount; ++n ) + sal_uInt16 nCount = pVer->_nEnd - pVer->_nStart + 1; + sal_uInt16 nNewWhich = 0; + for ( sal_uInt16 n = 0; n < nCount; ++n ) { nNewWhich = pVer->_pMap[n]; rStream << nNewWhich; @@ -191,7 +191,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const // Workaround gegen Bug in SetVersionMap der 312 if ( SOFFICE_FILEFORMAT_31 == _nFileFormatVersion ) - rStream << USHORT(nNewWhich+1); + rStream << sal_uInt16(nNewWhich+1); } } @@ -206,11 +206,11 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const SfxPoolItemArray_Impl **pArr = pImp->ppPoolItems; SfxPoolItem **ppDefItem = ppStaticDefaults; - const USHORT nSize = GetSize_Impl(); - for ( USHORT i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem ) + const sal_uInt16 nSize = GetSize_Impl(); + for ( size_t i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem ) { // Version des Items feststellen - USHORT nItemVersion = (*ppDefItem)->GetVersion( _nFileFormatVersion ); + sal_uInt16 nItemVersion = (*ppDefItem)->GetVersion( _nFileFormatVersion ); if ( USHRT_MAX == nItemVersion ) // => kam in zu exportierender Version gar nicht vor continue; @@ -225,29 +225,29 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) ) { // eigene Kennung, globale Which-Id und Item-Version - USHORT nSlotId = GetSlotId( (*ppDefItem)->Which(), FALSE ); + sal_uInt16 nSlotId = GetSlotId( (*ppDefItem)->Which(), sal_False ); aWhichIdsRec.NewContent(nSlotId, 0); rStream << (*ppDefItem)->Which(); rStream << nItemVersion; - const USHORT nCount = (*pArr)->Count(); - DBG_ASSERT(nCount, "ItemArr ist leer"); + const sal_uInt32 nCount = ::std::min<size_t>( (*pArr)->size(), SAL_MAX_UINT32 ); + DBG_ASSERT(nCount, "ItemArr is empty"); rStream << nCount; // Items an sich schreiben SfxMultiMixRecordWriter aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS, 0 ); - for ( USHORT j = 0; j < nCount; ++j ) + for ( size_t j = 0; j < nCount; ++j ) { // Item selbst besorgen - const SfxPoolItem *pItem = (*pArr)->GetObject(j); + const SfxPoolItem *pItem = (*pArr)->operator[](j); if ( pItem && pItem->GetRefCount() ) //! siehe anderes MI-REF { - aItemsRec.NewContent(j, 'X' ); + aItemsRec.NewContent((sal_uInt16)j, 'X' ); if ( pItem->GetRefCount() == SFX_ITEMS_SPECIAL ) - rStream << (USHORT) pItem->GetKind(); + rStream << (sal_uInt16) pItem->GetKind(); else { - rStream << (USHORT) pItem->GetRefCount(); + rStream << (sal_uInt16) pItem->GetRefCount(); if( pItem->GetRefCount() > SFX_ITEMS_OLD_MAXREF ) rStream.SetError( ERRCODE_IO_NOTSTORABLEINBINARYFORMAT ); } @@ -259,10 +259,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const #ifdef DBG_UTIL_MI if ( !pItem->ISA(SfxSetItem) ) { - ULONG nMark = rStream.Tell(); - rStream.Seek( nItemStartPos + sizeof(USHORT) ); + sal_uLong nMark = rStream.Tell(); + rStream.Seek( nItemStartPos + sizeof(sal_uInt16) ); SfxPoolItem *pClone = pItem->Create(rStream, nItemVersion ); - USHORT nWh = pItem->Which(); + sal_uInt16 nWh = pItem->Which(); SFX_ASSERT( rStream.Tell() == nMark, nWh,"asymmetric store/create" ); SFX_ASSERT( *pClone == *pItem, nWh, "unequal after store/create" ); delete pClone; @@ -281,20 +281,20 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const if ( !rStream.GetError() ) { SfxMultiMixRecordWriter aDefsRec( &rStream, SFX_ITEMPOOL_REC_DEFAULTS, 0 ); - USHORT nCount = GetSize_Impl(); - for ( USHORT n = 0; n < nCount; ++n ) + sal_uInt16 nCount = GetSize_Impl(); + for ( sal_uInt16 n = 0; n < nCount; ++n ) { const SfxPoolItem* pDefaultItem = ppPoolDefaults[n]; if ( pDefaultItem ) { // Version ermitteln - USHORT nItemVersion = pDefaultItem->GetVersion( _nFileFormatVersion ); + sal_uInt16 nItemVersion = pDefaultItem->GetVersion( _nFileFormatVersion ); if ( USHRT_MAX == nItemVersion ) // => gab es in der Version noch nicht continue; // eigene Kennung, globale Kennung, Version - USHORT nSlotId = GetSlotId( pDefaultItem->Which(), FALSE ); + sal_uInt16 nSlotId = GetSlotId( pDefaultItem->Which(), sal_False ); aDefsRec.NewContent( nSlotId, 0 ); rStream << pDefaultItem->Which(); rStream << nItemVersion; @@ -311,7 +311,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const if ( !rStream.GetError() && pSecondary ) pSecondary->Store( rStream ); - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } @@ -321,7 +321,7 @@ void SfxItemPool::LoadCompleted() /* [Beschreibung] - Wurde der SfxItemPool mit 'bRefCounts' == FALSE geladen, mu\s das + Wurde der SfxItemPool mit 'bRefCounts' == sal_False geladen, mu\s das Laden der Dokumentinhalte mit einem Aufruf dieser Methode beendet werden. Ansonsten hat der Aufruf dieser Methode keine Funktion. @@ -347,14 +347,14 @@ void SfxItemPool::LoadCompleted() // "uber alle Which-Werte iterieren SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems; - for( USHORT nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr ) + for( sal_uInt16 nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr ) { // ist "uberhaupt ein Item mit dem Which-Wert da? if ( *ppItemArr ) { // "uber alle Items mit dieser Which-Id iterieren - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -382,33 +382,33 @@ void SfxItemPool::LoadCompleted() //============================================================================ // This had to be moved to a method of its own to keep Solaris GCC happy: void SfxItemPool::readTheItems ( - SvStream & rStream, USHORT nItemCount, USHORT nVersion, + SvStream & rStream, sal_uInt32 nItemCount, sal_uInt16 nVersion, SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** ppArr) { SfxMultiRecordReader aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS ); - SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl( nItemCount ); + SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl(); SfxPoolItem *pItem = 0; - USHORT n, nLastSurrogate = USHORT(-1); + sal_uLong n, nLastSurrogate = sal_uLong(-1); while (aItemsRec.GetContent()) { // n"achstes Surrogat holen - USHORT nSurrogate = aItemsRec.GetContentTag(); + sal_uInt16 nSurrogate = aItemsRec.GetContentTag(); DBG_ASSERT( aItemsRec.GetContentVersion() == 'X', "not an item content" ); // fehlende auff"ullen for ( pItem = 0, n = nLastSurrogate+1; n < nSurrogate; ++n ) - pNewArr->C40_INSERT(SfxPoolItem, pItem, n); + pNewArr->push_back( (SfxPoolItem*) pItem ); nLastSurrogate = nSurrogate; // Ref-Count und Item laden - USHORT nRef; + sal_uInt16 nRef; rStream >> nRef; pItem = pDefItem->Create(rStream, nVersion); - pNewArr->C40_INSERT(SfxPoolItem, pItem, nSurrogate); + pNewArr->push_back( (SfxPoolItem*) pItem ); if ( !bPersistentRefCounts ) // bis <SfxItemPool::LoadCompleted()> festhalten @@ -424,33 +424,32 @@ void SfxItemPool::readTheItems ( // fehlende auff"ullen for ( pItem = 0, n = nLastSurrogate+1; n < nItemCount; ++n ) - pNewArr->C40_INSERT(SfxPoolItem, pItem, n); + pNewArr->push_back( (SfxPoolItem*) pItem ); SfxPoolItemArray_Impl *pOldArr = *ppArr; *ppArr = pNewArr; // die Items merken, die schon im Pool sind - int bEmpty = TRUE; + bool bEmpty = true; if ( 0 != pOldArr ) - for ( n = 0; bEmpty && n < pOldArr->Count(); ++n ) - bEmpty = pOldArr->GetObject(n) == 0; + for ( n = 0; bEmpty && n < pOldArr->size(); ++n ) + bEmpty = pOldArr->operator[](n) == 0; DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" ); if ( !bEmpty ) { // f"ur alle alten suchen, ob ein gleiches neues existiert - for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld ) + for ( size_t nOld = 0; nOld < pOldArr->size(); ++nOld ) { SfxPoolItem *pOldItem = (*pOldArr)[nOld]; if ( pOldItem ) { - USHORT nFree = USHRT_MAX; - int bFound = FALSE; - USHORT nCount = (*ppArr)->Count(); - for ( USHORT nNew = nCount; !bFound && nNew--; ) + sal_uInt32 nFree = SAL_MAX_UINT32; + bool bFound = false; + for ( size_t nNew = (*ppArr)->size(); nNew--; ) { // geladenes Item SfxPoolItem *&rpNewItem = - (SfxPoolItem*&)(*ppArr)->GetData()[nNew]; + (SfxPoolItem*&)(*ppArr)->operator[](nNew); // surrogat unbenutzt? if ( !rpNewItem ) @@ -464,17 +463,18 @@ void SfxItemPool::readTheItems ( SetRefCount( *rpNewItem, 0 ); delete rpNewItem; rpNewItem = pOldItem; - bFound = TRUE; + bFound = true; + break; } } // vorhervorhandene, nicht geladene uebernehmen if ( !bFound ) { - if ( nFree != USHRT_MAX ) - (SfxPoolItem*&)(*ppArr)->GetData()[nFree] = pOldItem; + if ( nFree != SAL_MAX_UINT32 ) + (SfxPoolItem*&)(*ppArr)->operator[](nFree) = pOldItem; else - (*ppArr)->C40_INSERT( SfxPoolItem, pOldItem, nCount ); + (*ppArr)->push_back( (SfxPoolItem*) pOldItem ); } } } @@ -495,14 +495,14 @@ SvStream &SfxItemPool::Load(SvStream &rStream) // "uber alle Which-Werte iterieren SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems; - for( USHORT nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr ) + for( size_t nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr ) { // ist "uberhaupt ein Item mit dem Which-Wert da? if ( *ppItemArr ) { // "uber alle Items mit dieser Which-Id iterieren - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -528,7 +528,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) pLoadMaster = pLoadMaster->pSecondary; // Gesamt Header einlesen - pImp->bStreaming = TRUE; + pImp->bStreaming = sal_True; if ( !pLoadMaster ) { // Format-Version laden @@ -549,7 +549,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) if ( pImp->nMajorVer > SFX_ITEMPOOL_VER_MAJOR ) { rStream.SetError(SVSTREAM_FILEFORMAT_ERROR); - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } @@ -562,19 +562,19 @@ SvStream &SfxItemPool::Load(SvStream &rStream) SfxMiniRecordReader aPoolRec( &rStream, SFX_ITEMPOOL_REC ); if ( rStream.GetError() ) { - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } // Einzel-Header - int bOwnPool = TRUE; + int bOwnPool = sal_True; UniString aExternName; { // Header-Record suchen SfxMiniRecordReader aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER ); if ( rStream.GetError() ) { - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } @@ -588,7 +588,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) { rStream.SetError(SVSTREAM_FILEFORMAT_ERROR); aPoolRec.Skip(); - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } } @@ -598,25 +598,25 @@ SvStream &SfxItemPool::Load(SvStream &rStream) SfxMultiRecordReader aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP ); if ( rStream.GetError() ) { - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } // Versions-Maps einlesen - USHORT nOwnVersion = pImp->nVersion; - for ( USHORT nVerNo = 0; aVerRec.GetContent(); ++nVerNo ) + sal_uInt16 nOwnVersion = pImp->nVersion; + for ( sal_uInt16 nVerNo = 0; aVerRec.GetContent(); ++nVerNo ) { // Header f"ur einzelne Version einlesen - USHORT nVersion, nHStart, nHEnd; + sal_uInt16 nVersion, nHStart, nHEnd; rStream >> nVersion >> nHStart >> nHEnd; - USHORT nCount = nHEnd - nHStart + 1; + sal_uInt16 nCount = nHEnd - nHStart + 1; - // Version neuer als bekannt? - if ( nVerNo >= pImp->aVersions.Count() ) + // Is new version is known? + if ( nVerNo >= pImp->aVersions.size() ) { - // neue Version hinzufuegen - USHORT *pMap = new USHORT[nCount]; - for ( USHORT n = 0; n < nCount; ++n ) + // Add new Version + sal_uInt16 *pMap = new sal_uInt16[nCount]; + for ( sal_uInt16 n = 0; n < nCount; ++n ) rStream >> pMap[n]; SetVersionMap( nVersion, nHStart, nHEnd, pMap ); } @@ -632,8 +632,9 @@ SvStream &SfxItemPool::Load(SvStream &rStream) while ( aWhichIdsRec.GetContent() ) { // SlotId, Which-Id und Item-Version besorgen - USHORT nCount, nVersion, nWhich; - //!USHORT nSlotId = aWhichIdsRec.GetContentTag(); + sal_uInt32 nCount; + sal_uInt16 nVersion, nWhich; + //!sal_uInt16 nSlotId = aWhichIdsRec.GetContentTag(); rStream >> nWhich; if ( pImp->nLoadingVersion != pImp->nVersion ) // Which-Id aus File-Version in Pool-Version verschieben @@ -646,11 +647,11 @@ SvStream &SfxItemPool::Load(SvStream &rStream) rStream >> nVersion; rStream >> nCount; //!SFX_ASSERTWARNING( !nSlotId || !HasMap() || - //! ( nSlotId == GetSlotId( nWhich, FALSE ) ) || - //! !GetSlotId( nWhich, FALSE ), + //! ( nSlotId == GetSlotId( nWhich, sal_False ) ) || + //! !GetSlotId( nWhich, sal_False ), //! nWhich, "Slot/Which mismatch" ); - USHORT nIndex = GetIndex_Impl(nWhich); + sal_uInt16 nIndex = GetIndex_Impl(nWhich); SfxPoolItemArray_Impl **ppArr = pImp->ppPoolItems + nIndex; // SfxSetItems k"onnten Items aus Sekund"arpools beinhalten @@ -659,7 +660,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) if ( !bSecondaryLoaded && pSecondary && pImp->bInSetItem ) { // an das Ende des eigenen Pools seeken - ULONG nLastPos = rStream.Tell(); + sal_uLong nLastPos = rStream.Tell(); aPoolRec.Skip(); // Sekund"arpool einlesen @@ -674,7 +675,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) // Items an sich lesen readTheItems(rStream, nCount, nVersion, pDefItem, ppArr); - pImp->bInSetItem = FALSE; + pImp->bInSetItem = sal_False; } } @@ -685,8 +686,8 @@ SvStream &SfxItemPool::Load(SvStream &rStream) while ( aDefsRec.GetContent() ) { // SlotId, Which-Id und Item-Version besorgen - USHORT nVersion, nWhich; - //!USHORT nSlotId = aDefsRec.GetContentTag(); + sal_uInt16 nVersion, nWhich; + //!sal_uInt16 nSlotId = aDefsRec.GetContentTag(); rStream >> nWhich; if ( pImp->nLoadingVersion != pImp->nVersion ) // Which-Id aus File-Version in Pool-Version verschieben @@ -697,7 +698,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) continue; rStream >> nVersion; - //!SFX_ASSERTWARNING( !HasMap() || ( nSlotId == GetSlotId( nWhich, FALSE ) ), + //!SFX_ASSERTWARNING( !HasMap() || ( nSlotId == GetSlotId( nWhich, sal_False ) ), //! nWhich, "Slot/Which mismatch" ); // Pool-Default-Item selbst laden @@ -723,7 +724,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) if ( aExternName != aName ) aName.Erase(); - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; }; @@ -739,19 +740,19 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) rStream >> pImp->nMajorVer >> pImp->nMinorVer; } sal_uInt32 nAttribSize; - int bOwnPool = TRUE; + int bOwnPool = sal_True; UniString aExternName; if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 2 ) rStream >> pImp->nLoadingVersion; SfxPoolItem::readByteString(rStream, aExternName); bOwnPool = aExternName == aName; - pImp->bStreaming = TRUE; + pImp->bStreaming = sal_True; //! solange wir keine fremden laden k"onnen if ( !bOwnPool ) { rStream.SetError(SVSTREAM_FILEFORMAT_ERROR); - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } @@ -760,7 +761,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) pImp->nVersion < pImp->nLoadingVersion ) { rStream.SetError(ERRCODE_IO_WRONGVERSION); - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } @@ -768,20 +769,20 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) rStream >> nAttribSize; // Size-Table einlesen - ULONG nStartPos = rStream.Tell(); + sal_uLong nStartPos = rStream.Tell(); rStream.SeekRel( nAttribSize ); CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_SIZES ); sal_uInt32 nSizeTableLen; rStream >> nSizeTableLen; sal_Char *pBuf = new sal_Char[nSizeTableLen]; rStream.Read( pBuf, nSizeTableLen ); - ULONG nEndOfSizes = rStream.Tell(); + sal_uLong nEndOfSizes = rStream.Tell(); SvMemoryStream aSizeTable( pBuf, nSizeTableLen, STREAM_READ ); // ab Version 1.3 steht in der Size-Table eine Versions-Map if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 3 ) { - // Version-Map finden (letztes ULONG der Size-Table gibt Pos an) + // Version-Map finden (letztes sal_uLong der Size-Table gibt Pos an) rStream.Seek( nEndOfSizes - sizeof(sal_uInt32) ); sal_uInt32 nVersionMapPos; rStream >> nVersionMapPos; @@ -789,22 +790,22 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) // Versions-Maps einlesen CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_VERSIONMAP ); - USHORT nVerCount; + sal_uInt16 nVerCount; rStream >> nVerCount; - for ( USHORT nVerNo = 0; nVerNo < nVerCount; ++nVerNo ) + for ( sal_uInt16 nVerNo = 0; nVerNo < nVerCount; ++nVerNo ) { // Header f"ur einzelne Version einlesen - USHORT nVersion, nHStart, nHEnd; + sal_uInt16 nVersion, nHStart, nHEnd; rStream >> nVersion >> nHStart >> nHEnd; - USHORT nCount = nHEnd - nHStart + 1; - USHORT nBytes = (nCount)*sizeof(USHORT); + sal_uInt16 nCount = nHEnd - nHStart + 1; + sal_uInt16 nBytes = (nCount)*sizeof(sal_uInt16); - // Version neuer als bekannt? - if ( nVerNo >= pImp->aVersions.Count() ) + // Is new version is known? + if ( nVerNo >= pImp->aVersions.size() ) { - // neue Version hinzufuegen - USHORT *pMap = new USHORT[nCount]; - for ( USHORT n = 0; n < nCount; ++n ) + // Add new Version + sal_uInt16 *pMap = new sal_uInt16[nCount]; + for ( sal_uInt16 n = 0; n < nCount; ++n ) rStream >> pMap[n]; SetVersionMap( nVersion, nHStart, nHEnd, pMap ); } @@ -819,7 +820,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_ITEMS ); bool bSecondaryLoaded = false; long nSecondaryEnd = 0; - USHORT nWhich, nSlot; + sal_uInt16 nWhich, nSlot; while ( rStream >> nWhich, nWhich ) { // ggf. Which-Id aus alter Version verschieben? @@ -827,10 +828,10 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) nWhich = GetNewWhich( nWhich ); rStream >> nSlot; - USHORT nMappedWhich = GetWhich(nSlot, FALSE); + sal_uInt16 nMappedWhich = GetWhich(nSlot, sal_False); int bKnownItem = bOwnPool || IsWhich(nMappedWhich); - USHORT nRef, nCount, nVersion; + sal_uInt16 nRef, nCount, nVersion; sal_uInt32 nAttrSize; rStream >> nVersion >> nCount; @@ -843,18 +844,18 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) nWhich = nMappedWhich; //!SFX_ASSERTWARNING( !nSlot || !HasMap() || - //! ( nSlot == GetSlotId( nWhich, FALSE ) ) || - //! !GetSlotId( nWhich, FALSE ), + //! ( nSlot == GetSlotId( nWhich, sal_False ) ) || + //! !GetSlotId( nWhich, sal_False ), //! nWhich, "Slot/Which mismatch" ); - USHORT nIndex = GetIndex_Impl(nWhich); + sal_uInt16 nIndex = GetIndex_Impl(nWhich); ppArr = pImp->ppPoolItems + nIndex; - pNewArr = new SfxPoolItemArray_Impl( nCount ); + pNewArr = new SfxPoolItemArray_Impl(); pDefItem = *(ppStaticDefaults + nIndex); } // Position vor ersten Item merken - ULONG nLastPos = rStream.Tell(); + sal_uLong nLastPos = rStream.Tell(); // SfxSetItems k"onnten Items aus Sekund"arpools beinhalten if ( !bSecondaryLoaded && pSecondary && pDefItem->ISA(SfxSetItem) ) @@ -874,9 +875,9 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) } // Items an sich lesen - for ( USHORT j = 0; j < nCount; ++j ) + for ( sal_uInt16 j = 0; j < nCount; ++j ) { - ULONG nPos = nLastPos; + sal_uLong nPos = nLastPos; rStream >> nRef; if ( bKnownItem ) @@ -897,8 +898,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) AddRef(*pItem, nRef); } } - - pNewArr->C40_INSERT( SfxPoolItem, pItem, j); + //pNewArr->insert( pItem, j ); + pNewArr->push_back( (SfxPoolItem*) pItem ); // restliche gespeicherte Laenge skippen (neueres Format) nLastPos = rStream.Tell(); @@ -922,26 +923,25 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) *ppArr = pNewArr; // die Items merken, die schon im Pool sind - int bEmpty = TRUE; + int bEmpty = sal_True; if ( 0 != pOldArr ) - for ( USHORT n = 0; bEmpty && n < pOldArr->Count(); ++n ) - bEmpty = pOldArr->GetObject(n) == 0; + for ( size_t n = 0; bEmpty && n < pOldArr->size(); ++n ) + bEmpty = pOldArr->operator[](n) == 0; DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" ); if ( !bEmpty ) { // f"ur alle alten suchen, ob ein gleiches neues existiert - for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld ) + for ( size_t nOld = 0; nOld < pOldArr->size(); ++nOld ) { SfxPoolItem *pOldItem = (*pOldArr)[nOld]; if ( pOldItem ) { - int bFound = FALSE; - for ( USHORT nNew = 0; - !bFound && nNew < (*ppArr)->Count(); - ++nNew ) + bool bFound = false; + for ( size_t nNew = 0; + nNew < (*ppArr)->size(); ++nNew ) { SfxPoolItem *&rpNewItem = - (SfxPoolItem*&)(*ppArr)->GetData()[nNew]; + (SfxPoolItem*&)(*ppArr)->operator[](nNew); if ( rpNewItem && *rpNewItem == *pOldItem ) { @@ -949,11 +949,11 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) SetRefCount( *rpNewItem, 0 ); delete rpNewItem; rpNewItem = pOldItem; - bFound = TRUE; + bFound = true; SFX_TRACE( "reusing item", pOldItem ); + break; } } - //! DBG_ASSERT( bFound, "old-item not found in file" ); if ( !bFound ) { SFX_TRACE( "item not found: ", pOldItem ); @@ -969,7 +969,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) if ( pImp->nMajorVer > 1 || pImp->nMinorVer > 0 ) CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_DEFAULTS ); - ULONG nLastPos = rStream.Tell(); + sal_uLong nLastPos = rStream.Tell(); while ( rStream >> nWhich, nWhich ) { // ggf. Which-Id aus alter Version verschieben? @@ -977,12 +977,12 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) nWhich = GetNewWhich( nWhich ); rStream >> nSlot; - USHORT nMappedWhich = GetWhich(nSlot, FALSE); + sal_uInt16 nMappedWhich = GetWhich(nSlot, sal_False); int bKnownItem = bOwnPool || IsWhich(nMappedWhich); - ULONG nPos = nLastPos; + sal_uLong nPos = nLastPos; sal_uInt32 nSize; - USHORT nVersion; + sal_uInt16 nVersion; rStream >> nVersion; if ( bKnownItem ) @@ -1020,7 +1020,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) if ( aExternName != aName ) aName.Erase(); - pImp->bStreaming = FALSE; + pImp->bStreaming = sal_False; return rStream; } @@ -1029,8 +1029,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) const SfxPoolItem* SfxItemPool::LoadSurrogate ( SvStream& rStream, // vor einem Surrogat positionierter Stream - USHORT& rWhich, // Which-Id des zu ladenden <SfxPoolItem>s - USHORT nSlotId, // Slot-Id des zu ladenden <SfxPoolItem>s + sal_uInt16& rWhich, // Which-Id des zu ladenden <SfxPoolItem>s + sal_uInt16 nSlotId, // Slot-Id des zu ladenden <SfxPoolItem>s const SfxItemPool* pRefPool // <SfxItemPool> in dem das Surrogat gilt ) @@ -1039,7 +1039,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate L"adt Surrogat aus 'rStream' und liefert das dadurch in 'rRefPool' repr"asentierte SfxPoolItem zu"ruck. Ist das im Stream befindliche Surrogat == SFX_ITEMS_DIRECT (!SFX_ITEM_POOLABLE) wird 0 zur"uckgegeben, - das Item ist direkt aus dem Stream zu laden. Bei 0xfff0 (SFX_ITEMS_NULL) + das Item ist direkt aus dem Stream zu laden. Bei 0xfffffff0 (SFX_ITEMS_NULL) wird auch 0 zurueckgegeben und rWhich auf 0 gesetzt, das Item ist nicht verfuegbar. @@ -1071,15 +1071,15 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate */ { - // erstmal das Surrogat lesen - USHORT nSurrogat; + // Read the first surrogate + sal_uInt32 nSurrogat; rStream >> nSurrogat; - // direkt gespeichertes Item? + // Is item stored directly? if ( SFX_ITEMS_DIRECT == nSurrogat ) return 0; - // nicht vorhandenes Item? + // Item does not exist? if ( SFX_ITEMS_NULL == nSurrogat ) { rWhich = 0; @@ -1095,12 +1095,12 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate { // Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId // aus dem Stream in eine Which-Id gemappt werden k"onnen. - USHORT nMappedWhich = nSlotId ? GetWhich(nSlotId, TRUE) : 0; + sal_uInt16 nMappedWhich = nSlotId ? GetWhich(nSlotId, sal_True) : 0; if ( IsWhich(nMappedWhich) ) { // gemappte SlotId kann "ubernommen werden rWhich = nMappedWhich; - bResolvable = TRUE; + bResolvable = sal_True; } } @@ -1114,13 +1114,13 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate if ( pTarget->IsInRange(rWhich) ) { // dflt-Attribut? - if ( SFX_ITEMS_STATICDEFAULT == nSurrogat ) + if ( SFX_ITEMS_DEFAULT == nSurrogat ) return *(pTarget->ppStaticDefaults + pTarget->GetIndex_Impl(rWhich)); SfxPoolItemArray_Impl* pItemArr = *(pTarget->pImp->ppPoolItems + pTarget->GetIndex_Impl(rWhich)); - pItem = pItemArr && nSurrogat < pItemArr->Count() + pItem = pItemArr && nSurrogat < pItemArr->size() ? (*pItemArr)[nSurrogat] : 0; if ( !pItem ) @@ -1144,7 +1144,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate } } - SFX_ASSERT( FALSE, rWhich, "can't resolve Which-Id in LoadSurrogate" ); + SFX_ASSERT( sal_False, rWhich, "can't resolve Which-Id in LoadSurrogate" ); } return 0; @@ -1172,7 +1172,7 @@ bool SfxItemPool::StoreSurrogate SFX_ITEMS_STATICDEFAULT und SFX_ITEMS_POOLDEFAULT gelten als 'echte' Surrogate - FALSE + sal_False es wurde ein Dummy-Surrogat (SFX_ITEMS_DIRECT) gespeichert, das eigentliche Item mu\s direkt hinterher selbst gespeichert werden @@ -1184,17 +1184,17 @@ bool SfxItemPool::StoreSurrogate bool bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); rStream << ( bRealSurrogate ? GetSurrogate( pItem ) - : (UINT16) SFX_ITEMS_DIRECT ); + : SFX_ITEMS_DIRECT ); return bRealSurrogate; } - rStream << (UINT16) SFX_ITEMS_NULL; - return TRUE; + rStream << SFX_ITEMS_NULL; + return sal_True; } // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const +sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const { DBG_CHKTHIS(SfxItemPool, 0); DBG_ASSERT( pItem, "no 0-Pointer Surrogate" ); @@ -1210,24 +1210,24 @@ USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const // Pointer auf static- oder pool-dflt-Attribut? if( IsStaticDefaultItem(pItem) || IsPoolDefaultItem(pItem) ) - return SFX_ITEMS_STATICDEFAULT; + return SFX_ITEMS_DEFAULT; SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(pItem->Which())); - DBG_ASSERT(pItemArr, "ItemArr nicht vorhanden"); - const USHORT nCount = pItemArr->Count(); - for ( USHORT i = 0; i < nCount; ++i ) + DBG_ASSERT(pItemArr, "ItemArr is not available"); + + for ( size_t i = 0; i < pItemArr->size(); ++i ) { const SfxPoolItem *p = (*pItemArr)[i]; if ( p == pItem ) return i; } - SFX_ASSERT( 0, pItem->Which(), "Item nicht im Pool"); + SFX_ASSERT( 0, pItem->Which(), "Item not in the pool"); return SFX_ITEMS_NULL; } // ----------------------------------------------------------------------- -bool SfxItemPool::IsInStoringRange( USHORT nWhich ) const +bool SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const { return nWhich >= pImp->nStoringStart && nWhich <= pImp->nStoringEnd; @@ -1235,7 +1235,7 @@ bool SfxItemPool::IsInStoringRange( USHORT nWhich ) const //------------------------------------------------------------------------ -void SfxItemPool::SetStoringRange( USHORT nFrom, USHORT nTo ) +void SfxItemPool::SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo ) /* [Beschreibung] @@ -1262,10 +1262,10 @@ void SfxItemPool::SetStoringRange( USHORT nFrom, USHORT nTo ) void SfxItemPool::SetVersionMap ( - USHORT nVer, /* neue Versionsnummer */ - USHORT nOldStart, /* alte erste Which-Id */ - USHORT nOldEnd, /* alte letzte Which-Id */ - USHORT* pOldWhichIdTab /* Array mit genau dem Aufbau der Which-Ids + sal_uInt16 nVer, /* neue Versionsnummer */ + sal_uInt16 nOldStart, /* alte erste Which-Id */ + sal_uInt16 nOldEnd, /* alte letzte Which-Id */ + sal_uInt16* pOldWhichIdTab /* Array mit genau dem Aufbau der Which-Ids der vorhergehenden Version, in denen die jeweils neue Which-Id steht. */ ) @@ -1313,31 +1313,31 @@ void SfxItemPool::SetVersionMap Dabei haben sich also die Ids 3 und 4 ge"andert. F"ur die neue Version m"u\ste am Pool folgendes gesetzt werden: - static USHORT nVersion1Map = { 1, 2, 5, 6 }; + static sal_uInt16 nVersion1Map = { 1, 2, 5, 6 }; pPool->SetVersionMap( 1, 1, 4, &nVersion1Map ); [Querverweise] <SfxItemPool::IsLoadingVersionCurrent()const> - <SfxItemPool::GetNewWhich(USHORT)> + <SfxItemPool::GetNewWhich(sal_uInt16)> <SfxItemPool::GetVersion()const> <SfxItemPool::GetLoadingVersion()const> */ { - // neuen Map-Eintrag erzeugen und einf"ugen - const SfxPoolVersion_Impl *pVerMap = new SfxPoolVersion_Impl( - nVer, nOldStart, nOldEnd, pOldWhichIdTab ); - pImp->aVersions.Insert( pVerMap, pImp->aVersions.Count() ); + // create new map entry to insert + const SfxPoolVersion_ImplPtr pVerMap = SfxPoolVersion_ImplPtr( new SfxPoolVersion_Impl( + nVer, nOldStart, nOldEnd, pOldWhichIdTab ) ); + pImp->aVersions.push_back( pVerMap ); DBG_ASSERT( nVer > pImp->nVersion, "Versions not sorted" ); pImp->nVersion = nVer; // Versions-Range anpassen - for ( USHORT n = 0; n < nOldEnd-nOldStart+1; ++n ) + for ( sal_uInt16 n = 0; n < nOldEnd-nOldStart+1; ++n ) { - USHORT nWhich = pOldWhichIdTab[n]; + sal_uInt16 nWhich = pOldWhichIdTab[n]; if ( nWhich < pImp->nVerStart ) { if ( !nWhich ) @@ -1351,9 +1351,9 @@ void SfxItemPool::SetVersionMap // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetNewWhich +sal_uInt16 SfxItemPool::GetNewWhich ( - USHORT nFileWhich // die aus dem Stream geladene Which-Id + sal_uInt16 nFileWhich // die aus dem Stream geladene Which-Id ) const /* [Beschreibung] @@ -1377,7 +1377,7 @@ USHORT SfxItemPool::GetNewWhich [Querverweise] <SfxItemPool::IsLoadingVersionCurrent()const> - <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)> + <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> <SfxItemPool::GetVersion()const> <SfxItemPool::GetLoadingVersion()const> */ @@ -1398,12 +1398,12 @@ USHORT SfxItemPool::GetNewWhich if ( nDiff > 0 ) { // von der Top-Version bis runter zur File-Version stufenweise mappen - for ( USHORT nMap = pImp->aVersions.Count(); nMap > 0; --nMap ) + for ( size_t nMap = pImp->aVersions.size(); nMap > 0; --nMap ) { - SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap-1]; + SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap-1]; if ( pVerInfo->_nVer > pImp->nVersion ) - { USHORT nOfs; - USHORT nCount = pVerInfo->_nEnd - pVerInfo->_nStart + 1; + { sal_uInt16 nOfs; + sal_uInt16 nCount = pVerInfo->_nEnd - pVerInfo->_nStart + 1; for ( nOfs = 0; nOfs <= nCount && pVerInfo->_pMap[nOfs] != nFileWhich; @@ -1424,9 +1424,9 @@ USHORT SfxItemPool::GetNewWhich else if ( nDiff < 0 ) { // von der File-Version bis zur aktuellen Version stufenweise mappen - for ( USHORT nMap = 0; nMap < pImp->aVersions.Count(); ++nMap ) + for ( size_t nMap = 0; nMap < pImp->aVersions.size(); ++nMap ) { - SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap]; + SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap]; if ( pVerInfo->_nVer > pImp->nLoadingVersion ) { DBG_ASSERT( nFileWhich >= pVerInfo->_nStart && @@ -1444,7 +1444,7 @@ USHORT SfxItemPool::GetNewWhich // ----------------------------------------------------------------------- -bool SfxItemPool::IsInVersionsRange( USHORT nWhich ) const +bool SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const { return nWhich >= pImp->nVerStart && nWhich <= pImp->nVerEnd; } @@ -1465,8 +1465,8 @@ bool SfxItemPool::IsCurrentVersionLoading() const [Querverweise] - <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)> - <SfxItemPool::GetNewWhich(USHORT)const> + <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> + <SfxItemPool::GetNewWhich(sal_uInt16)const> <SfxItemPool::GetVersion()const> <SfxItemPool::GetLoadingVersion()const> */ @@ -1478,7 +1478,7 @@ bool SfxItemPool::IsCurrentVersionLoading() const // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetVersion() const +sal_uInt16 SfxItemPool::GetVersion() const /* [Beschreibung] @@ -1499,8 +1499,8 @@ USHORT SfxItemPool::GetVersion() const [Querverweise] <SfxItemPool::IsLoadingVersionCurrent()const> - <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)> - <SfxItemPool::GetNewWhich(USHORT)const> + <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> + <SfxItemPool::GetNewWhich(sal_uInt16)const> <SfxItemPool::GetLoadingVersion()const> */ @@ -1510,7 +1510,7 @@ USHORT SfxItemPool::GetVersion() const // ----------------------------------------------------------------------- -USHORT SfxItemPool::GetLoadingVersion() const +sal_uInt16 SfxItemPool::GetLoadingVersion() const /* [Beschreibung] @@ -1531,8 +1531,8 @@ USHORT SfxItemPool::GetLoadingVersion() const [Querverweise] <SfxItemPool::IsLoadingVersionCurrent()const> - <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)> - <SfxItemPool::GetNewWhich(USHORT)const> + <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> + <SfxItemPool::GetNewWhich(sal_uInt16)const> <SfxItemPool::GetVersion()const> */ @@ -1556,21 +1556,21 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, /* [Beschreibung] Speichert das <SfxPoolItem> 'rItem' in den <SvStream> 'rStream' - entweder als Surrogat ('bDirect == FALSE') oder direkt mit 'rItem.Store()'. + entweder als Surrogat ('bDirect == sal_False') oder direkt mit 'rItem.Store()'. Nicht poolable Items werden immer direkt gespeichert. Items ohne Which-Id, also SID-Items, werden nicht gespeichert, ebenso wenn Items, die in der - File-Format-Version noch nicht vorhanden waren (return FALSE). + File-Format-Version noch nicht vorhanden waren (return sal_False). Das Item wird im Stream wie folgt abgelegt: - USHORT rItem.Which() - USHORT GetSlotId( rItem.Which() ) bzw. 0 falls nicht verf"urbar - USHORT GetSurrogate( &rItem ) bzw. SFX_ITEM_DIRECT bei '!SFX_ITEM_POOLBLE' + sal_uInt16 rItem.Which() + sal_uInt16 GetSlotId( rItem.Which() ) bzw. 0 falls nicht verf"urbar + sal_uInt16 GetSurrogate( &rItem ) bzw. SFX_ITEM_DIRECT bei '!SFX_ITEM_POOLBLE' - optional (falls 'bDirect == TRUE' oder '!rItem.IsPoolable()': + optional (falls 'bDirect == sal_True' oder '!rItem.IsPoolable()': - USHORT rItem.GetVersion() - ULONG Size + sal_uInt16 rItem.GetVersion() + sal_uLong Size Size rItem.Store() @@ -1583,34 +1583,34 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, DBG_ASSERT( !IsInvalidItem(&rItem), "cannot store invalid items" ); if ( IsSlot( rItem.Which() ) ) - return FALSE; + return sal_False; const SfxItemPool *pPool = this; while ( !pPool->IsInStoringRange(rItem.Which()) ) if ( 0 == ( pPool = pPool->pSecondary ) ) - return FALSE; + return sal_False; DBG_ASSERT( !pImp->bInSetItem || !rItem.ISA(SfxSetItem), "SetItem contains ItemSet with SetItem" ); - USHORT nSlotId = pPool->GetSlotId( rItem.Which(), TRUE ); - USHORT nItemVersion = rItem.GetVersion(_nFileFormatVersion); + sal_uInt16 nSlotId = pPool->GetSlotId( rItem.Which(), sal_True ); + sal_uInt16 nItemVersion = rItem.GetVersion(_nFileFormatVersion); if ( USHRT_MAX == nItemVersion ) - return FALSE; + return sal_False; rStream << rItem.Which() << nSlotId; if ( bDirect || !pPool->StoreSurrogate( rStream, &rItem ) ) { rStream << nItemVersion; - rStream << (UINT32) 0L; // Platz fuer Laenge in Bytes - ULONG nIStart = rStream.Tell(); + rStream << (sal_uInt32) 0L; // Platz fuer Laenge in Bytes + sal_uLong nIStart = rStream.Tell(); rItem.Store(rStream, nItemVersion); - ULONG nIEnd = rStream.Tell(); + sal_uLong nIEnd = rStream.Tell(); rStream.Seek( nIStart-4 ); - rStream << (INT32) ( nIEnd-nIStart ); + rStream << (sal_Int32) ( nIEnd-nIStart ); rStream.Seek( nIEnd ); } - return TRUE; + return sal_True; } //------------------------------------------------------------------------- @@ -1622,10 +1622,10 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, // pRefPool==-1 => nicht putten! { - USHORT nWhich, nSlot; // nSurrogate; + sal_uInt16 nWhich, nSlot; // nSurrogate; rStream >> nWhich >> nSlot; - BOOL bDontPut = (SfxItemPool*)-1 == pRefPool; + sal_Bool bDontPut = (SfxItemPool*)-1 == pRefPool; if ( bDontPut || !pRefPool ) pRefPool = this; @@ -1637,7 +1637,8 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, else { // WID in der Version nicht vorhanden => ueberspringen - USHORT nSurro, nVersion, nLen; + sal_uInt32 nSurro; + sal_uInt16 nVersion, nLen; rStream >> nSurro; if ( SFX_ITEMS_DIRECT == nSurro ) { @@ -1668,17 +1669,17 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, pItem = LoadSurrogate( rStream, nWhich, nSlot, pRefPool ); else // sonst "uberspringen - rStream.SeekRel( sizeof(USHORT) ); + rStream.SeekRel( sizeof(sal_uInt16) ); } // wird direkt, also nicht "uber Surrogat geladen? if ( bDirect || ( nWhich && !pItem ) ) { // bDirekt bzw. nicht IsPoolable() => Item direkt laden - USHORT nVersion; + sal_uInt16 nVersion; sal_uInt32 nLen; rStream >> nVersion >> nLen; - ULONG nIStart = rStream.Tell(); + sal_uLong nIStart = rStream.Tell(); // Which-Id in dieser Version bekannt? if ( nWhich ) @@ -1696,7 +1697,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, } else pItem = 0; - ULONG nIEnd = rStream.Tell(); + sal_uLong nIEnd = rStream.Tell(); DBG_ASSERT( nIEnd <= (nIStart+nLen), "read past end of item" ); if ( (nIStart+nLen) != nIEnd ) rStream.Seek( nIStart+nLen ); diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index c09e419781f0..ec2909fbd9ad 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -39,18 +39,18 @@ DBG_NAME(SfxVoidItem) // @@@ DBG_NAME(SfxInvalidItem); DBG_NAME(SfxItemHandle) -BYTE nSfxFlag8Val[8] = +sal_uInt8 nSfxFlag8Val[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }; -USHORT nSfxFlag16Val[16] = +sal_uInt16 nSfxFlag16Val[16] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 }; -ULONG nSfxFlag32Val[32] = +sal_uLong nSfxFlag32Val[32] = { 0x1L, 0x2L, 0x4L, 0x8L, 0x10L, 0x20L, 0x40L, 0x80L, @@ -72,7 +72,7 @@ TYPEINIT1(SfxSetItem, SfxPoolItem); // ------------------------------------------------------------------------ #if OSL_DEBUG_LEVEL > 1 -static ULONG nItemCount = 0; +static sal_uLong nItemCount = 0; const char* pw1 = "Wow! 10.000 items!"; const char* pw2 = "Wow! 100.000 items!"; @@ -84,7 +84,7 @@ const char* pw5 = "Wow! 10.000.000 items!"; IMPL_PTRHINT(SfxPoolItemHint,SfxPoolItem) // SfxPoolItem ----------------------------------------------------------- -SfxPoolItem::SfxPoolItem( USHORT nW ) +SfxPoolItem::SfxPoolItem( sal_uInt16 nW ) : nRefCount( 0 ), nWhich( nW ) , nKind( 0 ) @@ -193,26 +193,26 @@ int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const int SfxPoolItem::IsPoolable() const { DBG_CHKTHIS(SfxPoolItem, 0); - return TRUE; + return sal_True; } #endif // ----------------------------------------------------------------------- -SfxPoolItem* SfxPoolItem::Create(SvStream &, USHORT) const +SfxPoolItem* SfxPoolItem::Create(SvStream &, sal_uInt16) const { DBG_CHKTHIS(SfxPoolItem, 0); return Clone(0); } // ----------------------------------------------------------------------- -USHORT SfxPoolItem::GetVersion( USHORT ) const +sal_uInt16 SfxPoolItem::GetVersion( sal_uInt16 ) const { DBG_CHKTHIS(SfxPoolItem, 0); return 0; } // ----------------------------------------------------------------------- -SvStream& SfxPoolItem::Store(SvStream &rStream, USHORT ) const +SvStream& SfxPoolItem::Store(SvStream &rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxPoolItem, 0); return rStream; @@ -270,7 +270,7 @@ SfxItemPresentation SfxPoolItem::GetPresentation von allen UI-relevanten SfxPoolItem-Subklassen "uberladen werden. Da die Ma\seinheit des Wertes im SfxItemPool nur "uber - <SfxItemPool::GetMetric(USHORT)const> erfragbar ist, und nicht etwa + <SfxItemPool::GetMetric(sal_uInt16)const> erfragbar ist, und nicht etwa in der SfxPoolItem-Instanz oder -Subklasse verf"ugbar ist, wird die eigene Ma\seinheit als 'eCoreMetric' "ubergeben. @@ -313,7 +313,7 @@ SfxItemPresentation SfxPoolItem::GetPresentation } // SfxVoidItem ------------------------------------------------------------ -SfxVoidItem::SfxVoidItem( USHORT which ): +SfxVoidItem::SfxVoidItem( sal_uInt16 which ): SfxPoolItem(which) { DBG_CTOR(SfxVoidItem, 0); @@ -335,7 +335,7 @@ rCmp { DBG_CHKTHIS(SfxVoidItem, 0); DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" ); - return TRUE; + return sal_True; } // ------------------------------------------------------------------------ @@ -364,7 +364,7 @@ SfxPoolItem* SfxVoidItem::Clone(SfxItemPool *) const // SfxItemHandle ---------------------------------------------------------- SfxItemHandle::SfxItemHandle(SfxPoolItem &rItem): - pRef(new USHORT(1)), + pRef(new sal_uInt16(1)), pItem(rItem.Clone(0)) { DBG_CTOR(SfxItemHandle, 0); @@ -422,7 +422,7 @@ bool SfxPoolItem::HasMetrics() const // ----------------------------------------------------------------------- -bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, BYTE ) const +bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8 ) const { OSL_FAIL("There is no implementation for QueryValue for this item!"); return false; @@ -430,7 +430,7 @@ bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, BYTE ) const // ----------------------------------------------------------------------- -bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, BYTE ) +bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8 ) { OSL_FAIL("There is no implementation for PutValue for this item!"); return false; diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx index 3471f6eee0cf..e3d3ad5fdc1a 100644 --- a/svl/source/items/ptitem.cxx +++ b/svl/source/items/ptitem.cxx @@ -58,7 +58,7 @@ SfxPointItem::SfxPointItem() // ----------------------------------------------------------------------- -SfxPointItem::SfxPointItem( USHORT nW, const Point& rVal ) : +SfxPointItem::SfxPointItem( sal_uInt16 nW, const Point& rVal ) : SfxPoolItem( nW ), aVal( rVal ) { @@ -67,7 +67,7 @@ SfxPointItem::SfxPointItem( USHORT nW, const Point& rVal ) : // ----------------------------------------------------------------------- -SfxPointItem::SfxPointItem( USHORT nW, SvStream &rStream ) : +SfxPointItem::SfxPointItem( sal_uInt16 nW, SvStream &rStream ) : SfxPoolItem( nW ) { DBG_CTOR(SfxPointItem, 0); @@ -121,7 +121,7 @@ SfxPoolItem* SfxPointItem::Clone(SfxItemPool *) const // ----------------------------------------------------------------------- -SfxPoolItem* SfxPointItem::Create(SvStream &rStream, USHORT ) const +SfxPoolItem* SfxPointItem::Create(SvStream &rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxPointItem, 0); Point aStr; @@ -131,7 +131,7 @@ SfxPoolItem* SfxPointItem::Create(SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- -SvStream& SfxPointItem::Store(SvStream &rStream, USHORT ) const +SvStream& SfxPointItem::Store(SvStream &rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxPointItem, 0); rStream << aVal; @@ -141,7 +141,7 @@ SvStream& SfxPointItem::Store(SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- bool SfxPointItem::QueryValue( uno::Any& rVal, - BYTE nMemberId ) const + sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); awt::Point aTmp(aVal.X(), aVal.Y()); @@ -165,11 +165,11 @@ bool SfxPointItem::QueryValue( uno::Any& rVal, // ----------------------------------------------------------------------- bool SfxPointItem::PutValue( const uno::Any& rVal, - BYTE nMemberId ) + sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; - bool bRet = FALSE; + bool bRet = false; awt::Point aValue; sal_Int32 nVal = 0; if ( !nMemberId ) @@ -195,7 +195,7 @@ bool SfxPointItem::PutValue( const uno::Any& rVal, case 0: aVal.setX( aValue.X ); aVal.setY( aValue.Y ); break; case MID_X: aVal.setX( nVal ); break; case MID_Y: aVal.setY( nVal ); break; - default: OSL_FAIL("Wrong MemberId!"); return FALSE; + default: OSL_FAIL("Wrong MemberId!"); return false; } } diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx index bf3b865ef6d9..ddf19201e63b 100644 --- a/svl/source/items/rectitem.cxx +++ b/svl/source/items/rectitem.cxx @@ -55,7 +55,7 @@ SfxRectangleItem::SfxRectangleItem() // ----------------------------------------------------------------------- -SfxRectangleItem::SfxRectangleItem( USHORT nW, const Rectangle& rVal ) : +SfxRectangleItem::SfxRectangleItem( sal_uInt16 nW, const Rectangle& rVal ) : SfxPoolItem( nW ), aVal( rVal ) { @@ -64,7 +64,7 @@ SfxRectangleItem::SfxRectangleItem( USHORT nW, const Rectangle& rVal ) : // ----------------------------------------------------------------------- -SfxRectangleItem::SfxRectangleItem( USHORT nW, SvStream &rStream ) : +SfxRectangleItem::SfxRectangleItem( sal_uInt16 nW, SvStream &rStream ) : SfxPoolItem( nW ) { DBG_CTOR(SfxRectangleItem, 0); @@ -121,7 +121,7 @@ SfxPoolItem* SfxRectangleItem::Clone(SfxItemPool *) const // ----------------------------------------------------------------------- -SfxPoolItem* SfxRectangleItem::Create(SvStream &rStream, USHORT ) const +SfxPoolItem* SfxRectangleItem::Create(SvStream &rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxRectangleItem, 0); Rectangle aStr; @@ -131,7 +131,7 @@ SfxPoolItem* SfxRectangleItem::Create(SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- -SvStream& SfxRectangleItem::Store(SvStream &rStream, USHORT ) const +SvStream& SfxRectangleItem::Store(SvStream &rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxRectangleItem, 0); rStream << aVal; @@ -141,7 +141,7 @@ SvStream& SfxRectangleItem::Store(SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId) const + sal_uInt8 nMemberId) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -166,7 +166,7 @@ bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, // ----------------------------------------------------------------------- bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) + sal_uInt8 nMemberId ) { bool bRet = false; nMemberId &= ~CONVERT_TWIPS; diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx index a08329360d2a..6be0975f8535 100644 --- a/svl/source/items/rngitem.cxx +++ b/svl/source/items/rngitem.cxx @@ -32,7 +32,7 @@ #ifndef NUMTYPE -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SfxXRangeItem SfxRangeItem #define SfxXRangesItem SfxUShortRangesItem #include <svl/rngitem.hxx> diff --git a/svl/source/items/rngitem_inc.cxx b/svl/source/items/rngitem_inc.cxx index 97a641131b3e..5be6228f147f 100644..100755 --- a/svl/source/items/rngitem_inc.cxx +++ b/svl/source/items/rngitem_inc.cxx @@ -53,7 +53,7 @@ SfxXRangeItem::SfxXRangeItem() // ----------------------------------------------------------------------- -SfxXRangeItem::SfxXRangeItem( USHORT which, NUMTYPE from, NUMTYPE to ): +SfxXRangeItem::SfxXRangeItem( sal_uInt16 which, NUMTYPE from, NUMTYPE to ): SfxPoolItem( which ), nFrom( from ), nTo( to ) @@ -63,7 +63,7 @@ SfxXRangeItem::SfxXRangeItem( USHORT which, NUMTYPE from, NUMTYPE to ): // ----------------------------------------------------------------------- -SfxXRangeItem::SfxXRangeItem( USHORT nW, SvStream &rStream ) : +SfxXRangeItem::SfxXRangeItem( sal_uInt16 nW, SvStream &rStream ) : SfxPoolItem( nW ) { rStream >> nFrom; @@ -116,7 +116,7 @@ SfxPoolItem* SfxXRangeItem::Clone(SfxItemPool *) const // ----------------------------------------------------------------------- -SfxPoolItem* SfxXRangeItem::Create(SvStream &rStream, USHORT) const +SfxPoolItem* SfxXRangeItem::Create(SvStream &rStream, sal_uInt16) const { NUMTYPE nVon, nBis; rStream >> nVon; @@ -126,7 +126,7 @@ SfxPoolItem* SfxXRangeItem::Create(SvStream &rStream, USHORT) const // ----------------------------------------------------------------------- -SvStream& SfxXRangeItem::Store(SvStream &rStream, USHORT) const +SvStream& SfxXRangeItem::Store(SvStream &rStream, sal_uInt16) const { rStream << nFrom; rStream << nTo; @@ -142,7 +142,7 @@ SfxXRangesItem::SfxXRangesItem() //------------------------------------------------------------------------- -SfxXRangesItem::SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges ) +SfxXRangesItem::SfxXRangesItem( sal_uInt16 nWID, const NUMTYPE *pRanges ) : SfxPoolItem( nWID ) { NUMTYPE nCount = Count_Impl(pRanges) + 1; @@ -152,7 +152,7 @@ SfxXRangesItem::SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges ) //------------------------------------------------------------------------- -SfxXRangesItem::SfxXRangesItem( USHORT nWID, SvStream &rStream ) +SfxXRangesItem::SfxXRangesItem( sal_uInt16 nWID, SvStream &rStream ) : SfxPoolItem( nWID ) { NUMTYPE nCount; @@ -186,9 +186,9 @@ int SfxXRangesItem::operator==( const SfxPoolItem &rItem ) const { const SfxXRangesItem &rOther = (const SfxXRangesItem&) rItem; if ( !_pRanges && !rOther._pRanges ) - return TRUE; + return sal_True; if ( _pRanges || rOther._pRanges ) - return FALSE; + return sal_False; NUMTYPE n; for ( n = 0; _pRanges[n] && rOther._pRanges[n]; ++n ) @@ -219,14 +219,14 @@ SfxPoolItem* SfxXRangesItem::Clone( SfxItemPool * ) const //------------------------------------------------------------------------- -SfxPoolItem* SfxXRangesItem::Create( SvStream &rStream, USHORT ) const +SfxPoolItem* SfxXRangesItem::Create( SvStream &rStream, sal_uInt16 ) const { return new SfxXRangesItem( Which(), rStream ); } //------------------------------------------------------------------------- -SvStream& SfxXRangesItem::Store( SvStream &rStream, USHORT ) const +SvStream& SfxXRangesItem::Store( SvStream &rStream, sal_uInt16 ) const { NUMTYPE nCount = Count_Impl( _pRanges ); rStream >> nCount; diff --git a/svl/source/items/sfontitm.cxx b/svl/source/items/sfontitm.cxx index 4f41dfe63b39..61afc8a2004a 100644 --- a/svl/source/items/sfontitm.cxx +++ b/svl/source/items/sfontitm.cxx @@ -73,7 +73,7 @@ int SfxFontItem::operator ==(const SfxPoolItem & rItem) const //============================================================================ // virtual -SfxPoolItem * SfxFontItem::Create(SvStream & rStream, USHORT) const +SfxPoolItem * SfxFontItem::Create(SvStream & rStream, sal_uInt16) const { VersionCompat aItemCompat(rStream, STREAM_READ); SfxFontItem * pItem = new SfxFontItem(Which()); @@ -105,8 +105,8 @@ SfxPoolItem * SfxFontItem::Create(SvStream & rStream, USHORT) const rStream >> nKerning; pItem->m_bKerning = nKerning != 0; } - pItem->m_aColor.Read(rStream, TRUE); - pItem->m_aFillColor.Read(rStream, TRUE); + pItem->m_aColor.Read(rStream, sal_True); + pItem->m_aFillColor.Read(rStream, sal_True); sal_Int16 nFlags = 0; rStream >> nFlags; pItem->m_bHasFont = (nFlags & 4) != 0; @@ -117,7 +117,7 @@ SfxPoolItem * SfxFontItem::Create(SvStream & rStream, USHORT) const //============================================================================ // virtual -SvStream & SfxFontItem::Store(SvStream & rStream, USHORT) const +SvStream & SfxFontItem::Store(SvStream & rStream, sal_uInt16) const { VersionCompat aItemCompat(rStream, STREAM_WRITE, 1); { @@ -131,8 +131,8 @@ SvStream & SfxFontItem::Store(SvStream & rStream, USHORT) const << sal_Int8(m_bOutline) << sal_Int8(m_bShadow) << sal_Int8(m_bKerning); } - SAL_CONST_CAST(Color &, m_aColor).Write(rStream, TRUE); - SAL_CONST_CAST(Color &, m_aFillColor).Write(rStream, TRUE); + SAL_CONST_CAST(Color &, m_aColor).Write(rStream, sal_True); + SAL_CONST_CAST(Color &, m_aFillColor).Write(rStream, sal_True); rStream << sal_Int16(m_bHasFont << 2 | m_bHasColor | m_bHasFillColor << 1); return rStream; diff --git a/svl/source/items/sitem.cxx b/svl/source/items/sitem.cxx index 48953164d4d3..a077a6f5380f 100644 --- a/svl/source/items/sitem.cxx +++ b/svl/source/items/sitem.cxx @@ -42,16 +42,16 @@ DBG_NAME(SfxSetItem) // -------------------------------------------------------------------------- -SfxSetItem::SfxSetItem( USHORT which, const SfxItemSet &rSet) : +SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) : SfxPoolItem(which), - pSet(rSet.Clone(TRUE)) + pSet(rSet.Clone(sal_True)) { DBG_CTOR(SfxSetItem, 0); } // -------------------------------------------------------------------------- -SfxSetItem::SfxSetItem( USHORT which, SfxItemSet *pS) : +SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet *pS) : SfxPoolItem(which), pSet(pS) { @@ -63,7 +63,7 @@ SfxSetItem::SfxSetItem( USHORT which, SfxItemSet *pS) : SfxSetItem::SfxSetItem( const SfxSetItem& rCopy, SfxItemPool *pPool ) : SfxPoolItem(rCopy.Which()), - pSet(rCopy.pSet->Clone(TRUE, pPool)) + pSet(rCopy.pSet->Clone(sal_True, pPool)) { DBG_CTOR(SfxSetItem, 0); } @@ -102,7 +102,7 @@ SfxItemPresentation SfxSetItem::GetPresentation // -------------------------------------------------------------------------- -SvStream& SfxSetItem::Store(SvStream& rStream, USHORT) const +SvStream& SfxSetItem::Store(SvStream& rStream, sal_uInt16) const { GetItemSet().Store(rStream); return rStream; diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx index 392f986f942f..e001bf1e23f2 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.cxx @@ -46,12 +46,12 @@ TYPEINIT1_AUTOFACTORY(SfxStringListItem, SfxPoolItem); class SfxImpStringList { public: - USHORT nRefCount; + sal_uInt16 nRefCount; List aList; SfxImpStringList() { nRefCount = 1; } ~SfxImpStringList(); - void Sort( BOOL bAscending, List* ); + void Sort( sal_Bool bAscending, List* ); }; //------------------------------------------------------------------------ @@ -70,36 +70,36 @@ SfxImpStringList::~SfxImpStringList() //------------------------------------------------------------------------ -void SfxImpStringList::Sort( BOOL bAscending, List* pParallelList ) +void SfxImpStringList::Sort( sal_Bool bAscending, List* pParallelList ) { DBG_ASSERT(!pParallelList || pParallelList->Count() >= aList.Count(),"Sort:ParallelList too small"); - ULONG nCount = aList.Count(); + sal_uLong nCount = aList.Count(); if( nCount > 1 ) { nCount -= 2; // Bubble Dir Einen - BOOL bSwapped = TRUE; + sal_Bool bSwapped = sal_True; while( bSwapped ) { - bSwapped = FALSE; - for( ULONG nCur = 0; nCur <= nCount; nCur++ ) + bSwapped = sal_False; + for( sal_uLong nCur = 0; nCur <= nCount; nCur++ ) { String* pStr1 = (String*)aList.GetObject( nCur ); String* pStr2 = (String*)aList.GetObject( nCur+1 ); // COMPARE_GREATER => pStr2 ist groesser als pStr1 StringCompare eCompare = pStr1->CompareIgnoreCaseToAscii( *pStr2 ); //@@@ - BOOL bSwap = FALSE; + sal_Bool bSwap = sal_False; if( bAscending ) { if( eCompare == COMPARE_LESS ) - bSwap = TRUE; + bSwap = sal_True; } else if( eCompare == COMPARE_GREATER ) - bSwap = TRUE; + bSwap = sal_True; if( bSwap ) { - bSwapped = TRUE; + bSwapped = sal_True; aList.Replace( pStr1, nCur + 1 ); aList.Replace( pStr2, nCur ); if( pParallelList ) @@ -124,7 +124,7 @@ SfxStringListItem::SfxStringListItem() : //------------------------------------------------------------------------ -SfxStringListItem::SfxStringListItem( USHORT which, const List* pList ) : +SfxStringListItem::SfxStringListItem( sal_uInt16 which, const List* pList ) : SfxPoolItem( which ), pImp(NULL) { @@ -147,7 +147,7 @@ SfxStringListItem::SfxStringListItem( USHORT which, const List* pList ) : //------------------------------------------------------------------------ -SfxStringListItem::SfxStringListItem( USHORT which, SvStream& rStream ) : +SfxStringListItem::SfxStringListItem( sal_uInt16 which, SvStream& rStream ) : SfxPoolItem( which ), pImp(NULL) { @@ -215,9 +215,9 @@ int SfxStringListItem::operator==( const SfxPoolItem& rItem ) const SfxStringListItem* pItem = (SfxStringListItem*)&rItem; if( pImp == pItem->pImp ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } //------------------------------------------------------------------------ @@ -251,14 +251,14 @@ SfxPoolItem* SfxStringListItem::Clone( SfxItemPool *) const //------------------------------------------------------------------------ -SfxPoolItem* SfxStringListItem::Create( SvStream & rStream, USHORT ) const +SfxPoolItem* SfxStringListItem::Create( SvStream & rStream, sal_uInt16 ) const { return new SfxStringListItem( Which(), rStream ); } //------------------------------------------------------------------------ -SvStream& SfxStringListItem::Store( SvStream & rStream, USHORT ) const +SvStream& SfxStringListItem::Store( SvStream & rStream, sal_uInt16 ) const { if( !pImp ) { @@ -348,14 +348,14 @@ XubString SfxStringListItem::GetString() int SfxStringListItem::IsPoolable() const { - return FALSE; + return sal_False; } #endif //------------------------------------------------------------------------ -void SfxStringListItem::Sort( BOOL bAscending, List* pParallelList ) +void SfxStringListItem::Sort( sal_Bool bAscending, List* pParallelList ) { DBG_ASSERT(GetRefCount()==0,"Sort:RefCount!=0"); if( pImp ) @@ -394,7 +394,7 @@ void SfxStringListItem::GetStringList( com::sun::star::uno::Sequence< rtl::OUStr //---------------------------------------------------------------------------- // virtual -bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal,BYTE ) +bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Sequence< rtl::OUString > aValue; if ( rVal >>= aValue ) @@ -409,7 +409,7 @@ bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal,BYTE ) //---------------------------------------------------------------------------- // virtual -bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const +bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { // GetString() is not const!!! SfxStringListItem* pThis = const_cast< SfxStringListItem * >( this ); diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index b7e162511fb9..d1d0bf7483f5 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -102,7 +102,7 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames() const int nCount = SAL_N_ELEMENTS( aTranslitNames ); Sequence< ::rtl::OUString > aNames( nCount ); ::rtl::OUString* pNames = aNames.getArray(); - for (INT32 i = 0; i < nCount; ++i) + for (sal_Int32 i = 0; i < nCount; ++i) pNames[i] = ::rtl::OUString::createFromAscii( aTranslitNames[i] ); return aNames; @@ -132,7 +132,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : bBackward ( sal_False ), bPattern ( sal_False ), bContent ( sal_False ), - bAsianOptions ( FALSE ) + bAsianOptions ( sal_False ) { EnableNotification( lcl_GetNotifyNames() ); @@ -149,7 +149,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : if (aOpt.IsWholeWordsOnly()) aSearchOpt.searchFlag |= SearchFlags::NORM_WORD_ONLY; - INT32 &rFlags = aSearchOpt.transliterateFlags; + sal_Int32 &rFlags = aSearchOpt.transliterateFlags; if (!aOpt.IsMatchCase()) rFlags |= TransliterationModules_IGNORE_CASE; @@ -234,7 +234,7 @@ SfxPoolItem* SvxSearchItem::Clone( SfxItemPool *) const // ----------------------------------------------------------------------- //! used below -static BOOL operator == ( const SearchOptions& rItem1, const SearchOptions& rItem2 ) +static sal_Bool operator == ( const SearchOptions& rItem1, const SearchOptions& rItem2 ) { return rItem1.algorithmType == rItem2.algorithmType && rItem1.searchFlag == rItem2.searchFlag && @@ -431,7 +431,7 @@ void SvxSearchItem::SetTransliterationFlags( sal_Int32 nFlags ) aSearchOpt.transliterateFlags = nFlags; } -bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const +bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -523,7 +523,7 @@ bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) // ----------------------------------------------------------------------- -bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) +bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; bool bRet = false; diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx index cc1cd2d4e1e6..2dc013bdf5d4 100644 --- a/svl/source/items/stritem.cxx +++ b/svl/source/items/stritem.cxx @@ -40,7 +40,7 @@ TYPEINIT1_AUTOFACTORY(SfxStringItem, CntUnencodedStringItem) //============================================================================ // virtual -SfxStringItem::SfxStringItem(USHORT which, SvStream & rStream): +SfxStringItem::SfxStringItem(sal_uInt16 which, SvStream & rStream): CntUnencodedStringItem(which) { UniString aValue; @@ -51,14 +51,14 @@ SfxStringItem::SfxStringItem(USHORT which, SvStream & rStream): //============================================================================ // virtual -SfxPoolItem * SfxStringItem::Create(SvStream & rStream, USHORT) const +SfxPoolItem * SfxStringItem::Create(SvStream & rStream, sal_uInt16) const { return new SfxStringItem(Which(), rStream); } //============================================================================ // virtual -SvStream & SfxStringItem::Store(SvStream & rStream, USHORT) const +SvStream & SfxStringItem::Store(SvStream & rStream, sal_uInt16) const { writeByteString(rStream, GetValue()); return rStream; diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 243ab85019a0..adb7efa7b260 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -53,7 +53,7 @@ #include <algorithm> #define STYLESTREAM "SfxStyleSheets" -#define STYLESTREAM_VERSION USHORT(50) +#define STYLESTREAM_VERSION sal_uInt16(50) #ifdef DBG_UTIL class DbgStyleSheetReferences @@ -85,7 +85,7 @@ TYPEINIT1(SfxStyleSheetPoolHint, SfxHint); SfxStyleSheetHintExtended::SfxStyleSheetHintExtended ( - USHORT nAction, // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) const String& rOldName ) : SfxStyleSheetHint( nAction ), @@ -93,7 +93,7 @@ SfxStyleSheetHintExtended::SfxStyleSheetHintExtended {} SfxStyleSheetHintExtended::SfxStyleSheetHintExtended ( - USHORT nAction, // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) const String& rOldName, SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer ) @@ -105,7 +105,7 @@ SfxStyleSheetHintExtended::SfxStyleSheetHintExtended SfxStyleSheetHint::SfxStyleSheetHint ( - USHORT nAction, // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer ) : pStyleSh( &rStyleSheet ), @@ -114,7 +114,7 @@ SfxStyleSheetHint::SfxStyleSheetHint SfxStyleSheetHint::SfxStyleSheetHint ( - USHORT nAction // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction // SFX_STYLESHEET_... (s.o.) ) : pStyleSh( NULL ), nHint( nAction ) @@ -136,7 +136,7 @@ class SfxStyleSheetBasePool_Impl // Konstruktoren -SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBasePool& r, SfxStyleFamily eFam, USHORT mask ) +SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBasePool& r, SfxStyleFamily eFam, sal_uInt16 mask ) : rPool( r ) , nFamily( eFam ) , aName( rName ) @@ -145,7 +145,7 @@ SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBaseP , pSet( NULL ) , nMask(mask) , nHelpId( 0 ) - , bMySet( FALSE ) + , bMySet( sal_False ) { #ifdef DBG_UTIL aDbgStyleSheetReferences.mnStyles++; @@ -205,7 +205,7 @@ SfxStyleSheetBase::~SfxStyleSheetBase() } } -USHORT SfxStyleSheetBase::GetVersion() const +sal_uInt16 SfxStyleSheetBase::GetVersion() const { return 0x0000; } @@ -217,24 +217,24 @@ const XubString& SfxStyleSheetBase::GetName() const return aName; } -BOOL SfxStyleSheetBase::SetName( const XubString& rName ) +sal_Bool SfxStyleSheetBase::SetName( const XubString& rName ) { if(rName.Len() == 0) - return FALSE; + return sal_False; if( aName != rName ) { String aOldName = aName; SfxStyleSheetBase *pOther = rPool.Find( rName, nFamily ) ; if ( pOther && pOther != this ) - return FALSE; + return sal_False; SfxStyleFamily eTmpFam=rPool.GetSearchFamily(); - USHORT nTmpMask=rPool.GetSearchMask(); + sal_uInt16 nTmpMask=rPool.GetSearchMask(); rPool.SetSearchMask(nFamily); if ( aName.Len() ) - rPool.ChangeParent( aName, rName, FALSE ); + rPool.ChangeParent( aName, rName, sal_False ); if ( aFollow.Equals( aName ) ) aFollow = rName; aName = rName; @@ -242,7 +242,7 @@ BOOL SfxStyleSheetBase::SetName( const XubString& rName ) rPool.Broadcast( SfxStyleSheetHintExtended( SFX_STYLESHEET_MODIFIED, aOldName, *this ) ); } - return TRUE; + return sal_True; } rtl::OUString SfxStyleSheetBase::GetDisplayName() const @@ -269,10 +269,10 @@ const XubString& SfxStyleSheetBase::GetParent() const return aParent; } -BOOL SfxStyleSheetBase::SetParent( const XubString& rName ) +sal_Bool SfxStyleSheetBase::SetParent( const XubString& rName ) { if ( rName == aName ) - return FALSE; + return sal_False; if( aParent != rName ) { @@ -280,20 +280,20 @@ BOOL SfxStyleSheetBase::SetParent( const XubString& rName ) if( rName.Len() && !pIter ) { OSL_FAIL( "StyleSheet-Parent nicht gefunden" ); - return FALSE; + return sal_False; } // rekursive Verknuepfungen verhindern if( aName.Len() ) while(pIter) { if(pIter->GetName() == aName && aName != rName) - return FALSE; + return sal_False; pIter = rPool.Find(pIter->GetParent(), nFamily); } aParent = rName; } rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) ); - return TRUE; + return sal_True; } // Follow aendern @@ -303,19 +303,19 @@ const XubString& SfxStyleSheetBase::GetFollow() const return aFollow; } -BOOL SfxStyleSheetBase::SetFollow( const XubString& rName ) +sal_Bool SfxStyleSheetBase::SetFollow( const XubString& rName ) { if( aFollow != rName ) { if( !rPool.Find( rName, nFamily ) ) { OSL_FAIL( "StyleSheet-Follow nicht gefunden" ); - return FALSE; + return sal_False; } aFollow = rName; } rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) ); - return TRUE; + return sal_True; } // Itemset setzen. Die Dflt-Implementation legt ein neues Set an. @@ -325,20 +325,20 @@ SfxItemSet& SfxStyleSheetBase::GetItemSet() if( !pSet ) { pSet = new SfxItemSet( rPool.GetPool() ); - bMySet = TRUE; + bMySet = sal_True; } return *pSet; } // Hilfe-Datei und -ID setzen und abfragen -ULONG SfxStyleSheetBase::GetHelpId( String& rFile ) +sal_uLong SfxStyleSheetBase::GetHelpId( String& rFile ) { rFile = aHelpFile; return nHelpId; } -void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId ) +void SfxStyleSheetBase::SetHelpId( const String& rFile, sal_uLong nId ) { aHelpFile = rFile; nHelpId = nId; @@ -346,30 +346,30 @@ void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId ) // Folgevorlage m"oglich? Default: Ja -BOOL SfxStyleSheetBase::HasFollowSupport() const +sal_Bool SfxStyleSheetBase::HasFollowSupport() const { - return TRUE; + return sal_True; } // Basisvorlage m"oglich? Default: Ja -BOOL SfxStyleSheetBase::HasParentSupport() const +sal_Bool SfxStyleSheetBase::HasParentSupport() const { - return TRUE; + return sal_True; } // Basisvorlage uf NULL setzen m"oglich? Default: Nein -BOOL SfxStyleSheetBase::HasClearParentSupport() const +sal_Bool SfxStyleSheetBase::HasClearParentSupport() const { - return FALSE; + return sal_False; } // Defaultmaessig sind alle StyleSheets Used -BOOL SfxStyleSheetBase::IsUsed() const +sal_Bool SfxStyleSheetBase::IsUsed() const { - return TRUE; + return sal_True; } // eingestellte Attribute ausgeben @@ -416,30 +416,30 @@ SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const return nSearchFamily; } -inline BOOL SfxStyleSheetIterator::IsTrivialSearch() +inline sal_Bool SfxStyleSheetIterator::IsTrivialSearch() { return nMask == 0xFFFF && GetSearchFamily() == SFX_STYLE_FAMILY_ALL; } -BOOL SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle) +sal_Bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle) { return ((GetSearchFamily() == SFX_STYLE_FAMILY_ALL) || ( pStyle->GetFamily() == GetSearchFamily() )) && (( pStyle->GetMask() & ( GetSearchMask() & ~SFXSTYLEBIT_USED )) || - ( bSearchUsed ? pStyle->IsUsed() : FALSE ) || + ( bSearchUsed ? pStyle->IsUsed() : sal_False ) || GetSearchMask() == SFXSTYLEBIT_ALL ); } SfxStyleSheetIterator::SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase, - SfxStyleFamily eFam, USHORT n) + SfxStyleFamily eFam, sal_uInt16 n) { pBasePool=pBase; nSearchFamily=eFam; - bSearchUsed=FALSE; + bSearchUsed=sal_False; if((n != SFXSTYLEBIT_ALL ) && ((n & SFXSTYLEBIT_USED) == SFXSTYLEBIT_USED)) { - bSearchUsed = TRUE; + bSearchUsed = sal_True; n &= ~SFXSTYLEBIT_USED; } nMask=n; @@ -450,13 +450,13 @@ SfxStyleSheetIterator::~SfxStyleSheetIterator() } -USHORT SfxStyleSheetIterator::Count() +sal_uInt16 SfxStyleSheetIterator::Count() { - USHORT n = 0; + sal_uInt16 n = 0; if( IsTrivialSearch()) - n = (USHORT) pBasePool->aStyles.size(); + n = (sal_uInt16) pBasePool->aStyles.size(); else - for(USHORT i=0; i<pBasePool->aStyles.size(); i++) + for(sal_uInt16 i=0; i<pBasePool->aStyles.size(); i++) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[i].get(); if(DoesStyleMatch(pStyle)) @@ -465,13 +465,13 @@ USHORT SfxStyleSheetIterator::Count() return n; } -SfxStyleSheetBase* SfxStyleSheetIterator::operator[](USHORT nIdx) +SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx) { if( IsTrivialSearch()) return pBasePool->aStyles[nIdx].get(); - USHORT z = 0; - for(USHORT n=0; n<pBasePool->aStyles.size(); n++) + sal_uInt16 z = 0; + for(sal_uInt16 n=0; n<pBasePool->aStyles.size(); n++) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); if( DoesStyleMatch(pStyle)) @@ -490,12 +490,12 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](USHORT nIdx) SfxStyleSheetBase* SfxStyleSheetIterator::First() { - INT32 nIdx = -1; + sal_Int32 nIdx = -1; if ( IsTrivialSearch() && pBasePool->aStyles.size() ) nIdx = 0; else - for( USHORT n = 0; n < pBasePool->aStyles.size(); n++ ) + for( sal_uInt16 n = 0; n < pBasePool->aStyles.size(); n++ ) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); @@ -508,7 +508,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First() if ( nIdx != -1 ) { - nAktPosition = (USHORT)nIdx; + nAktPosition = (sal_uInt16)nIdx; return pAktStyle = pBasePool->aStyles[nIdx].get(); } return 0; @@ -517,13 +517,13 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First() SfxStyleSheetBase* SfxStyleSheetIterator::Next() { - INT32 nIdx = -1; + sal_Int32 nIdx = -1; if ( IsTrivialSearch() && - (USHORT)pBasePool->aStyles.size() > nAktPosition + 1 ) + (sal_uInt16)pBasePool->aStyles.size() > nAktPosition + 1 ) nIdx = nAktPosition + 1; else - for( USHORT n = nAktPosition + 1; n < pBasePool->aStyles.size(); n++ ) + for( sal_uInt16 n = nAktPosition + 1; n < pBasePool->aStyles.size(); n++ ) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); @@ -536,7 +536,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() if ( nIdx != -1 ) { - nAktPosition = (USHORT)nIdx; + nAktPosition = (sal_uInt16)nIdx; return pAktStyle = pBasePool->aStyles[nIdx].get(); } return 0; @@ -545,11 +545,11 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() SfxStyleSheetBase* SfxStyleSheetIterator::Find(const XubString& rStr) { - for ( USHORT n = 0; n < pBasePool->aStyles.size(); n++ ) + for ( sal_uInt16 n = 0; n < pBasePool->aStyles.size(); n++ ) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); - // #98454# performance: in case of bSearchUsed==TRUE it may be + // #98454# performance: in case of bSearchUsed==sal_True it may be // significant to first compare the name and only if it matches to call // the style sheet IsUsed() method in DoesStyleMatch(). if ( pStyle->GetName().Equals( rStr ) && DoesStyleMatch( pStyle ) ) @@ -562,9 +562,9 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const XubString& rStr) } -USHORT SfxStyleSheetIterator::GetSearchMask() const +sal_uInt16 SfxStyleSheetIterator::GetSearchMask() const { - USHORT mask = nMask; + sal_uInt16 mask = nMask; if ( bSearchUsed ) mask |= SFXSTYLEBIT_USED; @@ -636,7 +636,7 @@ SfxStyleSheetBasePool::~SfxStyleSheetBasePool() delete pImp; } -BOOL SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent) +sal_Bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent) { SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL); SfxStyleSheetBase *pStyle = @@ -645,16 +645,16 @@ BOOL SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rSty if(pStyle) return pStyle->SetParent(rParent); else - return FALSE; + return sal_False; } -void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, USHORT n) +void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n) { nSearchFamily = eFam; nMask = n; } -USHORT SfxStyleSheetBasePool::GetSearchMask() const +sal_uInt16 SfxStyleSheetBasePool::GetSearchMask() const { return nMask; } @@ -674,7 +674,7 @@ String SfxStyleSheetBasePool::GetStreamName() SfxStyleSheetIterator* SfxStyleSheetBasePool::CreateIterator ( SfxStyleFamily eFam, - USHORT mask + sal_uInt16 mask ) { return new SfxStyleSheetIterator(this,eFam,mask); @@ -685,7 +685,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create ( const XubString& rName, SfxStyleFamily eFam, - USHORT mask + sal_uInt16 mask ) { return new SfxStyleSheetBase( rName, *this, eFam, mask ); @@ -696,7 +696,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r ) return new SfxStyleSheetBase( r ); } -SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, USHORT mask, USHORT nPos) +SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos) { OSL_ENSURE( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); @@ -764,19 +764,19 @@ SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator+=( const SfxStyleSheetBas //////////////////////////////// Suchen //////////////////////////////////// -USHORT SfxStyleSheetBasePool::Count() +sal_uInt16 SfxStyleSheetBasePool::Count() { return GetIterator_Impl().Count(); } -SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](USHORT nIdx) +SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](sal_uInt16 nIdx) { return GetIterator_Impl()[nIdx]; } SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const XubString& rName, SfxStyleFamily eFam, - USHORT mask) + sal_uInt16 mask) { SfxStyleSheetIterator aIter(this,eFam,mask); return aIter.Find(rName); @@ -867,9 +867,9 @@ void SfxStyleSheetBasePool::Clear() void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld, const XubString& rNew, - BOOL bVirtual) + sal_Bool bVirtual) { - const USHORT nTmpMask = GetSearchMask(); + const sal_uInt16 nTmpMask = GetSearchMask(); SetSearchMask(GetSearchFamily(), 0xffff); for( SfxStyleSheetBase* p = First(); p; p = Next() ) { @@ -886,7 +886,7 @@ void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld, /////////////////////////// Laden/Speichern ///////////////////////////////// -void SfxStyleSheetBase::Load( SvStream&, USHORT ) +void SfxStyleSheetBase::Load( SvStream&, sal_uInt16 ) { } @@ -895,7 +895,7 @@ void SfxStyleSheetBase::Store( SvStream& ) } -BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) +sal_Bool SfxStyleSheetBasePool::Load( SvStream& rStream ) { // alte Version? if ( !rPool.IsVer2_Impl() ) @@ -910,7 +910,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) { SfxSingleRecordReader aHeaderRec( &rStream, SFX_STYLES_REC_HEADER ); if ( !aHeaderRec.IsValid() ) - return FALSE; + return sal_False; aAppName = rPool.GetName(); rStream >> nCharSet; @@ -921,15 +921,15 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) { SfxMultiRecordReader aStylesRec( &rStream, SFX_STYLES_REC_STYLES ); if ( !aStylesRec.IsValid() ) - return FALSE; + return sal_False; rtl_TextEncoding eEnc = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, - sal::static_int_cast< USHORT >(rStream.GetVersion()) ); + sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) ); rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet(); rStream.SetStreamCharSet( eEnc ); - USHORT nStyles; + sal_uInt16 nStyles; for ( nStyles = 0; aStylesRec.GetContent(); nStyles++ ) { // kann nicht mehr weiterlesen? @@ -939,7 +939,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) // Globale Teile XubString aName, aParent, aFollow; String aHelpFile; - USHORT nFamily, nStyleMask,nCount; + sal_uInt16 nFamily, nStyleMask,nCount; sal_uInt32 nHelpId; rStream.ReadByteString(aName, eEnc ); rStream.ReadByteString(aParent, eEnc ); @@ -953,7 +953,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) // Hier erst einmal Parent und Follow zwischenspeichern rSheet.aParent = aParent; rSheet.aFollow = aFollow; - UINT32 nPos = rStream.Tell(); + sal_uInt32 nPos = rStream.Tell(); rStream >> nCount; if(nCount) { @@ -967,8 +967,8 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) //! rSet.Put( aTmpSet ); } // Lokale Teile - UINT32 nSize; - USHORT nVer; + sal_uInt32 nSize; + sal_uInt16 nVer; rStream >> nVer >> nSize; nPos = rStream.Tell() + nSize; rSheet.Load( rStream, nVer ); @@ -976,13 +976,13 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) } // #72939# only loop through the styles that were really inserted - ULONG n = aStyles.size(); + sal_uLong n = aStyles.size(); //! delete pTmpPool; // Jetzt Parent und Follow setzen. Alle Sheets sind geladen. // Mit Setxxx() noch einmal den String eintragen, da diese // virtuellen Methoden evtl. ueberlagert sind. - for ( ULONG i = 0; i < n; i++ ) + for ( sal_uLong i = 0; i < n; i++ ) { SfxStyleSheetBase* p = aStyles[ i ].get(); XubString aText = p->aParent; @@ -997,13 +997,13 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) } // alles klar? - return BOOL( rStream.GetError() == SVSTREAM_OK ); + return sal_Bool( rStream.GetError() == SVSTREAM_OK ); } -BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) +sal_Bool SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) { aAppName = rPool.GetName(); - USHORT nVersion; + sal_uInt16 nVersion; short nCharSet; rStream >> nVersion; @@ -1014,13 +1014,13 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) rtl_TextEncoding eEnc = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, - sal::static_int_cast< USHORT >(rStream.GetVersion()) ); + sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) ); rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet(); rStream.SetStreamCharSet( eEnc ); - USHORT nStyles; + sal_uInt16 nStyles; rStream >> nStyles; - USHORT i; + sal_uInt16 i; for ( i = 0; i < nStyles; i++ ) { // kann nicht mehr weiterlesen? @@ -1033,7 +1033,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) // Globale Teile XubString aName, aParent, aFollow; String aHelpFile; - USHORT nFamily, nStyleMask,nCount; + sal_uInt16 nFamily, nStyleMask,nCount; sal_uInt32 nHelpId; rStream.ReadByteString(aName, eEnc ); rStream.ReadByteString(aParent, eEnc ); @@ -1042,7 +1042,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) SfxPoolItem::readByteString(rStream, aHelpFile); if(nVersion!=STYLESTREAM_VERSION) { - USHORT nTmpHelpId; + sal_uInt16 nTmpHelpId; rStream >> nTmpHelpId; nHelpId=nTmpHelpId; } @@ -1054,7 +1054,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) // Hier erst einmal Parent und Follow zwischenspeichern rSheet.aParent = aParent; rSheet.aFollow = aFollow; - UINT32 nPos = rStream.Tell(); + sal_uInt32 nPos = rStream.Tell(); rStream >> nCount; if(nCount) { rStream.Seek( nPos ); @@ -1067,8 +1067,8 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) //! rSet.Put( aTmpSet ); } // Lokale Teile - UINT32 nSize; - USHORT nVer; + sal_uInt32 nSize; + sal_uInt16 nVer; rStream >> nVer >> nSize; nPos = rStream.Tell() + nSize; rSheet.Load( rStream, nVer ); @@ -1092,16 +1092,16 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) rStream.SetStreamCharSet( eOldEnc ); - return BOOL( rStream.GetError() == SVSTREAM_OK ); + return sal_Bool( rStream.GetError() == SVSTREAM_OK ); } -BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) +sal_Bool SfxStyleSheetBasePool::Store( SvStream& rStream, sal_Bool bUsed ) { // den ganzen StyleSheet-Pool in einen Mini-Record SfxMiniRecordWriter aPoolRec( &rStream, SFX_STYLES_REC ); // Erst einmal die Dummies rauszaehlen; die werden nicht gespeichert - USHORT nCount = 0; + sal_uInt16 nCount = 0; for( SfxStyleSheetBase* p = First(); p; p = Next() ) { if(!bUsed || p->IsUsed()) @@ -1112,7 +1112,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) rtl_TextEncoding eEnc = ::GetSOStoreTextEncoding( rStream.GetStreamCharSet(), - sal::static_int_cast< USHORT >(rStream.GetVersion()) ); + sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) ); rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet(); rStream.SetStreamCharSet( eEnc ); @@ -1139,7 +1139,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) { if(!bUsed || p->IsUsed()) { - USHORT nFamily = (USHORT)p->GetFamily(); + sal_uInt16 nFamily = (sal_uInt16)p->GetFamily(); String* pName = new String( p->GetName() ); ByteString* pConvName = new ByteString( *pName, eEnc ); @@ -1151,7 +1151,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) pConvName->SetChar( 1, sal::static_int_cast< char >(0xff & nFamily) ); - USHORT nInsPos, nAdd = aSortConvNames.Count(); + sal_uInt16 nInsPos, nAdd = aSortConvNames.Count(); while( !aSortConvNames.Insert( pConvName, nInsPos ) ) (pConvName->Append( '_' )).Append( ByteString::CreateFromInt32( nAdd++ )); @@ -1162,9 +1162,9 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) // now we have the list of the names, sorted by convertede names // But now we need the sorted list of orignames. { - USHORT nInsPos, nEnd = aOrigNames.Count(); + sal_uInt16 nInsPos, nEnd = aOrigNames.Count(); const ByteStringPtr* ppB = aSortConvNames.GetData(); - for( USHORT n = 0; n < nEnd; ++n, ++ppB ) + for( sal_uInt16 n = 0; n < nEnd; ++n, ++ppB ) { String* p = aOrigNames.GetObject( n ); aSortOrigNames.Insert( p, nInsPos ); @@ -1176,7 +1176,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) ByteString sEmpty; - USHORT nFndPos; + sal_uInt16 nFndPos; String sNm; SfxMultiVarRecordWriter aStylesRec( &rStream, SFX_STYLES_REC_STYLES, 0 ); for( SfxStyleSheetBase* p = First(); p; p = Next() ) @@ -1188,7 +1188,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) // Globale Teile speichern String aHelpFile; sal_uInt32 nHelpId = p->GetHelpId( aHelpFile ); - USHORT nFamily = sal::static_int_cast< USHORT >(p->GetFamily()); + sal_uInt16 nFamily = sal::static_int_cast< sal_uInt16 >(p->GetFamily()); String sFamily( (sal_Unicode)nFamily ); (sNm = sFamily) += p->GetName(); @@ -1215,18 +1215,18 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) if(p->pSet) p->pSet->Store( rStream ); else - rStream << (USHORT)0; + rStream << (sal_uInt16)0; // Lokale Teile speichern // Vor dem lokalen Teil wird die Laenge der lokalen Daten - // als UINT32 sowie die Versionsnummer gespeichert. - rStream << (USHORT) p->GetVersion(); - ULONG nPos1 = rStream.Tell(); - rStream << (UINT32) 0; + // als sal_uInt32 sowie die Versionsnummer gespeichert. + rStream << (sal_uInt16) p->GetVersion(); + sal_uLong nPos1 = rStream.Tell(); + rStream << (sal_uInt32) 0; p->Store( rStream ); - ULONG nPos2 = rStream.Tell(); + sal_uLong nPos2 = rStream.Tell(); rStream.Seek( nPos1 ); - rStream << (UINT32) ( nPos2 - nPos1 - sizeof( UINT32 ) ); + rStream << (sal_uInt32) ( nPos2 - nPos1 - sizeof( sal_uInt32 ) ); rStream.Seek( nPos2 ); if( rStream.GetError() != SVSTREAM_OK ) break; @@ -1236,7 +1236,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) rStream.SetStreamCharSet( eOldEnc ); - return BOOL( rStream.GetError() == SVSTREAM_OK ); + return sal_Bool( rStream.GetError() == SVSTREAM_OK ); } SfxItemPool& SfxStyleSheetBasePool::GetPool() @@ -1254,7 +1254,7 @@ const SfxItemPool& SfxStyleSheetBasePool::GetPool() const SfxStyleSheet::SfxStyleSheet(const XubString &rName, const SfxStyleSheetBasePool& r_Pool, SfxStyleFamily eFam, - USHORT mask ): + sal_uInt16 mask ): SfxStyleSheetBase(rName, const_cast< SfxStyleSheetBasePool& >( r_Pool ), eFam, mask) {} @@ -1274,10 +1274,10 @@ SfxStyleSheet::~SfxStyleSheet() } -BOOL SfxStyleSheet::SetParent( const XubString& rName ) +sal_Bool SfxStyleSheet::SetParent( const XubString& rName ) { if(aParent == rName) - return TRUE; + return sal_True; const XubString aOldParent(aParent); if(SfxStyleSheetBase::SetParent(rName)) { // aus der Benachrichtigungskette des alten @@ -1294,9 +1294,9 @@ BOOL SfxStyleSheet::SetParent( const XubString& rName ) if(pParent) StartListening(*pParent); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // alle Zuhoerer benachtichtigen @@ -1316,7 +1316,7 @@ SfxStyleSheetPool::SfxStyleSheetPool( SfxItemPool const& rSet) /////////////////////////////////// Factory //////////////////////////////// SfxStyleSheetBase* SfxStyleSheetPool::Create( const XubString& rName, - SfxStyleFamily eFam, USHORT mask ) + SfxStyleFamily eFam, sal_uInt16 mask ) { return new SfxStyleSheet( rName, *this, eFam, mask ); } @@ -1326,9 +1326,9 @@ SfxStyleSheetBase* SfxStyleSheetPool::Create( const SfxStyleSheet& r ) return new SfxStyleSheet( r ); } /* -BOOL SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &) +sal_Bool SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &) { - return FALSE; + return sal_False; } */ @@ -1336,7 +1336,7 @@ BOOL SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &) // class SfxUnoStyleSheet // -------------------------------------------------------------------- -SfxUnoStyleSheet::SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, USHORT _nMaske ) +SfxUnoStyleSheet::SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ) : ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >( _rName, _rPool, _eFamily, _nMaske ) { } diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index af8ebe3db269..1873ffda3a3b 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.cxx @@ -35,7 +35,7 @@ #include <vector> #include <map> -#include "stylepool.hxx" +#include <svl/stylepool.hxx> #include <svl/itemiter.hxx> #include <svl/itempool.hxx> @@ -380,13 +380,13 @@ public: : maRoot(), mnCount(0), mpIgnorableItems( pIgnorableItems != 0 - ? pIgnorableItems->Clone( FALSE ) + ? pIgnorableItems->Clone( sal_False ) : 0 ) { DBG_ASSERT( !pIgnorableItems || !pIgnorableItems->Count(), "<StylePoolImpl::StylePoolImpl(..)> - misusage: item set for ignorable item should be empty. Please correct usage." ); DBG_ASSERT( !mpIgnorableItems || !mpIgnorableItems->Count(), - "<StylePoolImpl::StylePoolImpl(..)> - <SfxItemSet::Clone( FALSE )> does not work as excepted - <mpIgnorableItems> is not empty. Please inform OD." ); + "<StylePoolImpl::StylePoolImpl(..)> - <SfxItemSet::Clone( sal_False )> does not work as excepted - <mpIgnorableItems> is not empty. Please inform OD." ); } ~StylePoolImpl() diff --git a/svl/source/items/szitem.cxx b/svl/source/items/szitem.cxx index 6ed1a30941ae..4bb7238c9b76 100644 --- a/svl/source/items/szitem.cxx +++ b/svl/source/items/szitem.cxx @@ -55,7 +55,7 @@ SfxSizeItem::SfxSizeItem() // ----------------------------------------------------------------------- -SfxSizeItem::SfxSizeItem( USHORT nW, const Size& rVal ) : +SfxSizeItem::SfxSizeItem( sal_uInt16 nW, const Size& rVal ) : SfxPoolItem( nW ), aVal( rVal ) { @@ -64,7 +64,7 @@ SfxSizeItem::SfxSizeItem( USHORT nW, const Size& rVal ) : // ----------------------------------------------------------------------- -SfxSizeItem::SfxSizeItem( USHORT nW, SvStream &rStream ) : +SfxSizeItem::SfxSizeItem( sal_uInt16 nW, SvStream &rStream ) : SfxPoolItem( nW ) { DBG_CTOR(SfxSizeItem, 0); @@ -118,7 +118,7 @@ SfxPoolItem* SfxSizeItem::Clone(SfxItemPool *) const // ----------------------------------------------------------------------- -SfxPoolItem* SfxSizeItem::Create(SvStream &rStream, USHORT ) const +SfxPoolItem* SfxSizeItem::Create(SvStream &rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxSizeItem, 0); Size aStr; @@ -128,7 +128,7 @@ SfxPoolItem* SfxSizeItem::Create(SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- -SvStream& SfxSizeItem::Store(SvStream &rStream, USHORT ) const +SvStream& SfxSizeItem::Store(SvStream &rStream, sal_uInt16 ) const { DBG_CHKTHIS(SfxSizeItem, 0); rStream << aVal; @@ -137,7 +137,7 @@ SvStream& SfxSizeItem::Store(SvStream &rStream, USHORT ) const // ----------------------------------------------------------------------- bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId ) const + sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -168,7 +168,7 @@ bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, // ----------------------------------------------------------------------- bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) + sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx index 67df8fc78d63..13f19a48800e 100644 --- a/svl/source/items/visitem.cxx +++ b/svl/source/items/visitem.cxx @@ -44,7 +44,7 @@ DBG_NAME(SfxVisibilityItem) TYPEINIT1_AUTOFACTORY(SfxVisibilityItem, SfxPoolItem); //============================================================================ -SfxVisibilityItem::SfxVisibilityItem(USHORT which, SvStream & rStream): +SfxVisibilityItem::SfxVisibilityItem(sal_uInt16 which, SvStream & rStream): SfxPoolItem(which) { DBG_CTOR(SfxVisibilityItem, 0); @@ -86,7 +86,7 @@ SfxItemPresentation SfxVisibilityItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const +bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= m_nValue; return true; @@ -94,7 +94,7 @@ bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const //============================================================================ // virtual -bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE) +bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { if (rVal >>= m_nValue) return true; @@ -105,7 +105,7 @@ bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE) //============================================================================ // virtual -SfxPoolItem * SfxVisibilityItem::Create(SvStream & rStream, USHORT) const +SfxPoolItem * SfxVisibilityItem::Create(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(SfxVisibilityItem, 0); return new SfxVisibilityItem(Which(), rStream); @@ -113,7 +113,7 @@ SfxPoolItem * SfxVisibilityItem::Create(SvStream & rStream, USHORT) const //============================================================================ // virtual -SvStream & SfxVisibilityItem::Store(SvStream & rStream, USHORT) const +SvStream & SfxVisibilityItem::Store(SvStream & rStream, sal_uInt16) const { DBG_CHKTHIS(SfxVisibilityItem, 0); rStream << m_nValue.bVisible; @@ -130,19 +130,19 @@ SfxPoolItem * SfxVisibilityItem::Clone(SfxItemPool *) const //============================================================================ // virtual -USHORT SfxVisibilityItem::GetValueCount() const +sal_uInt16 SfxVisibilityItem::GetValueCount() const { return 2; } //============================================================================ // virtual -UniString SfxVisibilityItem::GetValueTextByVal(BOOL bTheValue) const +UniString SfxVisibilityItem::GetValueTextByVal(sal_Bool bTheValue) const { return bTheValue ? - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) : - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE")); + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) : + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False")); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx index d5019a485915..0fa492b19443 100644 --- a/svl/source/items/whassert.hxx +++ b/svl/source/items/whassert.hxx @@ -43,7 +43,7 @@ ByteString aMsg( sMessage ); \ aMsg.Append(RTL_CONSTASCII_STRINGPARAM("\nwith Id/Pos: ")); \ aMsg += ByteString::CreateFromInt32( nId ); \ - DbgOut( aMsg.GetBuffer(), DBG_OUT_ERROR, __FILE__, __LINE__); \ + DbgError( aMsg.GetBuffer(), __FILE__, __LINE__); \ } \ } \ } diff --git a/svl/source/items/whiter.cxx b/svl/source/items/whiter.cxx index ba8ddba9559e..b9fb9ca46330 100644 --- a/svl/source/items/whiter.cxx +++ b/svl/source/items/whiter.cxx @@ -29,14 +29,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "whiter.hxx" +#include <svl/whiter.hxx> #include <svl/itemset.hxx> DBG_NAME(SfxWhichIter) // ----------------------------------------------------------------------- -SfxWhichIter::SfxWhichIter( const SfxItemSet& rSet, USHORT nFromWh, USHORT nToWh ): +SfxWhichIter::SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFromWh, sal_uInt16 nToWh ): pRanges(rSet.GetRanges()), pStart(rSet.GetRanges()), nOfst(0), nFrom(nFromWh), nTo(nToWh) @@ -55,19 +55,19 @@ SfxWhichIter::~SfxWhichIter() // ----------------------------------------------------------------------- -USHORT SfxWhichIter::NextWhich() +sal_uInt16 SfxWhichIter::NextWhich() { DBG_CHKTHIS(SfxWhichIter, 0); while ( 0 != *pRanges ) { - const USHORT nLastWhich = *pRanges + nOfst; + const sal_uInt16 nLastWhich = *pRanges + nOfst; ++nOfst; if (*(pRanges+1) == nLastWhich) { pRanges += 2; nOfst = 0; } - USHORT nWhich = *pRanges + nOfst; + sal_uInt16 nWhich = *pRanges + nOfst; if ( 0 == nWhich || ( nWhich >= nFrom && nWhich <= nTo ) ) return nWhich; } @@ -76,7 +76,7 @@ USHORT SfxWhichIter::NextWhich() // ----------------------------------------------------------------------- -USHORT SfxWhichIter::PrevWhich() +sal_uInt16 SfxWhichIter::PrevWhich() { DBG_CHKTHIS(SfxWhichIter, 0); while ( pRanges != pStart || 0 != nOfst ) @@ -87,7 +87,7 @@ USHORT SfxWhichIter::PrevWhich() pRanges -= 2; nOfst = *(pRanges+1) - (*pRanges); } - USHORT nWhich = *pRanges + nOfst; + sal_uInt16 nWhich = *pRanges + nOfst; if ( nWhich >= nFrom && nWhich <= nTo ) return nWhich; } @@ -96,7 +96,7 @@ USHORT SfxWhichIter::PrevWhich() // ----------------------------------------------------------------------- -USHORT SfxWhichIter::FirstWhich() +sal_uInt16 SfxWhichIter::FirstWhich() { DBG_CHKTHIS(SfxWhichIter, 0); pRanges = pStart; @@ -108,13 +108,13 @@ USHORT SfxWhichIter::FirstWhich() // ----------------------------------------------------------------------- -USHORT SfxWhichIter::LastWhich() +sal_uInt16 SfxWhichIter::LastWhich() { DBG_CHKTHIS(SfxWhichIter, 0); while(*pRanges) ++pRanges; nOfst = 0; - USHORT nWhich = *(pRanges-1); + sal_uInt16 nWhich = *(pRanges-1); if ( nWhich >= nFrom && nWhich <= nTo ) return nWhich; return PrevWhich(); diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx index 955681d84a0b..e94d00242de2 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.cxx @@ -59,30 +59,18 @@ #include <tools/debug.hxx> SV_IMPL_VARARR(SvPtrarr,VoidPtr) -SV_IMPL_VARARR_PLAIN(SvPtrarrPlain,VoidPtr) -USHORT SvPtrarr::GetPos( const VoidPtr& aElement ) const -{ USHORT n; +sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const +{ sal_uInt16 n; for( n=0; n < nA && *(GetData()+n) != aElement; ) n++; return ( n >= nA ? USHRT_MAX : n ); } -USHORT SvPtrarrPlain::GetPos( const VoidPtr aElement ) const -{ USHORT n; - for( n=0; n < nA && *(GetData()+n) != aElement; ) n++; - return ( n >= nA ? USHRT_MAX : n ); -} - - -SV_IMPL_VARARR( SvULongs, ULONG ) -SV_IMPL_VARARR( SvUShorts, USHORT ) +SV_IMPL_VARARR( SvULongs, sal_uLong ) SV_IMPL_VARARR( SvLongs, long) -SV_IMPL_VARARR_SORT( SvULongsSort, ULONG ) +SV_IMPL_VARARR_SORT( SvULongsSort, sal_uLong ) SV_IMPL_VARARR_SORT( SvLongsSort, long ) -SV_IMPL_VARARR_SORT( SvXub_StrLensSort, xub_StrLen ) - -SV_IMPL_VARARR( SvXub_StrLens, xub_StrLen ) SV_IMPL_PTRARR( SvStrings, StringPtr ) SV_IMPL_PTRARR( SvStringsDtor, StringPtr ) @@ -100,19 +88,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 ) @@ -126,40 +114,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 ) @@ -173,29 +161,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 ) @@ -207,29 +195,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) ) @@ -242,42 +230,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); } @@ -286,19 +274,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 ) @@ -312,39 +300,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 ) @@ -358,21 +346,21 @@ BOOL SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, USHORT* pP ) co if( COMPARE_EQUAL == eCmp ) { if( pP ) *pP = nM; - return TRUE; + return sal_True; } else if( COMPARE_LESS == eCmp ) nU = nM + 1; else if( nM == 0 ) { if( pP ) *pP = nU; - return FALSE; + return sal_False; } else nO = nM - 1; } } if( pP ) *pP = nU; - return FALSE; + return sal_False; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/PasswordHelper.cxx b/svl/source/misc/PasswordHelper.cxx index b07cbcf19233..50649dc4d1c5 100644 --- a/svl/source/misc/PasswordHelper.cxx +++ b/svl/source/misc/PasswordHelper.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "PasswordHelper.hxx" +#include <svl/PasswordHelper.hxx> #include <rtl/digest.h> #include <tools/string.hxx> diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx index 1c99aee9fc71..e0087aa5220d 100644 --- a/svl/source/misc/adrparse.cxx +++ b/svl/source/misc/adrparse.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" #include <tools/inetmime.hxx> -#include <adrparse.hxx> +#include <svl/adrparse.hxx> namespace unnamed_svl_adrparse {} using namespace unnamed_svl_adrparse; diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx index 14e0c36bc0b5..06ddc663d762 100644 --- a/svl/source/misc/filenotation.cxx +++ b/svl/source/misc/filenotation.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "filenotation.hxx" +#include <svl/filenotation.hxx> #include <osl/file.h> #include <osl/diagnose.h> #include <tools/urlobj.hxx> diff --git a/svl/source/misc/folderrestriction.cxx b/svl/source/misc/folderrestriction.cxx index 687dd443330e..28ff69d61f24 100644 --- a/svl/source/misc/folderrestriction.cxx +++ b/svl/source/misc/folderrestriction.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "folderrestriction.hxx" +#include <svl/folderrestriction.hxx> #include "osl/process.h" #include "tools/urlobj.hxx" #include "unotools/localfilehelper.hxx" diff --git a/svl/source/misc/fstathelper.cxx b/svl/source/misc/fstathelper.cxx index 46d6eae274f7..15494cdedc85 100644 --- a/svl/source/misc/fstathelper.cxx +++ b/svl/source/misc/fstathelper.cxx @@ -33,8 +33,7 @@ #include <tools/string.hxx> #include <ucbhelper/content.hxx> #include <com/sun/star/util/DateTime.hpp> - -#include <fstathelper.hxx> +#include <svl/fstathelper.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -44,7 +43,7 @@ using namespace ::rtl; sal_Bool FStatHelper::GetModifiedDateTimeOfFile( const UniString& rURL, Date* pDate, Time* pTime ) { - sal_Bool bRet = FALSE; + sal_Bool bRet = sal_False; try { ::ucbhelper::Content aTestContent( rURL, @@ -71,7 +70,7 @@ sal_Bool FStatHelper::GetModifiedDateTimeOfFile( const UniString& rURL, sal_Bool FStatHelper::IsDocument( const UniString& rURL ) { - BOOL bExist = FALSE; + sal_Bool bExist = sal_False; try { ::ucbhelper::Content aTestContent( rURL, @@ -86,7 +85,7 @@ sal_Bool FStatHelper::IsDocument( const UniString& rURL ) sal_Bool FStatHelper::IsFolder( const UniString& rURL ) { - BOOL bExist = FALSE; + sal_Bool bExist = sal_False; try { ::ucbhelper::Content aTestContent( rURL, diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index 511873a6adb7..eba1e4083d38 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -72,9 +72,9 @@ class INetURLHistory_Impl { /** Representation. */ - UINT32 m_nMagic; - UINT16 m_nNext; - UINT16 m_nMBZ; + sal_uInt32 m_nMagic; + sal_uInt16 m_nNext; + sal_uInt16 m_nMBZ; /** Initialization. */ @@ -92,13 +92,13 @@ class INetURLHistory_Impl { /** Representation. */ - UINT32 m_nHash; - UINT16 m_nLru; - UINT16 m_nMBZ; + sal_uInt32 m_nHash; + sal_uInt16 m_nLru; + sal_uInt16 m_nMBZ; /** Initialization. */ - void initialize (UINT16 nLru, UINT32 nHash = 0) + void initialize (sal_uInt16 nLru, sal_uInt32 nHash = 0) { m_nHash = nHash; m_nLru = nLru; @@ -107,20 +107,20 @@ class INetURLHistory_Impl /** Comparison. */ - BOOL operator== (const hash_entry &rOther) const + sal_Bool operator== (const hash_entry &rOther) const { return (m_nHash == rOther.m_nHash); } - BOOL operator< (const hash_entry &rOther) const + sal_Bool operator< (const hash_entry &rOther) const { return (m_nHash < rOther.m_nHash); } - BOOL operator== (UINT32 nHash) const + sal_Bool operator== (sal_uInt32 nHash) const { return (m_nHash == nHash); } - BOOL operator< (UINT32 nHash) const + sal_Bool operator< (sal_uInt32 nHash) const { return (m_nHash < nHash); } @@ -132,13 +132,13 @@ class INetURLHistory_Impl { /** Representation. */ - UINT32 m_nHash; - UINT16 m_nNext; - UINT16 m_nPrev; + sal_uInt32 m_nHash; + sal_uInt16 m_nNext; + sal_uInt16 m_nPrev; /** Initialization. */ - void initialize (UINT16 nThis, UINT32 nHash = 0) + void initialize (sal_uInt16 nThis, sal_uInt32 nHash = 0) { m_nHash = nHash; m_nNext = nThis; @@ -156,34 +156,34 @@ class INetURLHistory_Impl */ void initialize (void); - void downheap (hash_entry a[], UINT16 n, UINT16 k); - void heapsort (hash_entry a[], UINT16 n); + void downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k); + void heapsort (hash_entry a[], sal_uInt16 n); /** capacity. */ - UINT16 capacity (void) const + sal_uInt16 capacity (void) const { - return (UINT16)(INETHIST_SIZE_LIMIT); + return (sal_uInt16)(INETHIST_SIZE_LIMIT); } /** crc32. */ - UINT32 crc32 (UniString const & rData) const + sal_uInt32 crc32 (UniString const & rData) const { return rtl_crc32 (0, rData.GetBuffer(), rData.Len() * sizeof(sal_Unicode)); } /** find. */ - UINT16 find (UINT32 nHash) const; + sal_uInt16 find (sal_uInt32 nHash) const; /** move. */ - void move (UINT16 nSI, UINT16 nDI); + void move (sal_uInt16 nSI, sal_uInt16 nDI); /** backlink. */ - void backlink (UINT16 nThis, UINT16 nTail) + void backlink (sal_uInt16 nThis, sal_uInt16 nTail) { register lru_entry &rThis = m_pList[nThis]; register lru_entry &rTail = m_pList[nTail]; @@ -196,7 +196,7 @@ class INetURLHistory_Impl /** unlink. */ - void unlink (UINT16 nThis) + void unlink (sal_uInt16 nThis) { register lru_entry &rThis = m_pList[nThis]; @@ -218,7 +218,7 @@ public: /** putUrl/queryUrl. */ void putUrl (const String &rUrl); - BOOL queryUrl (const String &rUrl); + sal_Bool queryUrl (const String &rUrl); }; /*======================================================================== @@ -248,7 +248,7 @@ void INetURLHistory_Impl::initialize (void) { m_aHead.initialize(); - USHORT i, n = capacity(); + sal_uInt16 i, n = capacity(); for (i = 0; i < n; i++) m_pHash[i].initialize(i); for (i = 0; i < n; i++) @@ -260,12 +260,12 @@ void INetURLHistory_Impl::initialize (void) /* * downheap. */ -void INetURLHistory_Impl::downheap (hash_entry a[], UINT16 n, UINT16 k) +void INetURLHistory_Impl::downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k) { hash_entry h = a[k]; while (k < n / 2) { - UINT16 i = k + k + 1; + sal_uInt16 i = k + k + 1; if (((i + 1) < n) && (a[i] < a[i + 1])) i++; if (!(h < a[i])) break; a[k] = a[i]; @@ -277,11 +277,11 @@ void INetURLHistory_Impl::downheap (hash_entry a[], UINT16 n, UINT16 k) /* * heapsort. */ -void INetURLHistory_Impl::heapsort (hash_entry a[], UINT16 n) +void INetURLHistory_Impl::heapsort (hash_entry a[], sal_uInt16 n) { hash_entry h; - for (UINT16 k = (n - 1) / 2 + 1; k > 0; k--) + for (sal_uInt16 k = (n - 1) / 2 + 1; k > 0; k--) downheap (a, n, k - 1); while (n > 0) @@ -296,15 +296,15 @@ void INetURLHistory_Impl::heapsort (hash_entry a[], UINT16 n) /* * find. */ -UINT16 INetURLHistory_Impl::find (UINT32 nHash) const +sal_uInt16 INetURLHistory_Impl::find (sal_uInt32 nHash) const { - UINT16 l = 0; - UINT16 r = capacity() - 1; - UINT16 c = capacity(); + sal_uInt16 l = 0; + sal_uInt16 r = capacity() - 1; + sal_uInt16 c = capacity(); while ((l < r) && (r < c)) { - UINT16 m = (l + r) / 2; + sal_uInt16 m = (l + r) / 2; if (m_pHash[m] == nHash) return m; @@ -319,7 +319,7 @@ UINT16 INetURLHistory_Impl::find (UINT32 nHash) const /* * move. */ -void INetURLHistory_Impl::move (UINT16 nSI, UINT16 nDI) +void INetURLHistory_Impl::move (sal_uInt16 nSI, sal_uInt16 nDI) { hash_entry e = m_pHash[nSI]; if (nSI < nDI) @@ -346,12 +346,12 @@ void INetURLHistory_Impl::move (UINT16 nSI, UINT16 nDI) */ void INetURLHistory_Impl::putUrl (const String &rUrl) { - UINT32 h = crc32 (rUrl); - UINT16 k = find (h); + sal_uInt32 h = crc32 (rUrl); + sal_uInt16 k = find (h); if ((k < capacity()) && (m_pHash[k] == h)) { // Cache hit. - UINT16 nMRU = m_pHash[k].m_nLru; + sal_uInt16 nMRU = m_pHash[k].m_nLru; if (nMRU != m_aHead.m_nNext) { // Update LRU chain. @@ -365,9 +365,9 @@ void INetURLHistory_Impl::putUrl (const String &rUrl) else { // Cache miss. Obtain least recently used. - UINT16 nLRU = m_pList[m_aHead.m_nNext].m_nPrev; + sal_uInt16 nLRU = m_pList[m_aHead.m_nNext].m_nPrev; - UINT16 nSI = find (m_pList[nLRU].m_nHash); + sal_uInt16 nSI = find (m_pList[nLRU].m_nHash); if (!(nLRU == m_pHash[nSI].m_nLru)) { // Update LRU chain. @@ -380,7 +380,7 @@ void INetURLHistory_Impl::putUrl (const String &rUrl) m_aHead.m_nNext = m_pList[m_aHead.m_nNext].m_nPrev; // Check source and destination. - UINT16 nDI = std::min (k, UINT16(capacity() - 1)); + sal_uInt16 nDI = std::min (k, sal_uInt16(capacity() - 1)); if (nSI < nDI) { if (!(m_pHash[nDI] < h)) @@ -401,19 +401,19 @@ void INetURLHistory_Impl::putUrl (const String &rUrl) /* * queryUrl. */ -BOOL INetURLHistory_Impl::queryUrl (const String &rUrl) +sal_Bool INetURLHistory_Impl::queryUrl (const String &rUrl) { - UINT32 h = crc32 (rUrl); - UINT16 k = find (h); + sal_uInt32 h = crc32 (rUrl); + sal_uInt16 k = find (h); if ((k < capacity()) && (m_pHash[k] == h)) { // Cache hit. - return TRUE; + return sal_True; } else { // Cache miss. - return FALSE; + return sal_False; } } @@ -527,7 +527,7 @@ void INetURLHistory::PutUrl_Impl (const INetURLObject &rUrl) /* * QueryUrl_Impl. */ -BOOL INetURLHistory::QueryUrl_Impl (const INetURLObject &rUrl) +sal_Bool INetURLHistory::QueryUrl_Impl (const INetURLObject &rUrl) { DBG_ASSERT (m_pImpl, "QueryUrl_Impl(): no Implementation"); if (m_pImpl) @@ -537,7 +537,7 @@ BOOL INetURLHistory::QueryUrl_Impl (const INetURLObject &rUrl) return m_pImpl->queryUrl (aHistUrl.GetMainURL(INetURLObject::NO_DECODE)); } - return FALSE; + return sal_False; } diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 744a26a55eff..8bc44fdc2dd8 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -340,7 +340,7 @@ MediaTypeEntry const aStaticTypeNameMap[CONTENT_TYPE_LAST + 1] //============================================================================ /** A mapping from type IDs to presentation resource IDs. Sorted by type ID. */ -USHORT const aStaticResourceIDMap[CONTENT_TYPE_LAST + 1] +sal_uInt16 const aStaticResourceIDMap[CONTENT_TYPE_LAST + 1] = { STR_SVT_MIMETYPE_APP_OCTSTREAM, // CONTENT_TYPE_UNKNOWN STR_SVT_MIMETYPE_APP_OCTSTREAM, // CONTENT_TYPE_APP_OCTSTREAM STR_SVT_MIMETYPE_APP_PDF, // CONTENT_TYPE_APP_PDF @@ -639,19 +639,19 @@ Registration * Registration::m_pRegistration = 0; //============================================================================ Registration::~Registration() { - {for (ULONG i = 0; i < m_aTypeIDMap.Count(); ++i) + {for (sal_uLong i = 0; i < m_aTypeIDMap.Count(); ++i) delete static_cast< TypeIDMapEntry * >(m_aTypeIDMap.GetObject(i)); } m_aTypeIDMap.Clear(); - {for (USHORT i = 0; i < m_aTypeNameMap.Count(); ++i) + {for (sal_uInt16 i = 0; i < m_aTypeNameMap.Count(); ++i) delete static_cast< TypeNameMapEntry * >(m_aTypeNameMap.GetObject(i)); } - m_aTypeNameMap.Remove(USHORT(0), m_aTypeNameMap.Count()); - {for (USHORT i = 0; i < m_aExtensionMap.Count(); ++i) + m_aTypeNameMap.Remove(sal_uInt16(0), m_aTypeNameMap.Count()); + {for (sal_uInt16 i = 0; i < m_aExtensionMap.Count(); ++i) delete static_cast< ExtensionMapEntry * >(m_aExtensionMap.GetObject(i)); } - m_aExtensionMap.Remove(USHORT(0), m_aExtensionMap.Count()); + m_aExtensionMap.Remove(sal_uInt16(0), m_aExtensionMap.Count()); } //============================================================================ @@ -663,7 +663,7 @@ TypeNameMapEntry * Registration::getExtensionEntry(UniString const & { UniString aTheTypeName = rTypeName; aTheTypeName.ToLowerAscii(); - USHORT nPos; + sal_uInt16 nPos; if (m_pRegistration->m_aTypeNameMap.Seek_Entry(&aTheTypeName, &nPos)) return static_cast< TypeNameMapEntry * >(m_pRegistration-> m_aTypeNameMap. @@ -726,7 +726,7 @@ INetContentType Registration::GetContentType(UniString const & rTypeName) UniString aTheTypeName = rTypeName; aTheTypeName.ToLowerAscii(); - USHORT nPos; + sal_uInt16 nPos; return m_pRegistration->m_aTypeNameMap.Seek_Entry(&aTheTypeName, &nPos) ? static_cast< TypeNameMapEntry * >(m_pRegistration-> m_aTypeNameMap. @@ -770,7 +770,7 @@ UniString Registration::GetExtension(UniString const & rTypeName) UniString aTheTypeName = rTypeName; aTheTypeName.ToLowerAscii(); - USHORT nPos; + sal_uInt16 nPos; return m_pRegistration->m_aTypeNameMap.Seek_Entry(&aTheTypeName, &nPos) ? static_cast< TypeNameMapEntry * >(m_pRegistration-> m_aTypeNameMap. @@ -787,7 +787,7 @@ INetContentType Registration::GetContentType4Extension(UniString const & if (!m_pRegistration) m_pRegistration = new Registration; - USHORT nPos; + sal_uInt16 nPos; return m_pRegistration-> m_aExtensionMap. Seek_Entry(const_cast< UniString * >(&rExtension), @@ -949,7 +949,7 @@ UniString INetContentTypes::GetContentType(INetContentType eTypeID) UniString INetContentTypes::GetPresentation(INetContentType eTypeID, const ::com::sun::star::lang::Locale& aLocale) { - USHORT nResID = USHORT(); + sal_uInt16 nResID = sal_uInt16(); if (eTypeID <= CONTENT_TYPE_LAST) nResID = aStaticResourceIDMap[eTypeID]; else diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index c655a8dd86a3..2eba00efd565 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include <lngmisc.hxx> +#include <svl/lngmisc.hxx> #include <tools/solar.h> #include <tools/string.hxx> #include <tools/debug.hxx> @@ -43,11 +43,11 @@ namespace linguistic /////////////////////////////////////////////////////////////////////////// -INT32 GetNumControlChars( const OUString &rTxt ) +sal_Int32 GetNumControlChars( const OUString &rTxt ) { - INT32 nCnt = 0; - INT32 nLen = rTxt.getLength(); - for (INT32 i = 0; i < nLen; ++i) + sal_Int32 nCnt = 0; + sal_Int32 nLen = rTxt.getLength(); + for (sal_Int32 i = 0; i < nLen; ++i) { if (IsControlChar( rTxt[i] )) ++nCnt; @@ -56,33 +56,33 @@ INT32 GetNumControlChars( const OUString &rTxt ) } -BOOL RemoveHyphens( OUString &rTxt ) +sal_Bool RemoveHyphens( OUString &rTxt ) { - BOOL bModified = FALSE; + sal_Bool bModified = sal_False; if (HasHyphens( rTxt )) { String aTmp( rTxt ); aTmp.EraseAllChars( SVT_SOFT_HYPHEN ); aTmp.EraseAllChars( SVT_HARD_HYPHEN ); rTxt = aTmp; - bModified = TRUE; + bModified = sal_True; } return bModified; } -BOOL RemoveControlChars( OUString &rTxt ) +sal_Bool RemoveControlChars( OUString &rTxt ) { - BOOL bModified = FALSE; - INT32 nCtrlChars = GetNumControlChars( rTxt ); + sal_Bool bModified = sal_False; + sal_Int32 nCtrlChars = GetNumControlChars( rTxt ); if (nCtrlChars) { - INT32 nLen = rTxt.getLength(); - INT32 nSize = nLen - nCtrlChars; + sal_Int32 nLen = rTxt.getLength(); + sal_Int32 nSize = nLen - nCtrlChars; OUStringBuffer aBuf( nSize ); aBuf.setLength( nSize ); - INT32 nCnt = 0; - for (INT32 i = 0; i < nLen; ++i) + sal_Int32 nCnt = 0; + for (sal_Int32 i = 0; i < nLen; ++i) { sal_Unicode cChar = rTxt[i]; if (!IsControlChar( cChar )) @@ -93,7 +93,7 @@ BOOL RemoveControlChars( OUString &rTxt ) } DBG_ASSERT( nCnt == nSize, "wrong size" ); rTxt = aBuf.makeStringAndClear(); - bModified = TRUE; + bModified = sal_True; } return bModified; } @@ -102,20 +102,20 @@ BOOL RemoveControlChars( OUString &rTxt ) // non breaking field character #define CH_TXTATR_INWORD ((sal_Char) 0x02) -BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ ) +sal_Bool ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ ) { // the resulting string looks like this: // 1. non breaking field characters get removed // 2. remaining control characters will be replaced by ' ' - BOOL bModified = FALSE; - INT32 nCtrlChars = GetNumControlChars( rTxt ); + sal_Bool bModified = sal_False; + sal_Int32 nCtrlChars = GetNumControlChars( rTxt ); if (nCtrlChars) { - INT32 nLen = rTxt.getLength(); + sal_Int32 nLen = rTxt.getLength(); OUStringBuffer aBuf( nLen ); - INT32 nCnt = 0; - for (INT32 i = 0; i < nLen; ++i) + sal_Int32 nCnt = 0; + for (sal_Int32 i = 0; i < nLen; ++i) { sal_Unicode cChar = rTxt[i]; if (CH_TXTATR_INWORD != cChar) @@ -128,11 +128,43 @@ BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ ) } aBuf.setLength( nCnt ); rTxt = aBuf.makeStringAndClear(); - bModified = TRUE; + bModified = sal_True; } return bModified; } + +String GetThesaurusReplaceText( const String &rText ) +{ + // The strings for synonyms returned by the thesaurus sometimes have some + // explanation text put in between '(' and ')' or a trailing '*'. + // These parts should not be put in the ReplaceEdit Text that may get + // inserted into the document. Thus we strip them from the text. + + String aText( rText ); + + xub_StrLen nPos = aText.Search( sal_Unicode('(') ); + while (STRING_NOTFOUND != nPos) + { + xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos ); + if (STRING_NOTFOUND != nEnd) + aText.Erase( nPos, nEnd-nPos+1 ); + else + break; + nPos = aText.Search( sal_Unicode('(') ); + } + + nPos = aText.Search( sal_Unicode('*') ); + if (STRING_NOTFOUND != nPos) + aText.Erase( nPos ); + + // remove any possible remaining ' ' that may confuse the thesaurus + // when it gets called with the text + aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); + + return aText; +} + /////////////////////////////////////////////////////////////////////////// } // namespace linguistic diff --git a/svl/source/misc/makefile.mk b/svl/source/misc/makefile.mk deleted file mode 100644 index a68cb396f22c..000000000000 --- a/svl/source/misc/makefile.mk +++ /dev/null @@ -1,70 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=svl -TARGET=misc - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES=\ - $(SLO)$/documentlockfile.obj \ - $(SLO)$/folderrestriction.obj \ - $(SLO)$/fstathelper.obj \ - $(SLO)$/lockfilecommon.obj \ - $(SLO)$/ownlist.obj \ - $(SLO)$/restrictedpaths.obj \ - $(SLO)$/sharecontrolfile.obj \ - $(SLO)$/strmadpt.obj \ - $(SLO)$/svldata.obj \ - $(SLO)$/urihelper.obj - -SLOFILES=\ - $(EXCEPTIONSFILES) \ - $(SLO)$/adrparse.obj \ - $(SLO)$/filenotation.obj \ - $(SLO)$/inethist.obj \ - $(SLO)$/inettype.obj \ - $(SLO)$/lngmisc.obj \ - $(SLO)$/PasswordHelper.obj - -SRS1NAME=$(TARGET) -SRC1FILES=\ - mediatyp.src - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - - - - diff --git a/svl/source/misc/ownlist.cxx b/svl/source/misc/ownlist.cxx index 83663a17bc5e..c1edd6761839 100644 --- a/svl/source/misc/ownlist.cxx +++ b/svl/source/misc/ownlist.cxx @@ -42,14 +42,14 @@ using namespace com::sun::star; PRV_SV_IMPL_OWNER_LIST(SvCommandList,SvCommand) -static String parseString(const String & rCmd, USHORT * pIndex) +static String parseString(const String & rCmd, sal_uInt16 * pIndex) { String result; if(rCmd.GetChar( *pIndex ) == '\"') { (*pIndex) ++; - USHORT begin = *pIndex; + sal_uInt16 begin = *pIndex; while(*pIndex < rCmd.Len() && rCmd.GetChar((*pIndex) ++) != '\"') ; @@ -59,9 +59,9 @@ static String parseString(const String & rCmd, USHORT * pIndex) return result; } -static String parseWord(const String & rCmd, USHORT * pIndex) +static String parseWord(const String & rCmd, sal_uInt16 * pIndex) { - USHORT begin = *pIndex; + sal_uInt16 begin = *pIndex; while(*pIndex < rCmd.Len() && !isspace(rCmd.GetChar(*pIndex)) && rCmd.GetChar(*pIndex) != '=') (*pIndex) ++; @@ -69,7 +69,7 @@ static String parseWord(const String & rCmd, USHORT * pIndex) return String(rCmd.Copy(begin, *pIndex - begin)); } -static void eatSpace(const String & rCmd, USHORT * pIndex) +static void eatSpace(const String & rCmd, sal_uInt16 * pIndex) { while(*pIndex < rCmd.Len() && isspace(rCmd.GetChar(*pIndex))) (*pIndex) ++; @@ -77,10 +77,10 @@ static void eatSpace(const String & rCmd, USHORT * pIndex) //========================================================================= -BOOL SvCommandList::AppendCommands +sal_Bool SvCommandList::AppendCommands ( const String & rCmd, /* Dieser Text wird in Kommandos umgesetzt */ - USHORT * pEaten /* Anzahl der Zeichen, die gelesen wurden */ + sal_uInt16 * pEaten /* Anzahl der Zeichen, die gelesen wurden */ ) /* [Beschreibung] @@ -89,11 +89,11 @@ BOOL SvCommandList::AppendCommands [R"uckgabewert] - BOOL TRUE, der Text wurde korrekt geparsed. - FALSE, der Text wurde nicht korrekt geparsed. + sal_Bool sal_True, der Text wurde korrekt geparsed. + sal_False, der Text wurde nicht korrekt geparsed. */ { - USHORT index = 0; + sal_uInt16 index = 0; while(index < rCmd.Len()) { @@ -116,14 +116,14 @@ BOOL SvCommandList::AppendCommands *pEaten = index; -// USHORT nPos = 0; +// sal_uInt16 nPos = 0; // while( nPos < rCmd.Len() ) // { // // ein Zeichen ? Dann faengt hier eine Option an // if( isalpha( rCmd[nPos] ) ) // { // String aValue; -// USHORT nStt = nPos; +// sal_uInt16 nStt = nPos; // register char c; // while( nPos < rCmd.Len() && @@ -149,7 +149,7 @@ BOOL SvCommandList::AppendCommands // if( nPos != rCmd.Len() ) // { -// USHORT nLen = 0; +// sal_uInt16 nLen = 0; // nStt = nPos; // if( '"' == c ) // { @@ -182,7 +182,7 @@ BOOL SvCommandList::AppendCommands // nPos++; // } // *pEaten = nPos; - return TRUE; + return sal_True; } //========================================================================= @@ -199,7 +199,7 @@ String SvCommandList::GetCommands() const */ { String aRet; - for( ULONG i = 0; i < aTypes.Count(); i++ ) + for( sal_uLong i = 0; i < aTypes.Count(); i++ ) { if( i != 0 ) aRet += ' '; @@ -253,7 +253,7 @@ SvStream & operator >> SvStream & Der "ubergebene Stream. */ { - UINT32 nCount = 0; + sal_uInt32 nCount = 0; rStm >> nCount; if( !rStm.GetError() ) { @@ -284,10 +284,10 @@ SvStream & operator << SvStream & Der "ubergebene Stream. */ { - UINT32 nCount = rThis.aTypes.Count(); + sal_uInt32 nCount = rThis.aTypes.Count(); rStm << nCount; - for( UINT32 i = 0; i < nCount; i++ ) + for( sal_uInt32 i = 0; i < nCount; i++ ) { SvCommand * pCmd = (SvCommand *)rThis.aTypes.GetObject( i ); rStm << *pCmd; @@ -295,7 +295,7 @@ SvStream & operator << return rStm; } -BOOL SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence ) +sal_Bool SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence ) { const sal_Int32 nCount = aCommandSequence.getLength(); String aCommand, aArg; @@ -309,7 +309,7 @@ BOOL SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com: Append( aCommand, aArg ); } - return TRUE; + return sal_True; } void SvCommandList::FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence ) diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index b0e434bc5d2e..d7905f470290 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -36,9 +36,9 @@ #include <set> #include <rtl/alloc.h> #include <rtl/memory.h> -#include <instrm.hxx> -#include <outstrm.hxx> -#include <strmadpt.hxx> +#include <svl/instrm.hxx> +#include <svl/outstrm.hxx> +#include <svl/strmadpt.hxx> using namespace com::sun::star; @@ -152,7 +152,7 @@ TYPEINIT1(SvOutputStreamOpenLockBytes, SvOpenLockBytes) //============================================================================ // virtual -ErrCode SvOutputStreamOpenLockBytes::ReadAt(ULONG, void *, ULONG, ULONG *) +ErrCode SvOutputStreamOpenLockBytes::ReadAt(sal_uLong, void *, sal_uLong, sal_uLong *) const { return ERRCODE_IO_CANTREAD; @@ -160,8 +160,8 @@ ErrCode SvOutputStreamOpenLockBytes::ReadAt(ULONG, void *, ULONG, ULONG *) //============================================================================ // virtual -ErrCode SvOutputStreamOpenLockBytes::WriteAt(ULONG nPos, void const * pBuffer, - ULONG nCount, ULONG * pWritten) +ErrCode SvOutputStreamOpenLockBytes::WriteAt(sal_uLong nPos, void const * pBuffer, + sal_uLong nCount, sal_uLong * pWritten) { if (nPos != m_nPosition) return ERRCODE_IO_CANTWRITE; @@ -187,7 +187,7 @@ ErrCode SvOutputStreamOpenLockBytes::Flush() const //============================================================================ // virtual -ErrCode SvOutputStreamOpenLockBytes::SetSize(ULONG) +ErrCode SvOutputStreamOpenLockBytes::SetSize(sal_uLong) { return ERRCODE_IO_NOTSUPPORTED; } @@ -205,15 +205,15 @@ ErrCode SvOutputStreamOpenLockBytes::Stat(SvLockBytesStat * pStat, //============================================================================ // virtual ErrCode SvOutputStreamOpenLockBytes::FillAppend(void const * pBuffer, - ULONG nCount, - ULONG * pWritten) + sal_uLong nCount, + sal_uLong * pWritten) { if (!m_xOutputStream.is()) return ERRCODE_IO_CANTWRITE; if (nCount > 0 - && nCount > std::numeric_limits< ULONG >::max() - m_nPosition) + && nCount > std::numeric_limits< sal_uLong >::max() - m_nPosition) { - nCount = std::numeric_limits< ULONG >::max() - m_nPosition; + nCount = std::numeric_limits< sal_uLong >::max() - m_nPosition; if (nCount == 0) return ERRCODE_IO_CANTWRITE; } @@ -235,14 +235,14 @@ ErrCode SvOutputStreamOpenLockBytes::FillAppend(void const * pBuffer, //============================================================================ // virtual -ULONG SvOutputStreamOpenLockBytes::Tell() const +sal_uLong SvOutputStreamOpenLockBytes::Tell() const { return m_nPosition; } //============================================================================ // virtual -ULONG SvOutputStreamOpenLockBytes::Seek(ULONG) +sal_uLong SvOutputStreamOpenLockBytes::Seek(sal_uLong) { return m_nPosition; } @@ -476,7 +476,7 @@ bool SvInputStream::open() //============================================================================ // virtual -ULONG SvInputStream::GetData(void * pData, ULONG nSize) +sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) { if (!open()) { @@ -503,8 +503,8 @@ ULONG SvInputStream::GetData(void * pData, ULONG nSize) { sal_Int32 nRemain = sal_Int32( - std::min(ULONG(nSize - nRead), - ULONG(std::numeric_limits< sal_Int32 >::max()))); + std::min(sal_uLong(nSize - nRead), + sal_uLong(std::numeric_limits< sal_Int32 >::max()))); if (nRemain == 0) break; uno::Sequence< sal_Int8 > aBuffer; @@ -540,8 +540,8 @@ ULONG SvInputStream::GetData(void * pData, ULONG nSize) sal_Int32 nRemain = sal_Int32( std::min( - ULONG(nSize - nRead), - ULONG(std::numeric_limits< sal_Int32 >::max()))); + sal_uLong(nSize - nRead), + sal_uLong(std::numeric_limits< sal_Int32 >::max()))); if (nRemain == 0) break; uno::Sequence< sal_Int8 > aBuffer; @@ -571,7 +571,7 @@ ULONG SvInputStream::GetData(void * pData, ULONG nSize) //============================================================================ // virtual -ULONG SvInputStream::PutData(void const *, ULONG) +sal_uLong SvInputStream::PutData(void const *, sal_uLong) { SetError(ERRCODE_IO_NOTSUPPORTED); return 0; @@ -584,7 +584,7 @@ void SvInputStream::FlushData() //============================================================================ // virtual -ULONG SvInputStream::SeekPos(ULONG nPos) +sal_uLong SvInputStream::SeekPos(sal_uLong nPos) { if (open()) { @@ -601,7 +601,7 @@ ULONG SvInputStream::SeekPos(ULONG nPos) < STREAM_SEEK_TO_END) { m_nSeekedFrom = Tell(); - return ULONG(nLength); + return sal_uLong(nLength); } } catch (io::IOException) {} @@ -636,7 +636,7 @@ ULONG SvInputStream::SeekPos(ULONG nPos) //============================================================================ // virtual -void SvInputStream::SetSize(ULONG) +void SvInputStream::SetSize(sal_uLong) { SetError(ERRCODE_IO_NOTSUPPORTED); } @@ -668,14 +668,14 @@ SvInputStream::~SvInputStream() //============================================================================ // virtual -USHORT SvInputStream::IsA() const +sal_uInt16 SvInputStream::IsA() const { return 0; } //============================================================================ // virtual -void SvInputStream::AddMark(ULONG nPos) +void SvInputStream::AddMark(sal_uLong nPos) { if (open() && m_pPipe) m_pPipe->addMark(nPos); @@ -683,7 +683,7 @@ void SvInputStream::AddMark(ULONG nPos) //============================================================================ // virtual -void SvInputStream::RemoveMark(ULONG nPos) +void SvInputStream::RemoveMark(sal_uLong nPos) { if (open() && m_pPipe) m_pPipe->removeMark(nPos); @@ -696,7 +696,7 @@ void SvInputStream::RemoveMark(ULONG nPos) //============================================================================ // virtual -ULONG SvOutputStream::GetData(void *, ULONG) +sal_uLong SvOutputStream::GetData(void *, sal_uLong) { SetError(ERRCODE_IO_NOTSUPPORTED); return 0; @@ -704,20 +704,20 @@ ULONG SvOutputStream::GetData(void *, ULONG) //============================================================================ // virtual -ULONG SvOutputStream::PutData(void const * pData, ULONG nSize) +sal_uLong SvOutputStream::PutData(void const * pData, sal_uLong nSize) { if (!m_xStream.is()) { SetError(ERRCODE_IO_CANTWRITE); return 0; } - ULONG nWritten = 0; + sal_uLong nWritten = 0; for (;;) { sal_Int32 nRemain = sal_Int32( - std::min(ULONG(nSize - nWritten), - ULONG(std::numeric_limits< sal_Int32 >::max()))); + std::min(sal_uLong(nSize - nWritten), + sal_uLong(std::numeric_limits< sal_Int32 >::max()))); if (nRemain == 0) break; try @@ -739,7 +739,7 @@ ULONG SvOutputStream::PutData(void const * pData, ULONG nSize) //============================================================================ // virtual -ULONG SvOutputStream::SeekPos(ULONG) +sal_uLong SvOutputStream::SeekPos(sal_uLong) { SetError(ERRCODE_IO_NOTSUPPORTED); return 0; @@ -763,7 +763,7 @@ void SvOutputStream::FlushData() //============================================================================ // virtual -void SvOutputStream::SetSize(ULONG) +void SvOutputStream::SetSize(sal_uLong) { SetError(ERRCODE_IO_NOTSUPPORTED); } @@ -790,7 +790,7 @@ SvOutputStream::~SvOutputStream() //============================================================================ // virtual -USHORT SvOutputStream::IsA() const +sal_uInt16 SvOutputStream::IsA() const { return 0; } diff --git a/svl/source/misc/svldata.cxx b/svl/source/misc/svldata.cxx index eb36f0fc8f64..b76c1c002ce8 100644 --- a/svl/source/misc/svldata.cxx +++ b/svl/source/misc/svldata.cxx @@ -75,7 +75,7 @@ SimpleResMgr* ImpSvlData::GetSimpleRM(const ::com::sun::star::lang::Locale& rLoc = (*static_cast< SimpleResMgrMap * >(m_pThreadsafeRMs))[aISOcode]; if (!rResMgr) { - rResMgr = new SimpleResMgr(CREATEVERSIONRESMGR_NAME(svs), rLocale ); + rResMgr = new SimpleResMgr(CREATEVERSIONRESMGR_NAME(svl), rLocale ); } return rResMgr; } diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 4923eb1a64cb..ac70f8a6e467 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include <urihelper.hxx> +#include <svl/urihelper.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" diff --git a/svl/source/notify/brdcst.cxx b/svl/source/notify/brdcst.cxx index 12e22f97d262..7722814216a5 100644 --- a/svl/source/notify/brdcst.cxx +++ b/svl/source/notify/brdcst.cxx @@ -59,7 +59,7 @@ void SfxBroadcaster::Broadcast( const SfxHint &rHint ) if ( aListeners.Count() /*! || aGlobListeners.Count() */ ) { // notify all registered listeners exactly once - for ( USHORT n = 0; n < aListeners.Count(); ++n ) + for ( sal_uInt16 n = 0; n < aListeners.Count(); ++n ) { SfxListener* pListener = aListeners[n]; if ( pListener ) @@ -98,7 +98,7 @@ SfxBroadcaster::~SfxBroadcaster() Broadcast( SfxSimpleHint(SFX_HINT_DYING) ); // remove all still registered listeners - for ( USHORT nPos = 0; nPos < aListeners.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < aListeners.Count(); ++nPos ) { SfxListener *pListener = aListeners[nPos]; if ( pListener ) @@ -124,7 +124,7 @@ SfxBroadcaster::SfxBroadcaster( const SfxBroadcaster &rBC ) { DBG_CTOR(SfxBroadcaster, 0); - for ( USHORT n = 0; n < rBC.aListeners.Count(); ++n ) + for ( sal_uInt16 n = 0; n < rBC.aListeners.Count(); ++n ) { SfxListener *pListener = rBC.aListeners[n]; if ( pListener ) @@ -136,12 +136,12 @@ SfxBroadcaster::SfxBroadcaster( const SfxBroadcaster &rBC ) // add a new SfxListener to the list -BOOL SfxBroadcaster::AddListener( SfxListener& rListener ) +sal_Bool SfxBroadcaster::AddListener( SfxListener& rListener ) { DBG_CHKTHIS(SfxBroadcaster, 0); const SfxListener *pListener = &rListener; const SfxListener *pNull = 0; - USHORT nFreePos = aListeners.GetPos( pNull ); + sal_uInt16 nFreePos = aListeners.GetPos( pNull ); if ( nFreePos < aListeners.Count() ) aListeners.GetData()[nFreePos] = pListener; else if ( aListeners.Count() < (USHRT_MAX-1) ) @@ -149,12 +149,12 @@ BOOL SfxBroadcaster::AddListener( SfxListener& rListener ) else { OSL_FAIL( "array overflow" ); - return FALSE; + return sal_False; } DBG_ASSERT( USHRT_MAX != aListeners.GetPos(pListener), "AddListener failed" ); - return TRUE; + return sal_True; } //-------------------------------------------------------------------- @@ -172,8 +172,8 @@ void SfxBroadcaster::ListenersGone() void SfxBroadcaster::Forward(SfxBroadcaster& rBC, const SfxHint& rHint) { - const USHORT nCount = aListeners.Count(); - for ( USHORT i = 0; i < nCount; ++i ) + const sal_uInt16 nCount = aListeners.Count(); + for ( sal_uInt16 i = 0; i < nCount; ++i ) { SfxListener *pListener = aListeners[i]; if ( pListener ) @@ -189,7 +189,7 @@ void SfxBroadcaster::RemoveListener( SfxListener& rListener ) { {DBG_CHKTHIS(SfxBroadcaster, 0);} const SfxListener *pListener = &rListener; - USHORT nPos = aListeners.GetPos(pListener); + sal_uInt16 nPos = aListeners.GetPos(pListener); DBG_ASSERT( nPos != USHRT_MAX, "RemoveListener: Listener unknown" ); aListeners.GetData()[nPos] = 0; if ( !HasListeners() ) @@ -198,12 +198,12 @@ void SfxBroadcaster::RemoveListener( SfxListener& rListener ) //-------------------------------------------------------------------- -BOOL SfxBroadcaster::HasListeners() const +sal_Bool SfxBroadcaster::HasListeners() const { - for ( USHORT n = 0; n < aListeners.Count(); ++n ) + for ( sal_uInt16 n = 0; n < aListeners.Count(); ++n ) if ( aListeners.GetObject(n) != 0 ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } //-------------------------------------------------------------------- diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx index 16220033dbf8..a11a0b87aa9c 100644 --- a/svl/source/notify/broadcast.cxx +++ b/svl/source/notify/broadcast.cxx @@ -31,9 +31,9 @@ #include <tools/debug.hxx> -#include "listener.hxx" -#include "listeneriter.hxx" -#include "broadcast.hxx" +#include <svl/listener.hxx> +#include <svl/listeneriter.hxx> +#include <svl/broadcast.hxx> #include <svl/smplhint.hxx> @@ -92,7 +92,7 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint ) if( HasListeners() /* && !IsModifyLocked()*/ ) { // LockModify(); -// bInModify = TRUE; +// bInModify = sal_True; SvtListenerIter aIter( *this ); SvtListener* pLast = aIter.GoStart(); @@ -103,7 +103,7 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint ) break; } while( 0 != ( pLast = aIter.GoNext() )); -// bInModify = FALSE; +// bInModify = sal_False; // UnlockModify(); } } @@ -127,7 +127,7 @@ void SvtBroadcaster::Forward( SvtBroadcaster& rBC, const SfxHint& rHint ) if( rBC.HasListeners() /* && !IsModifyLocked()*/ ) { // LockModify(); -// bInModify = TRUE; +// bInModify = sal_True; SvtListenerIter aIter( rBC ); SvtListener* pLast = aIter.GoStart(); @@ -138,7 +138,7 @@ void SvtBroadcaster::Forward( SvtBroadcaster& rBC, const SfxHint& rHint ) break; } while( 0 != ( pLast = aIter.GoNext() )); -// bInModify = FALSE; +// bInModify = sal_False; // UnlockModify(); } } diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx index 70a4b2d23cd5..20fbc2993fbb 100644 --- a/svl/source/notify/listener.cxx +++ b/svl/source/notify/listener.cxx @@ -30,11 +30,10 @@ #include "precompiled_svl.hxx" #include <tools/debug.hxx> - -#include "broadcast.hxx" -#include "listener.hxx" +#include <svl/broadcast.hxx> +#include <svl/listener.hxx> #include "listenerbase.hxx" -#include "listeneriter.hxx" +#include <svl/listeneriter.hxx> //==================================================================== @@ -74,7 +73,7 @@ SvtListener::~SvtListener() // registeres at a specific SvtBroadcaster -BOOL SvtListener::StartListening( SvtBroadcaster& rBroadcaster ) +sal_Bool SvtListener::StartListening( SvtBroadcaster& rBroadcaster ) { const SvtListenerBase* pLst = pBrdCastLst; while( pLst ) @@ -82,19 +81,19 @@ BOOL SvtListener::StartListening( SvtBroadcaster& rBroadcaster ) if( &rBroadcaster == pLst->GetBroadcaster() ) { // double, than return - return FALSE; + return sal_False; } pLst = pLst->GetNext(); } new SvtListenerBase( *this, rBroadcaster ); - return TRUE; + return sal_True; } //-------------------------------------------------------------------- // unregisteres at a specific SvtBroadcaster -BOOL SvtListener::EndListening( SvtBroadcaster& rBroadcaster ) +sal_Bool SvtListener::EndListening( SvtBroadcaster& rBroadcaster ) { SvtListenerBase *pLst = pBrdCastLst, *pPrev = pLst; while( pLst ) @@ -107,12 +106,12 @@ BOOL SvtListener::EndListening( SvtBroadcaster& rBroadcaster ) pPrev->SetNext( pLst->GetNext() ); delete pLst; - return TRUE; + return sal_True; } pPrev = pLst; pLst = pLst->GetNext(); } - return FALSE; + return sal_False; } //-------------------------------------------------------------------- @@ -134,7 +133,7 @@ void SvtListener::EndListeningAll() //-------------------------------------------------------------------- -BOOL SvtListener::IsListening( SvtBroadcaster& rBroadcaster ) const +sal_Bool SvtListener::IsListening( SvtBroadcaster& rBroadcaster ) const { const SvtListenerBase *pLst = pBrdCastLst; while( pLst ) diff --git a/svl/source/notify/listenerbase.cxx b/svl/source/notify/listenerbase.cxx index ffc2b1819ea6..505d7f6e75c4 100644 --- a/svl/source/notify/listenerbase.cxx +++ b/svl/source/notify/listenerbase.cxx @@ -30,11 +30,10 @@ #include "precompiled_svl.hxx" #include <tools/debug.hxx> - #include "listenerbase.hxx" -#include "listeneriter.hxx" -#include "listener.hxx" -#include "broadcast.hxx" +#include <svl/listeneriter.hxx> +#include <svl/listener.hxx> +#include <svl/broadcast.hxx> SvtListenerBase::SvtListenerBase( SvtListener& rLst, diff --git a/svl/source/notify/listeneriter.cxx b/svl/source/notify/listeneriter.cxx index 46646f441fe6..9b3e16d8c120 100644 --- a/svl/source/notify/listeneriter.cxx +++ b/svl/source/notify/listeneriter.cxx @@ -31,9 +31,9 @@ #include <tools/debug.hxx> #include "listenerbase.hxx" -#include "listeneriter.hxx" -#include "broadcast.hxx" -#include "listener.hxx" +#include <svl/listeneriter.hxx> +#include <svl/broadcast.hxx> +#include <svl/listener.hxx> SvtListenerIter* SvtListenerIter::pListenerIters = 0; diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx index 498862e67638..2bdcb8852d15 100644 --- a/svl/source/notify/lstner.cxx +++ b/svl/source/notify/lstner.cxx @@ -58,7 +58,7 @@ SfxListener::SfxListener( const SfxListener &rListener ) { DBG_CTOR(SfxListener, 0); - for ( USHORT n = 0; n < rListener.aBCs.Count(); ++n ) + for ( sal_uInt16 n = 0; n < rListener.aBCs.Count(); ++n ) StartListening( *rListener.aBCs[n] ); } //-------------------------------------------------------------------- @@ -70,7 +70,7 @@ SfxListener::~SfxListener() DBG_DTOR(SfxListener, 0); // unregister at all remainding broadcasters - for ( USHORT nPos = 0; nPos < aBCs.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < aBCs.Count(); ++nPos ) { SfxBroadcaster *pBC = aBCs[nPos]; pBC->RemoveListener(*this); @@ -93,7 +93,7 @@ void SfxListener::RemoveBroadcaster_Impl( SfxBroadcaster& rBC ) // registeres at a specific SfxBroadcaster -BOOL SfxListener::StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDups ) +sal_Bool SfxListener::StartListening( SfxBroadcaster& rBroadcaster, sal_Bool bPreventDups ) { DBG_CHKTHIS(SfxListener, 0); @@ -105,23 +105,23 @@ BOOL SfxListener::StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDup aBCs.Insert( pBC, aBCs.Count() ); DBG_ASSERT( IsListening(rBroadcaster), "StartListening failed" ); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } //-------------------------------------------------------------------- // unregisteres at a specific SfxBroadcaster -BOOL SfxListener::EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups ) +sal_Bool SfxListener::EndListening( SfxBroadcaster& rBroadcaster, sal_Bool bAllDups ) { DBG_CHKTHIS(SfxListener, 0); if ( !IsListening( rBroadcaster ) ) - return FALSE; + return sal_False; do { @@ -130,14 +130,14 @@ BOOL SfxListener::EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups ) aBCs.Remove( aBCs.GetPos(pBC), 1 ); } while ( bAllDups && IsListening( rBroadcaster ) ); - return TRUE; + return sal_True; } //-------------------------------------------------------------------- // unregisteres at a specific SfxBroadcaster by index -void SfxListener::EndListening( USHORT nNo ) +void SfxListener::EndListening( sal_uInt16 nNo ) { DBG_CHKTHIS(SfxListener, 0); @@ -165,7 +165,7 @@ void SfxListener::EndListeningAll() //-------------------------------------------------------------------- -BOOL SfxListener::IsListening( SfxBroadcaster& rBroadcaster ) const +sal_Bool SfxListener::IsListening( SfxBroadcaster& rBroadcaster ) const { const SfxBroadcaster *pBC = &rBroadcaster; return USHRT_MAX != aBCs.GetPos( pBC ); diff --git a/svl/source/notify/makefile.mk b/svl/source/notify/makefile.mk deleted file mode 100644 index c2e6648907e5..000000000000 --- a/svl/source/notify/makefile.mk +++ /dev/null @@ -1,62 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=notify - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/smplhint.obj \ - $(SLO)$/hint.obj \ - $(SLO)$/lstner.obj \ - $(SLO)$/isethint.obj \ - $(SLO)$/brdcst.obj \ - $(SLO)$/listener.obj \ - $(SLO)$/listenerbase.obj \ - $(SLO)$/listeneriter.obj \ - $(SLO)$/broadcast.obj - -HXX1TARGET= notify -HXX1EXT= hxx -HXX1FILES= $(INC)$/hint.hxx \ - $(INC)$/smplhint.hxx \ - $(INC)$/lstner.hxx \ - $(INC)$/brdcst.hxx -HXX1EXCL= -E:*include* - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/notify/smplhint.cxx b/svl/source/notify/smplhint.cxx index 784bfb1df170..7aef9a7042bf 100644 --- a/svl/source/notify/smplhint.cxx +++ b/svl/source/notify/smplhint.cxx @@ -38,7 +38,7 @@ TYPEINIT1(SfxSimpleHint, SfxHint); //==================================================================== // creates a SimpleHint with the type nId -SfxSimpleHint::SfxSimpleHint( ULONG nIdP ) +SfxSimpleHint::SfxSimpleHint( sal_uLong nIdP ) { nId = nIdP; } diff --git a/svl/source/numbers/makefile.mk b/svl/source/numbers/makefile.mk deleted file mode 100644 index c38faa63b6a5..000000000000 --- a/svl/source/numbers/makefile.mk +++ /dev/null @@ -1,74 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=numbers -LIBTARGET=NO - -PROJECTPCH= -PROJECTPCHSOURCE= - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES= \ - $(SLO)$/numuno.obj \ - $(SLO)$/numfmuno.obj \ - $(SLO)$/supservs.obj \ - $(SLO)$/zforlist.obj \ - $(SLO)$/zforfind.obj \ - $(SLO)$/zformat.obj \ - $(SLO)$/zforscan.obj - -SLOFILES = \ - $(EXCEPTIONSFILES) \ - $(SLO)$/numhead.obj - -LIB1TARGET= $(SLB)$/$(TARGET).uno.lib -LIB1OBJFILES= \ - $(SLO)$/numfmuno.obj \ - $(SLO)$/supservs.obj - -LIB2TARGET= $(SLB)$/$(TARGET).lib -LIB2OBJFILES= \ - $(SLO)$/zforfind.obj \ - $(SLO)$/zforlist.obj \ - $(SLO)$/zformat.obj \ - $(SLO)$/zforscan.obj \ - $(SLO)$/numuno.obj \ - $(SLO)$/numhead.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/numbers/nbdll.cxx b/svl/source/numbers/nbdll.cxx deleted file mode 100644 index 285ae8dda567..000000000000 --- a/svl/source/numbers/nbdll.cxx +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#ifdef WIN -#include <svwin.h> - -#include <sysdep.hxx> - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index fa7d47267ba7..35f58e4ebee5 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -39,7 +39,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include "numfmuno.hxx" -#include "numuno.hxx" +#include <svl/numuno.hxx> #include <svl/zforlist.hxx> #include <svl/zformat.hxx> #include <svl/itemprop.hxx> @@ -182,7 +182,7 @@ sal_Int32 SAL_CALL SvNumberFormatterServiceObj::detectNumberFormat( { ::osl::MutexGuard aGuard( m_aMutex ); - INT32 nRet = 0; + sal_Int32 nRet = 0; SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; if (pFormatter) { @@ -248,7 +248,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryColorForNumber( sal_Int32 { ::osl::MutexGuard aGuard( m_aMutex ); - util::Color nRet = aDefaultColor; // color = INT32 + util::Color nRet = aDefaultColor; // color = sal_Int32 SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; if (pFormatter) { @@ -290,7 +290,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryColorForString( sal_Int32 { ::osl::MutexGuard aGuard( m_aMutex ); - util::Color nRet = aDefaultColor; // color = INT32 + util::Color nRet = aDefaultColor; // color = sal_Int32 SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; if (pFormatter) { @@ -341,7 +341,7 @@ rtl::OUString SAL_CALL SvNumberFormatterServiceObj::convertNumberToPreviewString LanguageType eLang = lcl_GetLanguage( nLocale ); Color* pColor = NULL; - BOOL bOk; + sal_Bool bOk; if ( bAllowEnglish ) bOk = pFormatter->GetPreviewStringGuess( aFormString, fValue, aOutString, &pColor, eLang ); @@ -368,7 +368,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber( { ::osl::MutexGuard aGuard( m_aMutex ); - util::Color nRet = aDefaultColor; // color = INT32 + util::Color nRet = aDefaultColor; // color = sal_Int32 SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; if (pFormatter) { @@ -377,7 +377,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber( LanguageType eLang = lcl_GetLanguage( nLocale ); Color* pColor = NULL; - BOOL bOk; + sal_Bool bOk; if ( bAllowEnglish ) bOk = pFormatter->GetPreviewStringGuess( aFormString, fValue, aOutString, &pColor, eLang ); @@ -484,7 +484,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::queryKey( const rtl::OUString& aFormat, { ::osl::MutexGuard aGuard( m_aMutex ); - INT32 nRet = 0; + sal_Int32 nRet = 0; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { @@ -508,7 +508,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNew( const rtl::OUString& aFormat, { ::osl::MutexGuard aGuard( m_aMutex ); - INT32 nRet = 0; + sal_Int32 nRet = 0; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { @@ -517,7 +517,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNew( const rtl::OUString& aFormat, sal_uInt32 nKey = 0; xub_StrLen nCheckPos = 0; short nType = 0; - BOOL bOk = pFormatter->PutEntry( aFormStr, nCheckPos, nType, nKey, eLang ); + sal_Bool bOk = pFormatter->PutEntry( aFormStr, nCheckPos, nType, nKey, eLang ); if (bOk) nRet = nKey; else if (nCheckPos) @@ -539,7 +539,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNewConverted( const rtl::OUString& aFo { ::osl::MutexGuard aGuard( m_aMutex ); - INT32 nRet = 0; + sal_Int32 nRet = 0; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { @@ -549,7 +549,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNewConverted( const rtl::OUString& aFo sal_uInt32 nKey = 0; xub_StrLen nCheckPos = 0; short nType = 0; - BOOL bOk = pFormatter->PutandConvertEntry( aFormStr, nCheckPos, nType, nKey, eLang, eNewLang ); + sal_Bool bOk = pFormatter->PutandConvertEntry( aFormStr, nCheckPos, nType, nKey, eLang, eNewLang ); if (bOk || nKey > 0) nRet = nKey; else if (nCheckPos) @@ -604,7 +604,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getStandardIndex( const lang::Locale& nLo { ::osl::MutexGuard aGuard( m_aMutex ); - INT32 nRet = 0; + sal_Int32 nRet = 0; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { @@ -622,7 +622,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getStandardFormat( sal_Int16 nType, const { ::osl::MutexGuard aGuard( m_aMutex ); - INT32 nRet = 0; + sal_Int32 nRet = 0; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { @@ -643,7 +643,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatIndex( sal_Int16 nIndex, const l { ::osl::MutexGuard aGuard( m_aMutex ); - INT32 nRet = 0; + sal_Int32 nRet = 0; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { @@ -661,7 +661,7 @@ sal_Bool SAL_CALL SvNumberFormatsObj::isTypeCompatible( sal_Int16 nOldType, sal_ { ::osl::MutexGuard aGuard( m_aMutex ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) bRet = pFormatter->IsCompatible( nOldType, nNewType ); @@ -676,7 +676,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatForLocale( sal_Int32 nKey, const { ::osl::MutexGuard aGuard( m_aMutex ); - INT32 nRet = 0; + sal_Int32 nRet = 0; SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { @@ -714,7 +714,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatsObj::getSupportedServiceNam //------------------------------------------------------------------------ -SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, ULONG nK, const ::comphelper::SharedMutex& _rMutex ) +SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uLong nK, const ::comphelper::SharedMutex& _rMutex ) :rSupplier( rParent ) ,nKey( nK ) ,m_aMutex( _rMutex ) @@ -758,8 +758,8 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL; if (pFormat) { - BOOL bThousand, bRed; - USHORT nDecimals, nLeading; + sal_Bool bThousand, bRed; + sal_uInt16 nDecimals, nLeading; String aString = aPropertyName; if (aString.EqualsAscii( PROPERTYNAME_FMTSTR )) @@ -783,12 +783,12 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro else if (aString.EqualsAscii( PROPERTYNAME_STDFORM )) { //! SvNumberformat Member bStandard rausreichen? - BOOL bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 ); + sal_Bool bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 ); aRet.setValue( &bStandard, getBooleanCppuType() ); } else if (aString.EqualsAscii( PROPERTYNAME_USERDEF )) { - BOOL bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 ); + sal_Bool bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 ); aRet.setValue( &bUserDef, getBooleanCppuType() ); } else if (aString.EqualsAscii( PROPERTYNAME_DECIMALS )) @@ -826,7 +826,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro else if (aString.EqualsAscii( PROPERTYNAME_CURRABB )) { String aSymbol, aExt; - BOOL bBank = FALSE; + sal_Bool bBank = sal_False; pFormat->GetNewCurrencySymbol( aSymbol, aExt ); const NfCurrencyEntry* pCurr = pFormatter->GetCurrencyEntry( bBank, aSymbol, aExt, pFormat->GetLanguage() ); @@ -888,7 +888,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue if (pFormat) { String aSymbol, aExt, aAbb; - BOOL bBank = FALSE; + sal_Bool bBank = sal_False; pFormat->GetNewCurrencySymbol( aSymbol, aExt ); const NfCurrencyEntry* pCurr = pFormatter->GetCurrencyEntry( bBank, aSymbol, aExt, pFormat->GetLanguage() ); @@ -897,11 +897,11 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue String aFmtStr = pFormat->GetFormatstring(); String aComment = pFormat->GetComment(); - BOOL bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 ); + sal_Bool bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 ); //! SvNumberformat Member bStandard rausreichen? - BOOL bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 ); - BOOL bThousand, bRed; - USHORT nDecimals, nLeading; + sal_Bool bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 ); + sal_Bool bThousand, bRed; + sal_uInt16 nDecimals, nLeading; pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading ); lang::Locale aLocale( MsLangId::convertLanguageToLocale( pFormat->GetLanguage())); @@ -1056,7 +1056,7 @@ uno::Any SAL_CALL SvNumberFormatSettingsObj::getPropertyValue( const rtl::OUStri String aString = aPropertyName; if (aString.EqualsAscii( PROPERTYNAME_NOZERO )) { - BOOL bNoZero = pFormatter->GetNoZero(); + sal_Bool bNoZero = pFormatter->GetNoZero(); aRet.setValue( &bNoZero, getBooleanCppuType() ); } else if (aString.EqualsAscii( PROPERTYNAME_NULLDATE )) diff --git a/svl/source/numbers/numfmuno.hxx b/svl/source/numbers/numfmuno.hxx index 4e793be42adc..1fdc30b4601c 100644 --- a/svl/source/numbers/numfmuno.hxx +++ b/svl/source/numbers/numfmuno.hxx @@ -184,11 +184,11 @@ class SvNumberFormatObj : public cppu::WeakImplHelper3< { private: SvNumberFormatsSupplierObj& rSupplier; - ULONG nKey; + sal_uLong nKey; mutable ::comphelper::SharedMutex m_aMutex; public: - SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, ULONG nK, const ::comphelper::SharedMutex& _rMutex ); + SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uLong nK, const ::comphelper::SharedMutex& _rMutex ); virtual ~SvNumberFormatObj(); // XPropertySet diff --git a/svl/source/numbers/numhead.cxx b/svl/source/numbers/numhead.cxx index d2274f8d5051..dcb16ef94f77 100644 --- a/svl/source/numbers/numhead.cxx +++ b/svl/source/numbers/numhead.cxx @@ -46,7 +46,7 @@ SvNumReadHeader::SvNumReadHeader(SvStream& rNewStream) : rStream( rNewStream ) { - ULONG nDataSize; + sal_uLong nDataSize; rStream >> nDataSize; nDataEnd = rStream.Tell() + nDataSize; } @@ -55,7 +55,7 @@ SvNumReadHeader::SvNumReadHeader(SvStream& rNewStream) : SvNumReadHeader::~SvNumReadHeader() { - ULONG nReadEnd = rStream.Tell(); + sal_uLong nReadEnd = rStream.Tell(); DBG_ASSERT( nReadEnd <= nDataEnd, "zuviele Bytes gelesen" ); if ( nReadEnd != nDataEnd ) rStream.Seek(nDataEnd); // Rest ueberspringen @@ -63,9 +63,9 @@ SvNumReadHeader::~SvNumReadHeader() //#pragma SEG_FUNCDEF(numhead_03) -ULONG SvNumReadHeader::BytesLeft() const +sal_uLong SvNumReadHeader::BytesLeft() const { - ULONG nReadEnd = rStream.Tell(); + sal_uLong nReadEnd = rStream.Tell(); if (nReadEnd <= nDataEnd) return nDataEnd-nReadEnd; @@ -77,7 +77,7 @@ ULONG SvNumReadHeader::BytesLeft() const //#pragma SEG_FUNCDEF(numhead_04) -SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault) : +SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, sal_uLong nDefault) : rStream( rNewStream ) { nDataSize = nDefault; @@ -89,7 +89,7 @@ SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault) : SvNumWriteHeader::~SvNumWriteHeader() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); if ( nPos - nDataPos != nDataSize ) // Default getroffen? { @@ -111,11 +111,11 @@ ImpSvNumMultipleReadHeader::ImpSvNumMultipleReadHeader(SvStream& rNewStream) : { sal_uInt32 nDataSize; rStream >> nDataSize; - ULONG nDataPos = rStream.Tell(); + sal_uLong nDataPos = rStream.Tell(); nEntryEnd = nDataPos; rStream.SeekRel(nDataSize); - USHORT nID; + sal_uInt16 nID; rStream >> nID; if (nID != SV_NUMID_SIZES) { @@ -150,7 +150,7 @@ void ImpSvNumMultipleReadHeader::Skip( SvStream& rStream ) sal_uInt32 nDataSize; rStream >> nDataSize; rStream.SeekRel( nDataSize ); - USHORT nID; + sal_uInt16 nID; rStream >> nID; if ( nID != SV_NUMID_SIZES ) { @@ -165,7 +165,7 @@ void ImpSvNumMultipleReadHeader::Skip( SvStream& rStream ) void ImpSvNumMultipleReadHeader::EndEntry() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); DBG_ASSERT( nPos <= nEntryEnd, "zuviel gelesen" ); if ( nPos != nEntryEnd ) rStream.Seek( nEntryEnd ); // Rest ueberspringen @@ -175,7 +175,7 @@ void ImpSvNumMultipleReadHeader::EndEntry() void ImpSvNumMultipleReadHeader::StartEntry() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); sal_uInt32 nEntrySize; (*pMemStream) >> nEntrySize; @@ -184,9 +184,9 @@ void ImpSvNumMultipleReadHeader::StartEntry() //#pragma SEG_FUNCDEF(numhead_09) -ULONG ImpSvNumMultipleReadHeader::BytesLeft() const +sal_uLong ImpSvNumMultipleReadHeader::BytesLeft() const { - ULONG nReadEnd = rStream.Tell(); + sal_uLong nReadEnd = rStream.Tell(); if (nReadEnd <= nEntryEnd) return nEntryEnd-nReadEnd; @@ -199,7 +199,7 @@ ULONG ImpSvNumMultipleReadHeader::BytesLeft() const //#pragma SEG_FUNCDEF(numhead_0a) ImpSvNumMultipleWriteHeader::ImpSvNumMultipleWriteHeader(SvStream& rNewStream, - ULONG nDefault) : + sal_uLong nDefault) : rStream( rNewStream ), aMemStream( 4096, 4096 ) { @@ -214,16 +214,16 @@ ImpSvNumMultipleWriteHeader::ImpSvNumMultipleWriteHeader(SvStream& rNewStream, ImpSvNumMultipleWriteHeader::~ImpSvNumMultipleWriteHeader() { - ULONG nDataEnd = rStream.Tell(); + sal_uLong nDataEnd = rStream.Tell(); - rStream << (USHORT) SV_NUMID_SIZES; + rStream << (sal_uInt16) SV_NUMID_SIZES; rStream << static_cast<sal_uInt32>(aMemStream.Tell()); rStream.Write( aMemStream.GetData(), aMemStream.Tell() ); if ( nDataEnd - nDataPos != nDataSize ) // Default getroffen? { nDataSize = nDataEnd - nDataPos; - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); rStream.Seek(nDataPos-sizeof(sal_uInt32)); rStream << nDataSize; // Groesse am Anfang eintragen rStream.Seek(nPos); @@ -234,7 +234,7 @@ ImpSvNumMultipleWriteHeader::~ImpSvNumMultipleWriteHeader() void ImpSvNumMultipleWriteHeader::EndEntry() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); aMemStream << static_cast<sal_uInt32>(nPos - nEntryStart); } @@ -242,7 +242,7 @@ void ImpSvNumMultipleWriteHeader::EndEntry() void ImpSvNumMultipleWriteHeader::StartEntry() { - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); nEntryStart = nPos; } diff --git a/svl/source/numbers/numhead.hxx b/svl/source/numbers/numhead.hxx index c43f1a92f337..8ccd91489a4c 100644 --- a/svl/source/numbers/numhead.hxx +++ b/svl/source/numbers/numhead.hxx @@ -40,24 +40,24 @@ class SvNumReadHeader { private: SvStream& rStream; - ULONG nDataEnd; + sal_uLong nDataEnd; public: SvNumReadHeader(SvStream& rNewStream); ~SvNumReadHeader(); - ULONG BytesLeft() const; + sal_uLong BytesLeft() const; }; class SvNumWriteHeader { private: SvStream& rStream; - ULONG nDataPos; - ULONG nDataSize; + sal_uLong nDataPos; + sal_uLong nDataSize; public: - SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault = 0); + SvNumWriteHeader(SvStream& rNewStream, sal_uLong nDefault = 0); ~SvNumWriteHeader(); }; @@ -71,8 +71,8 @@ private: SvStream& rStream; char* pBuf; SvMemoryStream* pMemStream; - ULONG nEndPos; - ULONG nEntryEnd; + sal_uLong nEndPos; + sal_uLong nEntryEnd; public: ImpSvNumMultipleReadHeader(SvStream& rNewStream); @@ -80,7 +80,7 @@ public: void StartEntry(); void EndEntry(); - ULONG BytesLeft() const; + sal_uLong BytesLeft() const; static void Skip( SvStream& ); // komplett ueberspringen }; @@ -90,12 +90,12 @@ class ImpSvNumMultipleWriteHeader private: SvStream& rStream; SvMemoryStream aMemStream; - ULONG nDataPos; + sal_uLong nDataPos; sal_uInt32 nDataSize; - ULONG nEntryStart; + sal_uLong nEntryStart; public: - ImpSvNumMultipleWriteHeader(SvStream& rNewStream, ULONG nDefault = 0); + ImpSvNumMultipleWriteHeader(SvStream& rNewStream, sal_uLong nDefault = 0); ~ImpSvNumMultipleWriteHeader(); void StartEntry(); diff --git a/svl/source/numbers/numuno.cxx b/svl/source/numbers/numuno.cxx index da0ec77ed7cc..8ef8615997e9 100644 --- a/svl/source/numbers/numuno.cxx +++ b/svl/source/numbers/numuno.cxx @@ -37,7 +37,7 @@ #include <osl/mutex.hxx> #include <rtl/uuid.h> -#include "numuno.hxx" +#include <svl/numuno.hxx> #include "numfmuno.hxx" #include <svl/zforlist.hxx> diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx index e3236c309bf4..1b5883553b32 100644 --- a/svl/source/numbers/supservs.cxx +++ b/svl/source/numbers/supservs.cxx @@ -35,8 +35,8 @@ #include <tools/debug.hxx> #include <osl/mutex.hxx> #include <tools/stream.hxx> -#include <strmadpt.hxx> -#include "instrm.hxx" +#include <svl/strmadpt.hxx> +#include <svl/instrm.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; diff --git a/svl/source/numbers/supservs.hxx b/svl/source/numbers/supservs.hxx index 0b115630c832..1402f11d993e 100644 --- a/svl/source/numbers/supservs.hxx +++ b/svl/source/numbers/supservs.hxx @@ -29,7 +29,7 @@ #ifndef _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_ #define _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_ -#include "numuno.hxx" +#include <svl/numuno.hxx> #include <svl/zforlist.hxx> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 12c92538d2be..d18ea9de19e9 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -62,11 +62,11 @@ #endif -const BYTE ImpSvNumberInputScan::nMatchedEndString = 0x01; -const BYTE ImpSvNumberInputScan::nMatchedMidString = 0x02; -const BYTE ImpSvNumberInputScan::nMatchedStartString = 0x04; -const BYTE ImpSvNumberInputScan::nMatchedVirgin = 0x08; -const BYTE ImpSvNumberInputScan::nMatchedUsedAsReturn = 0x10; +const sal_uInt8 ImpSvNumberInputScan::nMatchedEndString = 0x01; +const sal_uInt8 ImpSvNumberInputScan::nMatchedMidString = 0x02; +const sal_uInt8 ImpSvNumberInputScan::nMatchedStartString = 0x04; +const sal_uInt8 ImpSvNumberInputScan::nMatchedVirgin = 0x08; +const sal_uInt8 ImpSvNumberInputScan::nMatchedUsedAsReturn = 0x10; /* It is not clear how we want timezones to be handled. Convert them to local * time isn't wanted, as it isn't done in any other place and timezone @@ -141,7 +141,7 @@ void ImpSvNumberInputScan::Reset() //--------------------------------------------------------------------------- // // static -inline BOOL ImpSvNumberInputScan::MyIsdigit( sal_Unicode c ) +inline sal_Bool ImpSvNumberInputScan::MyIsdigit( sal_Unicode c ) { return c < 128 && isdigit( (unsigned char) c ); } @@ -170,19 +170,19 @@ void ImpSvNumberInputScan::TransformInput( String& rStr ) // Only simple unsigned floating point values without any error detection, // decimal separator has to be '.' -double ImpSvNumberInputScan::StringToDouble( const String& rStr, BOOL bForceFraction ) +double ImpSvNumberInputScan::StringToDouble( const String& rStr, sal_Bool bForceFraction ) { double fNum = 0.0; double fFrac = 0.0; int nExp = 0; xub_StrLen nPos = 0; xub_StrLen nLen = rStr.Len(); - BOOL bPreSep = !bForceFraction; + sal_Bool bPreSep = !bForceFraction; while (nPos < nLen) { if (rStr.GetChar(nPos) == '.') - bPreSep = FALSE; + bPreSep = sal_False; else if (bPreSep) fNum = fNum * 10.0 + (double) (rStr.GetChar(nPos) - '0'); else @@ -226,11 +226,11 @@ enum ScanState // States der Turing-Maschine SsGetString = 3 }; -BOOL ImpSvNumberInputScan::NextNumberStringSymbol( +sal_Bool ImpSvNumberInputScan::NextNumberStringSymbol( const sal_Unicode*& pStr, String& rSymbol ) { - BOOL isNumber = FALSE; + sal_Bool isNumber = sal_False; sal_Unicode cToken; ScanState eState = SsStart; register const sal_Unicode* pHere = pStr; @@ -245,7 +245,7 @@ BOOL ImpSvNumberInputScan::NextNumberStringSymbol( if ( MyIsdigit( cToken ) ) { eState = SsGetValue; - isNumber = TRUE; + isNumber = sal_True; } else eState = SsGetString; @@ -291,11 +291,11 @@ BOOL ImpSvNumberInputScan::NextNumberStringSymbol( // FIXME: should be grouping; it is only used though in case nAnzStrings is // near SV_MAX_ANZ_INPUT_STRINGS, in NumberStringDivision(). -BOOL ImpSvNumberInputScan::SkipThousands( +sal_Bool ImpSvNumberInputScan::SkipThousands( const sal_Unicode*& pStr, String& rSymbol ) { - BOOL res = FALSE; + sal_Bool res = sal_False; sal_Unicode cToken; const String& rThSep = pFormatter->GetNumThousandSep(); register const sal_Unicode* pHere = pStr; @@ -328,7 +328,7 @@ BOOL ImpSvNumberInputScan::SkipThousands( if (nCounter == 3) { eState = SsStart; - res = TRUE; // .000 combination found + res = sal_True; // .000 combination found } } else @@ -365,7 +365,7 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString ) { if ( NextNumberStringSymbol( pStr, sStrArray[nAnzStrings] ) ) { // Zahl - IsNum[nAnzStrings] = TRUE; + IsNum[nAnzStrings] = sal_True; nNums[nAnzNums] = nAnzStrings; nAnzNums++; if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS - 7 && @@ -375,7 +375,7 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString ) } else { - IsNum[nAnzStrings] = FALSE; + IsNum[nAnzStrings] = sal_False; } nAnzStrings++; } @@ -385,34 +385,34 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString ) //--------------------------------------------------------------------------- // Whether rString contains rWhat at nPos -BOOL ImpSvNumberInputScan::StringContainsImpl( const String& rWhat, +sal_Bool ImpSvNumberInputScan::StringContainsImpl( const String& rWhat, const String& rString, xub_StrLen nPos ) { if ( nPos + rWhat.Len() <= rString.Len() ) return StringPtrContainsImpl( rWhat, rString.GetBuffer(), nPos ); - return FALSE; + return sal_False; } //--------------------------------------------------------------------------- // Whether pString contains rWhat at nPos -BOOL ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat, +sal_Bool ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat, const sal_Unicode* pString, xub_StrLen nPos ) { if ( rWhat.Len() == 0 ) - return FALSE; + return sal_False; register const sal_Unicode* pWhat = rWhat.GetBuffer(); register const sal_Unicode* const pEnd = pWhat + rWhat.Len(); register const sal_Unicode* pStr = pString + nPos; while ( pWhat < pEnd ) { if ( *pWhat != *pStr ) - return FALSE; + return sal_False; pWhat++; pStr++; } - return TRUE; + return sal_True; } @@ -421,15 +421,15 @@ BOOL ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat, // // ueberspringt genau das angegebene Zeichen -inline BOOL ImpSvNumberInputScan::SkipChar( sal_Unicode c, const String& rString, +inline sal_Bool ImpSvNumberInputScan::SkipChar( sal_Unicode c, const String& rString, xub_StrLen& nPos ) { if ((nPos < rString.Len()) && (rString.GetChar(nPos) == c)) { nPos++; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -458,15 +458,15 @@ inline void ImpSvNumberInputScan::SkipBlanks( const String& rString, // // jump over rWhat in rString at nPos -inline BOOL ImpSvNumberInputScan::SkipString( const String& rWhat, +inline sal_Bool ImpSvNumberInputScan::SkipString( const String& rWhat, const String& rString, xub_StrLen& nPos ) { if ( StringContains( rWhat, rString, nPos ) ) { nPos = nPos + rWhat.Len(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -475,10 +475,10 @@ inline BOOL ImpSvNumberInputScan::SkipString( const String& rWhat, // // recognizes exactly ,111 in {3} and {3,2} or ,11 in {3,2} grouping -inline BOOL ImpSvNumberInputScan::GetThousandSep( +inline sal_Bool ImpSvNumberInputScan::GetThousandSep( const String& rString, xub_StrLen& nPos, - USHORT nStringPos ) + sal_uInt16 nStringPos ) { const String& rSep = pFormatter->GetNumThousandSep(); // Is it an ordinary space instead of a non-breaking space? @@ -487,7 +487,7 @@ inline BOOL ImpSvNumberInputScan::GetThousandSep( if (!( (rString == rSep || bSpaceBreak) // nothing else && nStringPos < nAnzStrings - 1 // safety first! && IsNum[nStringPos+1] )) // number follows - return FALSE; // no? => out + return sal_False; // no? => out utl::DigitGroupingIterator aGrouping( pFormatter->GetLocaleData()->getDigitGrouping()); @@ -504,9 +504,9 @@ inline BOOL ImpSvNumberInputScan::GetThousandSep( ) { nPos = nPos + rSep.Len(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -514,8 +514,8 @@ inline BOOL ImpSvNumberInputScan::GetThousandSep( // GetLogical // // Conversion of text to logial value -// "TRUE" => 1: -// "FALSE"=> -1: +// "sal_True" => 1: +// "sal_False"=> -1: // else => 0: short ImpSvNumberInputScan::GetLogical( const String& rString ) @@ -622,10 +622,10 @@ int ImpSvNumberInputScan::GetDayOfWeek( const String& rString, xub_StrLen& nPos // GetCurrency // // Lesen eines Waehrungssysmbols -// '$' => TRUE -// sonst => FALSE +// '$' => sal_True +// sonst => sal_False -BOOL ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos, +sal_Bool ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos, const SvNumberformat* pFormat ) { if ( rString.Len() > nPos ) @@ -640,7 +640,7 @@ BOOL ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos, if ( StringContains( aUpperCurrSymbol, rString, nPos ) ) { nPos = nPos + aUpperCurrSymbol.Len(); - return TRUE; + return sal_True; } if ( pFormat ) { @@ -653,14 +653,14 @@ BOOL ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos, if ( StringContains( aSymbol, rString, nPos ) ) { nPos = nPos + aSymbol.Len(); - return TRUE; + return sal_True; } } } } } - return FALSE; + return sal_False; } @@ -670,15 +670,15 @@ BOOL ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos, // Lesen des Zeitsymbols (AM od. PM) f. kurze Zeitangabe // // Rueckgabe: -// "AM" od. "PM" => TRUE -// sonst => FALSE +// "AM" od. "PM" => sal_True +// sonst => sal_False // // nAmPos: // "AM" => 1 // "PM" => -1 // sonst => 0 -BOOL ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos ) +sal_Bool ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos ) { if ( rString.Len() > nPos ) @@ -689,17 +689,17 @@ BOOL ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos { nAmPm = 1; nPos = nPos + pLoc->getTimeAM().Len(); - return TRUE; + return sal_True; } else if ( StringContains( pChr->upper( pLoc->getTimePM() ), rString, nPos ) ) { nAmPm = -1; nPos = nPos + pLoc->getTimePM().Len(); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } @@ -707,10 +707,10 @@ BOOL ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos // GetDecSep // // Lesen eines Dezimaltrenners (',') -// ',' => TRUE -// sonst => FALSE +// ',' => sal_True +// sonst => sal_False -inline BOOL ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrLen& nPos ) +inline sal_Bool ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrLen& nPos ) { if ( rString.Len() > nPos ) { @@ -718,17 +718,17 @@ inline BOOL ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrLen& if ( rString.Equals( rSep, nPos, rSep.Len() ) ) { nPos = nPos + rSep.Len(); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } //--------------------------------------------------------------------------- // read a hundredth seconds separator -inline BOOL ImpSvNumberInputScan::GetTime100SecSep( const String& rString, xub_StrLen& nPos ) +inline sal_Bool ImpSvNumberInputScan::GetTime100SecSep( const String& rString, xub_StrLen& nPos ) { if ( rString.Len() > nPos ) { @@ -736,10 +736,10 @@ inline BOOL ImpSvNumberInputScan::GetTime100SecSep( const String& rString, xub_S if ( rString.Equals( rSep, nPos, rSep.Len() ) ) { nPos = nPos + rSep.Len(); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } @@ -807,15 +807,15 @@ short ImpSvNumberInputScan::GetESign( const String& rString, xub_StrLen& nPos ) // i counts string portions, j counts numbers thereof. // It should had been called SkipNumber instead. -inline BOOL ImpSvNumberInputScan::GetNextNumber( USHORT& i, USHORT& j ) +inline sal_Bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j ) { if ( i < nAnzStrings && IsNum[i] ) { j++; i++; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -824,19 +824,19 @@ inline BOOL ImpSvNumberInputScan::GetNextNumber( USHORT& i, USHORT& j ) void ImpSvNumberInputScan::GetTimeRef( double& fOutNumber, - USHORT nIndex, // j-value of the first numeric time part of input, default 0 - USHORT nAnz ) // count of numeric time parts + sal_uInt16 nIndex, // j-value of the first numeric time part of input, default 0 + sal_uInt16 nAnz ) // count of numeric time parts { - USHORT nHour; - USHORT nMinute = 0; - USHORT nSecond = 0; + sal_uInt16 nHour; + sal_uInt16 nMinute = 0; + sal_uInt16 nSecond = 0; double fSecond100 = 0.0; - USHORT nStartIndex = nIndex; + sal_uInt16 nStartIndex = nIndex; if (nTimezonePos) { // find first timezone number index and adjust count - for (USHORT j=0; j<nAnzNums; ++j) + for (sal_uInt16 j=0; j<nAnzNums; ++j) { if (nNums[j] == nTimezonePos) { @@ -851,7 +851,7 @@ void ImpSvNumberInputScan::GetTimeRef( if (nDecPos == 2 && (nAnz == 3 || nAnz == 2)) // 20:45.5 or 45.5 nHour = 0; else if (nIndex - nStartIndex < nAnz) - nHour = (USHORT) sStrArray[nNums[nIndex++]].ToInt32(); + nHour = (sal_uInt16) sStrArray[nNums[nIndex++]].ToInt32(); else { nHour = 0; @@ -860,11 +860,11 @@ void ImpSvNumberInputScan::GetTimeRef( if (nDecPos == 2 && nAnz == 2) // 45.5 nMinute = 0; else if (nIndex - nStartIndex < nAnz) - nMinute = (USHORT) sStrArray[nNums[nIndex++]].ToInt32(); + nMinute = (sal_uInt16) sStrArray[nNums[nIndex++]].ToInt32(); if (nIndex - nStartIndex < nAnz) - nSecond = (USHORT) sStrArray[nNums[nIndex++]].ToInt32(); + nSecond = (sal_uInt16) sStrArray[nNums[nIndex++]].ToInt32(); if (nIndex - nStartIndex < nAnz) - fSecond100 = StringToDouble( sStrArray[nNums[nIndex]], TRUE ); + fSecond100 = StringToDouble( sStrArray[nNums[nIndex]], sal_True ); if (nAmPm == -1 && nHour != 12) // PM nHour += 12; else if (nAmPm == 1 && nHour == 12) // 12 AM @@ -880,13 +880,13 @@ void ImpSvNumberInputScan::GetTimeRef( //--------------------------------------------------------------------------- // ImplGetDay -USHORT ImpSvNumberInputScan::ImplGetDay( USHORT nIndex ) +sal_uInt16 ImpSvNumberInputScan::ImplGetDay( sal_uInt16 nIndex ) { - USHORT nRes = 0; + sal_uInt16 nRes = 0; if (sStrArray[nNums[nIndex]].Len() <= 2) { - USHORT nNum = (USHORT) sStrArray[nNums[nIndex]].ToInt32(); + sal_uInt16 nNum = (sal_uInt16) sStrArray[nNums[nIndex]].ToInt32(); if (nNum <= 31) nRes = nNum; } @@ -898,14 +898,14 @@ USHORT ImpSvNumberInputScan::ImplGetDay( USHORT nIndex ) //--------------------------------------------------------------------------- // ImplGetMonth -USHORT ImpSvNumberInputScan::ImplGetMonth( USHORT nIndex ) +sal_uInt16 ImpSvNumberInputScan::ImplGetMonth( sal_uInt16 nIndex ) { // preset invalid month number - USHORT nRes = pFormatter->GetCalendar()->getNumberOfMonthsInYear(); + sal_uInt16 nRes = pFormatter->GetCalendar()->getNumberOfMonthsInYear(); if (sStrArray[nNums[nIndex]].Len() <= 2) { - USHORT nNum = (USHORT) sStrArray[nNums[nIndex]].ToInt32(); + sal_uInt16 nNum = (sal_uInt16) sStrArray[nNums[nIndex]].ToInt32(); if ( 0 < nNum && nNum <= nRes ) nRes = nNum - 1; // zero based for CalendarFieldIndex::MONTH } @@ -919,13 +919,13 @@ USHORT ImpSvNumberInputScan::ImplGetMonth( USHORT nIndex ) // // 30 -> 1930, 29 -> 2029, oder 56 -> 1756, 55 -> 1855, ... -USHORT ImpSvNumberInputScan::ImplGetYear( USHORT nIndex ) +sal_uInt16 ImpSvNumberInputScan::ImplGetYear( sal_uInt16 nIndex ) { - USHORT nYear = 0; + sal_uInt16 nYear = 0; if (sStrArray[nNums[nIndex]].Len() <= 4) { - nYear = (USHORT) sStrArray[nNums[nIndex]].ToInt32(); + nYear = (sal_uInt16) sStrArray[nNums[nIndex]].ToInt32(); nYear = SvNumberFormatter::ExpandTwoDigitYear( nYear, nYear2000 ); } @@ -950,7 +950,7 @@ bool ImpSvNumberInputScan::MayBeIso8601() //--------------------------------------------------------------------------- // GetDateRef -BOOL ImpSvNumberInputScan::GetDateRef( double& fDays, USHORT& nCounter, +sal_Bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter, const SvNumberformat* pFormat ) { using namespace ::com::sun::star::i18n; @@ -977,7 +977,7 @@ BOOL ImpSvNumberInputScan::GetDateRef( double& fDays, USHORT& nCounter, eEDF = NF_EVALDATEFORMAT_INTL; nFormatOrder = 1; } - BOOL res = TRUE; + sal_Bool res = sal_True; const LocaleDataWrapper* pLoc = pFormatter->GetLocaleData(); CalendarWrapper* pCal = pFormatter->GetCalendar(); @@ -986,45 +986,45 @@ BOOL ImpSvNumberInputScan::GetDateRef( double& fDays, USHORT& nCounter, pCal->setGregorianDateTime( Date() ); // today String aOrgCalendar; // empty => not changed yet DateFormat DateFmt; - BOOL bFormatTurn; + sal_Bool bFormatTurn; switch ( eEDF ) { case NF_EVALDATEFORMAT_INTL : - bFormatTurn = FALSE; + bFormatTurn = sal_False; DateFmt = pLoc->getDateFormat(); break; case NF_EVALDATEFORMAT_FORMAT : - bFormatTurn = TRUE; + bFormatTurn = sal_True; DateFmt = pFormat->GetDateOrder(); break; case NF_EVALDATEFORMAT_INTL_FORMAT : if ( nTryOrder == 1 ) { - bFormatTurn = FALSE; + bFormatTurn = sal_False; DateFmt = pLoc->getDateFormat(); } else { - bFormatTurn = TRUE; + bFormatTurn = sal_True; DateFmt = pFormat->GetDateOrder(); } break; case NF_EVALDATEFORMAT_FORMAT_INTL : if ( nTryOrder == 2 ) { - bFormatTurn = FALSE; + bFormatTurn = sal_False; DateFmt = pLoc->getDateFormat(); } else { - bFormatTurn = TRUE; + bFormatTurn = sal_True; DateFmt = pFormat->GetDateOrder(); } break; default: OSL_FAIL( "ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat" ); DateFmt = YMD; - bFormatTurn = FALSE; + bFormatTurn = sal_False; } if ( bFormatTurn ) { @@ -1063,7 +1063,7 @@ input for the following reasons: #endif } - res = TRUE; + res = sal_True; nCounter = 0; // For incomplete dates, always assume first day of month if not specified. pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, 1 ); @@ -1074,7 +1074,7 @@ input for the following reasons: if (nMonthPos) // only month (Jan) pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); else - res = FALSE; + res = sal_False; break; case 1: // only one number @@ -1090,8 +1090,8 @@ input for the following reasons: { case MDY: case YMD: { - USHORT nDay = ImplGetDay(0); - USHORT nYear = ImplGetYear(0); + sal_uInt16 nDay = ImplGetDay(0); + sal_uInt16 nYear = ImplGetYear(0); if (nDay == 0 || nDay > 32) { pCal->setValue( CalendarFieldIndex::YEAR, nYear); } @@ -1103,7 +1103,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = FALSE; + res = sal_False; break; } break; @@ -1118,12 +1118,12 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = FALSE; + res = sal_False; break; } break; default: - res = FALSE; + res = sal_False; break; } // switch (nMonthPos) break; @@ -1210,7 +1210,7 @@ input for the following reasons: } break; default: - res = FALSE; + res = sal_False; break; } } @@ -1249,12 +1249,12 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = FALSE; + res = sal_False; break; } break; default: // else, e.g. month at the end (94 10 Jan) - res = FALSE; + res = sal_False; break; } // switch (nMonthPos) break; @@ -1267,7 +1267,7 @@ input for the following reasons: nCounter = 3; if ( nTimePos > 1 ) { // find first time number index (should only be 3 or 2 anyway) - for ( USHORT j = 0; j < nAnzNums; j++ ) + for ( sal_uInt16 j = 0; j < nAnzNums; j++ ) { if ( nNums[j] == nTimePos - 2 ) { @@ -1299,7 +1299,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = FALSE; + res = sal_False; break; } } @@ -1314,7 +1314,7 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(1) ); break; default: - res = FALSE; + res = sal_False; break; } break; @@ -1332,13 +1332,13 @@ input for the following reasons: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; default: - res = FALSE; + res = sal_False; break; } break; default: // else, e.g. month at the end (94 10 Jan 8:23) nCounter = 2; - res = FALSE; + res = sal_False; break; } // switch (nMonthPos) break; @@ -1352,7 +1352,7 @@ input for the following reasons: nTryOrder = nFormatOrder; // break for } else - res = FALSE; + res = sal_False; if ( aOrgCalendar.Len() ) pCal->loadCalendar( aOrgCalendar, pLoc->getLocale() ); // restore calendar @@ -1450,10 +1450,10 @@ input for the following reasons: // ScanStartString // // ersten String analysieren -// Alles weg => TRUE -// sonst => FALSE +// Alles weg => sal_True +// sonst => sal_False -BOOL ImpSvNumberInputScan::ScanStartString( const String& rString, +sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString, const SvNumberformat* pFormat ) { xub_StrLen nPos = 0; @@ -1471,7 +1471,7 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString, { // Match against format in any case, so later on for a "x1-2-3" input // we may distinguish between a xy-m-d (or similar) date and a x0-0-0 // format. No sign detection here! - if ( ScanStringNumFor( rString, nPos, pFormat, 0, TRUE ) ) + if ( ScanStringNumFor( rString, nPos, pFormat, 0, sal_True ) ) nMatchedAllStrings |= nMatchedStartString; else nMatchedAllStrings = 0; @@ -1551,7 +1551,7 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString, return MatchedReturn(); } - return TRUE; + return sal_True; } @@ -1559,11 +1559,11 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString, // ScanMidString // // String in der Mitte analysieren -// Alles weg => TRUE -// sonst => FALSE +// Alles weg => sal_True +// sonst => sal_False -BOOL ImpSvNumberInputScan::ScanMidString( const String& rString, - USHORT nStringPos, const SvNumberformat* pFormat ) +sal_Bool ImpSvNumberInputScan::ScanMidString( const String& rString, + sal_uInt16 nStringPos, const SvNumberformat* pFormat ) { xub_StrLen nPos = 0; short eOldScannedType = eScannedType; @@ -1793,10 +1793,10 @@ BOOL ImpSvNumberInputScan::ScanMidString( const String& rString, if ( nMatchedAllStrings & ~nMatchedVirgin ) eScannedType = eOldScannedType; else - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } @@ -1804,10 +1804,10 @@ BOOL ImpSvNumberInputScan::ScanMidString( const String& rString, // ScanEndString // // Schlussteil analysieren -// Alles weg => TRUE -// sonst => FALSE +// Alles weg => sal_True +// sonst => sal_False -BOOL ImpSvNumberInputScan::ScanEndString( const String& rString, +sal_Bool ImpSvNumberInputScan::ScanEndString( const String& rString, const SvNumberformat* pFormat ) { xub_StrLen nPos = 0; @@ -2038,30 +2038,30 @@ BOOL ImpSvNumberInputScan::ScanEndString( const String& rString, { // does input EndString equal EndString in Format? if ( !ScanStringNumFor( rString, nPos, pFormat, 0xFFFF ) ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } -BOOL ImpSvNumberInputScan::ScanStringNumFor( +sal_Bool ImpSvNumberInputScan::ScanStringNumFor( const String& rString, // String to scan xub_StrLen nPos, // Position until which was consumed const SvNumberformat* pFormat, // The format to match - USHORT nString, // Substring of format, 0xFFFF => last - BOOL bDontDetectNegation // Suppress sign detection + sal_uInt16 nString, // Substring of format, 0xFFFF => last + sal_Bool bDontDetectNegation // Suppress sign detection ) { if ( !pFormat ) - return FALSE; + return sal_False; const ::utl::TransliterationWrapper* pTransliteration = pFormatter->GetTransliteration(); const String* pStr; String aString( rString ); - BOOL bFound = FALSE; - BOOL bFirst = TRUE; - BOOL bContinue = TRUE; - USHORT nSub; + sal_Bool bFound = sal_False; + sal_Bool bFirst = sal_True; + sal_Bool bContinue = sal_True; + sal_uInt16 nSub; do { // Don't try "lower" subformats ff the very first match was the second @@ -2070,22 +2070,22 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor( do { // Step through subformats, first positive, then negative, then // other, but not the last (text) subformat. - pStr = pFormat->GetNumForString( nSub, nString, TRUE ); + pStr = pFormat->GetNumForString( nSub, nString, sal_True ); if ( pStr && pTransliteration->isEqual( aString, *pStr ) ) { - bFound = TRUE; - bContinue = FALSE; + bFound = sal_True; + bContinue = sal_False; } else if ( nSub < 2 ) ++nSub; else - bContinue = FALSE; + bContinue = sal_False; } while ( bContinue ); if ( !bFound && bFirst && nPos ) { // try remaining substring - bFirst = FALSE; + bFirst = sal_False; aString.Erase( 0, nPos ); - bContinue = TRUE; + bContinue = sal_True; } } while ( bContinue ); @@ -2097,13 +2097,13 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor( aString.EraseAllChars( ' ' ); if ( (aString.Len() == 1) && (aString.GetChar(0) == '-') ) { - bFound = TRUE; + bFound = sal_True; nStringScanSign = -1; nSub = 0; //! not 1 } } if ( !bFound ) - return FALSE; + return sal_False; } else if ( !bDontDetectNegation && (nSub == 1) && pFormat->IsNegativeRealNegative() ) @@ -2131,7 +2131,7 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor( nStringScanSign = -1; } nStringScanNumFor = nSub; - return TRUE; + return sal_True; } @@ -2139,9 +2139,9 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor( // IsNumberFormatMain // // Recognizes types of number, exponential, fraction, percent, currency, date, time. -// Else text => return FALSE +// Else text => return sal_False -BOOL ImpSvNumberInputScan::IsNumberFormatMain( +sal_Bool ImpSvNumberInputScan::IsNumberFormatMain( const String& rString, // string to be analyzed double& , // OUT: result as number, if possible const SvNumberformat* pFormat ) // maybe number format set to match against @@ -2149,7 +2149,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( Reset(); NumberStringDivision( rString ); // breakdown into strings and numbers if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS) // too many elements - return FALSE; // Njet, Nope, ... + return sal_False; // Njet, Nope, ... if (nAnzNums == 0) // no number in input { @@ -2165,17 +2165,17 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_LOGICAL; // !!! it's a BOOLEAN nMatchedAllStrings &= ~nMatchedVirgin; - return TRUE; + return sal_True; } else - return FALSE; // simple text + return sal_False; // simple text } else - return FALSE; // simple text + return sal_False; // simple text } - USHORT i = 0; // mark any symbol - USHORT j = 0; // mark only numbers + sal_uInt16 i = 0; // mark any symbol + sal_uInt16 j = 0; // mark only numbers switch ( nAnzNums ) { @@ -2190,14 +2190,14 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return TRUE; + return sal_True; } } } else { // Analyze start string if (!ScanStartString( sStrArray[i], pFormat )) // i=0 - return FALSE; // already an error + return sal_False; // already an error i++; // next symbol, i=1 } GetNextNumber(i,j); // i=1,2 @@ -2212,11 +2212,11 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return TRUE; + return sal_True; } } if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) - return FALSE; + return sal_False; } break; case 2 : // Exactly 2 numbers in input @@ -2224,16 +2224,16 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( if (!GetNextNumber(i,j)) // i=1,0 { // Analyze start string if (!ScanStartString( sStrArray[i], pFormat )) - return FALSE; // already an error + return sal_False; // already an error i++; // i=1 } GetNextNumber(i,j); // i=1,2 if ( !ScanMidString( sStrArray[i], i, pFormat ) ) - return FALSE; + return sal_False; i++; // next symbol, i=2,3 GetNextNumber(i,j); // i=3,4 if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) - return FALSE; + return sal_False; if (eSetType == NUMBERFORMAT_FRACTION) // -1,200. as fraction { if (!nNegCheck && // no sign '(' @@ -2243,7 +2243,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return TRUE; + return sal_True; } } } @@ -2253,24 +2253,24 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( if (!GetNextNumber(i,j)) // i=1,0 { // Analyze start string if (!ScanStartString( sStrArray[i], pFormat )) - return FALSE; // already an error + return sal_False; // already an error i++; // i=1 if (nDecPos == 1) // decimal separator at start => error - return FALSE; + return sal_False; } GetNextNumber(i,j); // i=1,2 if ( !ScanMidString( sStrArray[i], i, pFormat ) ) - return FALSE; + return sal_False; i++; // i=2,3 if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at end - return FALSE; + return sal_False; GetNextNumber(i,j); // i=3,4 if ( !ScanMidString( sStrArray[i], i, pFormat ) ) - return FALSE; + return sal_False; i++; // i=4,5 GetNextNumber(i,j); // i=5,6 if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) - return FALSE; + return sal_False; if (eSetType == NUMBERFORMAT_FRACTION) // -1,200,100. as fraction { if (!nNegCheck && // no sign '(' @@ -2280,11 +2280,11 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return TRUE; + return sal_True; } } if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos ) - return FALSE; // #36857# not a real fraction + return sal_False; // #36857# not a real fraction } break; default: // More than 3 numbers in input @@ -2292,45 +2292,45 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( if (!GetNextNumber(i,j)) // i=1,0 { // Analyze startstring if (!ScanStartString( sStrArray[i], pFormat )) - return FALSE; // already an error + return sal_False; // already an error i++; // i=1 if (nDecPos == 1) // decimal separator at start => error - return FALSE; + return sal_False; } GetNextNumber(i,j); // i=1,2 if ( !ScanMidString( sStrArray[i], i, pFormat ) ) - return FALSE; + return sal_False; i++; // i=2,3 - USHORT nThOld = 10; // just not 0 or 1 + sal_uInt16 nThOld = 10; // just not 0 or 1 while (nThOld != nThousand && j < nAnzNums-1) // Execute at least one time // but leave one number. { // Loop over group separators nThOld = nThousand; if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at end - return FALSE; + return sal_False; GetNextNumber(i,j); if ( i < nAnzStrings && !ScanMidString( sStrArray[i], i, pFormat ) ) - return FALSE; + return sal_False; i++; } if (eScannedType == NUMBERFORMAT_DATE || // long date or eScannedType == NUMBERFORMAT_TIME || // long time or eScannedType == NUMBERFORMAT_UNDEFINED) // long number { - for (USHORT k = j; k < nAnzNums-1; k++) + for (sal_uInt16 k = j; k < nAnzNums-1; k++) { if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at endd - return FALSE; + return sal_False; GetNextNumber(i,j); if ( i < nAnzStrings && !ScanMidString( sStrArray[i], i, pFormat ) ) - return FALSE; + return sal_False; i++; } } GetNextNumber(i,j); if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat )) - return FALSE; + return sal_False; if (eSetType == NUMBERFORMAT_FRACTION) // -1,200,100. as fraction { if (!nNegCheck && // no sign '(' @@ -2340,11 +2340,11 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( { eScannedType = NUMBERFORMAT_FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; - return TRUE; + return sal_True; } } if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos ) - return FALSE; // #36857# not a real fraction + return sal_False; // #36857# not a real fraction } } @@ -2352,18 +2352,18 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( { nMatchedAllStrings &= ~nMatchedVirgin; // did match including nMatchedUsedAsReturn - BOOL bDidMatch = (nMatchedAllStrings != 0); + sal_Bool bDidMatch = (nMatchedAllStrings != 0); if ( nMatchedAllStrings ) { - BOOL bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual( - nStringScanNumFor, nAnzStrings, nAnzNums ) : FALSE); + sal_Bool bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual( + nStringScanNumFor, nAnzStrings, nAnzNums ) : sal_False); if ( !bMatch ) nMatchedAllStrings = 0; } if ( nMatchedAllStrings ) eScannedType = eSetType; else if ( bDidMatch ) - return FALSE; + return sal_False; else eScannedType = NUMBERFORMAT_NUMBER; // everything else should have been recognized by now @@ -2371,36 +2371,36 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain( else if ( eScannedType == NUMBERFORMAT_DATE ) { // the very relaxed date input checks may interfere with a preset format nMatchedAllStrings &= ~nMatchedVirgin; - BOOL bWasReturn = ((nMatchedAllStrings & nMatchedUsedAsReturn) != 0); + sal_Bool bWasReturn = ((nMatchedAllStrings & nMatchedUsedAsReturn) != 0); if ( nMatchedAllStrings ) { - BOOL bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual( - nStringScanNumFor, nAnzStrings, nAnzNums ) : FALSE); + sal_Bool bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual( + nStringScanNumFor, nAnzStrings, nAnzNums ) : sal_False); if ( !bMatch ) nMatchedAllStrings = 0; } if ( nMatchedAllStrings ) eScannedType = eSetType; else if ( bWasReturn ) - return FALSE; + return sal_False; } else nMatchedAllStrings = 0; // reset flag to no substrings matched - return TRUE; + return sal_True; } //--------------------------------------------------------------------------- -// return TRUE or FALSE depending on the nMatched... state and remember usage -BOOL ImpSvNumberInputScan::MatchedReturn() +// return sal_True or sal_False depending on the nMatched... state and remember usage +sal_Bool ImpSvNumberInputScan::MatchedReturn() { if ( nMatchedAllStrings & ~nMatchedVirgin ) { nMatchedAllStrings |= nMatchedUsedAsReturn; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -2435,7 +2435,7 @@ void ImpSvNumberInputScan::InitText() pUpperDayText[j] = pChrCls->upper( xElems[j].FullName ); pUpperAbbrevDayText[j] = pChrCls->upper( xElems[j].AbbrevName ); } - bTextInitialized = TRUE; + bTextInitialized = sal_True; } @@ -2454,7 +2454,7 @@ void ImpSvNumberInputScan::ChangeIntl() cDecSep == '/' || cDecSep == '.' || cDecSep == pFormatter->GetDateSep().GetChar(0) ); - bTextInitialized = FALSE; + bTextInitialized = sal_False; aUpperCurrSymbol.Erase(); } @@ -2463,9 +2463,9 @@ void ImpSvNumberInputScan::ChangeIntl() // ChangeNullDate void ImpSvNumberInputScan::ChangeNullDate( - const USHORT Day, - const USHORT Month, - const USHORT Year ) + const sal_uInt16 Day, + const sal_uInt16 Month, + const sal_uInt16 Year ) { if ( pNullDate ) *pNullDate = Date(Day, Month, Year); @@ -2479,7 +2479,7 @@ void ImpSvNumberInputScan::ChangeNullDate( // // => does rString represent a number (also date, time et al) -BOOL ImpSvNumberInputScan::IsNumberFormat( +sal_Bool ImpSvNumberInputScan::IsNumberFormat( const String& rString, // string to be analyzed short& F_Type, // IN: old type, OUT: new type double& fOutNumber, // OUT: number if convertable @@ -2487,13 +2487,13 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( { String sResString; String aString; - BOOL res; // return value + sal_Bool res; // return value eSetType = F_Type; // old type set if ( !rString.Len() ) - res = FALSE; + res = sal_False; else if (rString.Len() > 308) // arbitrary - res = FALSE; + res = sal_False; else { // NoMoreUpperNeeded, all comparisons on UpperCase @@ -2509,7 +2509,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( || (nSign && (eScannedType == NUMBERFORMAT_DATE || eScannedType == NUMBERFORMAT_DATETIME)) ) // signed date/datetime - res = FALSE; + res = sal_False; else { // check count of partial number strings switch (eScannedType) @@ -2523,7 +2523,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if ( nMatchedAllStrings ) nThousand = nAnzNums - 1; else if ( nAnzNums != 1 ) - res = FALSE; + res = sal_False; } else if (nDecPos == 2) // 1.05 { @@ -2531,7 +2531,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if ( nMatchedAllStrings ) nThousand = nAnzNums - 1; else if ( nAnzNums != nThousand+2 ) - res = FALSE; + res = sal_False; } else // 1,100 or 1,100. { @@ -2539,7 +2539,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if ( nMatchedAllStrings ) nThousand = nAnzNums - 1; else if ( nAnzNums != nThousand+1 ) - res = FALSE; + res = sal_False; } break; @@ -2547,17 +2547,17 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if (nDecPos == 1) // .05 { if (nAnzNums != 2) - res = FALSE; + res = sal_False; } else if (nDecPos == 2) // 1.05 { if (nAnzNums != nThousand+3) - res = FALSE; + res = sal_False; } else // 1,100 or 1,100. { if (nAnzNums != nThousand+2) - res = FALSE; + res = sal_False; } break; @@ -2565,12 +2565,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if (nMonth) { // month name and numbers if (nAnzNums > 2) - res = FALSE; + res = sal_False; } else { if (nAnzNums > 3) - res = FALSE; + res = sal_False; } break; @@ -2578,12 +2578,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if (nDecPos) { // hundredth seconds included if (nAnzNums > 4) - res = FALSE; + res = sal_False; } else { if (nAnzNums > 3) - res = FALSE; + res = sal_False; } break; @@ -2593,12 +2593,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if (nDecPos) { // hundredth seconds included if (nAnzNums > 6) - res = FALSE; + res = sal_False; } else { if (nAnzNums > 5) - res = FALSE; + res = sal_False; } } else @@ -2606,12 +2606,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if (nDecPos) { // hundredth seconds included if (nAnzNums > 7) - res = FALSE; + res = sal_False; } else { if (nAnzNums > 6) - res = FALSE; + res = sal_False; } } break; @@ -2632,7 +2632,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( else if (nLogical == -1) fOutNumber = 0.0; // False else - res = FALSE; // Oops + res = sal_False; // Oops break; case NUMBERFORMAT_PERCENT: @@ -2645,13 +2645,13 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( sResString.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "0." ) ); else sResString.Erase(); - USHORT k; + sal_uInt16 k; for ( k = 0; k <= nThousand; k++) sResString += sStrArray[nNums[k]]; // integer part if ( nDecPos == 2 && k < nAnzNums ) // . somewhere { sResString += '.'; - USHORT nStop = (eScannedType == NUMBERFORMAT_SCIENTIFIC ? + sal_uInt16 nStop = (eScannedType == NUMBERFORMAT_SCIENTIFIC ? nAnzNums-1 : nAnzNums); for ( ; k < nStop; k++) sResString += sStrArray[nNums[k]]; // fractional part @@ -2675,7 +2675,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( fOutNumber = 0.0; else fOutNumber = DBL_MAX; -/*!*/ return TRUE; +/*!*/ return sal_True; } } @@ -2712,12 +2712,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if (fNenner != 0.0) fOutNumber = fZaehler/fNenner; else - res = FALSE; + res = sal_False; } } else // nAnzNums > 2 { - USHORT k = 1; + sal_uInt16 k = 1; sResString = sStrArray[nNums[0]]; if (nThousand > 0) for (k = 1; k <= nThousand; k++) @@ -2731,7 +2731,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( if (fNenner != 0.0) fOutNumber += fZaehler/fNenner; else - res = FALSE; + res = sal_False; } } @@ -2754,14 +2754,14 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( case NUMBERFORMAT_DATE: { - USHORT nCounter = 0; // dummy here + sal_uInt16 nCounter = 0; // dummy here res = GetDateRef( fOutNumber, nCounter, pFormat ); } break; case NUMBERFORMAT_DATETIME: { - USHORT nCounter = 0; // needed here + sal_uInt16 nCounter = 0; // needed here res = GetDateRef( fOutNumber, nCounter, pFormat ); if ( res ) { @@ -2785,17 +2785,17 @@ BOOL ImpSvNumberInputScan::IsNumberFormat( { F_Type = NUMBERFORMAT_TEXT; fOutNumber = -DBL_MAX; - return TRUE; + return sal_True; } else if (fOutNumber > DBL_MAX) // 1.7E308 { F_Type = NUMBERFORMAT_TEXT; fOutNumber = DBL_MAX; - return TRUE; + return sal_True; } } - if (res == FALSE) + if (res == sal_False) { eScannedType = NUMBERFORMAT_TEXT; fOutNumber = 0.0; diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index ced58e84c2f6..4af1ca91ae8a 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -47,12 +47,12 @@ public: /// set reference date for offset calculation void ChangeNullDate( - const USHORT nDay, - const USHORT nMonth, - const USHORT nYear ); + const sal_uInt16 nDay, + const sal_uInt16 nMonth, + const sal_uInt16 nYear ); /// convert input string to number - BOOL IsNumberFormat( + sal_Bool IsNumberFormat( const String& rString, /// input string short& F_Type, /// format type (in + out) double& fOutNumber, /// value determined (out) @@ -62,12 +62,12 @@ public: /// after IsNumberFormat: get decimal position short GetDecPos() const { return nDecPos; } /// after IsNumberFormat: get count of numeric substrings in input string - USHORT GetAnzNums() const { return nAnzNums; } + sal_uInt16 GetAnzNums() const { return nAnzNums; } /// set threshold of two-digit year input - void SetYear2000( USHORT nVal ) { nYear2000 = nVal; } + void SetYear2000( sal_uInt16 nVal ) { nYear2000 = nVal; } /// get threshold of two-digit year input - USHORT GetYear2000() const { return nYear2000; } + sal_uInt16 GetYear2000() const { return nYear2000; } private: SvNumberFormatter* pFormatter; @@ -76,50 +76,50 @@ private: String* pUpperDayText; // Array of day of week names, uppercase String* pUpperAbbrevDayText; // Array of day of week names, abbreviated, uppercase String aUpperCurrSymbol; // Currency symbol, uppercase - BOOL bTextInitialized; // Whether days and months are initialized + sal_Bool bTextInitialized; // Whether days and months are initialized Date* pNullDate; // 30Dec1899 // Variables for provisional results: String sStrArray[SV_MAX_ANZ_INPUT_STRINGS]; // Array of scanned substrings - BOOL IsNum[SV_MAX_ANZ_INPUT_STRINGS]; // Whether a substring is numeric - USHORT nNums[SV_MAX_ANZ_INPUT_STRINGS]; // Sequence of offsets to numeric strings - USHORT nAnzStrings; // Total count of scanned substrings - USHORT nAnzNums; // Count of numeric substrings - BOOL bDecSepInDateSeps; // True <=> DecSep in {.,-,/,DateSep} - BYTE nMatchedAllStrings; // Scan...String() matched all substrings, + sal_Bool IsNum[SV_MAX_ANZ_INPUT_STRINGS]; // Whether a substring is numeric + sal_uInt16 nNums[SV_MAX_ANZ_INPUT_STRINGS]; // Sequence of offsets to numeric strings + sal_uInt16 nAnzStrings; // Total count of scanned substrings + sal_uInt16 nAnzNums; // Count of numeric substrings + sal_Bool bDecSepInDateSeps; // True <=> DecSep in {.,-,/,DateSep} + sal_uInt8 nMatchedAllStrings; // Scan...String() matched all substrings, // bit mask of nMatched... constants - static const BYTE nMatchedEndString; // 0x01 - static const BYTE nMatchedMidString; // 0x02 - static const BYTE nMatchedStartString; // 0x04 - static const BYTE nMatchedVirgin; // 0x08 - static const BYTE nMatchedUsedAsReturn; // 0x10 + static const sal_uInt8 nMatchedEndString; // 0x01 + static const sal_uInt8 nMatchedMidString; // 0x02 + static const sal_uInt8 nMatchedStartString; // 0x04 + static const sal_uInt8 nMatchedVirgin; // 0x08 + static const sal_uInt8 nMatchedUsedAsReturn; // 0x10 int nSign; // Sign of number short nMonth; // Month (1..x) if date // negative => short format short nMonthPos; // 1 = front, 2 = middle // 3 = end - USHORT nTimePos; // Index of first time separator (+1) + sal_uInt16 nTimePos; // Index of first time separator (+1) short nDecPos; // Index of substring containing "," (+1) short nNegCheck; // '( )' for negative short nESign; // Sign of exponent short nAmPm; // +1 AM, -1 PM, 0 if none short nLogical; // -1 => False, 1 => True - USHORT nThousand; // Count of group (AKA thousand) separators - USHORT nPosThousandString; // Position of concatenaded 000,000,000 string + sal_uInt16 nThousand; // Count of group (AKA thousand) separators + sal_uInt16 nPosThousandString; // Position of concatenaded 000,000,000 string short eScannedType; // Scanned type short eSetType; // Preset Type - USHORT nStringScanNumFor; // Fixed strings recognized in + sal_uInt16 nStringScanNumFor; // Fixed strings recognized in // pFormat->NumFor[nNumForStringScan] short nStringScanSign; // Sign resulting of FixString - USHORT nYear2000; // Two-digit threshold + sal_uInt16 nYear2000; // Two-digit threshold // Year as 20xx // default 18 // number <= nYear2000 => 20xx // number > nYear2000 => 19xx - USHORT nTimezonePos; // Index of timezone separator (+1) - BYTE nMayBeIso8601; // 0:=dontknowyet, 1:=yes, 2:=no + sal_uInt16 nTimezonePos; // Index of timezone separator (+1) + sal_uInt8 nMayBeIso8601; // 0:=dontknowyet, 1:=yes, 2:=no #ifdef _ZFORFIND_CXX // methods private to implementation void Reset(); // Reset all variables before start of analysis @@ -129,17 +129,17 @@ private: // Convert string to double. // Only simple unsigned floating point values without any error detection, // decimal separator has to be '.' - // If bForceFraction==TRUE the string is taken to be the fractional part + // If bForceFraction==sal_True the string is taken to be the fractional part // of 0.1234 without the leading 0. (thus being just "1234"). double StringToDouble( const String& rStr, - BOOL bForceFraction = FALSE ); + sal_Bool bForceFraction = sal_False ); - BOOL NextNumberStringSymbol( // Next number/string symbol + sal_Bool NextNumberStringSymbol( // Next number/string symbol const sal_Unicode*& pStr, String& rSymbol ); - BOOL SkipThousands( // Concatenate ,000,23 blocks + sal_Bool SkipThousands( // Concatenate ,000,23 blocks const sal_Unicode*& pStr, // in input to 000123 String& rSymbol ); @@ -151,50 +151,50 @@ private: // optimized substring versions - static inline BOOL StringContains( // Whether rString contains rWhat at nPos + static inline sal_Bool StringContains( // Whether rString contains rWhat at nPos const String& rWhat, const String& rString, xub_StrLen nPos ) { // mostly used with one character if ( rWhat.GetChar(0) != rString.GetChar(nPos) ) - return FALSE; + return sal_False; return StringContainsImpl( rWhat, rString, nPos ); } - static inline BOOL StringPtrContains( // Whether pString contains rWhat at nPos + static inline sal_Bool StringPtrContains( // Whether pString contains rWhat at nPos const String& rWhat, const sal_Unicode* pString, xub_StrLen nPos ) // nPos MUST be a valid offset from pString { // mostly used with one character if ( rWhat.GetChar(0) != *(pString+nPos) ) - return FALSE; + return sal_False; return StringPtrContainsImpl( rWhat, pString, nPos ); } - static BOOL StringContainsImpl( //! DO NOT use directly + static sal_Bool StringContainsImpl( //! DO NOT use directly const String& rWhat, const String& rString, xub_StrLen nPos ); - static BOOL StringPtrContainsImpl( //! DO NOT use directly + static sal_Bool StringPtrContainsImpl( //! DO NOT use directly const String& rWhat, const sal_Unicode* pString, xub_StrLen nPos ); - static inline BOOL SkipChar( // Skip a special character + static inline sal_Bool SkipChar( // Skip a special character sal_Unicode c, const String& rString, xub_StrLen& nPos ); static inline void SkipBlanks( // Skip blank const String& rString, xub_StrLen& nPos ); - static inline BOOL SkipString( // Jump over rWhat in rString at nPos + static inline sal_Bool SkipString( // Jump over rWhat in rString at nPos const String& rWhat, const String& rString, xub_StrLen& nPos ); - inline BOOL GetThousandSep( // Recognizes exactly ,111 as group separator + inline sal_Bool GetThousandSep( // Recognizes exactly ,111 as group separator const String& rString, xub_StrLen& nPos, - USHORT nStringPos ); + sal_uInt16 nStringPos ); short GetLogical( // Get boolean value const String& rString ); short GetMonth( // Get month and advance string position @@ -203,17 +203,17 @@ private: int GetDayOfWeek( // Get day of week and advance string position const String& rString, xub_StrLen& nPos ); - BOOL GetCurrency( // Get currency symbol and advance string position + sal_Bool GetCurrency( // Get currency symbol and advance string position const String& rString, xub_StrLen& nPos, const SvNumberformat* pFormat = NULL ); // optional number format to match against - BOOL GetTimeAmPm( // Get symbol AM or PM and advance string position + sal_Bool GetTimeAmPm( // Get symbol AM or PM and advance string position const String& rString, xub_StrLen& nPos ); - inline BOOL GetDecSep( // Get decimal separator and advance string position + inline sal_Bool GetDecSep( // Get decimal separator and advance string position const String& rString, xub_StrLen& nPos ); - inline BOOL GetTime100SecSep( // Get hundredth seconds separator and advance string position + inline sal_Bool GetTime100SecSep( // Get hundredth seconds separator and advance string position const String& rString, xub_StrLen& nPos ); int GetSign( // Get sign and advance string position @@ -223,30 +223,30 @@ private: const String& rString, xub_StrLen& nPos ); - inline BOOL GetNextNumber( // Get next number as array offset - USHORT& i, - USHORT& j ); + inline sal_Bool GetNextNumber( // Get next number as array offset + sal_uInt16& i, + sal_uInt16& j ); void GetTimeRef( // Converts time -> double (only decimals) double& fOutNumber, // result as double - USHORT nIndex, // Index of hour in input - USHORT nAnz ); // Count of time substrings in input - USHORT ImplGetDay ( USHORT nIndex ); // Day input, 0 if no match - USHORT ImplGetMonth( USHORT nIndex ); // Month input, zero based return, NumberOfMonths if no match - USHORT ImplGetYear ( USHORT nIndex ); // Year input, 0 if no match - BOOL GetDateRef( // Conversion of date to number + sal_uInt16 nIndex, // Index of hour in input + sal_uInt16 nAnz ); // Count of time substrings in input + sal_uInt16 ImplGetDay ( sal_uInt16 nIndex ); // Day input, 0 if no match + sal_uInt16 ImplGetMonth( sal_uInt16 nIndex ); // Month input, zero based return, NumberOfMonths if no match + sal_uInt16 ImplGetYear ( sal_uInt16 nIndex ); // Year input, 0 if no match + sal_Bool GetDateRef( // Conversion of date to number double& fDays, // OUT: days diff to null date - USHORT& nCounter, // Count of date substrings + sal_uInt16& nCounter, // Count of date substrings const SvNumberformat* pFormat = NULL ); // optional number format to match against - BOOL ScanStartString( // Analyze start of string + sal_Bool ScanStartString( // Analyze start of string const String& rString, const SvNumberformat* pFormat = NULL ); - BOOL ScanMidString( // Analyze middle substring + sal_Bool ScanMidString( // Analyze middle substring const String& rString, - USHORT nStringPos, + sal_uInt16 nStringPos, const SvNumberformat* pFormat = NULL ); - BOOL ScanEndString( // Analyze end of string + sal_Bool ScanEndString( // Analyze end of string const String& rString, const SvNumberformat* pFormat = NULL ); @@ -256,27 +256,27 @@ private: // Compare rString to substring of array indexed by nString // nString == 0xFFFF => last substring - BOOL ScanStringNumFor( + sal_Bool ScanStringNumFor( const String& rString, xub_StrLen nPos, const SvNumberformat* pFormat, - USHORT nString, - BOOL bDontDetectNegation = FALSE ); + sal_uInt16 nString, + sal_Bool bDontDetectNegation = sal_False ); - // if nMatchedAllStrings set nMatchedUsedAsReturn and return TRUE, - // else do nothing and return FALSE - BOOL MatchedReturn(); + // if nMatchedAllStrings set nMatchedUsedAsReturn and return sal_True, + // else do nothing and return sal_False + sal_Bool MatchedReturn(); //! Be sure that the string to be analyzed is already converted to upper //! case and if it contained native humber digits that they are already //! converted to ASCII. - BOOL IsNumberFormatMain( // Main anlyzing function + sal_Bool IsNumberFormatMain( // Main anlyzing function const String& rString, double& fOutNumber, // return value if string is numeric const SvNumberformat* pFormat = NULL // optional number format to match against ); - static inline BOOL MyIsdigit( sal_Unicode c ); + static inline sal_Bool MyIsdigit( sal_Unicode c ); // native number transliteration if necessary void TransformInput( String& rString ); diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 64b3c55e2b62..ec6f2c399f5c 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -88,7 +88,7 @@ using ::rtl::OUString; * (old currency) is recognized as a date (#53155#). */ #define UNKNOWN_SUBSTITUTE LANGUAGE_ENGLISH_US -static BOOL bIndexTableInitialized = FALSE; +static sal_Bool bIndexTableInitialized = sal_False; static sal_uInt32 theIndexTable[NF_INDEX_TABLE_ENTRIES]; @@ -160,7 +160,7 @@ void SvNumberFormatterRegistry_Impl::ConfigurationChanged( utl::ConfigurationBro // ==================================================================== SvNumberFormatterRegistry_Impl* SvNumberFormatter::pFormatterRegistry = NULL; -BOOL SvNumberFormatter::bCurrencyTableInitialized = FALSE; +sal_Bool SvNumberFormatter::bCurrencyTableInitialized = sal_False; namespace { struct theCurrencyTable : @@ -169,7 +169,7 @@ namespace struct theLegacyOnlyCurrencyTable : public rtl::Static< NfCurrencyTable, theLegacyOnlyCurrencyTable > {}; } -USHORT SvNumberFormatter::nSystemCurrencyPosition = 0; +sal_uInt16 SvNumberFormatter::nSystemCurrencyPosition = 0; SV_IMPL_PTRARR( NfCurrencyTable, NfCurrencyEntry* ); SV_IMPL_PTRARR( NfWSStringsDtor, String* ); @@ -254,9 +254,9 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang ) pFormatScanner = new ImpSvNumberformatScan( this ); pFormatTable = NULL; MaxCLOffset = 0; - ImpGenerateFormats( 0, FALSE ); // 0 .. 999 for initialized language formats + ImpGenerateFormats( 0, sal_False ); // 0 .. 999 for initialized language formats pMergeTable = NULL; - bNoZero = FALSE; + bNoZero = sal_False; ::osl::MutexGuard aGuard( GetMutex() ); GetFormatterRegistry().Insert( this ); @@ -316,7 +316,7 @@ SvNumberFormatterRegistry_Impl& SvNumberFormatter::GetFormatterRegistry() } -Color* SvNumberFormatter::GetUserDefColor(USHORT nIndex) +Color* SvNumberFormatter::GetUserDefColor(sal_uInt16 nIndex) { if( aColorLink.IsSet() ) return (Color*) ( aColorLink.Call( (void*) &nIndex )); @@ -324,9 +324,9 @@ Color* SvNumberFormatter::GetUserDefColor(USHORT nIndex) return NULL; } -void SvNumberFormatter::ChangeNullDate(USHORT nDay, - USHORT nMonth, - USHORT nYear) +void SvNumberFormatter::ChangeNullDate(sal_uInt16 nDay, + sal_uInt16 nMonth, + sal_uInt16 nYear) { pFormatScanner->ChangeNullDate(nDay, nMonth, nYear); pStringScanner->ChangeNullDate(nDay, nMonth, nYear); @@ -347,7 +347,7 @@ sal_uInt16 SvNumberFormatter::GetStandardPrec() return pFormatScanner->GetStandardPrec(); } -void SvNumberFormatter::ImpChangeSysCL( LanguageType eLnge, BOOL bLoadingSO5 ) +void SvNumberFormatter::ImpChangeSysCL( LanguageType eLnge, sal_Bool bLoadingSO5 ) { if (eLnge == LANGUAGE_DONTKNOW) eLnge = UNKNOWN_SUBSTITUTE; @@ -408,12 +408,12 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) // reset ActLnge otherwise ChangeIntl() wouldn't switch if already LANGUAGE_SYSTEM ActLnge = LANGUAGE_DONTKNOW; ChangeIntl( LANGUAGE_SYSTEM ); - ImpGenerateFormats( nCLOffset, TRUE ); + ImpGenerateFormats( nCLOffset, sal_True ); // convert additional and user defined from old system to new system SvNumberformat* pStdFormat = (SvNumberformat*) aFTable.Get( nCLOffset + ZF_STANDARD ); sal_uInt32 nLastKey = nMaxBuiltin; - pFormatScanner->SetConvertMode( eOldLanguage, LANGUAGE_SYSTEM, TRUE ); + pFormatScanner->SetConvertMode( eOldLanguage, LANGUAGE_SYSTEM, sal_True ); aOldTable.First(); while ( aOldTable.Count() ) { @@ -451,34 +451,34 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) delete pOldEntry; } - pFormatScanner->SetConvertMode(FALSE); - pStdFormat->SetLastInsertKey( USHORT(nLastKey - nCLOffset) ); + pFormatScanner->SetConvertMode(sal_False); + pStdFormat->SetLastInsertKey( sal_uInt16(nLastKey - nCLOffset) ); // append new system additional formats NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() ); - ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, TRUE ); + ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, sal_True ); } -BOOL SvNumberFormatter::IsTextFormat(sal_uInt32 F_Index) const +sal_Bool SvNumberFormatter::IsTextFormat(sal_uInt32 F_Index) const { SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index); if (!pFormat) - return FALSE; + return sal_False; else return pFormat->IsTextFormat(); } -BOOL SvNumberFormatter::HasTextFormat(sal_uInt32 F_Index) const +sal_Bool SvNumberFormatter::HasTextFormat(sal_uInt32 F_Index) const { SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index); if (!pFormat) - return FALSE; + return sal_False; else return pFormat->HasTextFormat(); } -BOOL SvNumberFormatter::PutEntry(String& rString, +sal_Bool SvNumberFormatter::PutEntry(String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, // Formatnummer @@ -488,14 +488,14 @@ BOOL SvNumberFormatter::PutEntry(String& rString, if (rString.Len() == 0) // keinen Leerstring { nCheckPos = 1; // -> Fehler - return FALSE; + return sal_False; } if (eLnge == LANGUAGE_DONTKNOW) eLnge = IniLnge; ChangeIntl(eLnge); // ggfs. austauschen LanguageType eLge = eLnge; // Umgehung const fuer ConvertMode - BOOL bCheck = FALSE; + sal_Bool bCheck = sal_False; SvNumberformat* p_Entry = new SvNumberformat(rString, pFormatScanner, pStringScanner, @@ -533,9 +533,9 @@ BOOL SvNumberFormatter::PutEntry(String& rString, delete p_Entry; else { - bCheck = TRUE; + bCheck = sal_True; nKey = nPos+1; - pStdFormat->SetLastInsertKey((USHORT) (nKey-CLOffset)); + pStdFormat->SetLastInsertKey((sal_uInt16) (nKey-CLOffset)); } } } @@ -555,48 +555,48 @@ bool SvNumberFormatter::PutEntry( return bRet; } -BOOL SvNumberFormatter::PutandConvertEntry(String& rString, +bool SvNumberFormatter::PutandConvertEntry(String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge) { - BOOL bRes; + bool bRes; if (eNewLnge == LANGUAGE_DONTKNOW) eNewLnge = IniLnge; pFormatScanner->SetConvertMode(eLnge, eNewLnge); bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge); - pFormatScanner->SetConvertMode(FALSE); + pFormatScanner->SetConvertMode(false); return bRes; } -BOOL SvNumberFormatter::PutandConvertEntrySystem(String& rString, +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 @@ -651,7 +651,7 @@ sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( String & rString, if (rNewInserted) { DeleteEntry( nKey); // don't leave trails of rubbish - rNewInserted = FALSE; + rNewInserted = sal_False; } nKey = GetStandardFormat( NUMBERFORMAT_CURRENCY, eLnge); } @@ -671,7 +671,7 @@ void SvNumberFormatter::PrepareSave() SvNumberformat* pFormat = aFTable.First(); while (pFormat) { - pFormat->SetUsed(FALSE); + pFormat->SetUsed(sal_False); pFormat = aFTable.Next(); } } @@ -680,41 +680,41 @@ void SvNumberFormatter::SetFormatUsed(sal_uInt32 nFIndex) { SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nFIndex); if (pFormat) - pFormat->SetUsed(TRUE); + pFormat->SetUsed(sal_True); } -BOOL SvNumberFormatter::Load( SvStream& rStream ) +sal_Bool SvNumberFormatter::Load( SvStream& rStream ) { LanguageType eSysLang = SvtSysLocale().GetLanguage(); SvNumberFormatter* pConverter = NULL; ImpSvNumMultipleReadHeader aHdr( rStream ); - USHORT nVersion; + sal_uInt16 nVersion; rStream >> nVersion; SvNumberformat* pEntry; sal_uInt32 nPos; LanguageType eSaveSysLang, eLoadSysLang; - USHORT nSysOnStore, eLge, eDummy; // Dummy fuer kompatibles Format + sal_uInt16 nSysOnStore, eLge, eDummy; // Dummy fuer kompatibles Format rStream >> nSysOnStore >> eLge; // Systemeinstellung aus // Dokument eSaveSysLang = (nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE ? LANGUAGE_SYSTEM : (LanguageType) nSysOnStore); LanguageType eLnge = (LanguageType) eLge; - ImpChangeSysCL( eLnge, TRUE ); + ImpChangeSysCL( eLnge, sal_True ); rStream >> nPos; while (nPos != NUMBERFORMAT_ENTRY_NOT_FOUND) { rStream >> eDummy >> eLge; eLnge = (LanguageType) eLge; - ImpGenerateCL( eLnge, TRUE ); // ggfs. neue Standardformate anlegen + ImpGenerateCL( eLnge, sal_True ); // ggfs. neue Standardformate anlegen sal_uInt32 nOffset = nPos % SV_COUNTRY_LANGUAGE_OFFSET; // relativIndex - BOOL bUserDefined = (nOffset > SV_MAX_ANZ_STANDARD_FORMATE); + sal_Bool bUserDefined = (nOffset > SV_MAX_ANZ_STANDARD_FORMATE); //! HACK! ER 29.07.97 15:15 // SaveLang wurde bei SYSTEM nicht gespeichert sondern war auch SYSTEM, // erst ab 364i Unterscheidung moeglich - BOOL bConversionHack; + sal_Bool bConversionHack; if ( eLnge == LANGUAGE_SYSTEM ) { if ( nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE ) @@ -724,13 +724,13 @@ BOOL SvNumberFormatter::Load( SvStream& rStream ) } else { - bConversionHack = FALSE; + bConversionHack = sal_False; eLoadSysLang = eSysLang; } } else { - bConversionHack = FALSE; + bConversionHack = sal_False; eLoadSysLang = eSaveSysLang; } @@ -747,7 +747,7 @@ BOOL SvNumberFormatter::Load( SvStream& rStream ) { case NF_CONVERT_GERMAN_ENGLISH : pEntry->ConvertLanguage( *pConverter, - LANGUAGE_ENGLISH_US, eSysLang, TRUE ); + LANGUAGE_ENGLISH_US, eSysLang, sal_True ); break; case NF_CONVERT_ENGLISH_GERMAN : switch ( eSysLang ) @@ -761,7 +761,7 @@ BOOL SvNumberFormatter::Load( SvStream& rStream ) break; default: pEntry->ConvertLanguage( *pConverter, - LANGUAGE_GERMAN, eSysLang, TRUE ); + LANGUAGE_GERMAN, eSysLang, sal_True ); } break; case NF_CONVERT_NONE : @@ -791,33 +791,33 @@ BOOL SvNumberFormatter::Load( SvStream& rStream ) case LANGUAGE_GERMAN_LIECHTENSTEIN: // alles beim alten pEntry->ConvertLanguage( *pConverter, - eSaveSysLang, eLoadSysLang, TRUE ); + eSaveSysLang, eLoadSysLang, sal_True ); break; default: // alte english nach neuem anderen pEntry->ConvertLanguage( *pConverter, - LANGUAGE_ENGLISH_US, eLoadSysLang, TRUE ); + LANGUAGE_ENGLISH_US, eLoadSysLang, sal_True ); } } else pEntry->ConvertLanguage( *pConverter, - eSaveSysLang, eLoadSysLang, TRUE ); + eSaveSysLang, eLoadSysLang, sal_True ); } else { // nicht SYSTEM oder gleiches SYSTEM if ( nVersion < SV_NUMBERFORMATTER_VERSION_KEYWORDS ) { LanguageType eLoadLang; - BOOL bSystem; + sal_Bool bSystem; if ( eLnge == LANGUAGE_SYSTEM ) { eLoadLang = eSysLang; - bSystem = TRUE; + bSystem = sal_True; } else { eLoadLang = eLnge; - bSystem = FALSE; + bSystem = sal_False; } switch ( eLoadLang ) { @@ -854,9 +854,9 @@ BOOL SvNumberFormatter::Load( SvStream& rStream ) if ( nVersion >= SV_NUMBERFORMATTER_VERSION_YEAR2000 ) { aHdr.StartEntry(); - if ( aHdr.BytesLeft() >= sizeof(UINT16) ) + if ( aHdr.BytesLeft() >= sizeof(sal_uInt16) ) { - UINT16 nY2k; + sal_uInt16 nY2k; rStream >> nY2k; if ( nVersion < SV_NUMBERFORMATTER_VERSION_TWODIGITYEAR && nY2k < 100 ) nY2k += 1901; // war vor src513e: 29, jetzt: 1930 @@ -873,28 +873,28 @@ BOOL SvNumberFormatter::Load( SvStream& rStream ) NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() ); SvUShorts aList; GetUsedLanguages( aList ); - USHORT nCount = aList.Count(); - for ( USHORT j=0; j<nCount; j++ ) + sal_uInt16 nCount = aList.Count(); + for ( sal_uInt16 j=0; j<nCount; j++ ) { LanguageType eLang = aList[j]; ChangeIntl( eLang ); sal_uInt32 CLOffset = ImpGetCLOffset( eLang ); - ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, TRUE ); + ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, sal_True ); } ChangeIntl( eOldLanguage ); if (rStream.GetError()) - return FALSE; + return sal_False; else - return TRUE; + return sal_True; } -BOOL SvNumberFormatter::Save( SvStream& rStream ) const +sal_Bool SvNumberFormatter::Save( SvStream& rStream ) const { ImpSvNumMultipleWriteHeader aHdr( rStream ); // ab 364i wird gespeichert was SYSTEM wirklich war, vorher hart LANGUAGE_SYSTEM - rStream << (USHORT) SV_NUMBERFORMATTER_VERSION; - rStream << (USHORT) SvtSysLocale().GetLanguage() << (USHORT) IniLnge; + rStream << (sal_uInt16) SV_NUMBERFORMATTER_VERSION; + rStream << (sal_uInt16) SvtSysLocale().GetLanguage() << (sal_uInt16) IniLnge; SvNumberFormatTable* pTable = (SvNumberFormatTable*) &aFTable; SvNumberformat* pEntry = (SvNumberformat*) pTable->First(); while (pEntry) @@ -907,8 +907,8 @@ BOOL SvNumberFormatter::Save( SvStream& rStream ) const (pTable->GetCurKey() % SV_COUNTRY_LANGUAGE_OFFSET == 0) ) { rStream << static_cast<sal_uInt32>(pTable->GetCurKey()) - << (USHORT) LANGUAGE_SYSTEM - << (USHORT) pEntry->GetLanguage(); + << (sal_uInt16) LANGUAGE_SYSTEM + << (sal_uInt16) pEntry->GetLanguage(); pEntry->Save(rStream, aHdr); } pEntry = (SvNumberformat*) pTable->Next(); @@ -917,13 +917,13 @@ BOOL SvNumberFormatter::Save( SvStream& rStream ) const // ab SV_NUMBERFORMATTER_VERSION_YEAR2000 aHdr.StartEntry(); - rStream << (UINT16) GetYear2000(); + rStream << (sal_uInt16) GetYear2000(); aHdr.EndEntry(); if (rStream.GetError()) - return FALSE; + return sal_False; else - return TRUE; + return sal_True; } // static @@ -952,14 +952,14 @@ void SvNumberFormatter::FillKeywordTable( NfKeywordTable& rKeywords, { ChangeIntl( eLang ); const String* pTable = pFormatScanner->GetKeywords(); - for ( USHORT i = 0; i < NF_KEYWORD_ENTRIES_COUNT; ++i ) + for ( sal_uInt16 i = 0; i < NF_KEYWORD_ENTRIES_COUNT; ++i ) { rKeywords[i] = pTable[i]; } } -String SvNumberFormatter::GetKeyword( LanguageType eLnge, USHORT nIndex ) +String SvNumberFormatter::GetKeyword( LanguageType eLnge, sal_uInt16 nIndex ) { ChangeIntl(eLnge); const String* pTable = pFormatScanner->GetKeywords(); @@ -1077,7 +1077,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable( return GetEntryTable(eTypetmp, FIndex, rLnge); } -sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, BOOL bLoadingSO5 ) +sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, sal_Bool bLoadingSO5 ) { ChangeIntl(eLnge); sal_uInt32 CLOffset = ImpGetCLOffset(ActLnge); @@ -1199,7 +1199,7 @@ SvNumberFormatTable& SvNumberFormatter::GetEntryTable( return *pFormatTable; } -BOOL SvNumberFormatter::IsNumberFormat(const String& sString, +sal_Bool SvNumberFormatter::IsNumberFormat(const String& sString, sal_uInt32& F_Index, double& fOutNumber) { @@ -1218,12 +1218,12 @@ BOOL SvNumberFormatter::IsNumberFormat(const String& sString, FType = NUMBERFORMAT_DEFINED; ChangeIntl(pFormat->GetLanguage()); } - BOOL res; + sal_Bool res; short RType = FType; // Ergebnistyp // ohne def-Kennung if (RType == NUMBERFORMAT_TEXT) // Zahlzelle ->Stringz. - res = FALSE; + res = sal_False; else res = pStringScanner->IsNumberFormat(sString, RType, fOutNumber, pFormat); @@ -1253,13 +1253,13 @@ BOOL SvNumberFormatter::IsNumberFormat(const String& sString, return res; } -BOOL SvNumberFormatter::IsCompatible(short eOldType, +sal_Bool SvNumberFormatter::IsCompatible(short eOldType, short eNewType) { if (eOldType == eNewType) - return TRUE; + return sal_True; else if (eOldType == NUMBERFORMAT_DEFINED) - return TRUE; + return sal_True; else { switch (eNewType) @@ -1274,9 +1274,9 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType, case NUMBERFORMAT_FRACTION: // case NUMBERFORMAT_LOGICAL: case NUMBERFORMAT_DEFINED: - return TRUE; + return sal_True; default: - return FALSE; + return sal_False; } } break; @@ -1285,9 +1285,9 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType, switch (eOldType) { case NUMBERFORMAT_DATETIME: - return TRUE; + return sal_True; default: - return FALSE; + return sal_False; } } break; @@ -1296,9 +1296,9 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType, switch (eOldType) { case NUMBERFORMAT_DATETIME: - return TRUE; + return sal_True; default: - return FALSE; + return sal_False; } } break; @@ -1308,16 +1308,16 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType, { case NUMBERFORMAT_TIME: case NUMBERFORMAT_DATE: - return TRUE; + return sal_True; default: - return FALSE; + return sal_False; } } break; default: - return FALSE; + return sal_False; } - return FALSE; + return sal_False; } } @@ -1346,7 +1346,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType ) default: nSearch = CLOffset + ZF_STANDARD; } - sal_uInt32 nDefaultFormat = (sal_uInt32)(sal_uIntPtr) aDefaultFormatKeys.Get( nSearch ); + sal_uInt32 nDefaultFormat = (sal_uInt32)(sal_uLong) aDefaultFormatKeys.Get( nSearch ); if ( !nDefaultFormat ) nDefaultFormat = NUMBERFORMAT_ENTRY_NOT_FOUND; if ( nDefaultFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) @@ -1430,7 +1430,7 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( short eType, LanguageType eLnge } } -BOOL SvNumberFormatter::IsSpecialStandardFormat( sal_uInt32 nFIndex, +sal_Bool SvNumberFormatter::IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge ) { return @@ -1459,14 +1459,14 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( double fNumber, sal_uInt32 nFIn { case NUMBERFORMAT_TIME : { - BOOL bSign; + sal_Bool bSign; if ( fNumber < 0.0 ) { - bSign = TRUE; + bSign = sal_True; fNumber = -fNumber; } else - bSign = FALSE; + bSign = sal_False; double fSeconds = fNumber * 86400; if ( floor( fSeconds + 0.5 ) * 100 != floor( fSeconds * 100 + 0.5 ) ) { // mit 100stel Sekunden @@ -1578,14 +1578,14 @@ void SvNumberFormatter::GetOutputString(String& sString, } } -BOOL SvNumberFormatter::GetPreviewString(const String& sFormatString, +sal_Bool SvNumberFormatter::GetPreviewString(const String& sFormatString, double fPreviewNumber, String& sOutString, Color** ppColor, LanguageType eLnge) { if (sFormatString.Len() == 0) // keinen Leerstring - return FALSE; + return sal_False; xub_StrLen nCheckPos = STRING_NOTFOUND; sal_uInt32 nKey; @@ -1609,30 +1609,30 @@ BOOL SvNumberFormatter::GetPreviewString(const String& sFormatString, else p_Entry->GetOutputString(fPreviewNumber,sOutString, ppColor); delete p_Entry; - return TRUE; + return sal_True; } else { delete p_Entry; - return FALSE; + return sal_False; } } -BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, +sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber, String& sOutString, Color** ppColor, LanguageType eLnge ) { if (sFormatString.Len() == 0) // keinen Leerstring - return FALSE; + return sal_False; if (eLnge == LANGUAGE_DONTKNOW) eLnge = IniLnge; ChangeIntl( eLnge ); eLnge = ActLnge; - BOOL bEnglish = (eLnge == LANGUAGE_ENGLISH_US); + sal_Bool bEnglish = (eLnge == LANGUAGE_ENGLISH_US); String aFormatStringUpper( pCharClass->upper( sFormatString ) ); sal_uInt32 nCLOffset = ImpGenerateCL( eLnge ); @@ -1640,7 +1640,7 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, if ( nKey != NUMBERFORMAT_ENTRY_NOT_FOUND ) { // Zielformat vorhanden GetOutputString( fPreviewNumber, nKey, sOutString, ppColor ); - return TRUE; + return sal_True; } SvNumberformat *pEntry = NULL; @@ -1657,7 +1657,7 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, { nCLOffset = ImpGenerateCL( LANGUAGE_ENGLISH_US ); nKey = ImpIsEntry( aFormatStringUpper, nCLOffset, LANGUAGE_ENGLISH_US ); - BOOL bEnglishFormat = (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND); + sal_Bool bEnglishFormat = (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND); // try english --> other bzw. english nach other konvertieren LanguageType eFormatLang = LANGUAGE_ENGLISH_US; @@ -1665,7 +1665,7 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, sTmpString = sFormatString; pEntry = new SvNumberformat( sTmpString, pFormatScanner, pStringScanner, nCheckPos, eFormatLang ); - pFormatScanner->SetConvertMode( FALSE ); + pFormatScanner->SetConvertMode( sal_False ); ChangeIntl( eLnge ); if ( !bEnglishFormat ) @@ -1687,7 +1687,7 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, sTmpString = sFormatString; SvNumberformat* pEntry2 = new SvNumberformat( sTmpString, pFormatScanner, pStringScanner, nCheckPos2, eFormatLang ); - pFormatScanner->SetConvertMode( FALSE ); + pFormatScanner->SetConvertMode( sal_False ); ChangeIntl( eLnge ); if ( nCheckPos2 == 0 && !xTransliteration->isEqual( sFormatString, pEntry2->GetFormatstring() ) ) @@ -1707,20 +1707,20 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, ImpGenerateCL( eLnge ); // ggfs. neu Standardformate anlegen pEntry->GetOutputString( fPreviewNumber, sOutString, ppColor ); delete pEntry; - return TRUE; + return sal_True; } delete pEntry; - return FALSE; + return sal_False; } -BOOL SvNumberFormatter::GetPreviewString( const String& sFormatString, +sal_Bool SvNumberFormatter::GetPreviewString( const String& sFormatString, const String& sPreviewString, String& sOutString, Color** ppColor, LanguageType eLnge ) { if (sFormatString.Len() == 0) // no empty string - return FALSE; + return sal_False; xub_StrLen nCheckPos = STRING_NOTFOUND; sal_uInt32 nKey; @@ -1756,12 +1756,12 @@ BOOL SvNumberFormatter::GetPreviewString( const String& sFormatString, } } delete p_Entry; - return TRUE; + return sal_True; } else { delete p_Entry; - return FALSE; + return sal_False; } } @@ -1798,7 +1798,7 @@ sal_uInt32 SvNumberFormatter::TestNewString(const String& sFormatString, SvNumberformat* SvNumberFormatter::ImpInsertFormat( const ::com::sun::star::i18n::NumberFormatCode& rCode, - sal_uInt32 nPos, BOOL bAfterLoadingSO5, sal_Int16 nOrgIndex ) + sal_uInt32 nPos, sal_Bool bAfterLoadingSO5, sal_Int16 nOrgIndex ) { String aCodeStr( rCode.Code ); if ( rCode.Index < NF_INDEX_TABLE_ENTRIES && @@ -1806,7 +1806,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( rCode.Index != NF_CURRENCY_1000DEC2_CCC ) { // strip surrounding [$...] on automatic currency if ( aCodeStr.SearchAscii( "[$" ) != STRING_NOTFOUND ) - aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr, FALSE ); + aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr, sal_False ); else { if (LocaleDataWrapper::areChecksEnabled() && @@ -1919,7 +1919,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( SvNumberformat* SvNumberFormatter::ImpInsertNewStandardFormat( const ::com::sun::star::i18n::NumberFormatCode& rCode, - sal_uInt32 nPos, USHORT nVersion, BOOL bAfterLoadingSO5, + sal_uInt32 nPos, sal_uInt16 nVersion, sal_Bool bAfterLoadingSO5, sal_Int16 nOrgIndex ) { SvNumberformat* pNewFormat = ImpInsertFormat( rCode, nPos, @@ -1931,10 +1931,10 @@ SvNumberformat* SvNumberFormatter::ImpInsertNewStandardFormat( } void SvNumberFormatter::GetFormatSpecialInfo(sal_uInt32 nFormat, - BOOL& bThousand, - BOOL& IsRed, - USHORT& nPrecision, - USHORT& nAnzLeading) + sal_Bool& bThousand, + sal_Bool& IsRed, + sal_uInt16& nPrecision, + sal_uInt16& nAnzLeading) { const SvNumberformat* pFormat = aFTable.Get(nFormat); @@ -1943,14 +1943,14 @@ void SvNumberFormatter::GetFormatSpecialInfo(sal_uInt32 nFormat, nPrecision, nAnzLeading); else { - bThousand = FALSE; - IsRed = FALSE; + bThousand = sal_False; + IsRed = sal_False; nPrecision = pFormatScanner->GetStandardPrec(); nAnzLeading = 0; } } -USHORT SvNumberFormatter::GetFormatPrecision( sal_uInt32 nFormat ) const +sal_uInt16 SvNumberFormatter::GetFormatPrecision( sal_uInt32 nFormat ) const { const SvNumberformat* pFormat = aFTable.Get( nFormat ); if ( pFormat ) @@ -1983,8 +1983,8 @@ String SvNumberFormatter::GetFormatDecimalSep( sal_uInt32 nFormat ) const sal_uInt32 SvNumberFormatter::GetFormatSpecialInfo( const String& rFormatString, - BOOL& bThousand, BOOL& IsRed, USHORT& nPrecision, - USHORT& nAnzLeading, LanguageType eLnge ) + sal_Bool& bThousand, sal_Bool& IsRed, sal_uInt16& nPrecision, + sal_uInt16& nAnzLeading, LanguageType eLnge ) { xub_StrLen nCheckPos = 0; @@ -1999,8 +1999,8 @@ sal_uInt32 SvNumberFormatter::GetFormatSpecialInfo( const String& rFormatString, pFormat->GetFormatSpecialInfo( bThousand, IsRed, nPrecision, nAnzLeading ); else { - bThousand = FALSE; - IsRed = FALSE; + bThousand = sal_False; + IsRed = sal_False; nPrecision = pFormatScanner->GetStandardPrec(); nAnzLeading = 0; } @@ -2084,7 +2084,7 @@ sal_Int32 SvNumberFormatter::ImpGetFormatCodeIndex( sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault( ::com::sun::star::i18n::NumberFormatCode * pFormatArr, - sal_Int32 nCnt, BOOL bCheckCorrectness ) + sal_Int32 nCnt, sal_Bool bCheckCorrectness ) { using namespace ::com::sun::star; @@ -2190,20 +2190,20 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault( } -void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO5 ) +void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadingSO5 ) { using namespace ::com::sun::star; if ( !bIndexTableInitialized ) { - for ( USHORT j=0; j<NF_INDEX_TABLE_ENTRIES; j++ ) + for ( sal_uInt16 j=0; j<NF_INDEX_TABLE_ENTRIES; j++ ) { theIndexTable[j] = NUMBERFORMAT_ENTRY_NOT_FOUND; } } - BOOL bOldConvertMode = pFormatScanner->GetConvertMode(); + sal_Bool bOldConvertMode = pFormatScanner->GetConvertMode(); if (bOldConvertMode) - pFormatScanner->SetConvertMode(FALSE); // switch off for this function + pFormatScanner->SetConvertMode(sal_False); // switch off for this function NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() ); @@ -2217,7 +2217,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO // of a category (TLOT:=The Legacy Of Templin), altogether about 20 formats. // Has to be incremented on each ImpInsertNewStandardformat, new formats // must be appended, not inserted! - USHORT nNewExtended = ZF_STANDARD_NEWEXTENDED; + sal_uInt16 nNewExtended = ZF_STANDARD_NEWEXTENDED; // Number uno::Sequence< i18n::NumberFormatCode > aFormatSeq @@ -2378,7 +2378,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 @@ -2431,7 +2431,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 ); @@ -2630,22 +2630,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; @@ -2700,7 +2700,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++ ) @@ -2718,7 +2718,7 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset, } } - pStdFormat->SetLastInsertKey( (USHORT)(nPos - CLOffset) ); + pStdFormat->SetLastInsertKey( (sal_uInt16)(nPos - CLOffset) ); } @@ -2737,15 +2737,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(); @@ -2801,15 +2801,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, @@ -2819,12 +2819,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, @@ -2882,7 +2882,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) @@ -2892,11 +2892,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, @@ -3004,7 +3004,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 { @@ -3068,7 +3068,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; @@ -3077,19 +3077,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, @@ -3099,9 +3099,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(); } @@ -3136,9 +3136,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; @@ -3154,9 +3154,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 ) @@ -3173,9 +3173,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 ) @@ -3204,11 +3204,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 ) { @@ -3219,7 +3219,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 ) { @@ -3245,8 +3245,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 @@ -3264,7 +3264,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat() { sal_uInt32 CLOffset = ImpGetCLOffset( ActLnge ); sal_uInt32 nDefaultCurrencyFormat = - (sal_uInt32)(sal_uIntPtr) aDefaultFormatKeys.Get( CLOffset + ZF_STANDARD_CURRENCY ); + (sal_uInt32)(sal_uLong) aDefaultFormatKeys.Get( CLOffset + ZF_STANDARD_CURRENCY ); if ( !nDefaultCurrencyFormat ) nDefaultCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND; if ( nDefaultCurrencyFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) @@ -3290,8 +3290,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() ) { @@ -3323,39 +3323,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 @@ -3364,19 +3364,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 ) { @@ -3385,11 +3385,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; @@ -3415,17 +3415,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; @@ -3442,14 +3442,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 || @@ -3471,7 +3471,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 || @@ -3493,7 +3493,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 ); @@ -3642,10 +3642,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" ); @@ -3658,14 +3658,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(); @@ -3674,7 +3674,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( @@ -3682,8 +3682,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] ); @@ -3709,7 +3709,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 ) @@ -3730,15 +3730,15 @@ void SvNumberFormatter::ImpInitCurrencyTable() { pEntry = new NfCurrencyEntry( pCurrencies[nCurrency], *pLocaleData, eLang ); // no dupes - BOOL bInsert = TRUE; + sal_Bool bInsert = sal_True; NfCurrencyEntry const * const * pData = rCurrencyTable.GetData(); - USHORT n = rCurrencyTable.Count(); + sal_uInt16 n = rCurrencyTable.Count(); pData++; // skip first SYSTEM entry - for ( USHORT j=1; j<n; j++ ) + for ( sal_uInt16 j=1; j<n; j++ ) { if ( *(*pData++) == *pEntry ) { - bInsert = FALSE; + bInsert = sal_False; break; // for } } @@ -3776,20 +3776,20 @@ void SvNumberFormatter::ImpInitCurrencyTable() delete pLocaleData; SvtSysLocaleOptions::SetCurrencyChangeLink( STATIC_LINK( NULL, SvNumberFormatter, CurrencyChangeLink ) ); - bInitializing = FALSE; - bCurrencyTableInitialized = TRUE; + bInitializing = sal_False; + bCurrencyTableInitialized = sal_True; } -USHORT SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr, - const NfCurrencyEntry& rCurr, BOOL bBank ) const +sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr, + const NfCurrencyEntry& rCurr, sal_Bool bBank ) const { - USHORT nDefault = 0; + sal_uInt16 nDefault = 0; if ( bBank ) { // nur Bankensymbole String aPositiveBank, aNegativeBank; - rCurr.BuildPositiveFormatString( aPositiveBank, TRUE, *xLocaleData, 1 ); - rCurr.BuildNegativeFormatString( aNegativeBank, TRUE, *xLocaleData, 1 ); + rCurr.BuildPositiveFormatString( aPositiveBank, sal_True, *xLocaleData, 1 ); + rCurr.BuildNegativeFormatString( aNegativeBank, sal_True, *xLocaleData, 1 ); WSStringPtr pFormat1 = new String( aPositiveBank ); *pFormat1 += ';'; @@ -3819,14 +3819,14 @@ USHORT SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr, aRed += pFormatScanner->GetRedString(); aRed += ']'; - rCurr.BuildPositiveFormatString( aPositive, FALSE, *xLocaleData, 1 ); - rCurr.BuildNegativeFormatString( aNegative, FALSE, *xLocaleData, 1 ); + rCurr.BuildPositiveFormatString( aPositive, sal_False, *xLocaleData, 1 ); + rCurr.BuildNegativeFormatString( aNegative, sal_False, *xLocaleData, 1 ); if ( rCurr.GetDigits() ) { - rCurr.BuildPositiveFormatString( aPositiveNoDec, FALSE, *xLocaleData, 0 ); - rCurr.BuildNegativeFormatString( aNegativeNoDec, FALSE, *xLocaleData, 0 ); - rCurr.BuildPositiveFormatString( aPositiveDashed, FALSE, *xLocaleData, 2 ); - rCurr.BuildNegativeFormatString( aNegativeDashed, FALSE, *xLocaleData, 2 ); + rCurr.BuildPositiveFormatString( aPositiveNoDec, sal_False, *xLocaleData, 0 ); + rCurr.BuildNegativeFormatString( aNegativeNoDec, sal_False, *xLocaleData, 0 ); + rCurr.BuildPositiveFormatString( aPositiveDashed, sal_False, *xLocaleData, 2 ); + rCurr.BuildNegativeFormatString( aNegativeDashed, sal_False, *xLocaleData, 2 ); pFormat1 = new String( aPositiveNoDec ); *pFormat1 += ';'; @@ -3909,7 +3909,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 @@ -3930,10 +3930,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; } @@ -3947,8 +3947,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 += '$'; @@ -3975,7 +3975,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 ); @@ -3987,28 +3987,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 ); @@ -4016,8 +4016,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 ); @@ -4027,7 +4027,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 ) { @@ -4058,7 +4058,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 ) { @@ -4179,11 +4179,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 ) { @@ -4215,7 +4215,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 ) @@ -4300,8 +4300,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 d0dc56bf7534..f4db791770b7 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -48,13 +48,13 @@ #define _ZFORMAT_CXX #include <svl/zformat.hxx> -#include "zforscan.hxx" +#include <zforscan.hxx> #include "zforfind.hxx" #include <svl/zforlist.hxx> #include "numhead.hxx" #include <unotools/digitgroupingiterator.hxx> -#include "nfsymbol.hxx" +#include <svl/nfsymbol.hxx> #include <cmath> @@ -77,13 +77,13 @@ const double EXP_LOWER_BOUND = 1.0E-4; // prefer scientific notation below this const double _D_MAX_U_LONG_ = (double) 0xffffffff; // 4294967295.0 const double _D_MAX_LONG_ = (double) 0x7fffffff; // 2147483647.0 -const USHORT _MAX_FRACTION_PREC = 3; +const sal_uInt16 _MAX_FRACTION_PREC = 3; const double D_EPS = 1.0E-2; const double _D_MAX_D_BY_100 = 1.7E306; const double _D_MIN_M_BY_1000 = 2.3E-305; -static BYTE cCharWidths[ 128-32 ] = { +static sal_uInt8 cCharWidths[ 128-32 ] = { 1,1,1,2,2,3,2,1,1,1,1,2,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2, 3,2,2,2,2,2,2,3,2,1,2,2,2,3,3,3, @@ -97,7 +97,7 @@ xub_StrLen SvNumberformat::InsertBlanks( String& r, xub_StrLen nPos, sal_Unicode { if( c >= 32 ) { - USHORT n = 2; // Default fuer Zeichen > 128 (HACK!) + sal_uInt16 n = 2; // Default fuer Zeichen > 128 (HACK!) if( c <= 127 ) n = cCharWidths[ c - 32 ]; while( n-- ) @@ -130,15 +130,15 @@ static long GetPrecExp( double fAbsVal ) } } -const USHORT nNewCurrencyVersionId = 0x434E; // "NC" +const sal_uInt16 nNewCurrencyVersionId = 0x434E; // "NC" const sal_Unicode cNewCurrencyMagic = 0x01; // Magic for format code in comment -const USHORT nNewStandardFlagVersionId = 0x4653; // "SF" +const sal_uInt16 nNewStandardFlagVersionId = 0x4653; // "SF" /***********************Funktion SvNumberformatInfo******************************/ -void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, USHORT nAnz ) +void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, sal_uInt16 nAnz ) { - for (USHORT i = 0; i < nAnz; i++) + for (sal_uInt16 i = 0; i < nAnz; i++) { sStrArray[i] = rNumFor.sStrArray[i]; nTypeArray[i] = rNumFor.nTypeArray[i]; @@ -151,9 +151,9 @@ void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, USHORT n nCntExp = rNumFor.nCntExp; } -void ImpSvNumberformatInfo::Save(SvStream& rStream, USHORT nAnz) const +void ImpSvNumberformatInfo::Save(SvStream& rStream, sal_uInt16 nAnz) const { - for (USHORT i = 0; i < nAnz; i++) + for (sal_uInt16 i = 0; i < nAnz; i++) { rStream.WriteByteString( sStrArray[i], rStream.GetStreamCharSet() ); short nType = nTypeArray[i]; @@ -178,9 +178,9 @@ void ImpSvNumberformatInfo::Save(SvStream& rStream, USHORT nAnz) const << nCntPre << nCntPost << nCntExp; } -void ImpSvNumberformatInfo::Load(SvStream& rStream, USHORT nAnz) +void ImpSvNumberformatInfo::Load(SvStream& rStream, sal_uInt16 nAnz) { - for (USHORT i = 0; i < nAnz; i++) + for (sal_uInt16 i = 0; i < nAnz; i++) { SvNumberformat::LoadString( rStream, sStrArray[i] ); rStream >> nTypeArray[i]; @@ -192,9 +192,9 @@ void ImpSvNumberformatInfo::Load(SvStream& rStream, USHORT nAnz) //============================================================================ // static -BYTE SvNumberNatNum::MapDBNumToNatNum( BYTE nDBNum, LanguageType eLang, BOOL bDate ) +sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, sal_Bool bDate ) { - BYTE nNatNum = 0; + sal_uInt8 nNatNum = 0; eLang = MsLangId::getRealLanguage( eLang ); // resolve SYSTEM etc. eLang &= 0x03FF; // 10 bit primary language if ( bDate ) @@ -245,9 +245,9 @@ BYTE SvNumberNatNum::MapDBNumToNatNum( BYTE nDBNum, LanguageType eLang, BOOL bDa } // static -BYTE SvNumberNatNum::MapNatNumToDBNum( BYTE nNatNum, LanguageType eLang, BOOL bDate ) +sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, sal_Bool bDate ) { - BYTE nDBNum = 0; + sal_uInt8 nDBNum = 0; eLang = MsLangId::getRealLanguage( eLang ); // resolve SYSTEM etc. eLang &= 0x03FF; // 10 bit primary language if ( bDate ) @@ -331,7 +331,7 @@ ImpSvNumFor::ImpSvNumFor() aI.nTypeArray = NULL; aI.sStrArray = NULL; aI.eScannedType = NUMBERFORMAT_UNDEFINED; - aI.bThousand = FALSE; + aI.bThousand = sal_False; aI.nThousand = 0; aI.nCntPre = 0; aI.nCntPost = 0; @@ -341,13 +341,13 @@ ImpSvNumFor::ImpSvNumFor() ImpSvNumFor::~ImpSvNumFor() { - for (USHORT i = 0; i < nAnzStrings; i++) + for (sal_uInt16 i = 0; i < nAnzStrings; i++) aI.sStrArray[i].Erase(); delete [] aI.sStrArray; delete [] aI.nTypeArray; } -void ImpSvNumFor::Enlarge(USHORT nAnz) +void ImpSvNumFor::Enlarge(sal_uInt16 nAnz) { if ( nAnzStrings != nAnz ) { @@ -391,7 +391,7 @@ void ImpSvNumFor::Save(SvStream& rStream) const void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc, String& rLoadedColorName ) { - USHORT nAnz; + sal_uInt16 nAnz; rStream >> nAnz; //! noch nicht direkt nAnzStrings wg. Enlarge Enlarge( nAnz ); aI.Load( rStream, nAnz ); @@ -400,20 +400,20 @@ void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc, pColor = rSc.GetColor(sColorName); } -BOOL ImpSvNumFor::HasNewCurrency() const +sal_Bool ImpSvNumFor::HasNewCurrency() const { - for ( USHORT j=0; j<nAnzStrings; j++ ) + for ( sal_uInt16 j=0; j<nAnzStrings; j++ ) { if ( aI.nTypeArray[j] == NF_SYMBOLTYPE_CURRENCY ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol, +sal_Bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const { - for ( USHORT j=0; j<nAnzStrings; j++ ) + for ( sal_uInt16 j=0; j<nAnzStrings; j++ ) { if ( aI.nTypeArray[j] == NF_SYMBOLTYPE_CURRENCY ) { @@ -422,17 +422,17 @@ BOOL ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol, rExtension = aI.sStrArray[j+1]; else rExtension.Erase(); - return TRUE; + return sal_True; } } //! kein Erase an rSymbol, rExtension - return FALSE; + return sal_False; } void ImpSvNumFor::SaveNewCurrencyMap( SvStream& rStream ) const { - USHORT j; - USHORT nCnt = 0; + sal_uInt16 j; + sal_uInt16 nCnt = 0; for ( j=0; j<nAnzStrings; j++ ) { switch ( aI.nTypeArray[j] ) @@ -460,11 +460,11 @@ void ImpSvNumFor::SaveNewCurrencyMap( SvStream& rStream ) const void ImpSvNumFor::LoadNewCurrencyMap( SvStream& rStream ) { - USHORT nCnt; + sal_uInt16 nCnt; rStream >> nCnt; - for ( USHORT j=0; j<nCnt; j++ ) + for ( sal_uInt16 j=0; j<nCnt; j++ ) { - USHORT nPos; + sal_uInt16 nPos; short nType; rStream >> nPos >> nType; if ( nPos < nAnzStrings ) @@ -515,7 +515,7 @@ SvNumberformat::SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge ) : rScan(rSc), nNewStandardDefined(0), - bStarFlag( FALSE ) + bStarFlag( sal_False ) { maLocale.meLanguage = eLge; } @@ -537,7 +537,7 @@ void SvNumberformat::ImpCopyNumberformat( const SvNumberformat& rFormat ) // #121103# when copying between documents, get color pointers from own scanner ImpSvNumberformatScan* pColorSc = ( &rScan != &rFormat.rScan ) ? &rScan : NULL; - for (USHORT i = 0; i < 4; i++) + for (sal_uInt16 i = 0; i < 4; i++) NumFor[i].Copy(rFormat.NumFor[i], pColorSc); } @@ -553,10 +553,10 @@ SvNumberformat::SvNumberformat( SvNumberformat& rFormat, ImpSvNumberformatScan& ImpCopyNumberformat( rFormat ); } -BOOL lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) +sal_Bool lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) { if ( nSymbolType > 0 ) - return TRUE; // conditions + return sal_True; // conditions switch ( nSymbolType ) { case BRACKET_SYMBOLTYPE_COLOR : @@ -590,9 +590,9 @@ BOOL lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) case BRACKET_SYMBOLTYPE_NATNUM17 : case BRACKET_SYMBOLTYPE_NATNUM18 : case BRACKET_SYMBOLTYPE_NATNUM19 : - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } SvNumberformat::SvNumberformat(String& rString, @@ -600,11 +600,11 @@ SvNumberformat::SvNumberformat(String& rString, ImpSvNumberInputScan* pISc, xub_StrLen& nCheckPos, LanguageType& eLan, - BOOL bStan) + sal_Bool bStan) : rScan(*pSc), nNewStandardDefined(0), - bStarFlag( FALSE ) + bStarFlag( sal_False ) { // If the group (AKA thousand) separator is a Non-Breaking Space (French) // replace all occurrences by a simple space. @@ -627,15 +627,15 @@ SvNumberformat::SvNumberformat(String& rString, else maLocale.meLanguage = eLan; bStandard = bStan; - bIsUsed = FALSE; + bIsUsed = sal_False; fLimit1 = 0.0; fLimit2 = 0.0; eOp1 = NUMBERFORMAT_OP_NO; eOp2 = NUMBERFORMAT_OP_NO; eType = NUMBERFORMAT_DEFINED; - BOOL bCancel = FALSE; - BOOL bCondition = FALSE; + sal_Bool bCancel = sal_False; + sal_Bool bCondition = sal_False; short eSymbolType; xub_StrLen nPos = 0; xub_StrLen nPosOld; @@ -643,7 +643,7 @@ SvNumberformat::SvNumberformat(String& rString, String aComment; // Split into 4 sub formats - USHORT nIndex; + sal_uInt16 nIndex; for ( nIndex = 0; nIndex < 4 && !bCancel; nIndex++ ) { // Original language/country may have to be reestablished @@ -660,14 +660,14 @@ SvNumberformat::SvNumberformat(String& rString, { if ( nIndex == 0 && !bCondition ) { - bCondition = TRUE; + bCondition = sal_True; eOp1 = (SvNumberformatLimitOps) eSymbolType; } else if ( nIndex == 1 && bCondition ) eOp2 = (SvNumberformatLimitOps) eSymbolType; else // error { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } if (!bCancel) @@ -701,7 +701,7 @@ SvNumberformat::SvNumberformat(String& rString, nPos++; else { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPos; } } @@ -715,7 +715,7 @@ SvNumberformat::SvNumberformat(String& rString, { if ( NumFor[nIndex].GetColor() != NULL ) { // error, more than one color - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } else @@ -724,7 +724,7 @@ SvNumberformat::SvNumberformat(String& rString, NumFor[nIndex].SetColor( pColor, sStr); if (pColor == NULL) { // error - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } } @@ -753,16 +753,16 @@ SvNumberformat::SvNumberformat(String& rString, { if ( NumFor[nIndex].GetNatNum().IsSet() ) { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } else { sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "NatNum" ) ); //! eSymbolType is negative - BYTE nNum = sal::static_int_cast< BYTE >(0 - (eSymbolType - BRACKET_SYMBOLTYPE_NATNUM0)); + sal_uInt8 nNum = sal::static_int_cast< sal_uInt8 >(0 - (eSymbolType - BRACKET_SYMBOLTYPE_NATNUM0)); sStr += String::CreateFromInt32( nNum ); - NumFor[nIndex].SetNatNumNum( nNum, FALSE ); + NumFor[nIndex].SetNatNumNum( nNum, sal_False ); } } break; @@ -778,16 +778,16 @@ SvNumberformat::SvNumberformat(String& rString, { if ( NumFor[nIndex].GetNatNum().IsSet() ) { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } else { sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DBNum" ) ); //! eSymbolType is negative - BYTE nNum = sal::static_int_cast< BYTE >(1 - (eSymbolType - BRACKET_SYMBOLTYPE_DBNUM1)); + sal_uInt8 nNum = sal::static_int_cast< sal_uInt8 >(1 - (eSymbolType - BRACKET_SYMBOLTYPE_DBNUM1)); sStr += static_cast< sal_Unicode >('0' + nNum); - NumFor[nIndex].SetNatNumNum( nNum, TRUE ); + NumFor[nIndex].SetNatNumNum( nNum, sal_True ); } } break; @@ -795,7 +795,7 @@ SvNumberformat::SvNumberformat(String& rString, { if ( NumFor[nIndex].GetNatNum().GetLang() != LANGUAGE_DONTKNOW ) { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } else @@ -804,7 +804,7 @@ SvNumberformat::SvNumberformat(String& rString, maLocale = ImpGetLocaleType( sStr, nTmp ); if (maLocale.meLanguage == LANGUAGE_DONTKNOW) { - bCancel = TRUE; // break for + bCancel = sal_True; // break for nCheckPos = nPosOld; } else @@ -845,7 +845,7 @@ SvNumberformat::SvNumberformat(String& rString, else { xub_StrLen nStrPos = pSc->ScanFormat( sStr, aComment ); - USHORT nAnz = pSc->GetAnzResStrings(); + sal_uInt16 nAnz = pSc->GetAnzResStrings(); if (nAnz == 0) // error nStrPos = 1; if (nStrPos == 0) // ok @@ -857,7 +857,7 @@ SvNumberformat::SvNumberformat(String& rString, aNat += String::CreateFromInt32( pSc->GetNatNumModifier()); aNat += ']'; sStr.Insert( aNat, 0); - NumFor[nIndex].SetNatNumNum( pSc->GetNatNumModifier(), FALSE ); + NumFor[nIndex].SetNatNumNum( pSc->GetNatNumModifier(), sal_False ); } // #i53826# #i42727# For the Thai T speciality we need // to freeze the locale and immunize it against @@ -910,19 +910,19 @@ SvNumberformat::SvNumberformat(String& rString, else { nCheckPos = nPosOld + nStrPos; // error in string - bCancel = TRUE; // break for + bCancel = sal_True; // break for } } } else if (eSymbolType == BRACKET_SYMBOLTYPE_ERROR) // error { nCheckPos = nPosOld; - bCancel = TRUE; + bCancel = sal_True; } else if ( lcl_SvNumberformat_IsBracketedPrefix( eSymbolType ) ) { nCheckPos = nPosOld+1; // error, prefix in string - bCancel = TRUE; // break for + bCancel = sal_True; // break for } } if ( bCancel && !nCheckPos ) @@ -941,7 +941,7 @@ SvNumberformat::SvNumberformat(String& rString, // hides any text. Need the type here for HasTextFormat() NumFor[3].Info().eScannedType = NUMBERFORMAT_TEXT; } - bCancel = TRUE; + bCancel = sal_True; } if ( NumFor[nIndex].GetNatNum().IsSet() ) NumFor[nIndex].SetNatNumDate( @@ -957,7 +957,7 @@ SvNumberformat::SvNumberformat(String& rString, String aTmp; if ( !pSc->ScanFormat( aAdd, aTmp ) ) { - USHORT nAnz = pSc->GetAnzResStrings(); + sal_uInt16 nAnz = pSc->GetAnzResStrings(); if ( nAnz ) { NumFor[0].Enlarge(nAnz); @@ -976,7 +976,7 @@ SvNumberformat::SvNumberformat(String& rString, String aTmp; if ( !pSc->ScanFormat( aAdd, aTmp ) ) { - USHORT nAnz = pSc->GetAnzResStrings(); + sal_uInt16 nAnz = pSc->GetAnzResStrings(); if ( nAnz ) { NumFor[nIndex].Enlarge(nAnz); @@ -994,7 +994,7 @@ SvNumberformat::SvNumberformat(String& rString, String aTmp; if ( !pSc->ScanFormat( aAdd, aTmp ) ) { - USHORT nAnz = pSc->GetAnzResStrings(); + sal_uInt16 nAnz = pSc->GetAnzResStrings(); if ( nAnz ) { NumFor[nIndex].Enlarge(nAnz); @@ -1479,12 +1479,12 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, ImpSvNumberInputScan& rISc ) { rHdr.StartEntry(); - USHORT nOp1, nOp2; + sal_uInt16 nOp1, nOp2; SvNumberformat::LoadString( rStream, sFormatstring ); rStream >> eType >> fLimit1 >> fLimit2 >> nOp1 >> nOp2 >> bStandard >> bIsUsed; NfHackConversion eHackConversion = NF_CONVERT_NONE; - BOOL bOldConvert = FALSE; + sal_Bool bOldConvert = sal_False; LanguageType eOldTmpLang = 0; LanguageType eOldNewLang = 0; if ( pHackConverter ) @@ -1494,7 +1494,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, eOldNewLang = rScan.GetNewLnge(); } String aLoadedColorName; - for (USHORT i = 0; i < 4; i++) + for (sal_uInt16 i = 0; i < 4; i++) { NumFor[i].Load( rStream, rScan, aLoadedColorName ); if ( pHackConverter && eHackConversion == NF_CONVERT_NONE ) @@ -1540,25 +1540,25 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, } xub_StrLen nNewCurrencyEnd = STRING_NOTFOUND; - BOOL bNewCurrencyComment = ( aComment.GetChar(0) == cNewCurrencyMagic && + sal_Bool bNewCurrencyComment = ( aComment.GetChar(0) == cNewCurrencyMagic && (nNewCurrencyEnd = aComment.Search( cNewCurrencyMagic, 1 )) != STRING_NOTFOUND ); - BOOL bNewCurrencyLoaded = FALSE; - BOOL bNewCurrency = FALSE; + sal_Bool bNewCurrencyLoaded = sal_False; + sal_Bool bNewCurrency = sal_False; - BOOL bGoOn = TRUE; + sal_Bool bGoOn = sal_True; while ( rHdr.BytesLeft() && bGoOn ) { // as of SV_NUMBERFORMATTER_VERSION_NEW_CURR - USHORT nId; + sal_uInt16 nId; rStream >> nId; switch ( nId ) { case nNewCurrencyVersionId : { - bNewCurrencyLoaded = TRUE; + bNewCurrencyLoaded = sal_True; rStream >> bNewCurrency; if ( bNewCurrency ) { - for ( USHORT j=0; j<4; j++ ) + for ( sal_uInt16 j=0; j<4; j++ ) { NumFor[j].LoadNewCurrencyMap( rStream ); } @@ -1570,7 +1570,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, break; default: DBG_ERRORFILE( "SvNumberformat::Load: unknown header bytes left nId" ); - bGoOn = FALSE; // stop reading unknown stream left over of newer versions + bGoOn = sal_False; // stop reading unknown stream left over of newer versions // Would be nice to have multiple read/write headers instead // but old versions wouldn't know it, TLOT. } @@ -1592,7 +1592,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, aComment.Erase( 0, nNewCurrencyEnd+1 ); // Zustaende merken short nDefined = ( eType & NUMBERFORMAT_DEFINED ); - USHORT nNewStandard = nNewStandardDefined; + sal_uInt16 nNewStandard = nNewStandardDefined; // neu parsen etc. String aStr( sFormatstring ); xub_StrLen nCheckPos = 0; @@ -1614,11 +1614,11 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, { case NF_CONVERT_ENGLISH_GERMAN : ConvertLanguage( *pHackConverter, - LANGUAGE_ENGLISH_US, LANGUAGE_GERMAN, TRUE ); + LANGUAGE_ENGLISH_US, LANGUAGE_GERMAN, sal_True ); break; case NF_CONVERT_GERMAN_ENGLISH : ConvertLanguage( *pHackConverter, - LANGUAGE_GERMAN, LANGUAGE_ENGLISH_US, TRUE ); + LANGUAGE_GERMAN, LANGUAGE_ENGLISH_US, sal_True ); break; default: DBG_ERRORFILE( "SvNumberformat::Load: eHackConversion unknown" ); @@ -1628,7 +1628,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, } void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, - LanguageType eConvertFrom, LanguageType eConvertTo, BOOL bSystem ) + LanguageType eConvertFrom, LanguageType eConvertTo, sal_Bool bSystem ) { xub_StrLen nCheckPos; sal_uInt32 nKey; @@ -1649,7 +1649,7 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, if ( bSystem ) maLocale.meLanguage = LANGUAGE_SYSTEM; // pColor zeigt noch auf Tabelle in temporaerem Formatter/Scanner - for ( USHORT i = 0; i < 4; i++ ) + for ( sal_uInt16 i = 0; i < 4; i++ ) { String aColorName = NumFor[i].GetColorName(); Color* pColor = rScan.GetColor( aColorName ); @@ -1699,7 +1699,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr SetComment( "", aFormatstring, aComment ); #endif - BOOL bNewCurrency = HasNewCurrency(); + sal_Bool bNewCurrency = HasNewCurrency(); if ( bNewCurrency ) { // SV_NUMBERFORMATTER_VERSION_NEW_CURR im Kommentar speichern aComment.Insert( cNewCurrencyMagic, 0 ); @@ -1710,7 +1710,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr // old SO5 versions do behave strange (no output) if standard flag is set // on formats not prepared for it (not having the following exact types) - BOOL bOldStandard = bStandard; + sal_Bool bOldStandard = bStandard; if ( bOldStandard ) { switch ( eType ) @@ -1724,15 +1724,15 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr // ok to save break; default: - bOldStandard = FALSE; + bOldStandard = sal_False; } } rHdr.StartEntry(); rStream.WriteByteString( aFormatstring, rStream.GetStreamCharSet() ); - rStream << eType << fLimit1 << fLimit2 << (USHORT) eOp1 << (USHORT) eOp2 + rStream << eType << fLimit1 << fLimit2 << (sal_uInt16) eOp1 << (sal_uInt16) eOp2 << bOldStandard << bIsUsed; - for (USHORT i = 0; i < 4; i++) + for (sal_uInt16 i = 0; i < 4; i++) NumFor[i].Save(rStream); // ab SV_NUMBERFORMATTER_VERSION_NEWSTANDARD rStream.WriteByteString( aComment, rStream.GetStreamCharSet() ); @@ -1742,7 +1742,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr rStream << bNewCurrency; if ( bNewCurrency ) { - for ( USHORT j=0; j<4; j++ ) + for ( sal_uInt16 j=0; j<4; j++ ) { NumFor[j].SaveNewCurrencyMap( rStream ); } @@ -1758,32 +1758,32 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr rHdr.EndEntry(); } -BOOL SvNumberformat::HasNewCurrency() const +sal_Bool SvNumberformat::HasNewCurrency() const { - for ( USHORT j=0; j<4; j++ ) + for ( sal_uInt16 j=0; j<4; j++ ) { if ( NumFor[j].HasNewCurrency() ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SvNumberformat::GetNewCurrencySymbol( String& rSymbol, +sal_Bool SvNumberformat::GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const { - for ( USHORT j=0; j<4; j++ ) + for ( sal_uInt16 j=0; j<4; j++ ) { if ( NumFor[j].GetNewCurrencySymbol( rSymbol, rExtension ) ) - return TRUE; + return sal_True; } rSymbol.Erase(); rExtension.Erase(); - return FALSE; + return sal_False; } // static String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, - BOOL bQuoteSymbol ) + sal_Bool bQuoteSymbol ) { String aTmp; xub_StrLen nStartPos, nPos, nLen; @@ -1832,7 +1832,7 @@ String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, void SvNumberformat::Build50Formatstring( String& rStr ) const { - rStr = StripNewCurrencyDelimiters( sFormatstring, TRUE ); + rStr = StripNewCurrencyDelimiters( sFormatstring, sal_True ); } void SvNumberformat::ImpGetOutputStandard(double& fNumber, String& OutString) @@ -1897,7 +1897,7 @@ void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, String& rOutStr void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString) { - BOOL bModified = FALSE; + sal_Bool bModified = sal_False; if ( (eType & NUMBERFORMAT_PERCENT) && (fabs(fNumber) < _D_MAX_D_BY_100)) { if (fNumber == 0.0) @@ -1906,7 +1906,7 @@ void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString) return; } fNumber *= 100; - bModified = TRUE; + bModified = sal_True; } if (fNumber == 0.0) @@ -1941,12 +1941,12 @@ short SvNumberformat::ImpCheckCondition(double& fNumber, } } -BOOL SvNumberformat::GetOutputString(String& sString, +sal_Bool SvNumberformat::GetOutputString(String& sString, String& OutString, Color** ppColor) { OutString.Erase(); - USHORT nIx; + sal_uInt16 nIx; if (eType & NUMBERFORMAT_TEXT) nIx = 0; else if (NumFor[3].GetCount() > 0) @@ -1954,15 +1954,15 @@ BOOL SvNumberformat::GetOutputString(String& sString, else { *ppColor = NULL; // no change of color - return FALSE; + return sal_False; } *ppColor = NumFor[nIx].GetColor(); const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); if (rInfo.eScannedType == NUMBERFORMAT_TEXT) { - BOOL bRes = FALSE; - const USHORT nAnz = NumFor[nIx].GetCount(); - for (USHORT i = 0; i < nAnz; i++) + sal_Bool bRes = sal_False; + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); + for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) { @@ -1971,7 +1971,7 @@ BOOL SvNumberformat::GetOutputString(String& sString, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = TRUE; + bRes = sal_True; } break; case NF_SYMBOLTYPE_BLANK: @@ -1988,24 +1988,24 @@ BOOL SvNumberformat::GetOutputString(String& sString, } return bRes; } - return FALSE; + return sal_False; } /* -void SvNumberformat::GetNextFareyNumber(ULONG nPrec, ULONG x0, ULONG x1, - ULONG y0, ULONG y1, - ULONG& x2,ULONG& y2) +void SvNumberformat::GetNextFareyNumber(sal_uLong nPrec, sal_uLong x0, sal_uLong x1, + sal_uLong y0, sal_uLong y1, + sal_uLong& x2,sal_uLong& y2) { x2 = ((y0+nPrec)/y1)*x1 - x0; y2 = ((y0+nPrec)/y1)*y1 - y0; } */ -ULONG SvNumberformat::ImpGGT(ULONG x, ULONG y) +sal_uLong SvNumberformat::ImpGGT(sal_uLong x, sal_uLong y) { if (y == 0) return x; else { - ULONG z = x%y; + sal_uLong z = x%y; while (z) { x = y; @@ -2016,13 +2016,13 @@ ULONG SvNumberformat::ImpGGT(ULONG x, ULONG y) } } -ULONG SvNumberformat::ImpGGTRound(ULONG x, ULONG y) +sal_uLong SvNumberformat::ImpGGTRound(sal_uLong x, sal_uLong y) { if (y == 0) return x; else { - ULONG z = x%y; + sal_uLong z = x%y; while ((double)z/(double)y > D_EPS) { x = y; @@ -2125,11 +2125,11 @@ bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, Stri return true; } -BOOL SvNumberformat::GetOutputString(double fNumber, +sal_Bool SvNumberformat::GetOutputString(double fNumber, String& OutString, Color** ppColor) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; OutString.Erase(); // alles loeschen *ppColor = NULL; // keine Farbaenderung if (eType & NUMBERFORMAT_LOGICAL) @@ -2138,14 +2138,14 @@ BOOL SvNumberformat::GetOutputString(double fNumber, OutString = rScan.GetTrueString(); else OutString = rScan.GetFalseString(); - return FALSE; + return sal_False; } if (eType & NUMBERFORMAT_TEXT) { ImpGetOutputStandard(fNumber, OutString); - return FALSE; + return sal_False; } - BOOL bHadStandard = FALSE; + sal_Bool bHadStandard = sal_False; if (bStandard) // einzelne Standardformate { if (rScan.GetStandardPrec() == SvNumberFormatter::INPUTSTRING_PRECISION) // alle Zahlformate InputLine @@ -2185,26 +2185,26 @@ BOOL SvNumberformat::GetOutputString(double fNumber, return false; } ImpGetOutputStandard(fNumber, OutString); - bHadStandard = TRUE; + bHadStandard = sal_True; } break; case NUMBERFORMAT_DATE: bRes |= ImpGetDateOutput(fNumber, 0, OutString); - bHadStandard = TRUE; + bHadStandard = sal_True; break; case NUMBERFORMAT_TIME: bRes |= ImpGetTimeOutput(fNumber, 0, OutString); - bHadStandard = TRUE; + bHadStandard = sal_True; break; case NUMBERFORMAT_DATETIME: bRes |= ImpGetDateTimeOutput(fNumber, 0, OutString); - bHadStandard = TRUE; + bHadStandard = sal_True; break; } } if ( !bHadStandard ) { - USHORT nIx; // Index des Teilformats + sal_uInt16 nIx; // Index des Teilformats short nCheck = ImpCheckCondition(fNumber, fLimit1, eOp1); if (nCheck == -1 || nCheck == 1) // nur 1 String oder True nIx = 0; @@ -2221,20 +2221,20 @@ BOOL SvNumberformat::GetOutputString(double fNumber, fNumber = -fNumber; // Vorzeichen eliminieren *ppColor = NumFor[nIx].GetColor(); const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); - const USHORT nAnz = NumFor[nIx].GetCount(); + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); if (nAnz == 0 && rInfo.eScannedType == NUMBERFORMAT_UNDEFINED) - return FALSE; // leer => nichts + return sal_False; // leer => nichts else if (nAnz == 0) // sonst Standard-Format { ImpGetOutputStandard(fNumber, OutString); - return FALSE; + return sal_False; } switch (rInfo.eScannedType) { case NUMBERFORMAT_TEXT: case NUMBERFORMAT_DEFINED: { - for (USHORT i = 0; i < nAnz; i++) + for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) { @@ -2243,7 +2243,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = TRUE; + bRes = sal_True; } break; case NF_SYMBOLTYPE_BLANK: @@ -2281,13 +2281,13 @@ BOOL SvNumberformat::GetOutputString(double fNumber, case NUMBERFORMAT_FRACTION: { String sStr, sFrac, sDiv; // Strings, Wert fuer - ULONG nFrac, nDiv; // Vorkommaanteil + sal_uLong nFrac, nDiv; // Vorkommaanteil // Zaehler und Nenner - BOOL bSign = FALSE; + sal_Bool bSign = sal_False; if (fNumber < 0) { if (nIx == 0) // nicht in hinteren - bSign = TRUE; // Formaten + bSign = sal_True; // Formaten fNumber = -fNumber; } double fNum = floor(fNumber); // Vorkommateil @@ -2296,30 +2296,30 @@ BOOL SvNumberformat::GetOutputString(double fNumber, // zu gross { OutString = rScan.GetErrorString(); - return FALSE; + return sal_False; } if (rInfo.nCntExp == 0) { OSL_FAIL("SvNumberformat:: Bruch, nCntExp == 0"); - return FALSE; + return sal_False; } - ULONG nBasis = ((ULONG)floor( // 9, 99, 999 ,... + sal_uLong nBasis = ((sal_uLong)floor( // 9, 99, 999 ,... pow(10.0,rInfo.nCntExp))) - 1; - ULONG x0, y0, x1, y1; + sal_uLong x0, y0, x1, y1; if (rInfo.nCntExp <= _MAX_FRACTION_PREC) { - BOOL bUpperHalf; + sal_Bool bUpperHalf; if (fNumber > 0.5) { - bUpperHalf = TRUE; + bUpperHalf = sal_True; fNumber -= (fNumber - 0.5) * 2.0; } else - bUpperHalf = FALSE; + bUpperHalf = sal_False; // Einstieg in Farey-Serie // finden: - x0 = (ULONG) floor(fNumber*nBasis); // z.B. 2/9 <= x < 3/9 + x0 = (sal_uLong) floor(fNumber*nBasis); // z.B. 2/9 <= x < 3/9 if (x0 == 0) // => x0 = 2 { y0 = 1; @@ -2345,12 +2345,12 @@ BOOL SvNumberformat::GetOutputString(double fNumber, y1 = nBasis - 1; double fUg = (double) x0 / (double) y0; double fOg = (double) x1 / (double) y1; - ULONG nGgt = ImpGGT(y0, x0); // x0/y0 kuerzen + sal_uLong nGgt = ImpGGT(y0, x0); // x0/y0 kuerzen x0 /= nGgt; y0 /= nGgt; // Einschachteln: - ULONG x2 = 0; - ULONG y2 = 0; - BOOL bStop = FALSE; + sal_uLong x2 = 0; + sal_uLong y2 = 0; + sal_Bool bStop = sal_False; while (!bStop) { #ifdef GCC @@ -2374,20 +2374,20 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if (fTest <= fOg) { fOg = fTest; - bStop = TRUE; + bStop = sal_True; } else if (y1 == 1) - bStop = TRUE; + bStop = sal_True; } // of while nGgt = ImpGGT(y1, x1); // x1/y1 kuerzen x2 = x1 / nGgt; y2 = y1 / nGgt; if (x2*y0 - x0*y2 == 1 || y1 <= 1) // Test, ob x2/y2 - bStop = TRUE; // naechste Farey-Zahl + bStop = sal_True; // naechste Farey-Zahl else { y1--; - bStop = FALSE; + bStop = sal_False; } } // of while x1 = x2; @@ -2398,8 +2398,8 @@ BOOL SvNumberformat::GetOutputString(double fNumber, fup = (double)x1/(double)y1; while (fNumber > fup) { - ULONG x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl - ULONG y2 = ((y0+nBasis)/y1)*y1 - y0; + sal_uLong x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl + sal_uLong y2 = ((y0+nBasis)/y1)*y1 - y0; // GetNextFareyNumber(nBasis, x0, x1, y0, y1, x2, y2); x0 = x1; y0 = y1; @@ -2428,14 +2428,14 @@ BOOL SvNumberformat::GetOutputString(double fNumber, } else // grosse Nenner { // 0,1234->123/1000 - ULONG nGgt; + sal_uLong nGgt; /* nDiv = nBasis+1; - nFrac = ((ULONG)floor(0.5 + fNumber * + nFrac = ((sal_uLong)floor(0.5 + fNumber * pow(10.0,rInfo.nCntExp))); */ nDiv = 10000000; - nFrac = ((ULONG)floor(0.5 + fNumber * 10000000.0)); + nFrac = ((sal_uLong)floor(0.5 + fNumber * 10000000.0)); nGgt = ImpGGT(nDiv, nFrac); if (nGgt > 1) { @@ -2454,7 +2454,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if (nDiv > nBasis) { nDiv = nBasis; - nFrac = ((ULONG)floor(0.5 + fNumber * + nFrac = ((sal_uLong)floor(0.5 + fNumber * pow(10.0,rInfo.nCntExp))); nGgt = ImpGGTRound(nDiv, nFrac); if (nGgt > 1) @@ -2481,9 +2481,9 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if (fNum1 > _D_MAX_U_LONG_) { OutString = rScan.GetErrorString(); - return FALSE; + return sal_False; } - nFrac = (ULONG) floor(fNum1); + nFrac = (sal_uLong) floor(fNum1); sStr.Erase(); } else if (fNum == 0.0 && nFrac != 0) @@ -2506,10 +2506,10 @@ BOOL SvNumberformat::GetOutputString(double fNumber, sDiv = ImpIntToString( nIx, nDiv ); } - USHORT j = nAnz-1; // letztes Symbol->rueckw. + sal_uInt16 j = nAnz-1; // letztes Symbol->rueckw. xub_StrLen k; // Nenner: bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC); - BOOL bCont = TRUE; + sal_Bool bCont = sal_True; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRAC) { if (rInfo.nCntPre > 0 && nFrac == 0) @@ -2519,7 +2519,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = FALSE; + bCont = sal_False; } // weiter Zaehler: if ( !bCont ) @@ -2533,7 +2533,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = FALSE; + bCont = sal_False; } } // weiter Hauptzahl @@ -2554,11 +2554,11 @@ BOOL SvNumberformat::GetOutputString(double fNumber, break; case NUMBERFORMAT_SCIENTIFIC: { - BOOL bSign = FALSE; + sal_Bool bSign = sal_False; if (fNumber < 0) { if (nIx == 0) // nicht in hinteren - bSign = TRUE; // Formaten + bSign = sal_True; // Formaten fNumber = -fNumber; } String sStr( ::rtl::math::doubleToUString( fNumber, @@ -2598,7 +2598,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, ExpStr = String::CreateFromInt32( nExp ); } } - USHORT j = nAnz-1; // last symbol + sal_uInt16 j = nAnz-1; // last symbol xub_StrLen k; // position in ExpStr bRes |= ImpNumberFill(ExpStr, fNumber, k, j, nIx, NF_SYMBOLTYPE_EXP); @@ -2608,7 +2608,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if (nZeros) ExpStr.Erase( 0, nZeros); - BOOL bCont = TRUE; + sal_Bool bCont = sal_True; if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_EXP) { const String& rStr = rInfo.sStrArray[j]; @@ -2620,7 +2620,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if ( j ) j--; else - bCont = FALSE; + bCont = sal_False; } // weiter Hauptzahl: if ( !bCont ) @@ -2643,20 +2643,20 @@ BOOL SvNumberformat::GetOutputString(double fNumber, return bRes; } -BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, - USHORT nIx, +sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, + sal_uInt16 nIx, String& OutString) { using namespace ::com::sun::star::i18n; - BOOL bCalendarSet = FALSE; + sal_Bool bCalendarSet = sal_False; double fNumberOrig = fNumber; - BOOL bRes = FALSE; - BOOL bSign = FALSE; + sal_Bool bRes = sal_False; + sal_Bool bSign = sal_False; if (fNumber < 0.0) { fNumber = -fNumber; if (nIx == 0) - bSign = TRUE; + bSign = sal_True; } const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); if (rInfo.bThousand) // []-Format @@ -2664,22 +2664,22 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, if (fNumber > 1.0E10) // zu gross { OutString = rScan.GetErrorString(); - return FALSE; + return sal_False; } } else fNumber -= floor(fNumber); // sonst Datum abtrennen - BOOL bInputLine; + sal_Bool bInputLine; xub_StrLen nCntPost; if ( rScan.GetStandardPrec() == 300 && 0 < rInfo.nCntPost && rInfo.nCntPost < 7 ) { // round at 7 decimals (+5 of 86400 == 12 significant digits) - bInputLine = TRUE; + bInputLine = sal_True; nCntPost = 7; } else { - bInputLine = FALSE; + bInputLine = sal_False; nCntPost = xub_StrLen(rInfo.nCntPost); } if (bSign && !rInfo.bThousand) // kein []-Format @@ -2687,14 +2687,14 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, double fTime = fNumber * 86400.0; fTime = ::rtl::math::round( fTime, int(nCntPost) ); if (bSign && fTime == 0.0) - bSign = FALSE; // nicht -00:00:00 + bSign = sal_False; // nicht -00:00:00 if( floor( fTime ) > _D_MAX_U_LONG_ ) { OutString = rScan.GetErrorString(); - return FALSE; + return sal_False; } - ULONG nSeconds = (ULONG)floor( fTime ); + sal_uLong nSeconds = (sal_uLong)floor( fTime ); String sSecStr( ::rtl::math::doubleToUString( fTime-nSeconds, rtl_math_StringFormat_F, int(nCntPost), '.')); @@ -2713,7 +2713,7 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, xub_StrLen nSecPos = 0; // Zum Ziffernweisen // abarbeiten - ULONG nHour, nMin, nSec; + sal_uLong nHour, nMin, nSec; if (!rInfo.bThousand) // kein [] Format { nHour = (nSeconds/3600) % 24; @@ -2762,8 +2762,8 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, nHour -= 12; } } - const USHORT nAnz = NumFor[nIx].GetCount(); - for (USHORT i = 0; i < nAnz; i++) + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); + for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) { @@ -2772,7 +2772,7 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = TRUE; + bRes = sal_True; } break; case NF_SYMBOLTYPE_BLANK: @@ -2806,7 +2806,7 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, double fDiff = DateTime(*(rScan.GetNullDate())) - GetCal().getEpochStart(); fDiff += fNumberOrig; GetCal().setLocalDateTime( fDiff ); - bCalendarSet = TRUE; + bCalendarSet = sal_True; } if (cAmPm == 'a') OutString += GetCal().getDisplayName( @@ -2851,29 +2851,29 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber, return bRes; } -BOOL SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const +sal_Bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const { if ( GetCal().getUniqueID() != Gregorian::get() ) - return FALSE; + return sal_False; const ImpSvNumberformatInfo& rInfo = rNumFor.Info(); - const USHORT nAnz = rNumFor.GetCount(); - USHORT i; + const sal_uInt16 nAnz = rNumFor.GetCount(); + sal_uInt16 i; for ( i = 0; i < nAnz; i++ ) { switch ( rInfo.nTypeArray[i] ) { case NF_SYMBOLTYPE_CALENDAR : - return FALSE; + return sal_False; case NF_KEY_EC : case NF_KEY_EEC : case NF_KEY_R : case NF_KEY_RR : case NF_KEY_AAA : case NF_KEY_AAAA : - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } void SvNumberformat::SwitchToOtherCalendar( String& rOrgCalendar, @@ -2919,7 +2919,7 @@ void SvNumberformat::SwitchToGregorianCalendar( const String& rOrgCalendar, } } -BOOL SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ) +sal_Bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ) { using namespace ::com::sun::star::i18n; CalendarWrapper& rCal = GetCal(); @@ -2939,18 +2939,18 @@ BOOL SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, doubl rOrgCalendar.Erase(); rCal.loadCalendar( rGregorian, rLoc().getLocale() ); rCal.setDateTime( fOrgDateTime ); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } -BOOL SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, +sal_Bool SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const { const ImpSvNumberformatInfo& rInfo = rNumFor.Info(); - const USHORT nAnz = rNumFor.GetCount(); - for ( USHORT i = 0; i < nAnz; i++ ) + const sal_uInt16 nAnz = rNumFor.GetCount(); + for ( sal_uInt16 i = 0; i < nAnz; i++ ) { if ( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_CALENDAR ) { @@ -2962,10 +2962,10 @@ BOOL SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, } rCal.loadCalendar( rInfo.sStrArray[i], rLoc().getLocale() ); rCal.setDateTime( fOrgDateTime ); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } // static @@ -2992,27 +2992,27 @@ void SvNumberformat::ImpAppendEraG( String& OutString, OutString += rCal.getDisplayString( CalendarDisplayCode::SHORT_ERA, nNatNum ); } -BOOL SvNumberformat::ImpGetDateOutput(double fNumber, - USHORT nIx, +sal_Bool SvNumberformat::ImpGetDateOutput(double fNumber, + sal_uInt16 nIx, String& OutString) { using namespace ::com::sun::star::i18n; - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; CalendarWrapper& rCal = GetCal(); double fDiff = DateTime(*(rScan.GetNullDate())) - rCal.getEpochStart(); fNumber += fDiff; rCal.setLocalDateTime( fNumber ); String aOrgCalendar; // empty => not changed yet double fOrgDateTime; - BOOL bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] ); + sal_Bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] ); if ( bOtherCalendar ) SwitchToOtherCalendar( aOrgCalendar, fOrgDateTime ); if ( ImpFallBackToGregorianCalendar( aOrgCalendar, fOrgDateTime ) ) - bOtherCalendar = FALSE; + bOtherCalendar = sal_False; const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); - const USHORT nAnz = NumFor[nIx].GetCount(); + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); sal_Int16 nNatNum = NumFor[nIx].GetNatNum().GetNatNum(); - for (USHORT i = 0; i < nAnz; i++) + for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) { @@ -3031,7 +3031,7 @@ BOOL SvNumberformat::ImpGetDateOutput(double fNumber, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = TRUE; + bRes = sal_True; } break; case NF_SYMBOLTYPE_BLANK: @@ -3175,29 +3175,29 @@ BOOL SvNumberformat::ImpGetDateOutput(double fNumber, return bRes; } -BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber, - USHORT nIx, +sal_Bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, + sal_uInt16 nIx, String& OutString) { using namespace ::com::sun::star::i18n; - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; CalendarWrapper& rCal = GetCal(); double fDiff = DateTime(*(rScan.GetNullDate())) - rCal.getEpochStart(); fNumber += fDiff; const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); - BOOL bInputLine; + sal_Bool bInputLine; xub_StrLen nCntPost; if ( rScan.GetStandardPrec() == 300 && 0 < rInfo.nCntPost && rInfo.nCntPost < 7 ) { // round at 7 decimals (+5 of 86400 == 12 significant digits) - bInputLine = TRUE; + bInputLine = sal_True; nCntPost = 7; } else { - bInputLine = FALSE; + bInputLine = sal_False; nCntPost = xub_StrLen(rInfo.nCntPost); } double fTime = (fNumber - floor( fNumber )) * 86400.0; @@ -3212,14 +3212,14 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber, String aOrgCalendar; // empty => not changed yet double fOrgDateTime; - BOOL bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] ); + sal_Bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] ); if ( bOtherCalendar ) SwitchToOtherCalendar( aOrgCalendar, fOrgDateTime ); if ( ImpFallBackToGregorianCalendar( aOrgCalendar, fOrgDateTime ) ) - bOtherCalendar = FALSE; + bOtherCalendar = sal_False; sal_Int16 nNatNum = NumFor[nIx].GetNatNum().GetNatNum(); - ULONG nSeconds = (ULONG)floor( fTime ); + sal_uLong nSeconds = (sal_uLong)floor( fTime ); String sSecStr( ::rtl::math::doubleToUString( fTime-nSeconds, rtl_math_StringFormat_F, int(nCntPost), '.')); sSecStr.EraseLeadingChars('0'); @@ -3237,7 +3237,7 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber, xub_StrLen nSecPos = 0; // Zum Ziffernweisen // abarbeiten - ULONG nHour, nMin, nSec; + sal_uLong nHour, nMin, nSec; if (!rInfo.bThousand) // [] Format { nHour = (nSeconds/3600) % 24; @@ -3284,8 +3284,8 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber, nHour -= 12; } } - const USHORT nAnz = NumFor[nIx].GetCount(); - for (USHORT i = 0; i < nAnz; i++) + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); + for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) { @@ -3304,7 +3304,7 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber, { OutString += (sal_Unicode) 0x1B; OutString += rInfo.sStrArray[i].GetChar(1); - bRes = TRUE; + bRes = sal_True; } break; case NF_SYMBOLTYPE_BLANK: @@ -3497,23 +3497,23 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber, return bRes; } -BOOL SvNumberformat::ImpGetNumberOutput(double fNumber, - USHORT nIx, +sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, + sal_uInt16 nIx, String& OutString) { - BOOL bRes = FALSE; - BOOL bSign; + sal_Bool bRes = sal_False; + sal_Bool bSign; if (fNumber < 0.0) { if (nIx == 0) // nicht in hinteren - bSign = TRUE; // Formaten + bSign = sal_True; // Formaten else - bSign = FALSE; + bSign = sal_False; fNumber = -fNumber; } else { - bSign = FALSE; + bSign = sal_False; if ( ::rtl::math::isSignBitSet( fNumber ) ) fNumber = -fNumber; // yes, -0.0 is possible, eliminate '-' } @@ -3525,17 +3525,17 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber, else { OutString = rScan.GetErrorString(); - return FALSE; + return sal_False; } } - USHORT i, j; + sal_uInt16 i, j; xub_StrLen k; String sStr; long nPrecExp; - BOOL bInteger = FALSE; + sal_Bool bInteger = sal_False; if ( rInfo.nThousand != FLAG_STANDARD_IN_FORMAT ) { // special formatting only if no GENERAL keyword in format code - const USHORT nThousand = rInfo.nThousand; + const sal_uInt16 nThousand = rInfo.nThousand; for (i = 0; i < nThousand; i++) { if (fNumber > _D_MIN_M_BY_1000) @@ -3579,12 +3579,12 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber, while ( *++p == '0' ) ; if ( !*p ) - bInteger = TRUE; + bInteger = sal_True; sStr.Erase( nPoint, 1 ); // . herausnehmen } if (bSign && (sStr.Len() == 0 || sStr.GetTokenCount('0') == sStr.Len()+1)) // nur 00000 - bSign = FALSE; // nicht -0.00 + bSign = sal_False; // nicht -0.00 } // End of != FLAG_STANDARD_IN_FORMAT // von hinten nach vorn @@ -3594,8 +3594,8 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber, // Nachkommastellen: if (rInfo.nCntPost > 0) { - BOOL bTrailing = TRUE; // ob Endnullen? - BOOL bFilled = FALSE; // ob aufgefuellt wurde ? + sal_Bool bTrailing = sal_True; // ob Endnullen? + sal_Bool bFilled = sal_False; // ob aufgefuellt wurde ? short nType; while (j > 0 && // rueckwaerts (nType = rInfo.nTypeArray[j]) != NF_SYMBOLTYPE_DECSEP) @@ -3607,7 +3607,7 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber, { sStr.Insert( (sal_Unicode) 0x1B, k /*++*/ ); sStr.Insert(rInfo.sStrArray[j].GetChar(1),k); - bRes = TRUE; + bRes = sal_True; } break; case NF_SYMBOLTYPE_BLANK: @@ -3632,21 +3632,21 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber, const sal_Unicode c = *p; k--; if ( sStr.GetChar(k) != '0' ) - bTrailing = FALSE; + bTrailing = sal_False; if (bTrailing) { if ( c == '0' ) - bFilled = TRUE; + bFilled = sal_True; else if ( c == '-' ) { if ( bInteger ) sStr.SetChar( k, '-' ); - bFilled = TRUE; + bFilled = sal_True; } else if ( c == '?' ) { sStr.SetChar( k, ' ' ); - bFilled = TRUE; + bFilled = sal_True; } else if ( !bFilled ) // # sStr.Erase(k,1); @@ -3688,27 +3688,27 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber, return bRes; } -BOOL SvNumberformat::ImpNumberFillWithThousands( +sal_Bool SvNumberformat::ImpNumberFillWithThousands( String& sStr, // number string double& rNumber, // number xub_StrLen k, // position within string - USHORT j, // symbol index within format code - USHORT nIx, // subformat index - USHORT nDigCnt) // count of integer digits in format + sal_uInt16 j, // symbol index within format code + sal_uInt16 nIx, // subformat index + sal_uInt16 nDigCnt) // count of integer digits in format { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; xub_StrLen nLeadingStringChars = 0; // inserted StringChars before number xub_StrLen nDigitCount = 0; // count of integer digits from the right - BOOL bStop = FALSE; + sal_Bool bStop = sal_False; const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); // no normal thousands separators if number divided by thousands - BOOL bDoThousands = (rInfo.nThousand == 0); + sal_Bool bDoThousands = (rInfo.nThousand == 0); utl::DigitGroupingIterator aGrouping( GetFormatter().GetLocaleData()->getDigitGrouping()); while (!bStop) // backwards { if (j == 0) - bStop = TRUE; + bStop = sal_True; switch (rInfo.nTypeArray[j]) { case NF_SYMBOLTYPE_DECSEP: @@ -3727,7 +3727,7 @@ BOOL SvNumberformat::ImpNumberFillWithThousands( { sStr.Insert( (sal_Unicode) 0x1B, k/*++*/ ); sStr.Insert(rInfo.sStrArray[j].GetChar(1),k); - bRes = TRUE; + bRes = sal_True; } break; case NF_SYMBOLTYPE_BLANK: @@ -3847,7 +3847,7 @@ void SvNumberformat::ImpDigitFill( String& sStr, // number string xub_StrLen nStart, // start of digits xub_StrLen& k, // position within string - USHORT nIx, // subformat index + sal_uInt16 nIx, // subformat index xub_StrLen & nDigitCount, // count of integer digits from the right so far utl::DigitGroupingIterator & rGrouping ) // current grouping { @@ -3869,18 +3869,18 @@ void SvNumberformat::ImpDigitFill( k = nStart; } -BOOL SvNumberformat::ImpNumberFill( String& sStr, // number string +sal_Bool SvNumberformat::ImpNumberFill( String& sStr, // number string double& rNumber, // number for "General" format xub_StrLen& k, // position within string - USHORT& j, // symbol index within format code - USHORT nIx, // subformat index + sal_uInt16& j, // symbol index within format code + sal_uInt16 nIx, // subformat index short eSymbolType ) // type of stop condition { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; k = sStr.Len(); // behind last digit const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); // no normal thousands separators if number divided by thousands - BOOL bDoThousands = (rInfo.nThousand == 0); + sal_Bool bDoThousands = (rInfo.nThousand == 0); short nType; while (j > 0 && (nType = rInfo.nTypeArray[j]) != eSymbolType ) { // rueckwaerts: @@ -3891,7 +3891,7 @@ BOOL SvNumberformat::ImpNumberFill( String& sStr, // number string { sStr.Insert( sal_Unicode(0x1B), k++ ); sStr.Insert(rInfo.sStrArray[j].GetChar(1),k); - bRes = TRUE; + bRes = sal_True; } break; case NF_SYMBOLTYPE_BLANK: @@ -3961,10 +3961,10 @@ BOOL SvNumberformat::ImpNumberFill( String& sStr, // number string return bRes; } -void SvNumberformat::GetFormatSpecialInfo(BOOL& bThousand, - BOOL& IsRed, - USHORT& nPrecision, - USHORT& nAnzLeading) const +void SvNumberformat::GetFormatSpecialInfo(sal_Bool& bThousand, + sal_Bool& IsRed, + sal_uInt16& nPrecision, + sal_uInt16& nAnzLeading) const { // as before: take info from nNumFor=0 for whole format (for dialog etc.) @@ -3976,13 +3976,13 @@ void SvNumberformat::GetFormatSpecialInfo(BOOL& bThousand, const Color* pColor = NumFor[1].GetColor(); if (fLimit1 == 0.0 && fLimit2 == 0.0 && pColor && (*pColor == rScan.GetRedColor())) - IsRed = TRUE; + IsRed = sal_True; else - IsRed = FALSE; + IsRed = sal_False; } -void SvNumberformat::GetNumForInfo( USHORT nNumFor, short& rScannedType, - BOOL& bThousand, USHORT& nPrecision, USHORT& nAnzLeading ) const +void SvNumberformat::GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType, + sal_Bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading ) const { // take info from a specified sub-format (for XML export) @@ -3999,9 +3999,9 @@ void SvNumberformat::GetNumForInfo( USHORT nNumFor, short& rScannedType, else { nAnzLeading = 0; - BOOL bStop = FALSE; - USHORT i = 0; - const USHORT nAnz = NumFor[nNumFor].GetCount(); + sal_Bool bStop = sal_False; + sal_uInt16 i = 0; + const sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); while (!bStop && i < nAnz) { short nType = rInfo.nTypeArray[i]; @@ -4014,18 +4014,18 @@ void SvNumberformat::GetNumForInfo( USHORT nNumFor, short& rScannedType, nAnzLeading++; } else if (nType == NF_SYMBOLTYPE_DECSEP || nType == NF_SYMBOLTYPE_EXP) - bStop = TRUE; + bStop = sal_True; i++; } } } -const String* SvNumberformat::GetNumForString( USHORT nNumFor, USHORT nPos, - BOOL bString /* = FALSE */ ) const +const String* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos, + sal_Bool bString /* = sal_False */ ) const { if ( nNumFor > 3 ) return NULL; - USHORT nAnz = NumFor[nNumFor].GetCount(); + sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); if ( !nAnz ) return NULL; if ( nPos == 0xFFFF ) @@ -4062,12 +4062,12 @@ const String* SvNumberformat::GetNumForString( USHORT nNumFor, USHORT nPos, return &NumFor[nNumFor].Info().sStrArray[nPos]; } -short SvNumberformat::GetNumForType( USHORT nNumFor, USHORT nPos, - BOOL bString /* = FALSE */ ) const +short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, + sal_Bool bString /* = sal_False */ ) const { if ( nNumFor > 3 ) return 0; - USHORT nAnz = NumFor[nNumFor].GetCount(); + sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); if ( !nAnz ) return 0; if ( nPos == 0xFFFF ) @@ -4103,15 +4103,15 @@ short SvNumberformat::GetNumForType( USHORT nNumFor, USHORT nPos, return NumFor[nNumFor].Info().nTypeArray[nPos]; } -BOOL SvNumberformat::IsNegativeWithoutSign() const +sal_Bool SvNumberformat::IsNegativeWithoutSign() const { if ( IsNegativeRealNegative() ) { - const String* pStr = GetNumForString( 1, 0, TRUE ); + const String* pStr = GetNumForString( 1, 0, sal_True ); if ( pStr ) return !HasStringNegativeSign( *pStr ); } - return FALSE; + return sal_False; } BOOL SvNumberformat::IsNegativeInBracket() const @@ -4136,8 +4136,8 @@ DateFormat SvNumberformat::GetDateOrder() const if ( (eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE ) { short const * const pType = NumFor[0].Info().nTypeArray; - USHORT nAnz = NumFor[0].GetCount(); - for ( USHORT j=0; j<nAnz; j++ ) + sal_uInt16 nAnz = NumFor[0].GetCount(); + for ( sal_uInt16 j=0; j<nAnz; j++ ) { switch ( pType[j] ) { @@ -4176,9 +4176,9 @@ sal_uInt32 SvNumberformat::GetExactDateOrder() const return nRet; } short const * const pType = NumFor[0].Info().nTypeArray; - USHORT nAnz = NumFor[0].GetCount(); + sal_uInt16 nAnz = NumFor[0].GetCount(); int nShift = 0; - for ( USHORT j=0; j<nAnz && nShift < 3; j++ ) + for ( sal_uInt16 j=0; j<nAnz && nShift < 3; j++ ) { switch ( pType[j] ) { @@ -4218,7 +4218,7 @@ void SvNumberformat::GetConditions( SvNumberformatLimitOps& rOper1, double& rVal rVal2 = fLimit2; } -Color* SvNumberformat::GetColor( USHORT nNumFor ) const +Color* SvNumberformat::GetColor( sal_uInt16 nNumFor ) const { if ( nNumFor > 3 ) return NULL; @@ -4264,10 +4264,10 @@ void lcl_SvNumberformat_AddLimitStringImpl( String& rStr, String SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, const LocaleDataWrapper& rLocWrp, - BOOL bDontQuote ) const + sal_Bool bDontQuote ) const { String aStr; - BOOL bDefault[4]; + sal_Bool bDefault[4]; // 1 subformat matches all if no condition specified, bDefault[0] = ( NumFor[1].GetCount() == 0 && eOp1 == NUMBERFORMAT_OP_NO ); // with 2 subformats [>=0];[<0] is implied if no condition specified @@ -4279,26 +4279,26 @@ String SvNumberformat::GetMappedFormatstring( bDefault[2] = ( !bDefault[0] && !bDefault[1] && eOp1 == NUMBERFORMAT_OP_GT && fLimit1 == 0.0 && eOp2 == NUMBERFORMAT_OP_LT && fLimit2 == 0.0 ); - BOOL bDefaults = bDefault[0] || bDefault[1] || bDefault[2]; + sal_Bool bDefaults = bDefault[0] || bDefault[1] || bDefault[2]; // from now on bDefault[] values are used to append empty subformats at the end - bDefault[3] = FALSE; + bDefault[3] = sal_False; if ( !bDefaults ) { // conditions specified if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 == NUMBERFORMAT_OP_NO ) - bDefault[0] = bDefault[1] = TRUE; // [];x + bDefault[0] = bDefault[1] = sal_True; // [];x else if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 != NUMBERFORMAT_OP_NO && NumFor[2].GetCount() == 0 ) - bDefault[0] = bDefault[1] = bDefault[2] = bDefault[3] = TRUE; // [];[];; + bDefault[0] = bDefault[1] = bDefault[2] = bDefault[3] = sal_True; // [];[];; // nothing to do if conditions specified for every subformat } else if ( bDefault[0] ) - bDefault[0] = FALSE; // a single unconditional subformat is never delimited + bDefault[0] = sal_False; // a single unconditional subformat is never delimited else { if ( bDefault[2] && NumFor[2].GetCount() == 0 && NumFor[1].GetCount() > 0 ) - bDefault[3] = TRUE; // special cases x;x;; and ;x;; + bDefault[3] = sal_True; // special cases x;x;; and ;x;; for ( int i=0; i<3 && !bDefault[i]; ++i ) - bDefault[i] = TRUE; + bDefault[i] = sal_True; } int nSem = 0; // needed ';' delimiters int nSub = 0; // subformats delimited so far @@ -4350,13 +4350,13 @@ String SvNumberformat::GetMappedFormatstring( aPrefix += 't'; // must be lowercase, otherwise taken as literal } - USHORT nAnz = NumFor[n].GetCount(); + sal_uInt16 nAnz = NumFor[n].GetCount(); if ( nSem && (nAnz || aPrefix.Len()) ) { for ( ; nSem; --nSem ) aStr += ';'; for ( ; nSub <= n; ++nSub ) - bDefault[nSub] = FALSE; + bDefault[nSub] = sal_False; } if ( aPrefix.Len() ) @@ -4366,7 +4366,7 @@ String SvNumberformat::GetMappedFormatstring( { const short* pType = NumFor[n].Info().nTypeArray; const String* pStr = NumFor[n].Info().sStrArray; - for ( USHORT j=0; j<nAnz; j++ ) + for ( sal_uInt16 j=0; j<nAnz; j++ ) { if ( 0 <= pType[j] && pType[j] < NF_KEYWORD_ENTRIES_COUNT ) { @@ -4424,7 +4424,7 @@ String SvNumberformat::GetMappedFormatstring( } String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum& rNum, - sal_Int32 nVal, USHORT nMinDigits ) const + sal_Int32 nVal, sal_uInt16 nMinDigits ) const { String aStr; if ( nMinDigits ) @@ -4469,7 +4469,7 @@ void SvNumberformat::ImpTransliterateImpl( String& rStr, void SvNumberformat::GetNatNumXml( com::sun::star::i18n::NativeNumberXmlAttributes& rAttr, - USHORT nNumFor ) const + sal_uInt16 nNumFor ) const { if ( nNumFor <= 3 ) { @@ -4489,27 +4489,27 @@ void SvNumberformat::GetNatNumXml( } // static -BOOL SvNumberformat::HasStringNegativeSign( const String& rStr ) +sal_Bool SvNumberformat::HasStringNegativeSign( const String& rStr ) { // fuer Sign muss '-' am Anfang oder am Ende des TeilStrings sein (Blanks ignored) xub_StrLen nLen = rStr.Len(); if ( !nLen ) - return FALSE; + return sal_False; const sal_Unicode* const pBeg = rStr.GetBuffer(); const sal_Unicode* const pEnd = pBeg + nLen; register const sal_Unicode* p = pBeg; do { // Anfang if ( *p == '-' ) - return TRUE; + return sal_True; } while ( *p == ' ' && ++p < pEnd ); p = pEnd - 1; do { // Ende if ( *p == '-' ) - return TRUE; + return sal_True; } while ( *p == ' ' && pBeg < --p ); - return FALSE; + return sal_False; } // static @@ -4567,9 +4567,9 @@ void SvNumberformat::EraseCommentBraces( String& rStr ) void SvNumberformat::EraseComment( String& rStr ) { register const sal_Unicode* p = rStr.GetBuffer(); - BOOL bInString = FALSE; - BOOL bEscaped = FALSE; - BOOL bFound = FALSE; + sal_Bool bInString = sal_False; + sal_Bool bEscaped = sal_False; + sal_Bool bFound = sal_False; xub_StrLen nPos = 0; while ( !bFound && *p ) { @@ -4585,14 +4585,14 @@ void SvNumberformat::EraseComment( String& rStr ) case '{' : if ( !bEscaped && !bInString ) { - bFound = TRUE; + bFound = sal_True; nPos = sal::static_int_cast< xub_StrLen >( p - rStr.GetBuffer()); } break; } if ( bEscaped && *p != '\\' ) - bEscaped = FALSE; + bEscaped = sal_False; ++p; } if ( bFound ) @@ -4600,31 +4600,31 @@ void SvNumberformat::EraseComment( String& rStr ) } // static -BOOL SvNumberformat::IsInQuote( const String& rStr, xub_StrLen nPos, +sal_Bool SvNumberformat::IsInQuote( const String& rStr, xub_StrLen nPos, sal_Unicode cQuote, sal_Unicode cEscIn, sal_Unicode cEscOut ) { xub_StrLen nLen = rStr.Len(); if ( nPos >= nLen ) - return FALSE; + return sal_False; register const sal_Unicode* p0 = rStr.GetBuffer(); register const sal_Unicode* p = p0; register const sal_Unicode* p1 = p0 + nPos; - BOOL bQuoted = FALSE; + sal_Bool bQuoted = sal_False; while ( p <= p1 ) { if ( *p == cQuote ) { if ( p == p0 ) - bQuoted = TRUE; + bQuoted = sal_True; else if ( bQuoted ) { if ( *(p-1) != cEscIn ) - bQuoted = FALSE; + bQuoted = sal_False; } else { if ( *(p-1) != cEscOut ) - bQuoted = TRUE; + bQuoted = sal_True; } } p++; @@ -4657,12 +4657,12 @@ xub_StrLen SvNumberformat::GetQuoteEnd( const String& rStr, xub_StrLen nPos, return nLen; // String Ende } -USHORT SvNumberformat::ImpGetNumForStringElementCount( USHORT nNumFor ) const +sal_uInt16 SvNumberformat::ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const { - USHORT nCnt = 0; - USHORT nAnz = NumFor[nNumFor].GetCount(); + sal_uInt16 nCnt = 0; + sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); short const * const pType = NumFor[nNumFor].Info().nTypeArray; - for ( USHORT j=0; j<nAnz; ++j ) + for ( sal_uInt16 j=0; j<nAnz; ++j ) { switch ( pType[j] ) { diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index b6e6bee7553d..b7077b00e134 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -44,7 +44,7 @@ #define _ZFORSCAN_CXX #include "zforscan.hxx" #undef _ZFORSCAN_CXX -#include "nfsymbol.hxx" +#include <svl/nfsymbol.hxx> using namespace svt; const sal_Unicode cNonBreakingSpace = 0xA0; @@ -80,7 +80,7 @@ namespace ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP ) { pFormatter = pFormatterP; - bConvertMode = FALSE; + bConvertMode = sal_False; //! All keywords MUST be UPPERCASE! sKeyword[NF_KEY_E].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "E" ) ); // Exponent sKeyword[NF_KEY_AMPM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "AM/PM" ) ); // AM/PM @@ -96,8 +96,8 @@ ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP ) sKeyword[NF_KEY_NNNN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "NNNN" ) ); // Day of week long incl. separator sKeyword[NF_KEY_WW].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "WW" ) ); // Week of year sKeyword[NF_KEY_CCC].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "CCC" ) ); // Currency abbreviation - bKeywordsNeedInit = TRUE; // locale dependent keywords - bCompatCurNeedInit = TRUE; // locale dependent compatibility currency strings + bKeywordsNeedInit = sal_True; // locale dependent keywords + bCompatCurNeedInit = sal_True; // locale dependent compatibility currency strings StandardColor[0] = Color(COL_BLACK); StandardColor[1] = Color(COL_LIGHTBLUE); @@ -125,8 +125,8 @@ ImpSvNumberformatScan::~ImpSvNumberformatScan() void ImpSvNumberformatScan::ChangeIntl() { - bKeywordsNeedInit = TRUE; - bCompatCurNeedInit = TRUE; + bKeywordsNeedInit = sal_True; + bCompatCurNeedInit = sal_True; // may be initialized by InitSpecialKeyword() sKeyword[NF_KEY_TRUE].Erase(); sKeyword[NF_KEY_FALSE].Erase(); @@ -143,7 +143,7 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const if ( !sKeyword[NF_KEY_TRUE].Len() ) { DBG_ERRORFILE( "InitSpecialKeyword: TRUE_WORD?" ); - ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "TRUE" ) ); + ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "sal_True" ) ); } break; case NF_KEY_FALSE : @@ -153,7 +153,7 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const if ( !sKeyword[NF_KEY_FALSE].Len() ) { DBG_ERRORFILE( "InitSpecialKeyword: FALSE_WORD?" ); - ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "FALSE" ) ); + ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "sal_False" ) ); } break; default: @@ -168,7 +168,7 @@ void ImpSvNumberformatScan::InitCompatCur() const pFormatter->GetCompatibilityCurrency( pThis->sCurSymbol, pThis->sCurAbbrev ); // currency symbol upper case pThis->sCurString = pFormatter->GetCharClass()->upper( sCurSymbol ); - bCompatCurNeedInit = FALSE; + bCompatCurNeedInit = sal_False; } void ImpSvNumberformatScan::InitKeywords() const @@ -176,7 +176,7 @@ void ImpSvNumberformatScan::InitKeywords() const if ( !bKeywordsNeedInit ) return ; ((ImpSvNumberformatScan*)this)->SetDependentKeywords(); - bKeywordsNeedInit = FALSE; + bKeywordsNeedInit = sal_False; } /** Extract the name of General, Standard, Whatever, ignoring leading modifiers @@ -449,7 +449,7 @@ void ImpSvNumberformatScan::SetDependentKeywords() InitCompatCur(); } -void ImpSvNumberformatScan::ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear) +void ImpSvNumberformatScan::ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear) { if ( pNullDate ) *pNullDate = Date(nDay, nMonth, nYear); @@ -507,7 +507,7 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr) { long nIndex = sString.ToInt32(); if (nIndex > 0 && nIndex <= 64) - pResult = pFormatter->GetUserDefColor((USHORT)nIndex-1); + pResult = pFormatter->GetUserDefColor((sal_uInt16)nIndex-1); } } } @@ -537,7 +537,7 @@ short ImpSvNumberformatScan::GetKeyWord( const String& sSymbol, xub_StrLen nPos return NF_KEY_GENERAL; //! MUST be a reverse search to find longer strings first short i = NF_KEYWORD_ENTRIES_COUNT-1; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; for ( ; i > NF_KEY_LASTKEYWORD_SO5; --i ) { bFound = sString.Search(pKeyword[i]) == 0; @@ -741,7 +741,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, short nTmpType = GetKeyWord( rStr, nPos-1 ); if ( nTmpType ) { - BOOL bCurrency = FALSE; + sal_Bool bCurrency = sal_False; // "Automatic" currency may start with keyword, // like "R" (Rand) and 'R' (era) if ( nCurrPos != STRING_NOTFOUND && @@ -751,7 +751,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, String aTest( rStr.Copy( nPos-1, sCurString.Len() ) ); pChrCls->toUpper( aTest ); if ( aTest == sCurString ) - bCurrency = TRUE; + bCurrency = sal_True; } if ( bCurrency ) { @@ -831,7 +831,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, } else { - BOOL bDontStop = FALSE; + sal_Bool bDontStop = sal_False; switch (cToken) { case '/': // AM/PM, A/P @@ -847,7 +847,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr, && (rStr.GetChar(nPos+1) == 'M' || rStr.GetChar(nPos+1) == 'm'))) ) { sSymbol += cToken; - bDontStop = TRUE; + bDontStop = sal_True; } } } @@ -916,7 +916,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString) } } nAnzStrings = 0; - BOOL bStar = FALSE; // wird bei '*'Detektion gesetzt + sal_Bool bStar = sal_False; // wird bei '*'Detektion gesetzt Reset(); xub_StrLen nPos = 0; @@ -929,7 +929,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString) if (bStar) return nPos; // Fehler: doppelter '*' else - bStar = TRUE; + bStar = sal_True; } nAnzStrings++; } @@ -937,7 +937,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString) return 0; // 0 => ok } -void ImpSvNumberformatScan::SkipStrings(USHORT& i, xub_StrLen& nPos) +void ImpSvNumberformatScan::SkipStrings(sal_uInt16& i, xub_StrLen& nPos) { while (i < nAnzStrings && ( nTypeArray[i] == NF_SYMBOLTYPE_STRING || nTypeArray[i] == NF_SYMBOLTYPE_BLANK @@ -948,7 +948,7 @@ void ImpSvNumberformatScan::SkipStrings(USHORT& i, xub_StrLen& nPos) } } -USHORT ImpSvNumberformatScan::PreviousKeyword(USHORT i) +sal_uInt16 ImpSvNumberformatScan::PreviousKeyword(sal_uInt16 i) { short res = 0; if (i > 0 && i < nAnzStrings) @@ -962,7 +962,7 @@ USHORT ImpSvNumberformatScan::PreviousKeyword(USHORT i) return res; } -USHORT ImpSvNumberformatScan::NextKeyword(USHORT i) +sal_uInt16 ImpSvNumberformatScan::NextKeyword(sal_uInt16 i) { short res = 0; if (i < nAnzStrings-1) @@ -976,7 +976,7 @@ USHORT ImpSvNumberformatScan::NextKeyword(USHORT i) return res; } -short ImpSvNumberformatScan::PreviousType( USHORT i ) +short ImpSvNumberformatScan::PreviousType( sal_uInt16 i ) { if ( i > 0 && i < nAnzStrings ) { @@ -989,7 +989,7 @@ short ImpSvNumberformatScan::PreviousType( USHORT i ) return 0; } -sal_Unicode ImpSvNumberformatScan::PreviousChar(USHORT i) +sal_Unicode ImpSvNumberformatScan::PreviousChar(sal_uInt16 i) { sal_Unicode res = ' '; if (i > 0 && i < nAnzStrings) @@ -1006,7 +1006,7 @@ sal_Unicode ImpSvNumberformatScan::PreviousChar(USHORT i) return res; } -sal_Unicode ImpSvNumberformatScan::NextChar(USHORT i) +sal_Unicode ImpSvNumberformatScan::NextChar(sal_uInt16 i) { sal_Unicode res = ' '; if (i < nAnzStrings-1) @@ -1024,28 +1024,28 @@ sal_Unicode ImpSvNumberformatScan::NextChar(USHORT i) return res; } -BOOL ImpSvNumberformatScan::IsLastBlankBeforeFrac(USHORT i) +sal_Bool ImpSvNumberformatScan::IsLastBlankBeforeFrac(sal_uInt16 i) { - BOOL res = TRUE; + sal_Bool res = sal_True; if (i < nAnzStrings-1) { - BOOL bStop = FALSE; + sal_Bool bStop = sal_False; i++; while (i < nAnzStrings-1 && !bStop) { i++; if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL && sStrArray[i].GetChar(0) == '/') - bStop = TRUE; + bStop = sal_True; else if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL && sStrArray[i].GetChar(0) == ' ') - res = FALSE; + res = sal_False; } if (!bStop) // kein '/' - res = FALSE; + res = sal_False; } else - res = FALSE; // kein '/' mehr + res = sal_False; // kein '/' mehr return res; } @@ -1064,24 +1064,24 @@ void ImpSvNumberformatScan::Reset() #endif eScannedType = NUMBERFORMAT_UNDEFINED; nRepPos = 0; - bExp = FALSE; - bThousand = FALSE; + bExp = sal_False; + bThousand = sal_False; nThousand = 0; - bDecSep = FALSE; + bDecSep = sal_False; nDecPos = -1; - nExpPos = (USHORT) -1; - nBlankPos = (USHORT) -1; + nExpPos = (sal_uInt16) -1; + nBlankPos = (sal_uInt16) -1; nCntPre = 0; nCntPost = 0; nCntExp = 0; - bFrac = FALSE; - bBlank = FALSE; + bFrac = sal_False; + bBlank = sal_False; nNatNumModifier = 0; } -BOOL ImpSvNumberformatScan::Is100SecZero( USHORT i, BOOL bHadDecSep ) +sal_Bool ImpSvNumberformatScan::Is100SecZero( sal_uInt16 i, sal_Bool bHadDecSep ) { - USHORT nIndexPre = PreviousKeyword( i ); + sal_uInt16 nIndexPre = PreviousKeyword( i ); return (nIndexPre == NF_KEY_S || nIndexPre == NF_KEY_SS) && (bHadDecSep // S, SS ',' || (i>0 && nTypeArray[i-1] == NF_SYMBOLTYPE_STRING)); @@ -1093,9 +1093,9 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) const LocaleDataWrapper* pLoc = pFormatter->GetLocaleData(); xub_StrLen nPos = 0; - USHORT i = 0; + sal_uInt16 i = 0; short eNewType; - BOOL bMatchBracket = FALSE; + sal_Bool bMatchBracket = sal_False; bool bHaveGeneral = false; // if General/Standard encountered SkipStrings(i, nPos); @@ -1119,8 +1119,8 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) case NF_KEY_M: // M case NF_KEY_MM: // MM { // minute or month - USHORT nIndexPre = PreviousKeyword(i); - USHORT nIndexNex = NextKeyword(i); + sal_uInt16 nIndexPre = PreviousKeyword(i); + sal_uInt16 nIndexNex = NextKeyword(i); sal_Unicode cChar = PreviousChar(i); if (nIndexPre == NF_KEY_H || // H nIndexPre == NF_KEY_HH || // HH @@ -1187,7 +1187,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) { if ( Is100SecZero( i, bDecSep ) ) { - bDecSep = TRUE; // subsequent 0's + bDecSep = sal_True; // subsequent 0's eNewType = NUMBERFORMAT_TIME; } else @@ -1210,18 +1210,18 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) sStrArray[i+1].GetChar(0) == '$' ) { // as of SV_NUMBERFORMATTER_VERSION_NEW_CURR eNewType = NUMBERFORMAT_CURRENCY; - bMatchBracket = TRUE; + bMatchBracket = sal_True; } else if ( i < nAnzStrings-1 && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1].GetChar(0) == '~' ) { // as of SV_NUMBERFORMATTER_VERSION_CALENDAR eNewType = NUMBERFORMAT_DATE; - bMatchBracket = TRUE; + bMatchBracket = sal_True; } else { - USHORT nIndexNex = NextKeyword(i); + sal_uInt16 nIndexNex = NextKeyword(i); if (nIndexNex == NF_KEY_H || // H nIndexNex == NF_KEY_HH || // HH nIndexNex == NF_KEY_M || // M @@ -1239,7 +1239,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) break; default: if ( sStrArray[i] == pLoc->getTime100SecSep() ) - bDecSep = TRUE; // for SS,0 + bDecSep = sal_True; // for SS,0 eNewType = NUMBERFORMAT_UNDEFINED; break; } @@ -1376,7 +1376,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) { if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL && sStrArray[i].GetChar(0) == ']' ) - bMatchBracket = FALSE; + bMatchBracket = sal_False; else nTypeArray[i] = NF_SYMBOLTYPE_STRING; nPos = nPos + sStrArray[i].Len(); @@ -1396,7 +1396,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) return 0; // Alles ok } -bool ImpSvNumberformatScan::InsertSymbol( USHORT & nPos, svt::NfSymbolType eType, const String& rStr ) +bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType eType, const String& rStr ) { if (nAnzStrings >= NF_MAX_FORMAT_SYMBOLS || nPos > nAnzStrings) return false; @@ -1417,8 +1417,8 @@ bool ImpSvNumberformatScan::InsertSymbol( USHORT & nPos, svt::NfSymbolType eType return true; } -int ImpSvNumberformatScan::FinalScanGetCalendar( xub_StrLen& nPos, USHORT& i, - USHORT& rAnzResStrings ) +int ImpSvNumberformatScan::FinalScanGetCalendar( xub_StrLen& nPos, sal_uInt16& i, + sal_uInt16& rAnzResStrings ) { if ( sStrArray[i].GetChar(0) == '[' && i < nAnzStrings-1 && @@ -1496,10 +1496,10 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) const CharClass* pChrCls = pFormatter->GetCharClass(); xub_StrLen nPos = 0; // error correction position - USHORT i = 0; // symbol loop counter - USHORT nCounter = 0; // counts digits + sal_uInt16 i = 0; // symbol loop counter + sal_uInt16 nCounter = 0; // counts digits nAnzResStrings = nAnzStrings; // counts remaining symbols - bDecSep = FALSE; // reset in case already used in TypeCheck + bDecSep = sal_False; // reset in case already used in TypeCheck bool bThaiT = false; // Thai T NatNum modifier present switch (eScannedType) @@ -1581,7 +1581,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if (bExp) // doppelt return nPos; - bExp = TRUE; + bExp = sal_True; nExpPos = i; if (bDecSep) nCntPost = nCounter; @@ -1597,7 +1597,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if (bDecSep && nCounter > 0) // Nachkommastellen return nPos; // Fehler - bBlank = TRUE; + bBlank = sal_True; nBlankPos = i; nCntPre = nCounter; nCounter = 0; @@ -1613,7 +1613,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) sStrArray[i].GetChar(0) <= '9') { rtl::OUString sDiv; - USHORT j = i; + sal_uInt16 j = i; while(j < nAnzStrings) sDiv += sStrArray[j++]; if (rtl::OUString::valueOf(sDiv.toInt32()) == sDiv) @@ -1742,7 +1742,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { nPos = nPos + sStrArray[i].Len(); if (!bThousand) // only once - bThousand = TRUE; + bThousand = sal_True; // Eat it, will be reinserted at proper // grouping positions further down. nTypeArray[i] = NF_SYMBOLTYPE_EMPTY; @@ -1755,7 +1755,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { // #,,,, if ( StringEqualsChar( sOldThousandSep, ' ' ) ) { // strange, those French.. - BOOL bFirst = TRUE; + sal_Bool bFirst = sal_True; String& rStr = sStrArray[i]; // set a hard Non-Breaking Space or ConvertMode const String& rSepF = pFormatter->GetNumThousandSep(); @@ -1767,7 +1767,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) nPos = nPos + sStrArray[i].Len(); if ( bFirst ) { - bFirst = FALSE; + bFirst = sal_False; rStr = rSepF; nTypeArray[i] = NF_SYMBOLTYPE_THSEP; } @@ -1799,7 +1799,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( bFirst ) { - bFirst = FALSE; + bFirst = sal_False; rStr = rSepF; nTypeArray[i] = NF_SYMBOLTYPE_THSEP; } @@ -1876,7 +1876,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) nPos = nPos + sStrArray[i].Len(); nTypeArray[i] = NF_SYMBOLTYPE_DECSEP; sStrArray[i] = pFormatter->GetNumDecimalSep(); - bDecSep = TRUE; + bDecSep = sal_True; nDecPos = i; nCntPre = nCounter; nCounter = 0; @@ -1894,7 +1894,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { // or behind / if (bDecSep && nCounter > 0)// dec. return nPos; // error - bBlank = TRUE; + bBlank = sal_True; nBlankPos = i; nCntPre = nCounter; nCounter = 0; @@ -1931,7 +1931,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) return nPos ? nPos : 1; // /? not allowed else if (!bFrac || (bDecSep && nCounter > 0)) { - bFrac = TRUE; + bFrac = sal_True; nCntPost = nCounter; nCounter = 0; nTypeArray[i] = NF_SYMBOLTYPE_FRAC; @@ -1969,7 +1969,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) String& rStr = sStrArray[i]; String* pStr = &sStrArray[i]; nTypeArray[i] = NF_SYMBOLTYPE_CURRENCY; // wandeln - BOOL bHadDash = FALSE; + sal_Bool bHadDash = sal_False; i++; while ( i < nAnzStrings && sStrArray[i].GetChar(0) != ']' ) @@ -1985,7 +1985,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( sStrArray[i].GetChar(0) == '-' ) { - bHadDash = TRUE; + bHadDash = sal_True; pStr = &sStrArray[i]; nTypeArray[i] = NF_SYMBOLTYPE_CURREXT; } @@ -2066,7 +2066,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) } if (bThousand) // Expansion of grouping separators { - USHORT nMaxPos; + sal_uInt16 nMaxPos; if (bFrac) { if (bBlank) @@ -2243,7 +2243,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( Is100SecZero( i, bDecSep ) ) { - bDecSep = TRUE; + bDecSep = sal_True; nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; String& rStr = sStrArray[i]; i++; @@ -2271,7 +2271,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if (bThousand) // doppelt return nPos; - bThousand = TRUE; // bei Time frei + bThousand = sal_True; // bei Time frei sal_Unicode cChar = pChrCls->upper( NextChar(i) ).GetChar(0); if ( cChar == cOldKeyH ) nThousand = 1; // H @@ -2304,7 +2304,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) } else if ( sStrArray[i] == sOldTime100SecSep ) { - bDecSep = TRUE; + bDecSep = sal_True; nTypeArray[i] = NF_SYMBOLTYPE_TIME100SECSEP; if ( bConvertMode ) sStrArray[i] = pLoc->getTime100SecSep(); @@ -2337,7 +2337,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NF_KEY_AMPM: // AM/PM case NF_KEY_AP: // A/P { - bExp = TRUE; // missbraucht fuer A/P + bExp = sal_True; // missbraucht fuer A/P sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT nPos = nPos + sStrArray[i].Len(); i++; @@ -2374,7 +2374,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) break; // of NUMBERFORMAT_TIME case NUMBERFORMAT_DATETIME: { - BOOL bTimePart = FALSE; + sal_Bool bTimePart = sal_False; while (i < nAnzStrings) { switch (nTypeArray[i]) @@ -2412,7 +2412,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { if ( bTimePart && Is100SecZero( i, bDecSep ) ) { - bDecSep = TRUE; + bDecSep = sal_True; nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; String& rStr = sStrArray[i]; i++; @@ -2449,7 +2449,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) } else if ( sStrArray[i] == sOldTime100SecSep ) { - bDecSep = TRUE; + bDecSep = sal_True; nTypeArray[i] = NF_SYMBOLTYPE_TIME100SECSEP; if ( bConvertMode ) sStrArray[i] = pLoc->getTime100SecSep(); @@ -2477,8 +2477,8 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NF_KEY_AMPM: // AM/PM case NF_KEY_AP: // A/P { - bTimePart = TRUE; - bExp = TRUE; // missbraucht fuer A/P + bTimePart = sal_True; + bExp = sal_True; // missbraucht fuer A/P sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT nPos = nPos + sStrArray[i].Len(); i++; @@ -2490,7 +2490,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NF_KEY_HH: // HH case NF_KEY_S: // S case NF_KEY_SS: // SS - bTimePart = TRUE; + bTimePart = sal_True; sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT nPos = nPos + sStrArray[i].Len(); i++; @@ -2521,7 +2521,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NF_KEY_GGG : // GGG case NF_KEY_R : // R case NF_KEY_RR : // RR - bTimePart = FALSE; + bTimePart = sal_False; sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT nPos = nPos + sStrArray[i].Len(); i++; @@ -2574,7 +2574,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) sOldCurString.GetChar(0) ) { String aTmp( sStrArray[i] ); - USHORT j = i + 1; + sal_uInt16 j = i + 1; while ( aTmp.Len() < sOldCurSymbol.Len() && j < nAnzStrings && nTypeArray[j] == NF_SYMBOLTYPE_STRING ) @@ -2619,7 +2619,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { xub_StrLen nStringPos = rString.Len(); xub_StrLen nArrPos = 0; - USHORT iPos = i; + sal_uInt16 iPos = i; do { if (sStrArray[i].Len() == 2 && @@ -2785,7 +2785,7 @@ xub_StrLen ImpSvNumberformatScan::ScanFormat( String& rString, String& rComment // res = 0 => Format ok } -void ImpSvNumberformatScan::CopyInfo(ImpSvNumberformatInfo* pInfo, USHORT nAnz) +void ImpSvNumberformatScan::CopyInfo(ImpSvNumberformatInfo* pInfo, sal_uInt16 nAnz) { size_t i,j; j = 0; diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index 1a46b06d697d..6ea2055efe59 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -33,7 +33,7 @@ #include <i18npool/lang.h> #include <tools/color.hxx> #include <svl/nfkeytab.hxx> -#include "nfsymbol.hxx" +#include <svl/nfsymbol.hxx> class SvNumberFormatter; struct ImpSvNumberformatInfo; @@ -43,7 +43,7 @@ const size_t NF_MAX_FORMAT_SYMBOLS = 100; const size_t NF_MAX_DEFAULT_COLORS = 10; // Hack: nThousand==1000 => "Default" occurs in format string -const USHORT FLAG_STANDARD_IN_FORMAT = 1000; +const sal_uInt16 FLAG_STANDARD_IN_FORMAT = 1000; class ImpSvNumberformatScan { @@ -53,15 +53,15 @@ public: ~ImpSvNumberformatScan(); void ChangeIntl(); // tauscht Keywords aus - void ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear); + void ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear); // tauscht Referenzdatum aus void ChangeStandardPrec(sal_uInt16 nPrec); // tauscht Standardprecision aus xub_StrLen ScanFormat( String& rString, String& rComment ); // Aufruf der Scan-Analyse void CopyInfo(ImpSvNumberformatInfo* pInfo, - USHORT nAnz); // Kopiert die FormatInfo - USHORT GetAnzResStrings() const { return nAnzResStrings; } + sal_uInt16 nAnz); // Kopiert die FormatInfo + sal_uInt16 GetAnzResStrings() const { return nAnzResStrings; } const CharClass& GetChrCls() const { return *pFormatter->GetCharClass(); } const LocaleDataWrapper& GetLoc() const { return *pFormatter->GetLocaleData(); } @@ -73,7 +73,7 @@ public: InitKeywords(); return sKeyword; } - // Keywords used in output like TRUE and FALSE + // Keywords used in output like sal_True and sal_False const String& GetSpecialKeyword( NfKeywordIndex eIdx ) const { if ( !sKeyword[eIdx].Len() ) @@ -124,18 +124,18 @@ public: } void SetConvertMode(LanguageType eTmpLge, LanguageType eNewLge, - BOOL bSystemToSystem = FALSE ) + sal_Bool bSystemToSystem = sal_False ) { - bConvertMode = TRUE; + bConvertMode = sal_True; eNewLnge = eNewLge; eTmpLnge = eTmpLge; bConvertSystemToSystem = bSystemToSystem; } - void SetConvertMode(BOOL bMode) { bConvertMode = bMode; } + void SetConvertMode(sal_Bool bMode) { bConvertMode = bMode; } // Veraendert nur die Bool-Variable // (zum temporaeren Unterbrechen des // Convert-Modus) - BOOL GetConvertMode() const { return bConvertMode; } + sal_Bool GetConvertMode() const { return bConvertMode; } LanguageType GetNewLnge() const { return eNewLnge; } // Lesezugriff auf ConvertMode // und Konvertierungsland/Spr. @@ -144,9 +144,9 @@ public: // und Ausgangsland/Spr. /// get Thai T speciality - BYTE GetNatNumModifier() const { return nNatNumModifier; } + sal_uInt8 GetNatNumModifier() const { return nNatNumModifier; } /// set Thai T speciality - void SetNatNumModifier( BYTE n ) { nNatNumModifier = n; } + void SetNatNumModifier( sal_uInt8 n ) { nNatNumModifier = n; } SvNumberFormatter* GetNumberformatter() { return pFormatter; } // Zugriff auf Formatierer @@ -165,42 +165,42 @@ private: // ---- privater Teil String sStrArray[NF_MAX_FORMAT_SYMBOLS]; // Array der Symbole short nTypeArray[NF_MAX_FORMAT_SYMBOLS]; // Array der Infos // externe Infos: - USHORT nAnzResStrings; // Anzahl der Ergebnissymbole + sal_uInt16 nAnzResStrings; // Anzahl der Ergebnissymbole #if !(defined SOLARIS && defined X86) short eScannedType; // Typ gemaess Scan #else int eScannedType; // wg. Optimierung #endif - BOOL bThousand; // Mit Tausenderpunkt - USHORT nThousand; // Zaehlt ....-Folgen - USHORT nCntPre; // Zaehlt Vorkommastellen - USHORT nCntPost; // Zaehlt Nachkommastellen - USHORT nCntExp; // Zaehlt Exp.Stellen, AM/PM + sal_Bool bThousand; // Mit Tausenderpunkt + sal_uInt16 nThousand; // Zaehlt ....-Folgen + sal_uInt16 nCntPre; // Zaehlt Vorkommastellen + sal_uInt16 nCntPost; // Zaehlt Nachkommastellen + sal_uInt16 nCntExp; // Zaehlt Exp.Stellen, AM/PM // interne Infos: - USHORT nAnzStrings; // Anzahl der Symbole - USHORT nRepPos; // Position eines '*' - USHORT nExpPos; // interne Position des E - USHORT nBlankPos; // interne Position des Blank + sal_uInt16 nAnzStrings; // Anzahl der Symbole + sal_uInt16 nRepPos; // Position eines '*' + sal_uInt16 nExpPos; // interne Position des E + sal_uInt16 nBlankPos; // interne Position des Blank short nDecPos; // interne Pos. des , - BOOL bExp; // wird bei Lesen des E gesetzt - BOOL bFrac; // wird bei Lesen des / gesetzt - BOOL bBlank; // wird bei ' '(Fraction) ges. - BOOL bDecSep; // Wird beim ersten , gesetzt - mutable BOOL bKeywordsNeedInit; // Locale dependent keywords need to be initialized - mutable BOOL bCompatCurNeedInit; // Locale dependent compatibility currency need to be initialized + sal_Bool bExp; // wird bei Lesen des E gesetzt + sal_Bool bFrac; // wird bei Lesen des / gesetzt + sal_Bool bBlank; // wird bei ' '(Fraction) ges. + sal_Bool bDecSep; // Wird beim ersten , gesetzt + mutable sal_Bool bKeywordsNeedInit; // Locale dependent keywords need to be initialized + mutable sal_Bool bCompatCurNeedInit; // Locale dependent compatibility currency need to be initialized String sCurSymbol; // Currency symbol for compatibility format codes String sCurString; // Currency symbol in upper case String sCurAbbrev; // Currency abbreviation String sErrStr; // String fuer Fehlerausgaben - BOOL bConvertMode; // Wird im Convert-Mode gesetzt + sal_Bool bConvertMode; // Wird im Convert-Mode gesetzt // Land/Sprache, in die der LanguageType eNewLnge; // gescannte String konvertiert // wird (fuer Excel Filter) // Land/Sprache, aus der der LanguageType eTmpLnge; // gescannte String konvertiert // wird (fuer Excel Filter) - BOOL bConvertSystemToSystem; // Whether the conversion is + sal_Bool bConvertSystemToSystem; // Whether the conversion is // from one system locale to // another system locale (in // this case the automatic @@ -209,7 +209,7 @@ private: // ---- privater Teil xub_StrLen nCurrPos; // Position des Waehrungssymbols - BYTE nNatNumModifier; // Thai T speciality + sal_uInt8 nNatNumModifier; // Thai T speciality void InitKeywords() const; void InitSpecialKeyword( NfKeywordIndex eIdx ) const; @@ -218,32 +218,32 @@ private: // ---- privater Teil #ifdef _ZFORSCAN_CXX // ----- private Methoden ----- void SetDependentKeywords(); // Setzt die Sprachabh. Keyw. - void SkipStrings(USHORT& i,xub_StrLen& nPos);// Ueberspringt StringSymbole - USHORT PreviousKeyword(USHORT i); // Gibt Index des vorangeh. + void SkipStrings(sal_uInt16& i,xub_StrLen& nPos);// Ueberspringt StringSymbole + sal_uInt16 PreviousKeyword(sal_uInt16 i); // Gibt Index des vorangeh. // Schluesselworts oder 0 - USHORT NextKeyword(USHORT i); // Gibt Index des naechsten + sal_uInt16 NextKeyword(sal_uInt16 i); // Gibt Index des naechsten // Schluesselworts oder 0 - sal_Unicode PreviousChar(USHORT i); // Gibt letzten Buchstaben + sal_Unicode PreviousChar(sal_uInt16 i); // Gibt letzten Buchstaben // vor der Position, // skipt EMPTY, STRING, STAR, BLANK - sal_Unicode NextChar(USHORT i); // Gibt ersten Buchst. danach - short PreviousType( USHORT i ); // Gibt Typ vor Position, + sal_Unicode NextChar(sal_uInt16 i); // Gibt ersten Buchst. danach + short PreviousType( sal_uInt16 i ); // Gibt Typ vor Position, // skipt EMPTY - BOOL IsLastBlankBeforeFrac(USHORT i); // True <=> es kommt kein ' ' + sal_Bool IsLastBlankBeforeFrac(sal_uInt16 i); // True <=> es kommt kein ' ' // mehr bis zum '/' void Reset(); // Reset aller Variablen // vor Analysestart short GetKeyWord( const String& sSymbol, // determine keyword at nPos xub_StrLen nPos ); // return 0 <=> not found - inline BOOL IsAmbiguousE( short nKey ) // whether nKey is ambiguous E of NF_KEY_E/NF_KEY_EC + inline sal_Bool IsAmbiguousE( short nKey ) // whether nKey is ambiguous E of NF_KEY_E/NF_KEY_EC { return (nKey == NF_KEY_EC || nKey == NF_KEY_E) && (GetKeywords()[NF_KEY_EC] == GetKeywords()[NF_KEY_E]); } // if 0 at strArray[i] is of S,00 or SS,00 or SS"any"00 in ScanType() or FinalScan() - BOOL Is100SecZero( USHORT i, BOOL bHadDecSep ); + sal_Bool Is100SecZero( sal_uInt16 i, sal_Bool bHadDecSep ); short Next_Symbol(const String& rStr, xub_StrLen& nPos, @@ -253,14 +253,14 @@ private: // ---- privater Teil xub_StrLen FinalScan( String& rString, String& rComment ); // Endanalyse mit Vorgabe // des Typs // -1:= error, return nPos in FinalScan; 0:= no calendar, 1:= calendar found - int FinalScanGetCalendar( xub_StrLen& nPos, USHORT& i, USHORT& nAnzResStrings ); + int FinalScanGetCalendar( xub_StrLen& nPos, sal_uInt16& i, sal_uInt16& nAnzResStrings ); /** Insert symbol into nTypeArray and sStrArray, e.g. grouping separator. If at nPos-1 a symbol type NF_SYMBOLTYPE_EMPTY is present, that is reused instead of shifting all one up and nPos is decremented! */ - bool InsertSymbol( USHORT & nPos, svt::NfSymbolType eType, const String& rStr ); + bool InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType eType, const String& rStr ); - static inline BOOL StringEqualsChar( const String& rStr, sal_Unicode ch ) + static inline sal_Bool StringEqualsChar( const String& rStr, sal_Unicode ch ) { return rStr.GetChar(0) == ch && rStr.Len() == 1; } // Yes, for efficiency get the character first and then compare length // because in most places where this is used the string is one char. diff --git a/svl/source/passwordcontainer/makefile.mk b/svl/source/passwordcontainer/makefile.mk deleted file mode 100644 index d9eb9615cf80..000000000000 --- a/svl/source/passwordcontainer/makefile.mk +++ /dev/null @@ -1,62 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=svl -TARGET=passwordcontainer.uno -LIBTARGET=NO -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ---------------------------------- - -.INCLUDE : settings.mk -DLLPRE= - -# --- Files ------------------------------------- - -SLOFILES= \ - $(SLO)$/passwordcontainer.obj\ - $(SLO)$/syscreds.obj - -SHL1TARGET= $(TARGET) -SHL1IMPLIB= i$(TARGET) -SHL1OBJS= $(SLOFILES) -SHL1STDLIBS=\ - $(UNOTOOLSLIB) \ - $(UCBHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) - -SHL1VERSIONMAP=$(SOLARENV)/src/component.map -SHL1DEF= $(MISC)$/$(SHL1TARGET).def -DEF1NAME= $(SHL1TARGET) - -# --- Targets ---------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component new file mode 100644 index 000000000000..42eb47cf14dd --- /dev/null +++ b/svl/source/passwordcontainer/passwordcontainer.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="stardiv.svl.PasswordContainer"> + <service name="com.sun.star.task.PasswordContainer"/> + </implementation> +</component> diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 7884ba5e6bb4..1865c0ac9bc8 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1544,24 +1544,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) - { - Reference< XRegistryKey > xRegistryKey ( - reinterpret_cast< XRegistryKey* >( pRegistryKey )); - Reference< XRegistryKey > xNewKey; - - xNewKey = xRegistryKey->createKey( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/stardiv.svl.PasswordContainer/UNO/SERVICES"))); - xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.PasswordContainer"))); - - return sal_True; - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx index da8b6998f2b2..6e8fe7662e05 100644 --- a/svl/source/svdde/ddecli.cxx +++ b/svl/source/svdde/ddecli.cxx @@ -87,7 +87,7 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( if( self ) { DdeTransaction* t; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; for( t = self->aTransactions.First(); t; t = self->aTransactions.Next() ) { switch( nCode ) @@ -96,9 +96,9 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( if( (DWORD)t->nId == nInfo1 ) { nCode = t->nType & (XCLASS_MASK | XTYP_MASK); - t->bBusy = FALSE; + t->bBusy = sal_False; t->Done( 0 != hData ); - bFound = TRUE; + bFound = sal_True; } break; @@ -109,11 +109,11 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( : DdeGetLastError( pInst->hDdeInstCli ); t = 0; nRet = 0; - bFound = TRUE; + bFound = sal_True; break; case XTYP_ADVDATA: - bFound = BOOL( *t->pName == hText2 ); + bFound = sal_Bool( *t->pName == hText2 ); break; } if( bFound ) @@ -223,7 +223,7 @@ DdeConnection::~DdeConnection() // --- DdeConnection::IsConnected() -------------------------------- -BOOL DdeConnection::IsConnected() +sal_Bool DdeConnection::IsConnected() { CONVINFO c; #ifdef OS2 @@ -232,13 +232,13 @@ BOOL DdeConnection::IsConnected() c.cb = sizeof( c ); #endif if ( DdeQueryConvInfo( pImp->hConv, QID_SYNC, &c ) ) - return TRUE; + return sal_True; else { DdeInstData* pInst = ImpGetInstData(); pImp->hConv = DdeReconnect( pImp->hConv ); pImp->nStatus = pImp->hConv ? DMLERR_NO_ERROR : DdeGetLastError( pInst->hDdeInstCli ); - return BOOL( pImp->nStatus == DMLERR_NO_ERROR ); + return sal_Bool( pImp->nStatus == DMLERR_NO_ERROR ); } } @@ -281,7 +281,7 @@ DdeTransaction::DdeTransaction( DdeConnection& d, const String& rItemName, nTime = n; nId = 0; nType = 0; - bBusy = FALSE; + bBusy = sal_False; rDde.aTransactions.Insert( this ); } @@ -307,7 +307,7 @@ void DdeTransaction::Execute() HSZ hItem = *pName; void* pData = (void*)(const void *)aDdeData; DWORD nData = (DWORD)(long)aDdeData; - ULONG nIntFmt = aDdeData.pImp->nFmt; + sal_uLong nIntFmt = aDdeData.pImp->nFmt; UINT nExtFmt = DdeData::GetExternalFormat( nIntFmt ); DdeInstData* pInst = ImpGetInstData(); @@ -343,7 +343,7 @@ void DdeTransaction::Execute() if ( nId && rDde.pImp->hConv ) DdeAbandonTransaction( pInst->hDdeInstCli, rDde.pImp->hConv, nId); nId = 0; - bBusy = TRUE; + bBusy = sal_True; HDDEDATA hRet = DdeClientTransaction( (unsigned char*)pData, nData, rDde.pImp->hConv, hItem, nExtFmt, (UINT)nType, TIMEOUT_ASYNC, @@ -374,7 +374,7 @@ void DdeTransaction::Data( const DdeData* p ) // --- DdeTransaction::Done() -------------------------------------- -void DdeTransaction::Done( BOOL bDataValid ) +void DdeTransaction::Done( sal_Bool bDataValid ) { aDone.Call( (void*)bDataValid ); } @@ -390,7 +390,7 @@ DdeLink::DdeLink( DdeConnection& d, const String& aItemName, long n ) : DdeLink::~DdeLink() { - nType = (USHORT)XTYP_ADVSTOP; + nType = (sal_uInt16)XTYP_ADVSTOP; nTime = 0; } @@ -428,7 +428,7 @@ DdeHotLink::DdeHotLink( DdeConnection& d, const String& i, long n ) : // --- DdePoke::DdePoke() ------------------------------------------ DdePoke::DdePoke( DdeConnection& d, const String& i, const char* p, - long l, ULONG f, long n ) : + long l, sal_uLong f, long n ) : DdeTransaction( d, i, n ) { aDdeData = DdeData( p, l, f ); diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx index 6754c2324adb..6afb6c20de87 100644 --- a/svl/source/svdde/ddedata.cxx +++ b/svl/source/svdde/ddedata.cxx @@ -42,10 +42,6 @@ #include <osl/thread.h> -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeData::DdeData() ------------------------------------------ DdeData::DdeData() @@ -59,7 +55,7 @@ DdeData::DdeData() // --- DdeData::DdeData() ------------------------------------------ -DdeData::DdeData( const void* p, long n, ULONG f ) +DdeData::DdeData( const void* p, long n, sal_uLong f ) { pImp = new DdeDataImp; pImp->hData = NULL; @@ -110,12 +106,12 @@ void DdeData::Lock() // --- DdeData::GetFormat() ---------------------------------------- -ULONG DdeData::GetFormat() const +sal_uLong DdeData::GetFormat() const { return pImp->nFmt; } -void DdeData::SetFormat( ULONG nFmt ) +void DdeData::SetFormat( sal_uLong nFmt ) { pImp->nFmt = nFmt; } @@ -149,7 +145,7 @@ DdeData& DdeData::operator = ( const DdeData& rData ) return *this; } -ULONG DdeData::GetExternalFormat( ULONG nFmt ) +sal_uLong DdeData::GetExternalFormat( sal_uLong nFmt ) { switch( nFmt ) { @@ -165,10 +161,10 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt ) default: { -#if defined(WNT) || defined(WIN) || defined( PM2 ) +#if defined(WNT) || defined( PM2 ) String aName( SotExchange::GetFormatName( nFmt ) ); -#if defined(WNT) || defined(WIN) +#if defined(WNT) if( aName.Len() ) nFmt = RegisterClipboardFormat( reinterpret_cast<LPCWSTR>(aName.GetBuffer()) ); @@ -178,7 +174,7 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt ) if( aName.Len() ) { HATOMTBL hSysTable = WinQuerySystemAtomTable(); - nFmt = (ULONG)WinAddAtom( hSysTable, (PSZ)aName.GetBuffer() ); + nFmt = (sal_uLong)WinAddAtom( hSysTable, (PSZ)aName.GetBuffer() ); } #endif #endif @@ -187,7 +183,7 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt ) return nFmt; } -ULONG DdeData::GetInternalFormat( ULONG nFmt ) +sal_uLong DdeData::GetInternalFormat( sal_uLong nFmt ) { switch( nFmt ) { @@ -204,7 +200,7 @@ ULONG DdeData::GetInternalFormat( ULONG nFmt ) break; default: -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nFmt >= CF_MAX ) { TCHAR szName[ 256 ]; diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx index 39ca8c5b6892..e80470c446c1 100644 --- a/svl/source/svdde/ddeimp.hxx +++ b/svl/source/svdde/ddeimp.hxx @@ -33,11 +33,11 @@ #include "ddemlos2.h" -#define WORD USHORT -#define DWORD ULONG -#define LPBYTE BYTE* -#define LPWORD USHORT* -#define LPDWORD ULONG* +#define WORD sal_uInt16 +#define DWORD sal_uLong +#define LPBYTE sal_uInt8* +#define LPWORD sal_uInt16* +#define LPDWORD sal_uLong* #define LPCTSTR PCSZ #else @@ -136,7 +136,7 @@ struct DdeDataImp HDDEDATA hData; LPBYTE pData; long nData; - ULONG nFmt; + sal_uLong nFmt; }; class DdeConnections; @@ -144,7 +144,7 @@ class DdeServices; struct DdeInstData { - USHORT nRefCount; + sal_uInt16 nRefCount; DdeConnections* pConnections; // Server long hCurConvSvr; diff --git a/svl/source/svdde/ddemlos2.h b/svl/source/svdde/ddemlos2.h deleted file mode 100644 index a31c14994353..000000000000 --- a/svl/source/svdde/ddemlos2.h +++ /dev/null @@ -1,377 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _DDEML_H -#define _DDEML_H - -#define INCL_OS2 -#define INCL_WIN - -#include <tools/svpm.h> -#include <tools/solar.h> -#include <tools/debug.hxx> -#include <tools/stream.hxx> - -typedef LHANDLE HSTR; - -#ifndef CALLBACK -#define CALLBACK -#endif - - -typedef ULONG HCONVLIST; -typedef ULONG HCONV; -typedef ATOM HSZ; -typedef DDESTRUCT* HDDEDATA; - -struct CONVINFO -{ - USHORT nSize; // sizeof(CONVINFO) - ULONG nUser; // Userhandle - HCONV hConvPartner; // - HSZ hszPartner; // Name der Partnerapp - HSZ hszServiceReq; // Name des angeforderten Services - HSZ hszTopic; // -- " -- Topics - HSZ hszItem; // -- " -- Items - USHORT nFormat; // Datenformat der akt. Transaktion - USHORT nType; // Typ der akt. Transaktion (XTYP_*) - USHORT nStatus; // ST_* der Konversation - USHORT nConvst; // XST_* der akt. Transaktion - USHORT nLastError; // letzter Fehler der Transaktion - HCONVLIST hConvList; // ConvListId , wenn in ConvList - CONVCONTEXT aConvCtxt; // conversation context -}; - -/* the following structure is for use with XTYP_WILDCONNECT processing. */ - -struct HSZPAIR -{ - HSZ hszSvc; - HSZ hszTopic; -}; -typedef HSZPAIR *PHSZPAIR; - -/***** conversation states (usState) *****/ - -#define XST_NULL 0 /* quiescent states */ -#define XST_INCOMPLETE 1 -#define XST_CONNECTED 2 -#define XST_INIT1 3 /* mid-initiation states */ -#define XST_INIT2 4 -#define XST_REQSENT 5 /* active conversation states */ -#define XST_DATARCVD 6 -#define XST_POKESENT 7 -#define XST_POKEACKRCVD 8 -#define XST_EXECSENT 9 -#define XST_EXECACKRCVD 10 -#define XST_ADVSENT 11 -#define XST_UNADVSENT 12 -#define XST_ADVACKRCVD 13 -#define XST_UNADVACKRCVD 14 -#define XST_ADVDATASENT 15 -#define XST_ADVDATAACKRCVD 16 - -/* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */ -#define CADV_LATEACK 0xFFFF - -/***** conversation status bits (fsStatus) *****/ - -#define ST_CONNECTED 0x0001 -#define ST_ADVISE 0x0002 -#define ST_ISLOCAL 0x0004 -#define ST_BLOCKED 0x0008 -#define ST_CLIENT 0x0010 -#define ST_TERMINATED 0x0020 -#define ST_INLIST 0x0040 -#define ST_BLOCKNEXT 0x0080 -#define ST_ISSELF 0x0100 - - -/* DDE constants for wStatus field */ - -//#define DDE_FACK 0x8000 -//#define DDE_FBUSY 0x4000 -//#define DDE_FDEFERUPD 0x4000 -//#define DDE_FACKREQ 0x8000 -//#define DDE_FRELEASE 0x2000 -//#define DDE_FREQUESTED 0x1000 -//#define DDE_FACKRESERVED 0x3ff0 -//#define DDE_FADVRESERVED 0x3fff -//#define DDE_FDATRESERVED 0x4fff -//#define DDE_FPOKRESERVED 0xdfff -//#define DDE_FAPPSTATUS 0x00ff -#define DDE_FNOTPROCESSED 0x0000 - -/***** message filter hook types *****/ - -#define MSGF_DDEMGR 0x8001 - -/***** codepage constants ****/ - -#define CP_WINANSI 1004 /* default codepage for windows & old DDE convs. */ - -/***** transaction types *****/ - -#define XTYPF_NOBLOCK 0x0002 /* CBR_BLOCK will not work */ -#define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */ -#define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */ - -#define XCLASS_MASK 0xFC00 -#define XCLASS_BOOL 0x1000 -#define XCLASS_DATA 0x2000 -#define XCLASS_FLAGS 0x4000 -#define XCLASS_NOTIFICATION 0x8000 - -#define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK ) -#define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS ) -#define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK ) -#define XTYP_ADVSTART (0x0030 | XCLASS_BOOL ) -#define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION) -#define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS ) -#define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK) -#define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) -#define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION ) -#define XTYP_POKE (0x0090 | XCLASS_FLAGS ) -#define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) -#define XTYP_REQUEST (0x00B0 | XCLASS_DATA ) -#define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) -#define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) -#define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK) - -#define XTYP_MASK 0x00F0 -#define XTYP_SHIFT 4 /* shift to turn XTYP_ into an index */ - -/***** Timeout constants *****/ - -#define TIMEOUT_ASYNC -1L - -/***** Transaction ID constants *****/ - -#define QID_SYNC -1L - -/****** public strings used in DDE ******/ - -#define SZDDESYS_TOPIC "System" -#define SZDDESYS_ITEM_TOPICS "Topics" -#define SZDDESYS_ITEM_SYSITEMS "SysItems" -#define SZDDESYS_ITEM_RTNMSG "ReturnMessage" -#define SZDDESYS_ITEM_STATUS "Status" -#define SZDDESYS_ITEM_FORMATS "Formats" -#define SZDDESYS_ITEM_HELP "Help" -#define SZDDE_ITEM_ITEMLIST "TopicItemList" - - -/****** API entry points ******/ - -typedef HDDEDATA CALLBACK FNCALLBACK(USHORT wType, USHORT wFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hData, ULONG dwData1, ULONG dwData2); -typedef FNCALLBACK* PFNCALLBACK; - -#define CBR_BLOCK 0xffffffffL - -/* DLL registration functions */ - -USHORT DdeInitialize(ULONG* pidInst, PFNCALLBACK pfnCallback, - ULONG afCmd, ULONG ulRes); - -/* - * Callback filter flags for use with standard apps. - */ - -#define CBF_FAIL_SELFCONNECTIONS 0x00001000 -#define CBF_FAIL_CONNECTIONS 0x00002000 -#define CBF_FAIL_ADVISES 0x00004000 -#define CBF_FAIL_EXECUTES 0x00008000 -#define CBF_FAIL_POKES 0x00010000 -#define CBF_FAIL_REQUESTS 0x00020000 -#define CBF_FAIL_ALLSVRXACTIONS 0x0003f000 - -#define CBF_SKIP_CONNECT_CONFIRMS 0x00040000 -#define CBF_SKIP_REGISTRATIONS 0x00080000 -#define CBF_SKIP_UNREGISTRATIONS 0x00100000 -#define CBF_SKIP_DISCONNECTS 0x00200000 -#define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000 - -/* - * Application command flags - */ -#define APPCMD_CLIENTONLY 0x00000010L -#define APPCMD_FILTERINITS 0x00000020L -#define APPCMD_MASK 0x00000FF0L - -/* - * Application classification flags - */ -#define APPCLASS_STANDARD 0x00000000L -#define APPCLASS_MASK 0x0000000FL - - -BOOL DdeUninitialize(ULONG idInst); - -/* conversation enumeration functions */ - -HCONVLIST DdeConnectList(ULONG idInst, HSZ hszService, HSZ hszTopic, - HCONVLIST hConvList, CONVCONTEXT* pCC); -HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev); -BOOL DdeDisconnectList(HCONVLIST hConvList); - -/* conversation control functions */ - -HCONV DdeConnect(ULONG idInst, HSZ hszService, HSZ hszTopic, - CONVCONTEXT* pCC); -BOOL DdeDisconnect(HCONV hConv); -HCONV DdeReconnect(HCONV hConv); - -USHORT DdeQueryConvInfo(HCONV hConv, ULONG idTransaction, CONVINFO* pConvInfo); -BOOL DdeSetUserHandle(HCONV hConv, ULONG id, ULONG hUser); - -BOOL DdeAbandonTransaction(ULONG idInst, HCONV hConv, ULONG idTransaction); - - -/* app server interface functions */ - -BOOL DdePostAdvise(ULONG idInst, HSZ hszTopic, HSZ hszItem); -BOOL DdeEnableCallback(ULONG idInst, HCONV hConv, USHORT wCmd); - -#define EC_ENABLEALL 0 -#define EC_ENABLEONE ST_BLOCKNEXT -#define EC_DISABLE ST_BLOCKED -#define EC_QUERYWAITING 2 - -HDDEDATA DdeNameService(ULONG idInst, HSZ hsz1, HSZ hsz2, USHORT afCmd); - -#define DNS_REGISTER 0x0001 -#define DNS_UNREGISTER 0x0002 -#define DNS_FILTERON 0x0004 -#define DNS_FILTEROFF 0x0008 - -/* app client interface functions */ - -HDDEDATA DdeClientTransaction(void* pData, ULONG cbData, - HCONV hConv, HSZ hszItem, USHORT wFmt, USHORT wType, - ULONG dwTimeout, ULONG* pdwResult); - -/* data transfer functions */ - -HDDEDATA DdeCreateDataHandle(ULONG idInst, void* pSrc, ULONG cb, - ULONG cbOff, HSZ hszItem, USHORT wFmt, USHORT afCmd); -// HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, ULONG cb, ULONG cbOff); -ULONG DdeGetData(HDDEDATA hData, void* pDst, ULONG cbMax, ULONG cbOff); -BYTE* DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize); -BOOL DdeUnaccessData(HDDEDATA hData); -BOOL DdeFreeDataHandle(HDDEDATA hData); - -#define HDATA_APPOWNED 0x0001 - -USHORT DdeGetLastError(ULONG idInst); - -#define DMLERR_NO_ERROR 0 /* must be 0 */ - -#define DMLERR_FIRST 0x4000 - -#define DMLERR_ADVACKTIMEOUT 0x4000 -#define DMLERR_BUSY 0x4001 -#define DMLERR_DATAACKTIMEOUT 0x4002 -#define DMLERR_DLL_NOT_INITIALIZED 0x4003 -#define DMLERR_DLL_USAGE 0x4004 -#define DMLERR_EXECACKTIMEOUT 0x4005 -#define DMLERR_INVALIDPARAMETER 0x4006 -#define DMLERR_LOW_MEMORY 0x4007 -#define DMLERR_MEMORY_ERROR 0x4008 -#define DMLERR_NOTPROCESSED 0x4009 -#define DMLERR_NO_CONV_ESTABLISHED 0x400a -#define DMLERR_POKEACKTIMEOUT 0x400b -#define DMLERR_POSTMSG_FAILED 0x400c -#define DMLERR_REENTRANCY 0x400d -#define DMLERR_SERVER_DIED 0x400e -#define DMLERR_SYS_ERROR 0x400f -#define DMLERR_UNADVACKTIMEOUT 0x4010 -#define DMLERR_UNFOUND_QUEUE_ID 0x4011 - -#define DMLERR_LAST 0x4011 - -HSZ DdeCreateStringHandle(ULONG idInst, PSZ pStr, int iCodePage); -ULONG DdeQueryString(ULONG idInst, HSZ hsz, PSZ pStr, ULONG cchMax, - int iCodePage); -BOOL DdeFreeStringHandle(ULONG idInst, HSZ hsz); -BOOL DdeKeepStringHandle(ULONG idInst, HSZ hsz); -int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2); - - - -/* von OS/2 nicht unterstuetzte Win3.1 Clipboard-Formate */ - -#define CF_NOTSUPPORTED_BASE 0xff00 - -#ifndef CF_DIB -#define CF_DIB CF_NOTSUPPORTED_BASE+1 -#endif - -#ifndef CF_DIF -#define CF_DIF CF_NOTSUPPORTED_BASE+2 -#endif - -#ifndef CF_DSPMETAFILEPICT -#define CF_DSPMETAFILEPICT CF_NOTSUPPORTED_BASE+3 -#endif - -#ifndef CF_METAFILEPICT -#define CF_METAFILEPICT CF_NOTSUPPORTED_BASE+4 -#endif - -#ifndef CF_OEMTEXT -#define CF_OEMTEXT CF_NOTSUPPORTED_BASE+5 -#endif - -#ifndef CF_OWNERDISPLAY -#define CF_OWNERDISPLAY CF_NOTSUPPORTED_BASE+6 -#endif - -#ifndef CF_PENDATA -#define CF_PENDATA CF_NOTSUPPORTED_BASE+7 -#endif - -#ifndef CF_RIFF -#define CF_RIFF CF_NOTSUPPORTED_BASE+8 -#endif - -#ifndef CF_SYLK -#define CF_SYLK CF_NOTSUPPORTED_BASE+9 -#endif - -#ifndef CF_TIFF -#define CF_TIFF CF_NOTSUPPORTED_BASE+10 -#endif - -#ifndef CF_WAVE -#define CF_WAVE CF_NOTSUPPORTED_BASE+11 -#endif - - -#endif /* _DDEML_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddestrg.cxx b/svl/source/svdde/ddestrg.cxx index 98aac8369d68..0b6186f4ef5c 100644 --- a/svl/source/svdde/ddestrg.cxx +++ b/svl/source/svdde/ddestrg.cxx @@ -34,10 +34,6 @@ #include "ddeimp.hxx" #include <svl/svdde.hxx> -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeString::DdeString() -------------------------------------- DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) : diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index ca1f161fada8..a2ff3fda485b 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -44,10 +44,10 @@ enum DdeItemType struct DdeItemImpData { - ULONG nHCnv; - USHORT nCnt; + sal_uLong nHCnv; + sal_uInt16 nCnt; - DdeItemImpData( ULONG nH ) : nHCnv( nH ), nCnt( 1 ) {} + DdeItemImpData( sal_uLong nH ) : nHCnv( nH ), nCnt( 1 ) {} }; SV_DECL_VARARR( DdeItemImp, DdeItemImpData, 1, 1 ) @@ -102,7 +102,7 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( { if( hText1 ) { - USHORT n = 0; + sal_uInt16 n = 0; while( STRING_NOTFOUND != n ) { String s( sTopics.GetToken( 0, '\t', n )); @@ -155,7 +155,7 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( } #else String sTopics( pService->Topics() ); - USHORT n = 0; + sal_uInt16 n = 0; while( STRING_NOTFOUND != n ) { String s( sTopics.GetToken( 0, '\t', n )); @@ -245,7 +245,7 @@ found: return (HDDEDATA)NULL; } - BOOL bExec = BOOL(nCode == XTYP_EXECUTE); + sal_Bool bExec = sal_Bool(nCode == XTYP_EXECUTE); pTopic = pC->pTopic; if ( pTopic && !bExec ) pItem = FindItem( *pTopic, hText2 ); @@ -261,7 +261,7 @@ found: else pTopic->aItem.Erase(); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; pInst->hCurConvSvr = (long)hConv; switch( nCode ) { @@ -350,14 +350,14 @@ found: pItem->IncMonitor( (long)hConv ); pInst->hCurConvSvr = NULL; } - return (HDDEDATA)TRUE; + return (HDDEDATA)sal_True; case XTYP_ADVSTOP: pItem->DecMonitor( (long)hConv ); if( !pItem->pImpData ) pTopic->StopAdviseLoop(); pInst->hCurConvSvr = NULL; - return (HDDEDATA)TRUE; + return (HDDEDATA)sal_True; case XTYP_EXECUTE: { @@ -405,7 +405,7 @@ DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic ) { DdeTopic* s; DdeTopics& rTopics = rService.aTopics; - int bWeiter = FALSE; + int bWeiter = sal_False; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); @@ -438,7 +438,7 @@ DdeItem* DdeInternal::FindItem( DdeTopic& rTopic, HSZ hItem ) DdeItems& rItems = rTopic.aItems; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - int bWeiter = FALSE; + int bWeiter = sal_False; do { // middle check loop @@ -592,7 +592,7 @@ void DdeService::RemoveTopic( const DdeTopic& rTopic ) // --- DdeService::HasCbFormat() ----------------------------------- -BOOL DdeService::HasCbFormat( USHORT nFmt ) +sal_Bool DdeService::HasCbFormat( sal_uInt16 nFmt ) { for ( size_t i = 0, n = aFormats.size(); i < n; ++i ) if ( aFormats[ i ] == nFmt ) @@ -602,14 +602,14 @@ BOOL DdeService::HasCbFormat( USHORT nFmt ) // --- DdeService::HasFormat() ------------------------------------- -BOOL DdeService::HasFormat( ULONG nFmt ) +sal_Bool DdeService::HasFormat( sal_uLong nFmt ) { - return HasCbFormat( (USHORT)DdeData::GetExternalFormat( nFmt )); + return HasCbFormat( (sal_uInt16)DdeData::GetExternalFormat( nFmt )); } // --- DdeService::AddFormat() ------------------------------------- -void DdeService::AddFormat( ULONG nFmt ) +void DdeService::AddFormat( sal_uLong nFmt ) { nFmt = DdeData::GetExternalFormat( nFmt ); for ( size_t i = 0, n = aFormats.size(); i < n; ++i ) @@ -620,7 +620,7 @@ void DdeService::AddFormat( ULONG nFmt ) // --- DdeService::RemoveFormat() ---------------------------------- -void DdeService::RemoveFormat( ULONG nFmt ) +void DdeService::RemoveFormat( sal_uLong nFmt ) { nFmt = DdeData::GetExternalFormat( nFmt ); for ( DdeFormats::iterator it = aFormats.begin(); it < aFormats.end(); ++it ) { @@ -663,9 +663,9 @@ const String& DdeTopic::GetName() const // --- DdeTopic::IsSystemTopic() ----------------------------------- -BOOL DdeTopic::IsSystemTopic() +sal_Bool DdeTopic::IsSystemTopic() { - return BOOL (GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC)); + return sal_Bool (GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC)); } // --- DdeTopic::AddItem() ----------------------------------------- @@ -759,7 +759,7 @@ void DdeTopic::_Disconnect( long nId ) // --- DdeTopic::Get() --------------------------------------------- -DdeData* DdeTopic::Get( ULONG nFmt ) +DdeData* DdeTopic::Get( sal_uLong nFmt ) { if ( aGetLink.IsSet() ) return (DdeData*)aGetLink.Call( (void*)nFmt ); @@ -769,22 +769,22 @@ DdeData* DdeTopic::Get( ULONG nFmt ) // --- DdeTopic::Put() --------------------------------------------- -BOOL DdeTopic::Put( const DdeData* r ) +sal_Bool DdeTopic::Put( const DdeData* r ) { if ( aPutLink.IsSet() ) - return (BOOL)aPutLink.Call( (void*) r ); + return (sal_Bool)aPutLink.Call( (void*) r ); else - return FALSE; + return sal_False; } // --- DdeTopic::Execute() ----------------------------------------- -BOOL DdeTopic::Execute( const String* r ) +sal_Bool DdeTopic::Execute( const String* r ) { if ( aExecLink.IsSet() ) - return (BOOL)aExecLink.Call( (void*)r ); + return (sal_Bool)aExecLink.Call( (void*)r ); else - return FALSE; + return sal_False; } // --- DdeTopic::GetConvId() --------------------------------------- @@ -798,16 +798,16 @@ long DdeTopic::GetConvId() // --- DdeTopic::StartAdviseLoop() --------------------------------- -BOOL DdeTopic::StartAdviseLoop() +sal_Bool DdeTopic::StartAdviseLoop() { - return FALSE; + return sal_False; } // --- DdeTopic::StopAdviseLoop() ---------------------------------- -BOOL DdeTopic::StopAdviseLoop() +sal_Bool DdeTopic::StopAdviseLoop() { - return FALSE; + return sal_False; } // --- DdeItem::DdeItem() ------------------------------------------ @@ -877,17 +877,17 @@ void DdeItem::NotifyClient() // --- DdeItem::IncMonitor() ------------------------------------------ -void DdeItem::IncMonitor( ULONG nHCnv ) +void DdeItem::IncMonitor( sal_uLong nHCnv ) { if( !pImpData ) { pImpData = new DdeItemImp; if( DDEGETPUTITEM == nType ) - ((DdeGetPutItem*)this)->AdviseLoop( TRUE ); + ((DdeGetPutItem*)this)->AdviseLoop( sal_True ); } else { - for( USHORT n = pImpData->Count(); n; ) + for( sal_uInt16 n = pImpData->Count(); n; ) if( (*pImpData)[ --n ].nHCnv == nHCnv ) { ++(*pImpData)[ n ].nHCnv; @@ -900,12 +900,12 @@ void DdeItem::IncMonitor( ULONG nHCnv ) // --- DdeItem::DecMonitor() ------------------------------------------ -void DdeItem::DecMonitor( ULONG nHCnv ) +void DdeItem::DecMonitor( sal_uLong nHCnv ) { if( pImpData ) { DdeItemImpData* pData = (DdeItemImpData*)pImpData->GetData(); - for( USHORT n = pImpData->Count(); n; --n, ++pData ) + for( sal_uInt16 n = pImpData->Count(); n; --n, ++pData ) if( pData->nHCnv == nHCnv ) { if( !pData->nCnt || !--pData->nCnt ) @@ -916,7 +916,7 @@ void DdeItem::DecMonitor( ULONG nHCnv ) { delete pImpData, pImpData = 0; if( DDEGETPUTITEM == nType ) - ((DdeGetPutItem*)this)->AdviseLoop( FALSE ); + ((DdeGetPutItem*)this)->AdviseLoop( sal_False ); } } return ; @@ -930,7 +930,7 @@ short DdeItem::GetLinks() { short nCnt = 0; if( pImpData ) - for( USHORT n = pImpData->Count(); n; ) + for( sal_uInt16 n = pImpData->Count(); n; ) nCnt = nCnt + (*pImpData)[ --n ].nCnt; return nCnt; } @@ -962,21 +962,21 @@ DdeGetPutItem::DdeGetPutItem( const DdeItem& rItem ) // --- DdeGetPutData::Get() ---------------------------------------- -DdeData* DdeGetPutItem::Get( ULONG ) +DdeData* DdeGetPutItem::Get( sal_uLong ) { return 0; } // --- DdeGetPutData::Put() ---------------------------------------- -BOOL DdeGetPutItem::Put( const DdeData* ) +sal_Bool DdeGetPutItem::Put( const DdeData* ) { - return FALSE; + return sal_False; } // --- DdeGetPutData::AdviseLoop() --------------------------------- -void DdeGetPutItem::AdviseLoop( BOOL ) +void DdeGetPutItem::AdviseLoop( sal_Bool ) { } @@ -1042,7 +1042,7 @@ String DdeService::Formats() s += '\t'; p = buf; - switch( (USHORT)f ) + switch( (sal_uInt16)f ) { case CF_TEXT: p = reinterpret_cast<LPCTSTR>(String::CreateFromAscii("TEXT").GetBuffer()); @@ -1089,9 +1089,9 @@ String DdeService::Status() // --- DdeService::IsBusy() ---------------------------------------- -BOOL DdeService::IsBusy() +sal_Bool DdeService::IsBusy() { - return FALSE; + return sal_False; } // --- DdeService::GetHelp() ---------------------------------------- @@ -1101,14 +1101,14 @@ String DdeService::GetHelp() return String(); } -BOOL DdeTopic::MakeItem( const String& ) +sal_Bool DdeTopic::MakeItem( const String& ) { - return FALSE; + return sal_False; } -BOOL DdeService::MakeTopic( const String& ) +sal_Bool DdeService::MakeTopic( const String& ) { - return FALSE; + return sal_False; } String DdeService::SysTopicGet( const String& ) @@ -1116,9 +1116,9 @@ String DdeService::SysTopicGet( const String& ) return String(); } -BOOL DdeService::SysTopicExecute( const String* ) +sal_Bool DdeService::SysTopicExecute( const String* ) { - return FALSE; + return sal_False; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/makefile.mk b/svl/source/svdde/makefile.mk deleted file mode 100644 index d7f0a790486b..000000000000 --- a/svl/source/svdde/makefile.mk +++ /dev/null @@ -1,60 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - - -.IF "$(GUIBASE)"=="WIN" - -PRJ=..$/.. - -PRJNAME=svl -TARGET=svdde - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - - -SLOFILES= $(SLO)$/ddecli.obj \ - $(SLO)$/ddesvr.obj \ - $(SLO)$/ddedata.obj \ - $(SLO)$/ddestrg.obj \ - $(SLO)$/ddewrap.obj \ - $(SLO)$/ddeinf.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - -.ELSE -dummy: - @echo GUI == "$(GUI)" - nothing to do - -.ENDIF - diff --git a/svl/source/svsql/converter.cxx b/svl/source/svsql/converter.cxx index a68d617d8918..6be7854137bb 100644 --- a/svl/source/svsql/converter.cxx +++ b/svl/source/svsql/converter.cxx @@ -28,14 +28,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "converter.hxx" +#include <svl/converter.hxx> -INT32 SvDbaseConverter::ConvertPrecisionToDbase(INT32 _nLen, INT32 _nScale) +sal_Int32 SvDbaseConverter::ConvertPrecisionToDbase(sal_Int32 _nLen, sal_Int32 _nScale) { return _nScale ? _nLen +2 : _nLen +1; } //------------------------------------------------------------------------ -INT32 SvDbaseConverter::ConvertPrecisionToOdbc(INT32 _nLen, INT32 _nScale) +sal_Int32 SvDbaseConverter::ConvertPrecisionToOdbc(sal_Int32 _nLen, sal_Int32 _nScale) { return _nScale ? _nLen -2 : _nLen -1; } diff --git a/svl/source/undo/makefile.mk b/svl/source/undo/makefile.mk deleted file mode 100644 index 8a615d97a03b..000000000000 --- a/svl/source/undo/makefile.mk +++ /dev/null @@ -1,47 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=undo -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/undo.obj - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index 7176dd894d0e..fcaba305bae7 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -31,10 +31,16 @@ #include <com/sun/star/uno/Exception.hpp> +#include <comphelper/flagguard.hxx> #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <svl/undo.hxx> +#include <vector> +#include <list> +#include <limits> + using ::com::sun::star::uno::Exception; // STATIC DATA ----------------------------------------------------------- @@ -56,14 +62,20 @@ SfxRepeatTarget::~SfxRepeatTarget() //------------------------------------------------------------------------ -BOOL SfxUndoAction::IsLinked() +SfxUndoContext::~SfxUndoContext() +{ +} + +//------------------------------------------------------------------------ + +sal_Bool SfxUndoAction::IsLinked() { return bLinked; } //------------------------------------------------------------------------ -void SfxUndoAction::SetLinked( BOOL bIsLinked ) +void SfxUndoAction::SetLinked( sal_Bool bIsLinked ) { bLinked = bIsLinked; } @@ -80,15 +92,15 @@ SfxUndoAction::~SfxUndoAction() SfxUndoAction::SfxUndoAction() { DBG_CTOR(SfxUndoAction, 0); - SetLinked( FALSE ); + SetLinked( sal_False ); } //------------------------------------------------------------------------ -BOOL SfxUndoAction::Merge( SfxUndoAction * ) +sal_Bool SfxUndoAction::Merge( SfxUndoAction * ) { DBG_CHKTHIS(SfxUndoAction, 0); - return FALSE; + return sal_False; } //------------------------------------------------------------------------ @@ -102,7 +114,7 @@ XubString SfxUndoAction::GetComment() const //------------------------------------------------------------------------ -USHORT SfxUndoAction::GetId() const +sal_uInt16 SfxUndoAction::GetId() const { DBG_CHKTHIS(SfxUndoAction, 0); return 0; @@ -118,7 +130,6 @@ XubString SfxUndoAction::GetRepeatComment(SfxRepeatTarget&) const //------------------------------------------------------------------------ - void SfxUndoAction::Undo() { // die sind nur konzeptuell pure virtual @@ -127,6 +138,14 @@ void SfxUndoAction::Undo() //------------------------------------------------------------------------ +void SfxUndoAction::UndoWithContext( SfxUndoContext& i_context ) +{ + (void)i_context; + Undo(); +} + +//------------------------------------------------------------------------ + void SfxUndoAction::Redo() { // die sind nur konzeptuell pure virtual @@ -135,6 +154,14 @@ void SfxUndoAction::Redo() //------------------------------------------------------------------------ +void SfxUndoAction::RedoWithContext( SfxUndoContext& i_context ) +{ + (void)i_context; + Redo(); +} + +//------------------------------------------------------------------------ + void SfxUndoAction::Repeat(SfxRepeatTarget&) { // die sind nur konzeptuell pure virtual @@ -144,213 +171,561 @@ void SfxUndoAction::Repeat(SfxRepeatTarget&) //------------------------------------------------------------------------ -BOOL SfxUndoAction::CanRepeat(SfxRepeatTarget&) const +sal_Bool SfxUndoAction::CanRepeat(SfxRepeatTarget&) const { - return TRUE; + return sal_True; } //======================================================================== +typedef ::std::vector< SfxUndoListener* > UndoListeners; + +struct SVL_DLLPRIVATE SfxUndoManager_Data +{ + ::osl::Mutex aMutex; + SfxUndoArray* pUndoArray; + SfxUndoArray* pActUndoArray; + SfxUndoArray* pFatherUndoArray; + + sal_Int32 mnLockCount; + sal_Int32 mnMarks; + sal_Int32 mnEmptyMark; + bool mbDoing; + bool mbClearUntilTopLevel; + + UndoListeners aListeners; + + SfxUndoManager_Data( size_t i_nMaxUndoActionCount ) + :pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) ) + ,pActUndoArray( NULL ) + ,pFatherUndoArray( NULL ) + ,mnLockCount( 0 ) + ,mnMarks( 0 ) + ,mnEmptyMark(MARK_INVALID) + ,mbDoing( false ) + ,mbClearUntilTopLevel( false ) + { + pActUndoArray = pUndoArray; + } + + ~SfxUndoManager_Data() + { + delete pUndoArray; + } +}; + +//======================================================================== + +namespace svl { namespace undo { namespace impl +{ + //-------------------------------------------------------------------- + class SVL_DLLPRIVATE LockGuard + { + public: + LockGuard( SfxUndoManager& i_manager ) + :m_manager( i_manager ) + { + m_manager.ImplEnableUndo_Lock( false ); + } + + ~LockGuard() + { + m_manager.ImplEnableUndo_Lock( true ); + } + + private: + SfxUndoManager& m_manager; + }; + + //-------------------------------------------------------------------- + typedef void ( SfxUndoListener::*UndoListenerVoidMethod )(); + typedef void ( SfxUndoListener::*UndoListenerStringMethod )( const String& ); + + //-------------------------------------------------------------------- + struct SVL_DLLPRIVATE NotifyUndoListener : public ::std::unary_function< SfxUndoListener*, void > + { + NotifyUndoListener() + :m_notificationMethod( NULL ) + ,m_altNotificationMethod( NULL ) + ,m_sActionComment() + { + } + + NotifyUndoListener( UndoListenerVoidMethod i_notificationMethod ) + :m_notificationMethod( i_notificationMethod ) + ,m_altNotificationMethod( NULL ) + ,m_sActionComment() + { + } + + NotifyUndoListener( UndoListenerStringMethod i_notificationMethod, const String& i_actionComment ) + :m_notificationMethod( NULL ) + ,m_altNotificationMethod( i_notificationMethod ) + ,m_sActionComment( i_actionComment ) + { + } + + bool is() const + { + return ( m_notificationMethod != NULL ) || ( m_altNotificationMethod != NULL ); + } + + void operator()( SfxUndoListener* i_listener ) const + { + OSL_PRECOND( is(), "NotifyUndoListener: this will crash!" ); + if ( m_altNotificationMethod != NULL ) + { + ( i_listener->*m_altNotificationMethod )( m_sActionComment ); + } + else + { + ( i_listener->*m_notificationMethod )(); + } + } + + private: + UndoListenerVoidMethod m_notificationMethod; + UndoListenerStringMethod m_altNotificationMethod; + String m_sActionComment; + }; + + //-------------------------------------------------------------------- + class SVL_DLLPRIVATE UndoManagerGuard + { + public: + UndoManagerGuard( SfxUndoManager_Data& i_managerData ) + :m_rManagerData( i_managerData ) + ,m_aGuard( i_managerData.aMutex ) + ,m_notifiers() + { + } + + ~UndoManagerGuard(); + + void clear() + { + m_aGuard.clear(); + } + + void reset() + { + m_aGuard.reset(); + } + + void cancelNotifications() + { + m_notifiers.clear(); + } + + /** marks the given Undo action for deletion + + The Undo action will be put into a list, whose members will be deleted from within the destructor of the + UndoManagerGuard. This deletion will happen without the UndoManager's mutex locked. + */ + void markForDeletion( SfxUndoAction* i_action ) + { + // remember + if ( i_action ) + m_aUndoActionsCleanup.push_back( i_action ); + } + + /** schedules the given SfxUndoListener method to be called for all registered listeners. + + The notification will happen after the Undo manager's mutex has been released, and after all pending + deletions of Undo actions are done. + */ + void scheduleNotification( UndoListenerVoidMethod i_notificationMethod ) + { + m_notifiers.push_back( NotifyUndoListener( i_notificationMethod ) ); + } + + void scheduleNotification( UndoListenerStringMethod i_notificationMethod, const String& i_actionComment ) + { + m_notifiers.push_back( NotifyUndoListener( i_notificationMethod, i_actionComment ) ); + } + + private: + SfxUndoManager_Data& m_rManagerData; + ::osl::ResettableMutexGuard m_aGuard; + ::std::list< SfxUndoAction* > m_aUndoActionsCleanup; + ::std::list< NotifyUndoListener > m_notifiers; + }; + + UndoManagerGuard::~UndoManagerGuard() + { + // copy members + UndoListeners aListenersCopy( m_rManagerData.aListeners ); + + // release mutex + m_aGuard.clear(); + + // delete all actions + while ( !m_aUndoActionsCleanup.empty() ) + { + SfxUndoAction* pAction = m_aUndoActionsCleanup.front(); + m_aUndoActionsCleanup.pop_front(); + try + { + delete pAction; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + // handle scheduled notification + for ( ::std::list< NotifyUndoListener >::const_iterator notifier = m_notifiers.begin(); + notifier != m_notifiers.end(); + ++notifier + ) + { + if ( notifier->is() ) + ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(), *notifier ); + } + } +} } } + +using namespace ::svl::undo::impl; + +//======================================================================== + +SfxUndoManager::SfxUndoManager( size_t nMaxUndoActionCount ) + :m_pData( new SfxUndoManager_Data( nMaxUndoActionCount ) ) +{ +} -SfxUndoManager::SfxUndoManager( USHORT nMaxUndoActionCount ) - : pFatherUndoArray(0) - , mbUndoEnabled( true ) +//------------------------------------------------------------------------ + +SfxUndoManager::~SfxUndoManager() { - pUndoArray=new SfxUndoArray(nMaxUndoActionCount); - pActUndoArray=pUndoArray; + UndoListeners aListenersCopy; + { + UndoManagerGuard aGuard( *m_pData ); + aListenersCopy = m_pData->aListeners; + } + ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(), + NotifyUndoListener( &SfxUndoListener::undoManagerDying ) ); } //------------------------------------------------------------------------ +void SfxUndoManager::EnableUndo( bool i_enable ) +{ + UndoManagerGuard aGuard( *m_pData ); + ImplEnableUndo_Lock( i_enable ); -SfxUndoManager::~SfxUndoManager() +} + +//------------------------------------------------------------------------ + +void SfxUndoManager::ImplEnableUndo_Lock( bool const i_enable ) { - delete pUndoArray; + if ( !i_enable ) + ++m_pData->mnLockCount; + else + { + OSL_PRECOND( m_pData->mnLockCount > 0, "SfxUndoManager::ImplEnableUndo_NoNotify: not disabled, so why enabling?" ); + if ( m_pData->mnLockCount > 0 ) + --m_pData->mnLockCount; + } } //------------------------------------------------------------------------ -void SfxUndoManager::EnableUndo( bool bEnable ) +bool SfxUndoManager::IsUndoEnabled() const { - mbUndoEnabled = bEnable; + UndoManagerGuard aGuard( *m_pData ); + return ImplIsUndoEnabled_Lock(); } //------------------------------------------------------------------------ +bool SfxUndoManager::ImplIsUndoEnabled_Lock() const +{ + return m_pData->mnLockCount == 0; +} + +//------------------------------------------------------------------------ -void SfxUndoManager::SetMaxUndoActionCount( USHORT nMaxUndoActionCount ) +void SfxUndoManager::SetMaxUndoActionCount( size_t nMaxUndoActionCount ) { + UndoManagerGuard aGuard( *m_pData ); + // Remove entries from the pActUndoArray when we have to reduce // the number of entries due to a lower nMaxUndoActionCount. // Both redo and undo action entries will be removed until we reached the // new nMaxUndoActionCount. - long nNumToDelete = pActUndoArray->aUndoActions.Count() - nMaxUndoActionCount; - if ( nNumToDelete > 0 ) + long nNumToDelete = m_pData->pActUndoArray->aUndoActions.size() - nMaxUndoActionCount; + while ( nNumToDelete > 0 ) { - while ( nNumToDelete > 0 ) + size_t nPos = m_pData->pActUndoArray->aUndoActions.size(); + if ( nPos > m_pData->pActUndoArray->nCurUndoAction ) { - USHORT nPos = pActUndoArray->aUndoActions.Count(); - if ( nPos > pActUndoArray->nCurUndoAction ) + SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[nPos-1].pAction; + if ( !pAction->IsLinked() ) { - if ( !pActUndoArray->aUndoActions[nPos-1]->IsLinked() ) - { - delete pActUndoArray->aUndoActions[nPos-1]; - pActUndoArray->aUndoActions.Remove( nPos-1 ); - --nNumToDelete; - } + aGuard.markForDeletion( pAction ); + m_pData->pActUndoArray->aUndoActions.Remove( nPos-1 ); + --nNumToDelete; } + } - if ( nNumToDelete > 0 && pActUndoArray->nCurUndoAction > 0 ) + if ( nNumToDelete > 0 && m_pData->pActUndoArray->nCurUndoAction > 0 ) + { + SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[0].pAction; + if ( !pAction->IsLinked() ) { - if ( !pActUndoArray->aUndoActions[0]->IsLinked() ) - { - delete pActUndoArray->aUndoActions[0]; - pActUndoArray->aUndoActions.Remove(0); - --pActUndoArray->nCurUndoAction; - --nNumToDelete; - } + aGuard.markForDeletion( pAction ); + m_pData->pActUndoArray->aUndoActions.Remove(0); + --m_pData->pActUndoArray->nCurUndoAction; + --nNumToDelete; } - - if ( nPos == pActUndoArray->aUndoActions.Count() ) - break; // Cannot delete more entries } + + if ( nPos == m_pData->pActUndoArray->aUndoActions.size() ) + break; // Cannot delete more entries } - pActUndoArray->nMaxUndoActions = nMaxUndoActionCount; + m_pData->pActUndoArray->nMaxUndoActions = nMaxUndoActionCount; } //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetMaxUndoActionCount() const +size_t SfxUndoManager::GetMaxUndoActionCount() const { - return pActUndoArray->nMaxUndoActions; + UndoManagerGuard aGuard( *m_pData ); + return m_pData->pActUndoArray->nMaxUndoActions; } //------------------------------------------------------------------------ -void SfxUndoManager::Clear() +void SfxUndoManager::ImplClearCurrentLevel_NoNotify( UndoManagerGuard& i_guard ) { - while ( pActUndoArray->aUndoActions.Count() ) + // clear array + while ( !m_pData->pActUndoArray->aUndoActions.empty() ) { - SfxUndoAction *pAction= - pActUndoArray->aUndoActions[pActUndoArray->aUndoActions.Count() - 1]; - pActUndoArray->aUndoActions.Remove( pActUndoArray->aUndoActions.Count() - 1 ); - delete pAction; + size_t deletePos = m_pData->pActUndoArray->aUndoActions.size() - 1; + SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ deletePos ].pAction; + i_guard.markForDeletion( pAction ); + m_pData->pActUndoArray->aUndoActions.Remove( deletePos ); } - pActUndoArray->nCurUndoAction = 0; + m_pData->pActUndoArray->nCurUndoAction = 0; + + m_pData->mnMarks = 0; + m_pData->mnEmptyMark = MARK_INVALID; } //------------------------------------------------------------------------ -void SfxUndoManager::ClearRedo() +void SfxUndoManager::Clear() { - while ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction ) - { - SfxUndoAction *pAction= - pActUndoArray->aUndoActions[pActUndoArray->aUndoActions.Count() - 1]; - pActUndoArray->aUndoActions.Remove( pActUndoArray->aUndoActions.Count() - 1 ); - delete pAction; - } + UndoManagerGuard aGuard( *m_pData ); + + OSL_ENSURE( !ImplIsInListAction_Lock(), "SfxUndoManager::Clear: suspicious call - do you really wish to clear the current level?" ); + ImplClearCurrentLevel_NoNotify( aGuard ); + + // notify listeners + aGuard.scheduleNotification( &SfxUndoListener::cleared ); } //------------------------------------------------------------------------ -void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerge ) +void SfxUndoManager::ClearAllLevels() { - if( mbUndoEnabled ) + UndoManagerGuard aGuard( *m_pData ); + ImplClearCurrentLevel_NoNotify( aGuard ); + + if ( ImplIsInListAction_Lock() ) + { + m_pData->mbClearUntilTopLevel = true; + } + else { - // Redo-Actions loeschen - for ( USHORT nPos = pActUndoArray->aUndoActions.Count(); - nPos > pActUndoArray->nCurUndoAction; --nPos ) - delete pActUndoArray->aUndoActions[nPos-1]; + aGuard.scheduleNotification( &SfxUndoListener::cleared ); + } +} - pActUndoArray->aUndoActions.Remove( - pActUndoArray->nCurUndoAction, - pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction ); +//------------------------------------------------------------------------ - if ( pActUndoArray->nMaxUndoActions ) - { - SfxUndoAction *pTmpAction = pActUndoArray->nCurUndoAction ? - pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1] : 0; +void SfxUndoManager::ImplClearRedo_NoLock( bool const i_currentLevel ) +{ + UndoManagerGuard aGuard( *m_pData ); + ImplClearRedo( aGuard, i_currentLevel ); +} - if ( !bTryMerge || !(pTmpAction && pTmpAction->Merge(pAction)) ) - { - // auf Max-Anzahl anpassen - if( pActUndoArray == pUndoArray ) - while( pActUndoArray->aUndoActions.Count() >= - pActUndoArray->nMaxUndoActions && - !pActUndoArray->aUndoActions[0]->IsLinked() ) - { - delete pActUndoArray->aUndoActions[0]; - pActUndoArray->aUndoActions.Remove(0); - --pActUndoArray->nCurUndoAction; - } - - // neue Action anh"angen - const SfxUndoAction* pTemp = pAction; - pActUndoArray->aUndoActions.Insert( - pTemp, pActUndoArray->nCurUndoAction++ ); - return; - } - } - } - delete pAction; +//------------------------------------------------------------------------ + +void SfxUndoManager::ClearRedo() +{ + OSL_ENSURE( !IsInListAction(), "SfxUndoManager::ClearRedo: suspicious call - do you really wish to clear the current level?" ); + ImplClearRedo_NoLock( CurrentLevel ); } //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetUndoActionCount() const +void SfxUndoManager::Reset() { - return pActUndoArray->nCurUndoAction; + UndoManagerGuard aGuard( *m_pData ); + + // clear all locks + while ( !ImplIsUndoEnabled_Lock() ) + ImplEnableUndo_Lock( true ); + + // cancel all list actions + while ( IsInListAction() ) + ImplLeaveListAction( false, aGuard ); + + // clear both stacks + ImplClearCurrentLevel_NoNotify( aGuard ); + + // cancel the notifications scheduled by ImplLeaveListAction, + // as we want to do an own, dedicated notification + aGuard.cancelNotifications(); + + // schedule notification + aGuard.scheduleNotification( &SfxUndoListener::resetAll ); } //------------------------------------------------------------------------ -XubString SfxUndoManager::GetUndoActionComment( USHORT nNo ) const +void SfxUndoManager::ImplClearUndo( UndoManagerGuard& i_guard ) { - DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment(), illegal id!" ); - if( nNo < pActUndoArray->nCurUndoAction ) + while ( m_pData->pActUndoArray->nCurUndoAction > 0 ) { - return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]->GetComment(); //! + SfxUndoAction* pUndoAction = m_pData->pActUndoArray->aUndoActions[0].pAction; + m_pData->pActUndoArray->aUndoActions.Remove( 0 ); + i_guard.markForDeletion( pUndoAction ); + --m_pData->pActUndoArray->nCurUndoAction; } - else + // TODO: notifications? We don't have clearedUndo, only cleared and clearedRedo at the SfxUndoListener +} + +//------------------------------------------------------------------------ + +void SfxUndoManager::ImplClearRedo( UndoManagerGuard& i_guard, bool const i_currentLevel ) +{ + SfxUndoArray* pUndoArray = ( i_currentLevel == IUndoManager::CurrentLevel ) ? m_pData->pActUndoArray : m_pData->pUndoArray; + + // clearance + while ( pUndoArray->aUndoActions.size() > pUndoArray->nCurUndoAction ) { - XubString aEmpty; - return aEmpty; + size_t deletePos = pUndoArray->aUndoActions.size() - 1; + SfxUndoAction* pAction = pUndoArray->aUndoActions[ deletePos ].pAction; + pUndoArray->aUndoActions.Remove( deletePos ); + i_guard.markForDeletion( pAction ); } + + // notification - only if the top level's stack was cleared + if ( i_currentLevel == IUndoManager::TopLevel ) + i_guard.scheduleNotification( &SfxUndoListener::clearedRedo ); } //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetUndoActionId( USHORT nNo ) const +bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bTryMerge, bool bClearRedo, UndoManagerGuard& i_guard ) { - DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" ); - if( nNo < pActUndoArray->nCurUndoAction ) + if ( !ImplIsUndoEnabled_Lock() || ( m_pData->pActUndoArray->nMaxUndoActions == 0 ) ) { - return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]->GetId(); //! + i_guard.markForDeletion( pAction ); + return false; } - else + + // merge, if required + SfxUndoAction* pMergeWithAction = m_pData->pActUndoArray->nCurUndoAction ? + m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction : NULL; + if ( bTryMerge && ( !pMergeWithAction || !pMergeWithAction->Merge( pAction ) ) ) { - return 0; + i_guard.markForDeletion( pAction ); + return false; + } + + // clear redo stack, if requested + if ( bClearRedo && ( ImplGetRedoActionCount_Lock( CurrentLevel ) > 0 ) ) + ImplClearRedo( i_guard, IUndoManager::CurrentLevel ); + + // respect max number + if( m_pData->pActUndoArray == m_pData->pUndoArray ) + { + while( m_pData->pActUndoArray->aUndoActions.size() >= + m_pData->pActUndoArray->nMaxUndoActions && + !m_pData->pActUndoArray->aUndoActions[0].pAction->IsLinked() ) + { + i_guard.markForDeletion( m_pData->pActUndoArray->aUndoActions[0].pAction ); + m_pData->pActUndoArray->aUndoActions.Remove(0); + --m_pData->pActUndoArray->nCurUndoAction; + } } + + // append new action + m_pData->pActUndoArray->aUndoActions.Insert( pAction, m_pData->pActUndoArray->nCurUndoAction++ ); + return true; } //------------------------------------------------------------------------ -SfxUndoAction* SfxUndoManager::GetUndoAction( USHORT nNo ) const +void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerge ) { - DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoAction(), illegal id!" ); - if( nNo < pActUndoArray->nCurUndoAction ) + UndoManagerGuard aGuard( *m_pData ); + + // add + if ( ImplAddUndoAction_NoNotify( pAction, bTryMerge, true, aGuard ) ) { - return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]; //! + // notify listeners + aGuard.scheduleNotification( &SfxUndoListener::undoActionAdded, pAction->GetComment() ); } - else +} + +//------------------------------------------------------------------------ + +size_t SfxUndoManager::GetUndoActionCount( bool const i_currentLevel ) const +{ + UndoManagerGuard aGuard( *m_pData ); + const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray; + return pUndoArray->nCurUndoAction; +} + +//------------------------------------------------------------------------ + +XubString SfxUndoManager::GetUndoActionComment( size_t nNo, bool const i_currentLevel ) const +{ + UndoManagerGuard aGuard( *m_pData ); + + String sComment; + const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray; + DBG_ASSERT( nNo < pUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment: illegal index!" ); + if( nNo < pUndoArray->nCurUndoAction ) { - return 0; + sComment = pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction - 1 - nNo ].pAction->GetComment(); } + return sComment; +} + +//------------------------------------------------------------------------ + +sal_uInt16 SfxUndoManager::GetUndoActionId() const +{ + UndoManagerGuard aGuard( *m_pData ); + + DBG_ASSERT( m_pData->pActUndoArray->nCurUndoAction > 0, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" ); + if ( m_pData->pActUndoArray->nCurUndoAction == 0 ) + return NULL; + return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction->GetId(); +} + +//------------------------------------------------------------------------ + +SfxUndoAction* SfxUndoManager::GetUndoAction( size_t nNo ) const +{ + UndoManagerGuard aGuard( *m_pData ); + + DBG_ASSERT( nNo < m_pData->pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoAction(), illegal id!" ); + if( nNo >= m_pData->pActUndoArray->nCurUndoAction ) + return NULL; + return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1-nNo].pAction; } //------------------------------------------------------------------------ @@ -358,196 +733,284 @@ SfxUndoAction* SfxUndoManager::GetUndoAction( USHORT nNo ) const /** clears the redo stack and removes the top undo action */ void SfxUndoManager::RemoveLastUndoAction() { - DBG_ASSERT( pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::RemoveLastUndoAction(), no action to remove?!" ); - if( pActUndoArray->nCurUndoAction ) - { - pActUndoArray->nCurUndoAction--; + UndoManagerGuard aGuard( *m_pData ); + + ENSURE_OR_RETURN_VOID( m_pData->pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::RemoveLastUndoAction(), no action to remove?!" ); - // delete redo-actions and top action - USHORT nPos; - for ( nPos = pActUndoArray->aUndoActions.Count(); nPos > pActUndoArray->nCurUndoAction; --nPos ) - delete pActUndoArray->aUndoActions[nPos-1]; + m_pData->pActUndoArray->nCurUndoAction--; - pActUndoArray->aUndoActions.Remove( - pActUndoArray->nCurUndoAction, - pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction ); + // delete redo-actions and top action + for ( size_t nPos = m_pData->pActUndoArray->aUndoActions.size(); nPos > m_pData->pActUndoArray->nCurUndoAction; --nPos ) + { + aGuard.markForDeletion( m_pData->pActUndoArray->aUndoActions[nPos-1].pAction ); } + + m_pData->pActUndoArray->aUndoActions.Remove( + m_pData->pActUndoArray->nCurUndoAction, + m_pData->pActUndoArray->aUndoActions.size() - m_pData->pActUndoArray->nCurUndoAction ); } //------------------------------------------------------------------------ -BOOL SfxUndoManager::Undo( USHORT ) +bool SfxUndoManager::IsDoing() const { - bool bUndoWasEnabled = mbUndoEnabled; - mbUndoEnabled = false; + UndoManagerGuard aGuard( *m_pData ); + return m_pData->mbDoing; +} - BOOL bRet = FALSE; +//------------------------------------------------------------------------ - try - { - DBG_ASSERT( pActUndoArray == pUndoArray, "svl::SfxUndoManager::Undo(), LeaveListAction() not yet called!" ); - if ( pActUndoArray->nCurUndoAction ) - { - Undo( *pActUndoArray->aUndoActions[ --pActUndoArray->nCurUndoAction ] ); - bRet = TRUE; - } - } - catch( Exception& e ) - { - mbUndoEnabled = bUndoWasEnabled; - throw e; - } - mbUndoEnabled = bUndoWasEnabled; - return bRet; +sal_Bool SfxUndoManager::Undo() +{ + return ImplUndo( NULL ); } //------------------------------------------------------------------------ -void SfxUndoManager::Undo( SfxUndoAction &rAction ) +sal_Bool SfxUndoManager::UndoWithContext( SfxUndoContext& i_context ) { - bool bUndoWasEnabled = mbUndoEnabled; - mbUndoEnabled = false; + return ImplUndo( &i_context ); +} + +//------------------------------------------------------------------------ + +sal_Bool SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull ) +{ + UndoManagerGuard aGuard( *m_pData ); + OSL_ENSURE( !IsDoing(), "SfxUndoManager::Undo: *nested* Undo/Redo actions? How this?" ); + + ::comphelper::FlagGuard aDoingGuard( m_pData->mbDoing ); + LockGuard aLockGuard( *this ); + + if ( ImplIsInListAction_Lock() ) + { + OSL_ENSURE( false, "SfxUndoManager::Undo: not possible when within a list action!" ); + return sal_False; + } + + if ( m_pData->pActUndoArray->nCurUndoAction == 0 ) + { + OSL_ENSURE( false, "SfxUndoManager::Undo: undo stack is empty!" ); + return sal_False; + } + + SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ --m_pData->pActUndoArray->nCurUndoAction ].pAction; + const String sActionComment = pAction->GetComment(); try { - rAction.Undo(); + // clear the guard/mutex before calling into the SfxUndoAction - this can be an extension-implemented UNO component + // nowadays ... + aGuard.clear(); + if ( i_contextOrNull != NULL ) + pAction->UndoWithContext( *i_contextOrNull ); + else + pAction->Undo(); + aGuard.reset(); } - catch( Exception& e ) + catch( ... ) { - mbUndoEnabled = bUndoWasEnabled; - throw e; + aGuard.reset(); + + // in theory, somebody might have tampered with all of *m_pData while the mutex was unlocked. So, see if + // we still find pAction in our current Undo array + size_t nCurAction = 0; + while ( nCurAction < m_pData->pActUndoArray->aUndoActions.size() ) + { + if ( m_pData->pActUndoArray->aUndoActions[ nCurAction++ ].pAction == pAction ) + { + // the Undo action is still there ... + // assume the error is a permanent failure, and clear the Undo stack + ImplClearUndo( aGuard ); + throw; + } + } + OSL_ENSURE( false, "SfxUndoManager::Undo: can't clear the Undo stack after the failure - some other party was faster ..." ); + throw; } - mbUndoEnabled = bUndoWasEnabled; + aGuard.scheduleNotification( &SfxUndoListener::actionUndone, sActionComment ); + + return sal_True; } //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetRedoActionCount() const +size_t SfxUndoManager::GetRedoActionCount( bool const i_currentLevel ) const { - return pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction; //! + UndoManagerGuard aGuard( *m_pData ); + return ImplGetRedoActionCount_Lock( i_currentLevel ); } //------------------------------------------------------------------------ -XubString SfxUndoManager::GetRedoActionComment( USHORT nNo ) const +size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel ) const { - return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetComment(); //! + const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray; + return pUndoArray->aUndoActions.size() - pUndoArray->nCurUndoAction; } //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetRedoActionId( USHORT nNo ) const +XubString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const { - return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetId(); //! + UndoManagerGuard aGuard( *m_pData ); + const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray; + return pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction->GetComment(); } //------------------------------------------------------------------------ -BOOL SfxUndoManager::Redo( USHORT ) +sal_Bool SfxUndoManager::Redo() { - bool bUndoWasEnabled = mbUndoEnabled; - mbUndoEnabled = false; - - BOOL bRet = FALSE; + return ImplRedo( NULL ); +} - try - { - if ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction ) - { - Redo( *pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction++] ); - bRet = TRUE; - } - } - catch( Exception& e ) - { - mbUndoEnabled = bUndoWasEnabled; - throw e; - } +//------------------------------------------------------------------------ - mbUndoEnabled = bUndoWasEnabled; - return bRet; +sal_Bool SfxUndoManager::RedoWithContext( SfxUndoContext& i_context ) +{ + return ImplRedo( &i_context ); } //------------------------------------------------------------------------ -void SfxUndoManager::Redo( SfxUndoAction &rAction ) +sal_Bool SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull ) { - bool bUndoWasEnabled = mbUndoEnabled; - mbUndoEnabled = false; + UndoManagerGuard aGuard( *m_pData ); + OSL_ENSURE( !IsDoing(), "SfxUndoManager::Redo: *nested* Undo/Redo actions? How this?" ); + + ::comphelper::FlagGuard aDoingGuard( m_pData->mbDoing ); + LockGuard aLockGuard( *this ); + + if ( ImplIsInListAction_Lock() ) + { + OSL_ENSURE( false, "SfxUndoManager::Redo: not possible when within a list action!" ); + return sal_False; + } + + if ( m_pData->pActUndoArray->nCurUndoAction >= m_pData->pActUndoArray->aUndoActions.size() ) + { + OSL_ENSURE( false, "SfxUndoManager::Redo: redo stack is empty!" ); + return sal_False; + } + SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction++ ].pAction; + const String sActionComment = pAction->GetComment(); try { - rAction.Redo(); + // clear the guard/mutex before calling into the SfxUndoAction - this can be a extension-implemented UNO component + // nowadays ... + aGuard.clear(); + if ( i_contextOrNull != NULL ) + pAction->RedoWithContext( *i_contextOrNull ); + else + pAction->Redo(); + aGuard.reset(); } - catch( Exception& e ) + catch( ... ) { - mbUndoEnabled = bUndoWasEnabled; - throw e; + aGuard.reset(); + + // in theory, somebody might have tampered with all of *m_pData while the mutex was unlocked. So, see if + // we still find pAction in our current Undo array + size_t nCurAction = 0; + while ( nCurAction < m_pData->pActUndoArray->aUndoActions.size() ) + { + if ( m_pData->pActUndoArray->aUndoActions[ nCurAction ].pAction == pAction ) + { + // the Undo action is still there ... + // assume the error is a permanent failure, and clear the Undo stack + ImplClearRedo( aGuard, IUndoManager::CurrentLevel ); + throw; + } + ++nCurAction; + } + OSL_ENSURE( false, "SfxUndoManager::Redo: can't clear the Undo stack after the failure - some other party was faster ..." ); + throw; } - mbUndoEnabled = bUndoWasEnabled; + aGuard.scheduleNotification( &SfxUndoListener::actionRedone, sActionComment ); + + return sal_True; } //------------------------------------------------------------------------ -USHORT SfxUndoManager::GetRepeatActionCount() const +size_t SfxUndoManager::GetRepeatActionCount() const { - return pActUndoArray->aUndoActions.Count(); + UndoManagerGuard aGuard( *m_pData ); + return m_pData->pActUndoArray->aUndoActions.size(); } //------------------------------------------------------------------------ -XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo ) const +XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget) const { - return pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 - nNo ] + UndoManagerGuard aGuard( *m_pData ); + return m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->aUndoActions.size() - 1 ].pAction ->GetRepeatComment(rTarget); } //------------------------------------------------------------------------ -BOOL SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, USHORT /*nFrom*/, USHORT /*nCount*/ ) +sal_Bool SfxUndoManager::Repeat( SfxRepeatTarget &rTarget ) { - if ( pActUndoArray->aUndoActions.Count() ) + UndoManagerGuard aGuard( *m_pData ); + if ( !m_pData->pActUndoArray->aUndoActions.empty() ) { - Repeat( rTarget, *pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 ] ); - return TRUE; + SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->aUndoActions.size() - 1 ].pAction; + aGuard.clear(); + if ( pAction->CanRepeat( rTarget ) ) + pAction->Repeat( rTarget ); + return sal_True; } - return FALSE; + return sal_False; } //------------------------------------------------------------------------ -void SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) +sal_Bool SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget ) const { - if ( rAction.CanRepeat(rTarget) ) - rAction.Repeat(rTarget); + UndoManagerGuard aGuard( *m_pData ); + if ( !m_pData->pActUndoArray->aUndoActions.empty() ) + { + size_t nActionNo = m_pData->pActUndoArray->aUndoActions.size() - 1; + return m_pData->pActUndoArray->aUndoActions[nActionNo].pAction->CanRepeat(rTarget); + } + return sal_False; } //------------------------------------------------------------------------ -BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const +void SfxUndoManager::AddUndoListener( SfxUndoListener& i_listener ) { - return rAction.CanRepeat(rTarget); + UndoManagerGuard aGuard( *m_pData ); + m_pData->aListeners.push_back( &i_listener ); } //------------------------------------------------------------------------ -BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo ) const +void SfxUndoManager::RemoveUndoListener( SfxUndoListener& i_listener ) { - if ( pActUndoArray->aUndoActions.Count() > nNo ) + UndoManagerGuard aGuard( *m_pData ); + for ( UndoListeners::iterator lookup = m_pData->aListeners.begin(); + lookup != m_pData->aListeners.end(); + ++lookup + ) { - USHORT nActionNo = pActUndoArray->aUndoActions.Count() - 1 - nNo; - return pActUndoArray->aUndoActions[nActionNo]->CanRepeat(rTarget); + if ( (*lookup) == &i_listener ) + { + m_pData->aListeners.erase( lookup ); + break; + } } - - return FALSE; } //------------------------------------------------------------------------ void SfxUndoManager::EnterListAction( - const XubString& rComment, const XubString &rRepeatComment, USHORT nId ) + const XubString& rComment, const XubString &rRepeatComment, sal_uInt16 nId ) /* [Beschreibung] @@ -555,74 +1018,275 @@ void SfxUndoManager::EnterListAction( */ { - if( !mbUndoEnabled ) + UndoManagerGuard aGuard( *m_pData ); + + if( !ImplIsUndoEnabled_Lock() ) return; - if ( !pUndoArray->nMaxUndoActions ) + if ( !m_pData->pUndoArray->nMaxUndoActions ) return; - pFatherUndoArray=pActUndoArray; - SfxListUndoAction *pAction=new SfxListUndoAction( - rComment, rRepeatComment, nId, pActUndoArray); - AddUndoAction( pAction ); - pActUndoArray=pAction; + m_pData->pFatherUndoArray = m_pData->pActUndoArray; + SfxListUndoAction* pAction = new SfxListUndoAction( rComment, rRepeatComment, nId, m_pData->pActUndoArray ); + OSL_VERIFY( ImplAddUndoAction_NoNotify( pAction, false, false, aGuard ) ); + // expected to succeed: all conditions under which it could fail should have been checked already + m_pData->pActUndoArray = pAction; + + // notification + aGuard.scheduleNotification( &SfxUndoListener::listActionEntered, rComment ); } //------------------------------------------------------------------------ -void SfxUndoManager::LeaveListAction() +bool SfxUndoManager::IsInListAction() const +{ + UndoManagerGuard aGuard( *m_pData ); + return ImplIsInListAction_Lock(); +} -/* [Beschreibung] +//------------------------------------------------------------------------ - Verlaesst die aktuelle ListAction und geht eine Ebene nach oben. -*/ +bool SfxUndoManager::ImplIsInListAction_Lock() const { - if ( !mbUndoEnabled ) - return; + return ( m_pData->pActUndoArray != m_pData->pUndoArray ); +} - if ( !pUndoArray->nMaxUndoActions ) - return; +//------------------------------------------------------------------------ + +size_t SfxUndoManager::GetListActionDepth() const +{ + UndoManagerGuard aGuard( *m_pData ); + size_t nDepth(0); - if( pActUndoArray == pUndoArray ) + SfxUndoArray* pLookup( m_pData->pActUndoArray ); + while ( pLookup != m_pData->pUndoArray ) { - OSL_FAIL( "svl::SfxUndoManager::LeaveListAction(), called without calling EnterListAction()!" ); - return; + pLookup = pLookup->pFatherUndoArray; + ++nDepth; } - DBG_ASSERT(pActUndoArray->pFatherUndoArray,"svl::SfxUndoManager::LeaveListAction(), no father undo array!?"); + return nDepth; +} + +//------------------------------------------------------------------------ - SfxUndoArray* pTmp=pActUndoArray; - pActUndoArray=pActUndoArray->pFatherUndoArray; +size_t SfxUndoManager::LeaveListAction() +{ + UndoManagerGuard aGuard( *m_pData ); + size_t nCount = ImplLeaveListAction( false, aGuard ); - // If no undo action where added, delete the undo list action - SfxUndoAction *pTmpAction= pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1]; - if(!pTmp->nCurUndoAction) + if ( m_pData->mbClearUntilTopLevel ) { - pActUndoArray->aUndoActions.Remove( --pActUndoArray->nCurUndoAction); - delete pTmpAction; + ImplClearCurrentLevel_NoNotify( aGuard ); + if ( !ImplIsInListAction_Lock() ) + { + m_pData->mbClearUntilTopLevel = false; + aGuard.scheduleNotification( &SfxUndoListener::cleared ); + } + nCount = 0; } - else + + return nCount; +} + +//------------------------------------------------------------------------ + +size_t SfxUndoManager::LeaveAndMergeListAction() +{ + UndoManagerGuard aGuard( *m_pData ); + return ImplLeaveListAction( true, aGuard ); +} + +//------------------------------------------------------------------------ + +size_t SfxUndoManager::ImplLeaveListAction( const bool i_merge, UndoManagerGuard& i_guard ) +{ + if ( !ImplIsUndoEnabled_Lock() ) + return 0; + + if ( !m_pData->pUndoArray->nMaxUndoActions ) + return 0; + + if( !ImplIsInListAction_Lock() ) + { + DBG_ERROR( "svl::SfxUndoManager::ImplLeaveListAction, called without calling EnterListAction()!" ); + return 0; + } + + DBG_ASSERT( m_pData->pActUndoArray->pFatherUndoArray, "SfxUndoManager::ImplLeaveListAction, no father undo array!?" ); + + // the array/level which we're about to leave + SfxUndoArray* pArrayToLeave = m_pData->pActUndoArray; + // one step up + m_pData->pActUndoArray = m_pData->pActUndoArray->pFatherUndoArray; + + // If no undo actions were added to the list, delete the list action + const size_t nListActionElements = pArrayToLeave->nCurUndoAction; + if ( nListActionElements == 0 ) + { + SfxUndoAction* pCurrentAction= m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction-1 ].pAction; + m_pData->pActUndoArray->aUndoActions.Remove( --m_pData->pActUndoArray->nCurUndoAction ); + i_guard.markForDeletion( pCurrentAction ); + + i_guard.scheduleNotification( &SfxUndoListener::listActionCancelled ); + return 0; + } + + // now that it is finally clear the list action is non-trivial, and does participate in the Undo stack, clear + // the redo stack + ImplClearRedo( i_guard, IUndoManager::CurrentLevel ); + + SfxUndoAction* pCurrentAction= m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction-1 ].pAction; + SfxListUndoAction* pListAction = dynamic_cast< SfxListUndoAction * >( pCurrentAction ); + ENSURE_OR_RETURN( pListAction, "SfxUndoManager::ImplLeaveListAction: list action expected at this position!", nListActionElements ); + + if ( i_merge ) + { + // merge the list action with its predecessor on the same level + OSL_ENSURE( m_pData->pActUndoArray->nCurUndoAction > 1, + "SfxUndoManager::ImplLeaveListAction: cannot merge the list action if there's no other action on the same level - check this beforehand!" ); + if ( m_pData->pActUndoArray->nCurUndoAction > 1 ) + { + SfxUndoAction* pPreviousAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction - 2 ].pAction; + m_pData->pActUndoArray->aUndoActions.Remove( m_pData->pActUndoArray->nCurUndoAction - 2 ); + --m_pData->pActUndoArray->nCurUndoAction; + pListAction->aUndoActions.Insert( pPreviousAction, 0 ); + ++pListAction->nCurUndoAction; + + pListAction->SetComment( pPreviousAction->GetComment() ); + } + } + + // if the undo array has no comment, try to get it from its children + if ( pListAction->GetComment().Len() == 0 ) + { + for( size_t n = 0; n < pListAction->aUndoActions.size(); n++ ) + { + if( pListAction->aUndoActions[n].pAction->GetComment().Len() ) + { + pListAction->SetComment( pListAction->aUndoActions[n].pAction->GetComment() ); + break; + } + } + } + + // notify listeners + i_guard.scheduleNotification( &SfxUndoListener::listActionLeft, pListAction->GetComment() ); + + // outta here + return nListActionElements; +} + +//------------------------------------------------------------------------ +UndoStackMark SfxUndoManager::MarkTopUndoAction() +{ + UndoManagerGuard aGuard( *m_pData ); + + OSL_ENSURE( !IsInListAction(), + "SfxUndoManager::MarkTopUndoAction(): suspicious call!" ); + OSL_ENSURE((m_pData->mnMarks + 1) < (m_pData->mnEmptyMark - 1), + "SfxUndoManager::MarkTopUndoAction(): mark overflow!"); + + size_t const nActionPos = m_pData->pUndoArray->nCurUndoAction; + if (0 == nActionPos) + { + --m_pData->mnEmptyMark; + return m_pData->mnEmptyMark; + } + + m_pData->pUndoArray->aUndoActions[ nActionPos-1 ].aMarks.push_back( + ++m_pData->mnMarks ); + return m_pData->mnMarks; +} + +//------------------------------------------------------------------------ +void SfxUndoManager::RemoveMark( UndoStackMark const i_mark ) +{ + UndoManagerGuard aGuard( *m_pData ); + + if ((m_pData->mnEmptyMark < i_mark) || (MARK_INVALID == i_mark)) + { + return; // nothing to remove + } + else if (i_mark == m_pData->mnEmptyMark) { - // if the undo array has no comment, try to get it from its children - SfxListUndoAction* pList = dynamic_cast< SfxListUndoAction * >( pTmpAction ); - if( pList && pList->GetComment().Len() == 0 ) + --m_pData->mnEmptyMark; // never returned from MarkTop => invalid + return; + } + + for ( size_t i=0; i<m_pData->pUndoArray->aUndoActions.size(); ++i ) + { + MarkedUndoAction& rAction = m_pData->pUndoArray->aUndoActions[i]; + for ( ::std::vector< UndoStackMark >::iterator markPos = rAction.aMarks.begin(); + markPos != rAction.aMarks.end(); + ++markPos + ) { - USHORT n; - for( n = 0; n < pList->aUndoActions.Count(); n++ ) + if ( *markPos == i_mark ) { - if( pList->aUndoActions[n]->GetComment().Len() ) - { - pList->SetComment( pList->aUndoActions[n]->GetComment() ); - break; - } + rAction.aMarks.erase( markPos ); + return; } } } + OSL_ENSURE( false, "SfxUndoManager::RemoveMark: mark not found!" ); + // TODO: this might be too offensive. There are situations where we implicitly remove marks + // without our clients, in particular the client which created the mark, having a chance to know + // about this. +} + +//------------------------------------------------------------------------ +bool SfxUndoManager::HasTopUndoActionMark( UndoStackMark const i_mark ) +{ + UndoManagerGuard aGuard( *m_pData ); + + size_t nActionPos = m_pData->pUndoArray->nCurUndoAction; + if ( nActionPos == 0 ) + { + return (i_mark == m_pData->mnEmptyMark); + } + + const MarkedUndoAction& rAction = + m_pData->pUndoArray->aUndoActions[ nActionPos-1 ]; + for ( ::std::vector< UndoStackMark >::const_iterator markPos = rAction.aMarks.begin(); + markPos != rAction.aMarks.end(); + ++markPos + ) + { + if ( *markPos == i_mark ) + return true; + } + + return false; +} + +//------------------------------------------------------------------------ + +void SfxUndoManager::RemoveOldestUndoActions( size_t const i_count ) +{ + UndoManagerGuard aGuard( *m_pData ); + + size_t nActionsToRemove = i_count; + while ( nActionsToRemove ) + { + SfxUndoAction* pActionToRemove = m_pData->pUndoArray->aUndoActions[0].pAction; + + if ( IsInListAction() && ( m_pData->pUndoArray->nCurUndoAction == 1 ) ) + { + OSL_ENSURE( false, "SfxUndoManager::RemoveOldestUndoActions: cannot remove a not-yet-closed list action!" ); + return; + } + + aGuard.markForDeletion( pActionToRemove ); + m_pData->pUndoArray->aUndoActions.Remove( 0 ); + --m_pData->pUndoArray->nCurUndoAction; + --nActionsToRemove; + } } //------------------------------------------------------------------------ -USHORT SfxListUndoAction::GetId() const +sal_uInt16 SfxListUndoAction::GetId() const { return nId; } @@ -655,7 +1319,7 @@ SfxListUndoAction::SfxListUndoAction ( const XubString &rComment, const XubString rRepeatComment, - USHORT Id, + sal_uInt16 Id, SfxUndoArray *pFather ) : nId(Id), aComment(rComment), aRepeatComment(rRepeatComment) @@ -668,8 +1332,17 @@ SfxListUndoAction::SfxListUndoAction void SfxListUndoAction::Undo() { - for(INT16 i=nCurUndoAction-1;i>=0;i--) - aUndoActions[i]->Undo(); + for(size_t i=nCurUndoAction;i>0;) + aUndoActions[--i].pAction->Undo(); + nCurUndoAction=0; +} + +//------------------------------------------------------------------------ + +void SfxListUndoAction::UndoWithContext( SfxUndoContext& i_context ) +{ + for(size_t i=nCurUndoAction;i>0;) + aUndoActions[--i].pAction->UndoWithContext( i_context ); nCurUndoAction=0; } @@ -677,39 +1350,48 @@ void SfxListUndoAction::Undo() void SfxListUndoAction::Redo() { - for(USHORT i=nCurUndoAction;i<aUndoActions.Count();i++) - aUndoActions[i]->Redo(); - nCurUndoAction = aUndoActions.Count(); + for(size_t i=nCurUndoAction;i<aUndoActions.size();i++) + aUndoActions[i].pAction->Redo(); + nCurUndoAction = aUndoActions.size(); +} + +//------------------------------------------------------------------------ + +void SfxListUndoAction::RedoWithContext( SfxUndoContext& i_context ) +{ + for(size_t i=nCurUndoAction;i<aUndoActions.size();i++) + aUndoActions[i].pAction->RedoWithContext( i_context ); + nCurUndoAction = aUndoActions.size(); } //------------------------------------------------------------------------ void SfxListUndoAction::Repeat(SfxRepeatTarget&rTarget) { - for(USHORT i=0;i<nCurUndoAction;i++) - aUndoActions[i]->Repeat(rTarget); + for(size_t i=0;i<nCurUndoAction;i++) + aUndoActions[i].pAction->Repeat(rTarget); } //------------------------------------------------------------------------ -BOOL SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const +sal_Bool SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const { - for(USHORT i=0;i<nCurUndoAction;i++) - if(!aUndoActions[i]->CanRepeat(r)) - return FALSE; - return TRUE; + for(size_t i=0;i<nCurUndoAction;i++) + if(!aUndoActions[i].pAction->CanRepeat(r)) + return sal_False; + return sal_True; } //------------------------------------------------------------------------ -BOOL SfxListUndoAction::Merge( SfxUndoAction *pNextAction ) +sal_Bool SfxListUndoAction::Merge( SfxUndoAction *pNextAction ) { - return aUndoActions.Count() && aUndoActions[aUndoActions.Count()-1]->Merge( pNextAction ); + return !aUndoActions.empty() && aUndoActions[aUndoActions.size()-1].pAction->Merge( pNextAction ); } //------------------------------------------------------------------------ -SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager) +SfxLinkUndoAction::SfxLinkUndoAction(::svl::IUndoManager *pManager) /* [Beschreibung] Richtet eine LinkAction ein, die auf einen weiteren UndoManager zeigt. @@ -719,10 +1401,15 @@ SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager) { pUndoManager = pManager; + SfxUndoManager* pUndoManagerImplementation = dynamic_cast< SfxUndoManager* >( pManager ); + ENSURE_OR_THROW( pUndoManagerImplementation != NULL, "unsupported undo manager implementation!" ); + // yes, this cast is dirty. But reaching into the the SfxUndoManager's implementation, + // directly accessing its internal stack, and tampering with an action on that stack + // is dirty, too. if ( pManager->GetMaxUndoActionCount() ) { - USHORT nPos = pManager->GetUndoActionCount()-1; - pAction = pManager->pActUndoArray->aUndoActions[nPos]; + size_t nPos = pManager->GetUndoActionCount()-1; + pAction = pUndoManagerImplementation->m_pData->pActUndoArray->aUndoActions[nPos].pAction; pAction->SetLinked(); } else @@ -734,7 +1421,7 @@ SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager) void SfxLinkUndoAction::Undo() { if ( pAction ) - pUndoManager->Undo(1); + pUndoManager->Undo(); } //------------------------------------------------------------------------ @@ -742,15 +1429,15 @@ void SfxLinkUndoAction::Undo() void SfxLinkUndoAction::Redo() { if ( pAction ) - pUndoManager->Redo(1); + pUndoManager->Redo(); } //------------------------------------------------------------------------ -BOOL SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const +sal_Bool SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const { - return pAction && pUndoManager->CanRepeat(r,*pAction); + return pAction && pAction->CanRepeat(r); } @@ -759,8 +1446,8 @@ BOOL SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const void SfxLinkUndoAction::Repeat(SfxRepeatTarget&r) { - if ( pAction ) - pUndoManager->Repeat(r,*pAction); + if ( pAction && pAction->CanRepeat( r ) ) + pAction->Repeat( r ); } @@ -790,7 +1477,7 @@ XubString SfxLinkUndoAction::GetRepeatComment(SfxRepeatTarget&r) const SfxLinkUndoAction::~SfxLinkUndoAction() { if( pAction ) - pAction->SetLinked( FALSE ); + pAction->SetLinked( sal_False ); } @@ -798,21 +1485,18 @@ SfxLinkUndoAction::~SfxLinkUndoAction() SfxUndoArray::~SfxUndoArray() { - while ( aUndoActions.Count() ) + while ( !aUndoActions.empty() ) { - SfxUndoAction *pAction = - aUndoActions[ aUndoActions.Count() - 1 ]; - aUndoActions.Remove( aUndoActions.Count() - 1 ); + SfxUndoAction *pAction = aUndoActions[ aUndoActions.size() - 1 ].pAction; + aUndoActions.Remove( aUndoActions.size() - 1 ); delete pAction; } } -USHORT SfxLinkUndoAction::GetId() const +sal_uInt16 SfxLinkUndoAction::GetId() const { return pAction ? pAction->GetId() : 0; } - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/svl/source/uno/makefile.mk b/svl/source/uno/makefile.mk deleted file mode 100644 index 3414871305d5..000000000000 --- a/svl/source/uno/makefile.mk +++ /dev/null @@ -1,47 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=unoiface -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES= \ - $(SLO)$/registerservices.obj\ - $(SLO)$/pathservice.obj - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index 49f00d6a7845..5caca580694f 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.cxx @@ -61,37 +61,6 @@ SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SVL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo ( - void * /* _pServiceManager */, void * _pRegistryKey) -{ - if (_pRegistryKey) - { - Reference< css::registry::XRegistryKey > xRegistryKey ( - reinterpret_cast< css::registry::XRegistryKey* >(_pRegistryKey)); - Reference< css::registry::XRegistryKey > xNewKey; - - xNewKey = xRegistryKey->createKey ( - OUString(RTL_CONSTASCII_USTRINGPARAM( - "/com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject/UNO/SERVICES" )) ); - xNewKey->createKey ( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier")) ); - - xNewKey = xRegistryKey->createKey ( - OUString(RTL_CONSTASCII_USTRINGPARAM( - "/com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject/UNO/SERVICES" )) ); - xNewKey->createKey ( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter")) ); - - xNewKey = xRegistryKey->createKey( - OUString(RTL_CONSTASCII_USTRINGPARAM("/com.sun.star.comp.svl.PathService/UNO/SERVICES")) ); - xNewKey->createKey ( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.config.SpecialConfigManager")) ); - - return sal_True; - } - return sal_False; -} - SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/) { diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx index aa5b75e2f350..7ec1a3b929ac 100644 --- a/svl/unx/source/svdde/ddedummy.cxx +++ b/svl/unx/source/svdde/ddedummy.cxx @@ -43,7 +43,7 @@ DdeData::DdeData( const DdeData& ) { } -DdeData::DdeData( const void*, long, ULONG) +DdeData::DdeData( const void*, long, sal_uLong) { } @@ -51,11 +51,11 @@ DdeData::~DdeData( void ) { } -void DdeData::SetFormat( ULONG ) +void DdeData::SetFormat( sal_uLong ) { } -ULONG DdeData::GetFormat() const +sal_uLong DdeData::GetFormat() const { return 0L; } @@ -112,7 +112,7 @@ void DdeTransaction::Execute(void) { } -void DdeTransaction::Done( BOOL ) +void DdeTransaction::Done( sal_Bool ) { } @@ -169,34 +169,34 @@ void DdeTopic::RemoveItem( const DdeItem& ) { } -DdeData* DdeTopic::Get( ULONG ) +DdeData* DdeTopic::Get( sal_uLong ) { return NULL; } -BOOL DdeTopic::MakeItem( const String& ) +sal_Bool DdeTopic::MakeItem( const String& ) { - return FALSE; + return sal_False; } -BOOL DdeTopic::StartAdviseLoop() +sal_Bool DdeTopic::StartAdviseLoop() { - return FALSE; + return sal_False; } -BOOL DdeTopic::StopAdviseLoop() +sal_Bool DdeTopic::StopAdviseLoop() { - return FALSE; + return sal_False; } -BOOL DdeTopic::Execute( const String* ) +sal_Bool DdeTopic::Execute( const String* ) { - return FALSE; + return sal_False; } -BOOL DdeTopic::Put( const DdeData* ) +sal_Bool DdeTopic::Put( const DdeData* ) { - return FALSE; + return sal_False; } const String& DdeTopic::GetName() const @@ -229,17 +229,17 @@ String DdeService::SysTopicGet(const String& rString) { return rString; } -BOOL DdeService::SysTopicExecute(const String*) { - return FALSE; +sal_Bool DdeService::SysTopicExecute(const String*) { + return sal_False; } DdeService::~DdeService() { } -BOOL DdeService::IsBusy() +sal_Bool DdeService::IsBusy() { - return FALSE; + return sal_False; } String DdeService::GetHelp() @@ -247,7 +247,7 @@ String DdeService::GetHelp() return String::EmptyString(); } -void DdeService::AddFormat( ULONG ) +void DdeService::AddFormat( sal_uLong ) { } @@ -259,9 +259,9 @@ void DdeService::RemoveTopic( const DdeTopic& ) { } -BOOL DdeService::MakeTopic( const String& ) +sal_Bool DdeService::MakeTopic( const String& ) { - return FALSE; + return sal_False; } const String& DdeService::GetName() const @@ -306,17 +306,17 @@ DdeItem( rItem ) { } -DdeData* DdeGetPutItem::Get( ULONG ) +DdeData* DdeGetPutItem::Get( sal_uLong ) { return NULL; } -BOOL DdeGetPutItem::Put( const DdeData* ) +sal_Bool DdeGetPutItem::Put( const DdeData* ) { - return FALSE; + return sal_False; } -void DdeGetPutItem::AdviseLoop( BOOL ) +void DdeGetPutItem::AdviseLoop( sal_Bool ) { } diff --git a/svl/unx/source/svdde/makefile.mk b/svl/unx/source/svdde/makefile.mk deleted file mode 100644 index 3d2ae4308821..000000000000 --- a/svl/unx/source/svdde/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/.. - -PRJNAME=svl -TARGET=svdde - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/ddedummy.obj - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/util/makefile.mk b/svl/util/makefile.mk deleted file mode 100644 index c19dc58914a1..000000000000 --- a/svl/util/makefile.mk +++ /dev/null @@ -1,120 +0,0 @@ -#************************************************************************* -#* -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -PRJNAME=svl -TARGET=svl -RESTARGETSIMPLE=svs -GEN_HID=TRUE -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- general section ---------------------------------------------------- - -.IF "$(GUI)"!="UNX" -LIB2TARGET= $(LB)$/isvl.lib -LIB2FILES= $(LB)$/_isvl.lib -.ENDIF - -LIB1TARGET= $(SLB)$/svl.lib -LIB1FILES= \ - $(SLB)$/config.lib \ - $(SLB)$/svdde.lib \ - $(SLB)$/undo.lib \ - $(SLB)$/numbers.lib \ - $(SLB)$/numbers.uno.lib \ - $(SLB)$/filerec.lib \ - $(SLB)$/filepicker.lib \ - $(SLB)$/items.lib \ - $(SLB)$/misc.lib \ - $(SLB)$/notify.lib \ - $(SLB)$/unoiface.lib \ - $(SLB)$/svarray.lib \ - $(SLB)$/svsql.lib - -# generation of resourcen-lib ---------------------------------------- - -RESLIB1NAME= $(RESTARGETSIMPLE) -RESLIB1SRSFILES=\ - $(SRS)$/items.srs \ - $(SRS)$/misc.srs - -# build the shared library -------------------------------------------------- - -SHL1TARGET= svl$(DLLPOSTFIX) -SHL1IMPLIB= _isvl -SHL1USE_EXPORTS=name -#Do not link with VCL or any other library that links with VCL -SHL1STDLIBS= \ - $(UNOTOOLSLIB) \ - $(TOOLSLIB) \ - $(I18NISOLANGLIB) \ - $(UCBHELPERLIB) \ - $(COMPHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SOTLIB) \ - $(SALLIB) - -.IF "$(GUI)"=="WNT" -SHL1STDLIBS+= \ - $(UWINAPILIB) \ - $(ADVAPI32LIB) \ - $(GDI32LIB) -.ENDIF # WNT - -SHL1LIBS= $(SLB)$/svl.lib - -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME= $(SHL1TARGET) -DEF1DEPN= $(SLB)$/svl.lib -DEFLIB1NAME=svl -DEF1DES =SvTools lite - -# --- Targets ------------------------------------------------------ - -.IF "$(GUI)"=="UNX" -SVTTARGETS= $(LB)$/lib$(SHL1TARGET)$(DLLPOST) -.ELSE -SVTTARGETS= $(LB)$/isvl.lib -.ENDIF - -# just a quick fix - has to be cleaned up some day... -.IF "$(L10N-framework)"=="" -ALL: $(SLB)$/svl.lib \ - $(MISC)$/$(SHL1TARGET).def \ - $(SVTTARGETS) \ - ALLTAR -.ENDIF # "$(L10N-framework)"=="" - -.INCLUDE : target.mk - diff --git a/svl/util/svl.component b/svl/util/svl.component new file mode 100644 index 000000000000..4af1a31f5782 --- /dev/null +++ b/svl/util/svl.component @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.svl.PathService"> + <service name="com.sun.star.config.SpecialConfigManager"/> + </implementation> + <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject"> + <service name="com.sun.star.util.NumberFormatsSupplier"/> + </implementation> + <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject"> + <service name="com.sun.star.util.NumberFormatter"/> + </implementation> +</component> |