diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-18 15:55:08 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-18 15:55:08 +0100 |
commit | 4fdd55226d2972e3a256426db3122ac23b0615c6 (patch) | |
tree | 23f5b3a68382d6d3b8db0cb5e2537ed74a228d7c /sot | |
parent | c3d5444d84e18fa82235bb9d419861ac5e54f544 (diff) | |
parent | e1028d9225bc47922c387aa462887c7643bc6c40 (diff) |
Merge remote-tracking branch 'origin/integration/dev300_m101'
Conflicts:
comphelper/source/misc/servicedecl.cxx
i18npool/source/breakiterator/breakiteratorImpl.cxx
l10ntools/scripts/localize.pl
svl/source/items/itemset.cxx
svl/source/memtools/svarray.cxx
svl/source/numbers/zformat.cxx
svtools/source/brwbox/brwbox1.cxx
tools/source/stream/strmwnt.cxx
vcl/inc/vcl/graphite_adaptors.hxx
vcl/inc/vcl/graphite_layout.hxx
vcl/inc/vcl/graphite_serverfont.hxx
vcl/source/control/imgctrl.cxx
vcl/source/gdi/outdev.cxx
vcl/source/gdi/outdev3.cxx
vcl/source/glyphs/gcach_ftyp.cxx
vcl/source/glyphs/graphite_adaptors.cxx
vcl/source/glyphs/graphite_layout.cxx
vcl/source/window/winproc.cxx
vcl/unx/source/fontmanager/fontconfig.cxx
Diffstat (limited to 'sot')
55 files changed, 2147 insertions, 2621 deletions
diff --git a/sot/source/unoolestorage/makefile.mk b/sot/JunitTest_sot_complex.mk index d88f72f14e51..e515ab539659 100644 --- a/sot/source/unoolestorage/makefile.mk +++ b/sot/JunitTest_sot_complex.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# Copyright 2000, 2011 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # @@ -25,27 +25,25 @@ # #************************************************************************* -PRJ=..$/.. +$(eval $(call gb_JunitTest_JunitTest,sot_complex)) -PRJNAME=sot -TARGET=unoolestorage +$(eval $(call gb_JunitTest_add_sourcefiles,sot_complex,\ + sot/qa/complex/olesimplestorage/OLESimpleStorageTest \ + sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest \ + sot/qa/complex/olesimplestorage/Test01 \ + sot/qa/complex/olesimplestorage/TestHelper \ +)) -# --- Settings ----------------------------------------------------- +$(eval $(call gb_JunitTest_add_jars,sot_complex,\ + $(OUTDIR)/bin/OOoRunner.jar \ + $(OUTDIR)/bin/ridl.jar \ + $(OUTDIR)/bin/test.jar \ + $(OUTDIR)/bin/unoil.jar \ + $(OUTDIR)/bin/jurt.jar \ +)) -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/xolesimplestorage.obj \ - $(SLO)$/register.obj - -EXCEPTIONSFILES= \ - $(SLO)$/xolesimplestorage.obj \ - $(SLO)$/register.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk +$(eval $(call gb_JunitTest_add_classes,sot_complex,\ + complex.olesimplestorage.OLESimpleStorageUnitTest \ +)) +# vim: set noet sw=4 ts=4: diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk new file mode 100644 index 000000000000..51679534763c --- /dev/null +++ b/sot/Library_sot.mk @@ -0,0 +1,80 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2009 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_Library_Library,sot)) + +$(eval $(call gb_Library_add_package_headers,sot,sot_inc)) + +$(eval $(call gb_Library_add_precompiled_header,sot,$(SRCDIR)/sot/inc/pch/precompiled_sot)) + +$(eval $(call gb_Library_set_componentfile,sot,sot/util/sot)) + +$(eval $(call gb_Library_set_include,sot,\ + -I$(realpath $(SRCDIR)/sot/inc/pch) \ + $$(INCLUDE) \ + -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_set_defs,sot,\ + $$(DEFS) \ + -DSOT_DLLIMPLEMENTATION \ +)) + +$(eval $(call gb_Library_add_linked_libs,sot,\ + comphelper \ + cppu \ + cppuhelper \ + sal \ + tl \ + ucbhelper \ + utl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_Library_add_exception_objects,sot,\ + sot/source/unoolestorage/xolesimplestorage \ + sot/source/unoolestorage/register \ + sot/source/base/formats \ + sot/source/base/object \ + sot/source/base/exchange \ + sot/source/base/filelist \ + sot/source/base/factory \ + sot/source/sdstor/stg \ + sot/source/sdstor/stgavl \ + sot/source/sdstor/stgcache \ + sot/source/sdstor/stgdir \ + sot/source/sdstor/stgelem \ + sot/source/sdstor/stgio \ + sot/source/sdstor/stgole \ + sot/source/sdstor/stgstrms \ + sot/source/sdstor/storage \ + sot/source/sdstor/storinfo \ + sot/source/sdstor/ucbstorage \ + sot/source/sdstor/unostorageholder \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sot/inc/makefile.mk b/sot/Makefile index bc31cd07e06b..a79aff831024 100644 --- a/sot/inc/makefile.mk +++ b/sot/Makefile @@ -24,25 +24,15 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ=.. -PRJNAME=sot -TARGET=inc +ifeq ($(strip $(SOLARENV)),) +$(error No environment set!) +endif -# --- Settings ----------------------------------------------------- +gb_PARTIALBUILD := T +GBUILDDIR := $(SOLARENV)/gbuild +include $(GBUILDDIR)/gbuild.mk -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - -.IF "$(ENABLE_PCH)"!="" -ALLTAR : \ - $(SLO)$/precompiled.pch \ - $(SLO)$/precompiled_ex.pch - -.ENDIF # "$(ENABLE_PCH)"!="" +$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk))) +# vim: set noet sw=4 ts=4: diff --git a/sot/source/base/makefile.mk b/sot/Module_sot.mk index 861b7cc5969b..a9b72bf5f8d6 100644 --- a/sot/source/base/makefile.mk +++ b/sot/Module_sot.mk @@ -2,7 +2,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2000, 2010 Oracle and/or its affiliates. +# Copyright 2009 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite # @@ -14,45 +14,25 @@ # # OpenOffice.org is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License version 3 for more details # (a copy is included in the LICENSE file that accompanied this code). # # You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see +# version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ=..$/.. +$(eval $(call gb_Module_Module,sot)) -PRJNAME=sot -TARGET=base +$(eval $(call gb_Module_add_targets,sot,\ + Package_inc \ + Library_sot \ +)) -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -.IF "$(COM)"=="GCC" -NOOPTFILES= \ - $(SLO)$/exchange.obj -.ENDIF # GCC - -SLOFILES= \ - $(SLO)$/factory.obj \ - $(SLO)$/object.obj \ - $(SLO)$/exchange.obj \ - $(SLO)$/filelist.obj \ - $(SLO)$/formats.obj - -EXCEPTIONSFILES= \ - $(SLO)$/formats.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk +$(eval $(call gb_Module_add_subsequentcheck_targets,sot,\ + JunitTest_sot_complex \ +)) diff --git a/sot/Package_inc.mk b/sot/Package_inc.mk new file mode 100644 index 000000000000..1b664c263184 --- /dev/null +++ b/sot/Package_inc.mk @@ -0,0 +1,42 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2009 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_Package_Package,sot_inc,$(SRCDIR)/sot/inc)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/absdev.hxx,sot/absdev.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/agg.hxx,sot/agg.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/clsids.hxx,sot/clsids.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/exchange.hxx,sot/exchange.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/factory.hxx,sot/factory.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/filelist.hxx,sot/filelist.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/formats.hxx,sot/formats.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/object.hxx,sot/object.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotdata.hxx,sot/sotdata.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotdllapi.h,sot/sotdllapi.h)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotref.hxx,sot/sotref.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/stg.hxx,sot/stg.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/storage.hxx,sot/storage.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/storinfo.hxx,sot/storinfo.hxx)) diff --git a/sot/inc/absdev.hxx b/sot/inc/sot/absdev.hxx index a464ce1f3c55..b33954621c35 100644 --- a/sot/inc/absdev.hxx +++ b/sot/inc/sot/absdev.hxx @@ -39,7 +39,7 @@ protected: public: virtual ~AbstractDeviceData() {} virtual AbstractDeviceData * Copy() const = 0; - virtual BOOL Equals( const AbstractDeviceData & ) const = 0; + virtual sal_Bool Equals( const AbstractDeviceData & ) const = 0; JobSetup * GetJobSetup() const { return pJobSetup; } }; diff --git a/sot/inc/agg.hxx b/sot/inc/sot/agg.hxx index 2521e4701f64..ff5b282160ae 100644 --- a/sot/inc/agg.hxx +++ b/sot/inc/sot/agg.hxx @@ -42,21 +42,21 @@ struct SvAggregate SotFactory * pFact; SotObject * pObj; }; - BOOL bFactory; - BOOL bMainObj; // TRUE, das Objekt, welches das casting steuert + sal_Bool bFactory; + sal_Bool bMainObj; // sal_True, das Objekt, welches das casting steuert SvAggregate() : pFact( NULL ) - , bFactory( FALSE ) - , bMainObj( FALSE ) {} - SvAggregate( SotObject * pObjP, BOOL bMainP ) + , bFactory( sal_False ) + , bMainObj( sal_False ) {} + SvAggregate( SotObject * pObjP, sal_Bool bMainP ) : pObj( pObjP ) - , bFactory( FALSE ) + , bFactory( sal_False ) , bMainObj( bMainP ) {} SvAggregate( SotFactory * pFactP ) : pFact( pFactP ) - , bFactory( TRUE ) - , bMainObj( FALSE ) {} + , bFactory( sal_True ) + , bMainObj( sal_False ) {} }; /************** class SvAggregateMemberList *****************************/ diff --git a/sot/inc/clsids.hxx b/sot/inc/sot/clsids.hxx index 56030d778f5c..56030d778f5c 100644 --- a/sot/inc/clsids.hxx +++ b/sot/inc/sot/clsids.hxx diff --git a/sot/inc/sot/exchange.hxx b/sot/inc/sot/exchange.hxx index 48dd74e57fde..7ab886f314ac 100644 --- a/sot/inc/sot/exchange.hxx +++ b/sot/inc/sot/exchange.hxx @@ -47,7 +47,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer { // - SotFormatStringId - // --------------------- -typedef ULONG SotFormatStringId; +typedef sal_uLong SotFormatStringId; // ---------------- // - DataFlavorEx - @@ -72,14 +72,14 @@ typedef ::std::list< ::com::sun::star::datatransfer::DataFlavor > DataFlavorLi typedef ::std::list< DataFlavorEx > DataFlavorExList; SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, - ULONG nId ); + sal_uLong nId ); // ------------------------- // - Vordefinierte Formate - // ------------------------- -// Die Reihenfolge und die Werte drfen nicht gendert werden, -// da die Implementation sich darauf verlt. +// Die Reihenfolge und die Werte d�rfen nicht ge�ndert werden, +// da die Implementation sich darauf verl��t. // Standard-Formate fuer die es auch Copy/Paste-Methoden gibt #define FORMAT_STRING 1 #define FORMAT_BITMAP 2 @@ -92,70 +92,70 @@ SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorE #define FORMAT_RTF 10 // Source-Options -#define EXCHG_SOURCE_MOVEABLE ((USHORT)0x0001) -#define EXCHG_SOURCE_COPYABLE ((USHORT)0x0002) -#define EXCHG_SOURCE_LINKABLE ((USHORT)0x0004) -#define EXCHG_SOURCE_PRINTABLE ((USHORT)0x0008) -#define EXCHG_SOURCE_DISCARDABLE ((USHORT)0x0010) -#define EXCHG_SOURCE_ALL ((USHORT)0x001F) -#define EXCHG_SOURCE_DEF_COPYABLE ((USHORT)0x0020) +#define EXCHG_SOURCE_MOVEABLE ((sal_uInt16)0x0001) +#define EXCHG_SOURCE_COPYABLE ((sal_uInt16)0x0002) +#define EXCHG_SOURCE_LINKABLE ((sal_uInt16)0x0004) +#define EXCHG_SOURCE_PRINTABLE ((sal_uInt16)0x0008) +#define EXCHG_SOURCE_DISCARDABLE ((sal_uInt16)0x0010) +#define EXCHG_SOURCE_ALL ((sal_uInt16)0x001F) +#define EXCHG_SOURCE_DEF_COPYABLE ((sal_uInt16)0x0020) // Aktionen -#define EXCHG_ACTION_MASK ((USHORT)0x00FF) -#define EXCHG_INOUT_ACTION_NONE ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE) +#define EXCHG_ACTION_MASK ((sal_uInt16)0x00FF) +#define EXCHG_INOUT_ACTION_NONE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE) #define EXCHG_IN_ACTION_DEFAULT EXCHG_INOUT_ACTION_NONE -#define EXCHG_IN_ACTION_MOVE ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE) -#define EXCHG_IN_ACTION_COPY ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY) -#define EXCHG_IN_ACTION_LINK ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK) -#define EXCHG_INOUT_ACTION_PRINT ((USHORT)8) -#define EXCHG_INOUT_ACTION_DISCARD ((USHORT)16) -#define EXCHG_OUT_ACTION_INSERT_OBJ ((USHORT)17) -#define EXCHG_OUT_ACTION_INSERT_BOOKMARK ((USHORT)18) -#define EXCHG_OUT_ACTION_INSERT_FILELINK ((USHORT)19) -#define EXCHG_OUT_ACTION_INSERT_FILE ((USHORT)20) -#define EXCHG_OUT_ACTION_INSERT_FILELIST ((USHORT)21) -#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP ((USHORT)22) -#define EXCHG_OUT_ACTION_INSERT_OLE ((USHORT)23) -#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE ((USHORT)24) -#define EXCHG_OUT_ACTION_INSERT_URLBUTTON ((USHORT)25) -#define EXCHG_OUT_ACTION_INSERT_CHAOSOBJ ((USHORT)26) // OBSOLET ab 500.b ? -#define EXCHG_OUT_ACTION_REPLACE_OBJ ((USHORT)27) -#define EXCHG_OUT_ACTION_REPLACE_LINK ((USHORT)28) -#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP ((USHORT)29) -#define EXCHG_OUT_ACTION_GET_ATTRIBUTES ((USHORT)30) -#define EXCHG_OUT_ACTION_UPLOAD ((USHORT)31) // OBSOLET ab 500.b ? -#define EXCHG_OUT_ACTION_MOVE_FILE ((USHORT)32) -#define EXCHG_OUT_ACTION_MOVE_FILELIST ((USHORT)33) -#define EXCHG_OUT_ACTION_UPDATE_RANGE ((USHORT)34) -#define EXCHG_OUT_ACTION_INSERT_PRIVATE ((USHORT)35) -#define EXCHG_OUT_ACTION_INSERT_HTML ((USHORT)36) -#define EXCHG_OUT_ACTION_MOVE_PRIVATE ((USHORT)37) -#define EXCHG_OUT_ACTION_INSERT_STRING ((USHORT)38) -#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ ((USHORT)39) -#define EXCHG_OUT_ACTION_INSERT_SVXB ((USHORT)40) -#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE ((USHORT)41) -#define EXCHG_OUT_ACTION_INSERT_BITMAP ((USHORT)42) -#define EXCHG_OUT_ACTION_INSERT_DDE ((USHORT)43) -#define EXCHG_OUT_ACTION_INSERT_HYPERLINK ((USHORT)44) -#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ ((USHORT)45) -#define EXCHG_OUT_ACTION_REPLACE_SVXB ((USHORT)46) -#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE ((USHORT)47) -#define EXCHG_OUT_ACTION_REPLACE_BITMAP ((USHORT)48) -#define EXCHG_OUT_ACTION_REPLACE_GRAPH ((USHORT)49) -#define EXCHG_OUT_ACTION_INSERT_GRAPH ((USHORT)50) -#define EXCHG_OUT_ACTION_INSERT_MSGATTACH ((USHORT)51) // obsolet ab 500.b ? -#define EXCHG_OUT_ACTION_COPY_CHAOSOBJ ((USHORT)52) -#define EXCHG_OUT_ACTION_MOVE_CHAOSOBJ ((USHORT)53) -#define EXCHG_OUT_ACTION_COPY_MSGATTACH ((USHORT)54) -#define EXCHG_OUT_ACTION_COPY_BOOKMARK ((USHORT)55) -#define EXCHG_OUT_ACTION_COPY_FILE ((USHORT)56) - -#define EXCHG_OUT_ACTION_FLAG_CREATE_THEME ((USHORT)0x0100) -#define EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE ((USHORT)0x0200) -#define EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP ((USHORT)0x0400) -#define EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP ((USHORT)0x0800) -#define EXCHG_OUT_ACTION_FLAG_FILL ((USHORT)0x1000) -#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((USHORT)0x2000) +#define EXCHG_IN_ACTION_MOVE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE) +#define EXCHG_IN_ACTION_COPY ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY) +#define EXCHG_IN_ACTION_LINK ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK) +#define EXCHG_INOUT_ACTION_PRINT ((sal_uInt16)8) +#define EXCHG_INOUT_ACTION_DISCARD ((sal_uInt16)16) +#define EXCHG_OUT_ACTION_INSERT_OBJ ((sal_uInt16)17) +#define EXCHG_OUT_ACTION_INSERT_BOOKMARK ((sal_uInt16)18) +#define EXCHG_OUT_ACTION_INSERT_FILELINK ((sal_uInt16)19) +#define EXCHG_OUT_ACTION_INSERT_FILE ((sal_uInt16)20) +#define EXCHG_OUT_ACTION_INSERT_FILELIST ((sal_uInt16)21) +#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP ((sal_uInt16)22) +#define EXCHG_OUT_ACTION_INSERT_OLE ((sal_uInt16)23) +#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE ((sal_uInt16)24) +#define EXCHG_OUT_ACTION_INSERT_URLBUTTON ((sal_uInt16)25) +#define EXCHG_OUT_ACTION_INSERT_CHAOSOBJ ((sal_uInt16)26) // OBSOLET ab 500.b ? +#define EXCHG_OUT_ACTION_REPLACE_OBJ ((sal_uInt16)27) +#define EXCHG_OUT_ACTION_REPLACE_LINK ((sal_uInt16)28) +#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP ((sal_uInt16)29) +#define EXCHG_OUT_ACTION_GET_ATTRIBUTES ((sal_uInt16)30) +#define EXCHG_OUT_ACTION_UPLOAD ((sal_uInt16)31) // OBSOLET ab 500.b ? +#define EXCHG_OUT_ACTION_MOVE_FILE ((sal_uInt16)32) +#define EXCHG_OUT_ACTION_MOVE_FILELIST ((sal_uInt16)33) +#define EXCHG_OUT_ACTION_UPDATE_RANGE ((sal_uInt16)34) +#define EXCHG_OUT_ACTION_INSERT_PRIVATE ((sal_uInt16)35) +#define EXCHG_OUT_ACTION_INSERT_HTML ((sal_uInt16)36) +#define EXCHG_OUT_ACTION_MOVE_PRIVATE ((sal_uInt16)37) +#define EXCHG_OUT_ACTION_INSERT_STRING ((sal_uInt16)38) +#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ ((sal_uInt16)39) +#define EXCHG_OUT_ACTION_INSERT_SVXB ((sal_uInt16)40) +#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE ((sal_uInt16)41) +#define EXCHG_OUT_ACTION_INSERT_BITMAP ((sal_uInt16)42) +#define EXCHG_OUT_ACTION_INSERT_DDE ((sal_uInt16)43) +#define EXCHG_OUT_ACTION_INSERT_HYPERLINK ((sal_uInt16)44) +#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ ((sal_uInt16)45) +#define EXCHG_OUT_ACTION_REPLACE_SVXB ((sal_uInt16)46) +#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE ((sal_uInt16)47) +#define EXCHG_OUT_ACTION_REPLACE_BITMAP ((sal_uInt16)48) +#define EXCHG_OUT_ACTION_REPLACE_GRAPH ((sal_uInt16)49) +#define EXCHG_OUT_ACTION_INSERT_GRAPH ((sal_uInt16)50) +#define EXCHG_OUT_ACTION_INSERT_MSGATTACH ((sal_uInt16)51) // obsolet ab 500.b ? +#define EXCHG_OUT_ACTION_COPY_CHAOSOBJ ((sal_uInt16)52) +#define EXCHG_OUT_ACTION_MOVE_CHAOSOBJ ((sal_uInt16)53) +#define EXCHG_OUT_ACTION_COPY_MSGATTACH ((sal_uInt16)54) +#define EXCHG_OUT_ACTION_COPY_BOOKMARK ((sal_uInt16)55) +#define EXCHG_OUT_ACTION_COPY_FILE ((sal_uInt16)56) + +#define EXCHG_OUT_ACTION_FLAG_CREATE_THEME ((sal_uInt16)0x0100) +#define EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE ((sal_uInt16)0x0200) +#define EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP ((sal_uInt16)0x0400) +#define EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP ((sal_uInt16)0x0800) +#define EXCHG_OUT_ACTION_FLAG_FILL ((sal_uInt16)0x1000) +#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((sal_uInt16)0x2000) // Ziele #define EXCHG_DEST_DOC_OLEOBJ 1 @@ -183,66 +183,66 @@ class SvGlobalName; class SOT_DLLPUBLIC SotExchange { public: - static ULONG RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static ULONG RegisterFormatName( const String& rName ); - static ULONG RegisterFormatMimeType( const String& rMimeType ); + static sal_uLong RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static sal_uLong RegisterFormatName( const String& rName ); + static sal_uLong RegisterFormatMimeType( const String& rMimeType ); - static ULONG GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static String GetFormatName( ULONG nFormat ); - static sal_Bool GetFormatDataFlavor( ULONG nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static String GetFormatMimeType( ULONG nFormat ); - static BOOL IsInternal( const SvGlobalName& ); - static ULONG GetFormatIdFromMimeType( const String& rMimeType ); + static sal_uLong GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static String GetFormatName( sal_uLong nFormat ); + static sal_Bool GetFormatDataFlavor( sal_uLong nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static String GetFormatMimeType( sal_uLong nFormat ); + static sal_Bool IsInternal( const SvGlobalName& ); + static sal_uLong GetFormatIdFromMimeType( const String& rMimeType ); // bestimme die SotFormatStringId von dem registrierten Format //JP 12.11.98: diese 3 Methoden sind ab sofort ueberfluessig, da // die ClipboardIds statisch sind und aequivalent zur // SotFormatStringId ist! - static SotFormatStringId GetFormatStringId( ULONG nFormat ) + static SotFormatStringId GetFormatStringId( sal_uLong nFormat ) { return nFormat; } static SotFormatStringId GetFormatStringId( const String& rName ) { return SotExchange::RegisterFormatMimeType( rName ); } - static ULONG RegisterSotFormatName( SotFormatStringId nId ) + static sal_uLong RegisterSotFormatName( SotFormatStringId nId ) { return nId; } // same for XTransferable interface - static USHORT GetExchangeAction( + static sal_uInt16 GetExchangeAction( // XTransferable const DataFlavorExVector& rDataFlavorExVector, // Ziel der Aktion (EXCHG_DEST_*) - USHORT nDestination, + sal_uInt16 nDestination, // Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...) - USHORT nSourceOptions, + sal_uInt16 nSourceOptions, // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) - USHORT nUserAction, + sal_uInt16 nUserAction, // In:- Out: Zu benutzendes Format - ULONG& rFormat, + sal_uLong& rFormat, // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) - USHORT& rDefaultAction, + sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - ULONG nOnlyTestFormat = 0, + sal_uLong nOnlyTestFormat = 0, // In:- optional - check the contents of Xtransferable const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >* pxTransferable = NULL ); // same for XTransferable interface - static USHORT GetExchangeAction( + static sal_uInt16 GetExchangeAction( // XTransferable const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable, // Ziel der Aktion (EXCHG_DEST_*) - USHORT nDestination, + sal_uInt16 nDestination, // Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...) - USHORT nSourceOptions, + sal_uInt16 nSourceOptions, // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) - USHORT nUserAction, + sal_uInt16 nUserAction, // In:- Out: Zu benutzendes Format - ULONG& rFormat, + sal_uLong& rFormat, // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) - USHORT& rDefaultAction, + sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - ULONG nOnlyTestFormat = 0 ); + sal_uLong nOnlyTestFormat = 0 ); - static USHORT IsChart( const SvGlobalName& rName ); - static USHORT IsMath( const SvGlobalName& rName ); + static sal_uInt16 IsChart( const SvGlobalName& rName ); + static sal_uInt16 IsMath( const SvGlobalName& rName ); }; #endif // _EXCHANGE_HXX diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx index d27251987428..d6eba9afe60a 100644 --- a/sot/inc/sot/factory.hxx +++ b/sot/inc/sot/factory.hxx @@ -45,13 +45,13 @@ typedef void * (*CreateInstanceType)( SotObject ** ); //==================class SotFactory======================================= class SOT_DLLPUBLIC SotFactory : public SvGlobalName { - USHORT nSuperCount; // Anzahl der Superklassen + sal_uInt16 nSuperCount; // Anzahl der Superklassen const SotFactory ** pSuperClasses; // Superklassen CreateInstanceType pCreateFunc; String aClassName; - static BOOL ExistTest( const SvGlobalName & ); + static sal_Bool ExistTest( const SvGlobalName & ); protected: virtual ~SotFactory(); public: @@ -59,7 +59,7 @@ public: static void DeInit(); static void IncSvObjectCount( SotObject * = NULL ); static void DecSvObjectCount( SotObject * = NULL ); - static UINT32 GetSvObjectCount(); + static sal_uInt32 GetSvObjectCount(); static void TestInvariant(); static const SotFactory * Find( const SvGlobalName & ); @@ -71,10 +71,9 @@ public: void PutSuperClass( const SotFactory * ); virtual void * CreateInstance( SotObject ** ppObj = NULL ) const; void * CastAndAddRef( SotObject * ) const; - void * AggCastAndAddRef( SotObject * ) const; - BOOL Is( const SotFactory * pSuperClass ) const; - const SotFactory * GetSuper( USHORT nPos ) const + sal_Bool Is( const SotFactory * pSuperClass ) const; + const SotFactory * GetSuper( sal_uInt16 nPos ) const { return nPos < nSuperCount ? pSuperClasses[ nPos ] diff --git a/sot/inc/filelist.hxx b/sot/inc/sot/filelist.hxx index e4f920437165..0ba367fa9f72 100644 --- a/sot/inc/filelist.hxx +++ b/sot/inc/sot/filelist.hxx @@ -63,7 +63,7 @@ public: SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList ); // Clipboard, D&D usw. - static ULONG GetFormat(); + static sal_uLong GetFormat(); // Liste fuellen/abfragen diff --git a/sot/inc/sot/formats.hxx b/sot/inc/sot/formats.hxx index 36c21d6075bb..595dd09e8cd8 100644 --- a/sot/inc/sot/formats.hxx +++ b/sot/inc/sot/formats.hxx @@ -47,145 +47,145 @@ #endif #include <sot/exchange.hxx> -#define SOT_FORMAT_SYSTEM_START ((ULONG)0) -#define SOT_FORMAT_STRING ((ULONG)FORMAT_STRING) -#define SOT_FORMAT_BITMAP ((ULONG)FORMAT_BITMAP) -#define SOT_FORMAT_GDIMETAFILE ((ULONG)FORMAT_GDIMETAFILE) -#define SOT_FORMAT_PRIVATE ((ULONG)FORMAT_PRIVATE) -#define SOT_FORMAT_FILE ((ULONG)FORMAT_FILE) -#define SOT_FORMAT_FILE_LIST ((ULONG)FORMAT_FILE_LIST) -#define SOT_FORMAT_RTF ((ULONG)FORMAT_RTF) +#define SOT_FORMAT_SYSTEM_START ((sal_uLong)0) +#define SOT_FORMAT_STRING ((sal_uLong)FORMAT_STRING) +#define SOT_FORMAT_BITMAP ((sal_uLong)FORMAT_BITMAP) +#define SOT_FORMAT_GDIMETAFILE ((sal_uLong)FORMAT_GDIMETAFILE) +#define SOT_FORMAT_PRIVATE ((sal_uLong)FORMAT_PRIVATE) +#define SOT_FORMAT_FILE ((sal_uLong)FORMAT_FILE) +#define SOT_FORMAT_FILE_LIST ((sal_uLong)FORMAT_FILE_LIST) +#define SOT_FORMAT_RTF ((sal_uLong)FORMAT_RTF) -#define SOT_FORMATSTR_ID_DRAWING ((ULONG)11) -#define SOT_FORMATSTR_ID_SVXB ((ULONG)12) -#define SOT_FORMATSTR_ID_SVIM ((ULONG)13) -#define SOT_FORMATSTR_ID_XFA ((ULONG)14) -#define SOT_FORMATSTR_ID_EDITENGINE ((ULONG)15) -#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((ULONG)16) -#define SOT_FORMATSTR_ID_SOLK ((ULONG)17) -#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((ULONG)18) -#define SOT_FORMATSTR_ID_TREELISTBOX ((ULONG)19) -#define SOT_FORMATSTR_ID_NATIVE ((ULONG)20) -#define SOT_FORMATSTR_ID_OWNERLINK ((ULONG)21) -#define SOT_FORMATSTR_ID_STARSERVER ((ULONG)22) -#define SOT_FORMATSTR_ID_STAROBJECT ((ULONG)23) -#define SOT_FORMATSTR_ID_APPLETOBJECT ((ULONG)24) -#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((ULONG)25) -#define SOT_FORMATSTR_ID_STARWRITER_30 ((ULONG)26) -#define SOT_FORMATSTR_ID_STARWRITER_40 ((ULONG)27) -#define SOT_FORMATSTR_ID_STARWRITER_50 ((ULONG)28) -#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((ULONG)29) -#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((ULONG)30) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((ULONG)31) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((ULONG)32) -#define SOT_FORMATSTR_ID_STARDRAW ((ULONG)33) -#define SOT_FORMATSTR_ID_STARDRAW_40 ((ULONG)34) -#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((ULONG)35) -#define SOT_FORMATSTR_ID_STARDRAW_50 ((ULONG)36) -#define SOT_FORMATSTR_ID_STARCALC ((ULONG)37) -#define SOT_FORMATSTR_ID_STARCALC_40 ((ULONG)38) -#define SOT_FORMATSTR_ID_STARCALC_50 ((ULONG)39) -#define SOT_FORMATSTR_ID_STARCHART ((ULONG)40) -#define SOT_FORMATSTR_ID_STARCHART_40 ((ULONG)41) -#define SOT_FORMATSTR_ID_STARCHART_50 ((ULONG)42) -#define SOT_FORMATSTR_ID_STARIMAGE ((ULONG)43) -#define SOT_FORMATSTR_ID_STARIMAGE_40 ((ULONG)44) -#define SOT_FORMATSTR_ID_STARIMAGE_50 ((ULONG)45) -#define SOT_FORMATSTR_ID_STARMATH ((ULONG)46) -#define SOT_FORMATSTR_ID_STARMATH_40 ((ULONG)47) -#define SOT_FORMATSTR_ID_STARMATH_50 ((ULONG)48) -#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((ULONG)49) -#define SOT_FORMATSTR_ID_FILLED_AREA ((ULONG)50) -#define SOT_FORMATSTR_ID_HTML ((ULONG)51) -#define SOT_FORMATSTR_ID_HTML_SIMPLE ((ULONG)52) -#define SOT_FORMATSTR_ID_CHAOS ((ULONG)53) -#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((ULONG)54) -#define SOT_FORMATSTR_ID_BIFF_5 ((ULONG)55) -#define SOT_FORMATSTR_ID_BIFF__5 ((ULONG)56) -#define SOT_FORMATSTR_ID_SYLK ((ULONG)57) -#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((ULONG)58) -#define SOT_FORMATSTR_ID_LINK ((ULONG)59) -#define SOT_FORMATSTR_ID_DIF ((ULONG)60) -#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((ULONG)61) -#define SOT_FORMATSTR_ID_SONLK ((ULONG)62) -#define SOT_FORMATSTR_ID_MSWORD_DOC ((ULONG)63) -#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((ULONG)64) -#define SOT_FORMATSTR_ID_OFFICE_DOC ((ULONG)65) -#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((ULONG)66) -#define SOT_FORMATSTR_ID_NOTES_HNOTE ((ULONG)67) -#define SOT_FORMATSTR_ID_NOTES_NATIVE ((ULONG)68) -#define SOT_FORMATSTR_ID_SFX_DOC ((ULONG)69) -#define SOT_FORMATSTR_ID_EVDF ((ULONG)70) -#define SOT_FORMATSTR_ID_ESDF ((ULONG)71) -#define SOT_FORMATSTR_ID_IDF ((ULONG)72) -#define SOT_FORMATSTR_ID_EFTP ((ULONG)73) -#define SOT_FORMATSTR_ID_EFD ((ULONG)74) -#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((ULONG)75) -#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((ULONG)76) -#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((ULONG)77) -#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((ULONG)78) -#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((ULONG)79) -#define SOT_FORMATSTR_ID_SBA_TABED ((ULONG)80) -#define SOT_FORMATSTR_ID_SBA_TABID ((ULONG)81) -#define SOT_FORMATSTR_ID_SBA_JOIN ((ULONG)82) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((ULONG)83) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((ULONG)84) -#define SOT_FORMATSTR_ID_EMBED_SOURCE ((ULONG)85) -#define SOT_FORMATSTR_ID_LINK_SOURCE ((ULONG)86) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((ULONG)87) -#define SOT_FORMATSTR_ID_FILECONTENT ((ULONG)88) -#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((ULONG)89) -#define SOT_FORMATSTR_ID_FILENAME ((ULONG)90) -#define SOT_FORMATSTR_ID_SD_OLE ((ULONG)91) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((ULONG)92) -#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((ULONG)93) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((ULONG)94) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((ULONG)95) -#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((ULONG)96) -#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((ULONG)97) -#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((ULONG)98) -#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((ULONG)99) -#define SOT_FORMATSTR_ID_INET_IMAGE ((ULONG)100) -#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((ULONG)101) -#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((ULONG)102) -#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((ULONG)103) -#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((ULONG)104) -#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((ULONG)105) -#define SOT_FORMATSTR_ID_GRAPHOBJ ((ULONG)106) -#define SOT_FORMATSTR_ID_STARWRITER_60 ((ULONG)107) -#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((ULONG)108) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((ULONG)109) -#define SOT_FORMATSTR_ID_STARDRAW_60 ((ULONG)110) -#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((ULONG)111) -#define SOT_FORMATSTR_ID_STARCALC_60 ((ULONG)112) -#define SOT_FORMATSTR_ID_STARCHART_60 ((ULONG)113) -#define SOT_FORMATSTR_ID_STARMATH_60 ((ULONG)114) -#define SOT_FORMATSTR_ID_WMF ((ULONG)115) -#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((ULONG)116) -#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((ULONG)117) -#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((ULONG)118) -#define SOT_FORMATSTR_ID_DIALOG_60 ((ULONG)119) -#define SOT_FORMATSTR_ID_EMF ((ULONG)120) -#define SOT_FORMATSTR_ID_BIFF_8 ((ULONG)121) -#define SOT_FORMATSTR_ID_BMP ((ULONG)122) -#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((ULONG)123) -#define SOT_FORMATSTR_ID_STARWRITER_8 ((ULONG)124) -#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((ULONG)125) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((ULONG)126) -#define SOT_FORMATSTR_ID_STARDRAW_8 ((ULONG)127) -#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((ULONG)128) -#define SOT_FORMATSTR_ID_STARCALC_8 ((ULONG)129) -#define SOT_FORMATSTR_ID_STARCHART_8 ((ULONG)130) -#define SOT_FORMATSTR_ID_STARMATH_8 ((ULONG)131) -#define SOT_FORMATSTR_ID_XFORMS ((ULONG)132) -#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((ULONG)133) -#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((ULONG)134) -#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((ULONG)135) -#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((ULONG)136) -#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((ULONG)137) -#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((ULONG)138) -#define SOT_FORMATSTR_ID_STARBASE_8 ((ULONG)139) -#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((ULONG)140) +#define SOT_FORMATSTR_ID_DRAWING ((sal_uLong)11) +#define SOT_FORMATSTR_ID_SVXB ((sal_uLong)12) +#define SOT_FORMATSTR_ID_SVIM ((sal_uLong)13) +#define SOT_FORMATSTR_ID_XFA ((sal_uLong)14) +#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uLong)15) +#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uLong)16) +#define SOT_FORMATSTR_ID_SOLK ((sal_uLong)17) +#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uLong)18) +#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uLong)19) +#define SOT_FORMATSTR_ID_NATIVE ((sal_uLong)20) +#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uLong)21) +#define SOT_FORMATSTR_ID_STARSERVER ((sal_uLong)22) +#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uLong)23) +#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uLong)24) +#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uLong)25) +#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uLong)26) +#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uLong)27) +#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uLong)28) +#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uLong)29) +#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uLong)30) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uLong)31) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uLong)32) +#define SOT_FORMATSTR_ID_STARDRAW ((sal_uLong)33) +#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uLong)34) +#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uLong)35) +#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uLong)36) +#define SOT_FORMATSTR_ID_STARCALC ((sal_uLong)37) +#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uLong)38) +#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uLong)39) +#define SOT_FORMATSTR_ID_STARCHART ((sal_uLong)40) +#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uLong)41) +#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uLong)42) +#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uLong)43) +#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uLong)44) +#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uLong)45) +#define SOT_FORMATSTR_ID_STARMATH ((sal_uLong)46) +#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uLong)47) +#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uLong)48) +#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uLong)49) +#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uLong)50) +#define SOT_FORMATSTR_ID_HTML ((sal_uLong)51) +#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uLong)52) +#define SOT_FORMATSTR_ID_CHAOS ((sal_uLong)53) +#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uLong)54) +#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uLong)55) +#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uLong)56) +#define SOT_FORMATSTR_ID_SYLK ((sal_uLong)57) +#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uLong)58) +#define SOT_FORMATSTR_ID_LINK ((sal_uLong)59) +#define SOT_FORMATSTR_ID_DIF ((sal_uLong)60) +#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uLong)61) +#define SOT_FORMATSTR_ID_SONLK ((sal_uLong)62) +#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uLong)63) +#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uLong)64) +#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uLong)65) +#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uLong)66) +#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uLong)67) +#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uLong)68) +#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uLong)69) +#define SOT_FORMATSTR_ID_EVDF ((sal_uLong)70) +#define SOT_FORMATSTR_ID_ESDF ((sal_uLong)71) +#define SOT_FORMATSTR_ID_IDF ((sal_uLong)72) +#define SOT_FORMATSTR_ID_EFTP ((sal_uLong)73) +#define SOT_FORMATSTR_ID_EFD ((sal_uLong)74) +#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uLong)75) +#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uLong)76) +#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uLong)77) +#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uLong)78) +#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uLong)79) +#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uLong)80) +#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uLong)81) +#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uLong)82) +#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uLong)83) +#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uLong)84) +#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uLong)85) +#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uLong)86) +#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uLong)87) +#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uLong)88) +#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uLong)89) +#define SOT_FORMATSTR_ID_FILENAME ((sal_uLong)90) +#define SOT_FORMATSTR_ID_SD_OLE ((sal_uLong)91) +#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uLong)92) +#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uLong)93) +#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uLong)94) +#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uLong)95) +#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uLong)96) +#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uLong)97) +#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uLong)98) +#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uLong)99) +#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uLong)100) +#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uLong)101) +#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uLong)102) +#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uLong)103) +#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uLong)104) +#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uLong)105) +#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uLong)106) +#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uLong)107) +#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uLong)108) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uLong)109) +#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uLong)110) +#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uLong)111) +#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uLong)112) +#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uLong)113) +#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uLong)114) +#define SOT_FORMATSTR_ID_WMF ((sal_uLong)115) +#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uLong)116) +#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uLong)117) +#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uLong)118) +#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uLong)119) +#define SOT_FORMATSTR_ID_EMF ((sal_uLong)120) +#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uLong)121) +#define SOT_FORMATSTR_ID_BMP ((sal_uLong)122) +#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uLong)123) +#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uLong)124) +#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uLong)125) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uLong)126) +#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uLong)127) +#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uLong)128) +#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uLong)129) +#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uLong)130) +#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uLong)131) +#define SOT_FORMATSTR_ID_XFORMS ((sal_uLong)132) +#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uLong)133) +#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uLong)134) +#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uLong)135) +#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uLong)136) +#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uLong)137) +#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uLong)138) +#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uLong)139) +#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uLong)140) #define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_HC_GDIMETAFILE #endif // _SOT_FORMATS_HXX diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx index 28239d58c8e4..02ae430a38f8 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -40,41 +40,41 @@ #define TEST_INVARIANT #ifdef TEST_INVARIANT #define SO2_DECL_INVARIANT() \ - virtual void TestObjRef( BOOL bFree ); \ - void TestMemberObjRef( BOOL bFree ); \ - virtual void TestInvariant( BOOL bPrint ); \ - void TestMemberInvariant( BOOL bPrint ); + virtual void TestObjRef( sal_Bool bFree ); \ + void TestMemberObjRef( sal_Bool bFree ); \ + virtual void TestInvariant( sal_Bool bPrint ); \ + void TestMemberInvariant( sal_Bool bPrint ); #define SO2_IMPL_INVARIANT(ClassName) \ -void ClassName::TestObjRef( BOOL bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ } \ -void ClassName::TestInvariant( BOOL bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ } #define SO2_IMPL_INVARIANT1(ClassName,Super1) \ -void ClassName::TestObjRef( BOOL bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ } \ -void ClassName::TestInvariant( BOOL bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ } #define SO2_IMPL_INVARIANT2(ClassName,Super1,Super2) \ -void ClassName::TestObjRef( BOOL bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ Super2::TestObjRef( bFree ); \ } \ -void ClassName::TestInvariant( BOOL bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -82,14 +82,14 @@ void ClassName::TestInvariant( BOOL bPrint ) \ } #define SO2_IMPL_INVARIANT3(ClassName,Super1,Super2,Super3) \ -void ClassName::TestObjRef( BOOL bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ Super2::TestObjRef( bFree ); \ Super3::TestObjRef( bFree ); \ } \ -void ClassName::TestInvariant( BOOL bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -98,7 +98,7 @@ void ClassName::TestInvariant( BOOL bPrint ) \ } #define SO2_IMPL_INVARIANT4(ClassName,Super1,Super2,Super3,Super4) \ -void ClassName::TestObjRef( BOOL bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ @@ -106,7 +106,7 @@ void ClassName::TestObjRef( BOOL bFree ) \ Super3::TestObjRef( bFree ); \ Super4::TestObjRef( bFree ); \ } \ -void ClassName::TestInvariant( BOOL bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -378,30 +378,25 @@ SotFactory * ClassName::pFactory = NULL; \ #pragma warning(disable: 4250) #endif -class SvAggregateMemberList; struct IUnknown; class SOT_DLLPUBLIC SotObject : virtual public SvRefBase { friend class SotFactory; friend class SvObject; - SvAggregateMemberList * pAggList; // fuer Aggregation, erstes ist das MainObj - USHORT nStrongLockCount; - USHORT nOwnerLockCount; - BOOL bOwner:1, + sal_uInt16 nStrongLockCount; + sal_uInt16 nOwnerLockCount; + sal_Bool bOwner:1, bSVObject:1, // Ist Proxy, dann TRUE wenn andere Seite SV ist bInClose:1; // TRUE, im DoClose - void * DownAggCast( const SotFactory * pFact ); - void RemoveInterface( ULONG ); - void RemoveInterface( SotObject * ); #if defined (GCC) && (defined (C281) || defined (C290) || defined (C291)) public: #else protected: #endif virtual ~SotObject(); - void SetExtern() { bOwner = FALSE; } - virtual BOOL Close(); + void SetExtern() { bOwner = sal_False; } + virtual sal_Bool Close(); public: SotObject(); SO2_DECL_BASIC_CLASS_DLL(SotObject,SOTDATA()) @@ -410,33 +405,18 @@ public: // Nur damit die Makros in So3 nicht ganz ausufern virtual IUnknown * GetInterface( const SvGlobalName & ); - BOOL Owner() const { return bOwner; } - BOOL IsSvObject() const; - - // Methoden fuer die Aggregation (siehe OLE2-Spec) - BOOL ShouldDelete(); - virtual void QueryDelete(); - SvAggregateMemberList & GetAggList(); - void AddInterface( SotObject * ); - void AddInterface( SotFactory * ); - virtual SotObjectRef CreateAggObj( const SotFactory * ); - void * AggCast( const SotFactory * pFact ); - void * CastAndAddRef( const SotFactory * pFact ); - SotObject * GetMainObj() const; - - // !!! Read the Manual !!! - virtual USHORT FuzzyLock( BOOL bLock, BOOL bIntern, BOOL bClose ); - void Lock( BOOL bLock ) - { - FuzzyLock( bLock, TRUE, TRUE ); - } - USHORT GetOwnerLockCount() const { return nOwnerLockCount; } - USHORT GetStrongLockCount() const { return nStrongLockCount; } - - void OwnerLock( BOOL bLock ); + sal_Bool Owner() const { return bOwner; } + + void* CastAndAddRef( const SotFactory * pFact ); + + sal_uInt16 Lock( sal_Bool bLock ); // affects nStrongLockCount + sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; } + sal_uInt16 GetStrongLockCount() const { return nStrongLockCount; } + + void OwnerLock( sal_Bool bLock ); void RemoveOwnerLock(); - BOOL DoClose(); - BOOL IsInClose() const { return bInClose; } + sal_Bool DoClose(); + sal_Bool IsInClose() const { return bInClose; } private: // Kopieren und Zuweisen dieses Objekttyps ist nicht erlaubt @@ -447,18 +427,6 @@ private: //==================class SotObjectRef====================================== SV_IMPL_REF(SotObject) -inline SotObjectRef::SotObjectRef( SotObject * pObjP, SvCastEnum ) -{ - if( pObjP ) - { - pObj = (SotObject *)pObjP->AggCast( SotObject::ClassFactory() ); - if( pObj ) - pObj->AddRef(); - } - else - pObj = NULL; -} - //==================class SotObject*List==================================== SV_DECL_REF_LIST(SotObject,SotObject*) SV_IMPL_REF_LIST(SotObject,SotObject*) diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx index 73c1b1010cb2..0e2564ee0ae9 100644 --- a/sot/inc/sot/sotdata.hxx +++ b/sot/inc/sot/sotdata.hxx @@ -46,7 +46,7 @@ typedef ::std::vector< SotFactory* > SotFactoryList; struct SotData_Impl { - UINT32 nSvObjCount; + sal_uInt32 nSvObjCount; SotObjectList * pObjectList; SotFactoryList * pFactoryList; SotFactory * pSotObjectFactory; diff --git a/sot/inc/sot/sotref.hxx b/sot/inc/sot/sotref.hxx index cb1a991320ab..ab4b2c4e0a76 100644 --- a/sot/inc/sot/sotref.hxx +++ b/sot/inc/sot/sotref.hxx @@ -32,14 +32,12 @@ #include <tools/ref.hxx> //======================================================================== -enum SvCastEnum { SV_AGGREGATION_CAST }; #ifndef SVT_DECL_SOTOBJECT_DEFINED #define SVT_DECL_SOTOBJECT_DEFINED class SotObject; class SotObjectRef { PRV_SV_DECL_REF(SotObject) - inline SotObjectRef( SotObject * pObjP, SvCastEnum ); }; #endif @@ -51,7 +49,6 @@ class ClassName##Ref \ PRV_SV_DECL_REF(ClassName) \ inline ClassName##Ref( const SotObjectRef & ); \ inline ClassName##Ref( SotObject * pObjP ); \ - inline ClassName##Ref( SotObject * pObjP, SvCastEnum ); \ }; #define SO2_IMPL_REF(ClassName) \ @@ -63,12 +60,9 @@ inline ClassName##Ref::ClassName##Ref( const SotObjectRef & r ) \ inline ClassName##Ref::ClassName##Ref( SotObject * pObjP ) \ { \ pObj = (ClassName *)ClassName::ClassFactory()->CastAndAddRef( pObjP );\ -} \ -inline ClassName##Ref::ClassName##Ref( SotObject * pObjP, SvCastEnum ) \ -{ \ - pObj = (ClassName *)ClassName::ClassFactory()->AggCastAndAddRef( pObjP );\ } + #define SO2_DECL_IMPL_REF(ClassName) \ SO2_DECL_REF(ClassName) \ SO2_IMPL_REF(ClassName) diff --git a/sot/inc/stg.hxx b/sot/inc/sot/stg.hxx index a64390521d57..30ffbf06d2a7 100644 --- a/sot/inc/stg.hxx +++ b/sot/inc/sot/stg.hxx @@ -56,30 +56,30 @@ class StgStrm; class SvGlobalName; struct ClsId { - INT32 n1; - INT16 n2, n3; - UINT8 n4, n5, n6, n7, n8, n9, n10, n11; + sal_Int32 n1; + sal_Int16 n2, n3; + sal_uInt8 n4, n5, n6, n7, n8, n9, n10, n11; }; class SOT_DLLPUBLIC StorageBase : public SvRefBase { protected: - ULONG m_nError; // error code + sal_uLong m_nError; // error code StreamMode m_nMode; // open mode - BOOL m_bAutoCommit; + sal_Bool m_bAutoCommit; StorageBase(); virtual ~StorageBase(); public: TYPEINFO(); virtual const SvStream* GetSvStream() const = 0; - virtual BOOL Validate( BOOL=FALSE ) const = 0; - virtual BOOL ValidateMode( StreamMode ) const = 0; + virtual sal_Bool Validate( sal_Bool=sal_False ) const = 0; + virtual sal_Bool ValidateMode( StreamMode ) const = 0; void ResetError() const; - void SetError( ULONG ) const; - ULONG GetError() const; - BOOL Good() const { return BOOL( m_nError == SVSTREAM_OK ); } + void SetError( sal_uLong ) const; + sal_uLong GetError() const; + sal_Bool Good() const { return sal_Bool( m_nError == SVSTREAM_OK ); } StreamMode GetMode() const { return m_nMode; } - void SetAutoCommit( BOOL bSet ) + void SetAutoCommit( sal_Bool bSet ) { m_bAutoCommit = bSet; } }; @@ -87,16 +87,16 @@ class BaseStorageStream : public StorageBase { public: TYPEINFO(); - virtual ULONG Read( void * pData, ULONG nSize ) = 0; - virtual ULONG Write( const void* pData, ULONG nSize ) = 0; - virtual ULONG Seek( ULONG nPos ) = 0; - virtual ULONG Tell() = 0; + virtual sal_uLong Read( void * pData, sal_uLong nSize ) = 0; + virtual sal_uLong Write( const void* pData, sal_uLong nSize ) = 0; + virtual sal_uLong Seek( sal_uLong nPos ) = 0; + virtual sal_uLong Tell() = 0; virtual void Flush() = 0; - virtual BOOL SetSize( ULONG nNewSize ) = 0; - virtual BOOL CopyTo( BaseStorageStream * pDestStm ) = 0; - virtual BOOL Commit() = 0; - virtual BOOL Revert() = 0; - virtual BOOL Equals( const BaseStorageStream& rStream ) const = 0; + virtual sal_Bool SetSize( sal_uLong nNewSize ) = 0; + virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ) = 0; + virtual sal_Bool Commit() = 0; + virtual sal_Bool Revert() = 0; + virtual sal_Bool Equals( const BaseStorageStream& rStream ) const = 0; }; class SvStorageInfoList; @@ -105,45 +105,45 @@ class BaseStorage : public StorageBase public: TYPEINFO(); virtual const String& GetName() const = 0; - virtual BOOL IsRoot() const = 0; + virtual sal_Bool IsRoot() const = 0; virtual void SetClassId( const ClsId& ) = 0; virtual const ClsId& GetClassId() const = 0; virtual void SetDirty() = 0; virtual void SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual SvGlobalName GetClassName() = 0; - virtual ULONG GetFormat() = 0; + virtual sal_uLong GetFormat() = 0; virtual String GetUserName() = 0; - virtual BOOL ShouldConvert() = 0; + virtual sal_Bool ShouldConvert() = 0; virtual void FillInfoList( SvStorageInfoList* ) const = 0; - virtual BOOL CopyTo( BaseStorage* pDestStg ) const = 0; - virtual BOOL Commit() = 0; - virtual BOOL Revert() = 0; + virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const = 0; + virtual sal_Bool Commit() = 0; + virtual sal_Bool Revert() = 0; virtual BaseStorageStream* OpenStream( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ) = 0; + sal_Bool bDirect = sal_True, const ByteString* pKey=0 ) = 0; virtual BaseStorage* OpenStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ) = 0; + sal_Bool bDirect = sal_False ) = 0; virtual BaseStorage* OpenUCBStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ) = 0; + sal_Bool bDirect = sal_False ) = 0; virtual BaseStorage* OpenOLEStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ) = 0; - virtual BOOL IsStream( const String& rEleName ) const = 0; - virtual BOOL IsStorage( const String& rEleName ) const = 0; - virtual BOOL IsContained( const String& rEleName ) const = 0; - virtual BOOL Remove( const String & rEleName ) = 0; - virtual BOOL Rename( const String & rEleName, const String & rNewName ) = 0; - virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0; - virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0; - virtual BOOL ValidateFAT() = 0; - virtual BOOL Equals( const BaseStorage& rStream ) const = 0; + sal_Bool bDirect = sal_False ) = 0; + virtual sal_Bool IsStream( const String& rEleName ) const = 0; + virtual sal_Bool IsStorage( const String& rEleName ) const = 0; + virtual sal_Bool IsContained( const String& rEleName ) const = 0; + virtual sal_Bool Remove( const String & rEleName ) = 0; + virtual sal_Bool Rename( const String & rEleName, const String & rNewName ) = 0; + virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0; + virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0; + virtual sal_Bool ValidateFAT() = 0; + virtual sal_Bool Equals( const BaseStorage& rStream ) const = 0; }; class OLEStorageBase @@ -154,8 +154,8 @@ protected: StgDirEntry* pEntry; // the dir entry OLEStorageBase( StgIo*, StgDirEntry*, StreamMode& ); ~OLEStorageBase(); - BOOL Validate_Impl( BOOL=FALSE ) const; - BOOL ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ; + sal_Bool Validate_Impl( sal_Bool=sal_False ) const; + sal_Bool ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ; const SvStream* GetSvStream_Impl() const; public: }; @@ -163,26 +163,26 @@ public: class StorageStream : public BaseStorageStream, public OLEStorageBase { //friend class Storage; - ULONG nPos; // current position + sal_uLong nPos; // current position protected: ~StorageStream(); public: TYPEINFO(); StorageStream( StgIo*, StgDirEntry*, StreamMode ); - virtual ULONG Read( void * pData, ULONG nSize ); - virtual ULONG Write( const void* pData, ULONG nSize ); - virtual ULONG Seek( ULONG nPos ); - virtual ULONG Tell() { return nPos; } + virtual sal_uLong Read( void * pData, sal_uLong nSize ); + virtual sal_uLong Write( const void* pData, sal_uLong nSize ); + virtual sal_uLong Seek( sal_uLong nPos ); + virtual sal_uLong Tell() { return nPos; } virtual void Flush(); - virtual BOOL SetSize( ULONG nNewSize ); - virtual BOOL CopyTo( BaseStorageStream * pDestStm ); - virtual BOOL Commit(); - virtual BOOL Revert(); - virtual BOOL Validate( BOOL=FALSE ) const; - virtual BOOL ValidateMode( StreamMode ) const; - BOOL ValidateMode( StreamMode, StgDirEntry* p ) const; + virtual sal_Bool SetSize( sal_uLong nNewSize ); + virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); + virtual sal_Bool Validate( sal_Bool=sal_False ) const; + virtual sal_Bool ValidateMode( StreamMode ) const; + sal_Bool ValidateMode( StreamMode, StgDirEntry* p ) const; const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorageStream& rStream ) const; + virtual sal_Bool Equals( const BaseStorageStream& rStream ) const; }; class UCBStorageStream; @@ -190,64 +190,64 @@ class UCBStorageStream; class SOT_DLLPUBLIC Storage : public BaseStorage, public OLEStorageBase { String aName; - BOOL bIsRoot; - void Init( BOOL bCreate ); + sal_Bool bIsRoot; + void Init( sal_Bool bCreate ); Storage( StgIo*, StgDirEntry*, StreamMode ); protected: ~Storage(); public: TYPEINFO(); - Storage( const String &, StreamMode = STREAM_STD_READWRITE, BOOL bDirect = TRUE ); - Storage( SvStream& rStrm, BOOL bDirect = TRUE ); - Storage( UCBStorageStream& rStrm, BOOL bDirect = TRUE ); + Storage( const String &, StreamMode = STREAM_STD_READWRITE, sal_Bool bDirect = sal_True ); + Storage( SvStream& rStrm, sal_Bool bDirect = sal_True ); + Storage( UCBStorageStream& rStrm, sal_Bool bDirect = sal_True ); - static BOOL IsStorageFile( const String & rFileName ); - static BOOL IsStorageFile( SvStream* ); + static sal_Bool IsStorageFile( const String & rFileName ); + static sal_Bool IsStorageFile( SvStream* ); virtual const String& GetName() const; - virtual BOOL IsRoot() const { return bIsRoot; } + virtual sal_Bool IsRoot() const { return bIsRoot; } virtual void SetClassId( const ClsId& ); virtual const ClsId& GetClassId() const; virtual void SetDirty(); virtual void SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual ULONG GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); - virtual BOOL ShouldConvert(); + virtual sal_Bool ShouldConvert(); virtual void FillInfoList( SvStorageInfoList* ) const; - virtual BOOL CopyTo( BaseStorage* pDestStg ) const; - virtual BOOL Commit(); - virtual BOOL Revert(); + virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const; + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); virtual BaseStorageStream* OpenStream( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ); + sal_Bool bDirect = sal_True, const ByteString* pKey=0 ); virtual BaseStorage* OpenStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); + sal_Bool bDirect = sal_False ); virtual BaseStorage* OpenUCBStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); + sal_Bool bDirect = sal_False ); virtual BaseStorage* OpenOLEStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); - virtual BOOL IsStream( const String& rEleName ) const; - virtual BOOL IsStorage( const String& rEleName ) const; - virtual BOOL IsContained( const String& rEleName ) const; - virtual BOOL Remove( const String & rEleName ); - virtual BOOL Rename( const String & rEleName, const String & rNewName ); - virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); - virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); - virtual BOOL ValidateFAT(); - virtual BOOL Validate( BOOL=FALSE ) const; - virtual BOOL ValidateMode( StreamMode ) const; - BOOL ValidateMode( StreamMode, StgDirEntry* p ) const; + sal_Bool bDirect = sal_False ); + virtual sal_Bool IsStream( const String& rEleName ) const; + virtual sal_Bool IsStorage( const String& rEleName ) const; + virtual sal_Bool IsContained( const String& rEleName ) const; + virtual sal_Bool Remove( const String & rEleName ); + virtual sal_Bool Rename( const String & rEleName, const String & rNewName ); + virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); + virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); + virtual sal_Bool ValidateFAT(); + virtual sal_Bool Validate( sal_Bool=sal_False ) const; + virtual sal_Bool ValidateMode( StreamMode ) const; + sal_Bool ValidateMode( StreamMode, StgDirEntry* p ) const; virtual const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorage& rStream ) const; + virtual sal_Bool Equals( const BaseStorage& rStream ) const; }; class UCBStorageStream_Impl; @@ -261,25 +261,25 @@ protected: ~UCBStorageStream(); public: TYPEINFO(); - UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey=0 ); - UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey, BOOL bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress ); + UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey=0 ); + UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress ); UCBStorageStream( UCBStorageStream_Impl* ); - virtual ULONG Read( void * pData, ULONG nSize ); - virtual ULONG Write( const void* pData, ULONG nSize ); - virtual ULONG Seek( ULONG nPos ); - virtual ULONG Tell(); + virtual sal_uLong Read( void * pData, sal_uLong nSize ); + virtual sal_uLong Write( const void* pData, sal_uLong nSize ); + virtual sal_uLong Seek( sal_uLong nPos ); + virtual sal_uLong Tell(); virtual void Flush(); - virtual BOOL SetSize( ULONG nNewSize ); - virtual BOOL CopyTo( BaseStorageStream * pDestStm ); - virtual BOOL Commit(); - virtual BOOL Revert(); - virtual BOOL Validate( BOOL=FALSE ) const; - virtual BOOL ValidateMode( StreamMode ) const; + virtual sal_Bool SetSize( sal_uLong nNewSize ); + virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); + virtual sal_Bool Validate( sal_Bool=sal_False ) const; + virtual sal_Bool ValidateMode( StreamMode ) const; const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorageStream& rStream ) const; - BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); + virtual sal_Bool Equals( const BaseStorageStream& rStream ) const; + sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); SvStream* GetModifySvStream(); @@ -300,76 +300,76 @@ class SOT_DLLPUBLIC UCBStorage : public BaseStorage protected: ~UCBStorage(); public: - static BOOL IsStorageFile( SvStream* ); - static BOOL IsStorageFile( const String& rName ); - static BOOL IsDiskSpannedFile( SvStream* ); + static sal_Bool IsStorageFile( SvStream* ); + static sal_Bool IsStorageFile( const String& rName ); + static sal_Bool IsDiskSpannedFile( SvStream* ); static String GetLinkedFile( SvStream& ); static String CreateLinkFile( const String& rName ); - UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, BOOL bDirect = TRUE, BOOL bIsRoot = TRUE ); + UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, sal_Bool bDirect = sal_True, sal_Bool bIsRoot = sal_True ); UCBStorage( const String& rName, StreamMode nMode, - BOOL bDirect = TRUE, - BOOL bIsRoot = TRUE ); + sal_Bool bDirect = sal_True, + sal_Bool bIsRoot = sal_True ); UCBStorage( const String& rName, StreamMode nMode, - BOOL bDirect, - BOOL bIsRoot, - BOOL bIsRepair, + sal_Bool bDirect, + sal_Bool bIsRoot, + sal_Bool bIsRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgressHandler ); UCBStorage( UCBStorage_Impl* ); - UCBStorage( SvStream& rStrm, BOOL bDirect = TRUE ); + UCBStorage( SvStream& rStrm, sal_Bool bDirect = sal_True ); TYPEINFO(); virtual const String& GetName() const; - virtual BOOL IsRoot() const; + virtual sal_Bool IsRoot() const; virtual void SetClassId( const ClsId& ); virtual const ClsId& GetClassId() const; virtual void SetDirty(); virtual void SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual ULONG GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); - virtual BOOL ShouldConvert(); + virtual sal_Bool ShouldConvert(); virtual void FillInfoList( SvStorageInfoList* ) const; - virtual BOOL CopyTo( BaseStorage* pDestStg ) const; - virtual BOOL Commit(); - virtual BOOL Revert(); + virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const; + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); virtual BaseStorageStream* OpenStream( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ); + sal_Bool bDirect = sal_True, const ByteString* pKey=0 ); virtual BaseStorage* OpenStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); + sal_Bool bDirect = sal_False ); virtual BaseStorage* OpenUCBStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); + sal_Bool bDirect = sal_False ); virtual BaseStorage* OpenOLEStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); - virtual BOOL IsStream( const String& rEleName ) const; - virtual BOOL IsStorage( const String& rEleName ) const; - virtual BOOL IsContained( const String& rEleName ) const; - virtual BOOL Remove( const String & rEleName ); - virtual BOOL Rename( const String & rEleName, const String & rNewName ); - virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); - virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); - virtual BOOL ValidateFAT(); - virtual BOOL Validate( BOOL=FALSE ) const; - virtual BOOL ValidateMode( StreamMode ) const; + sal_Bool bDirect = sal_False ); + virtual sal_Bool IsStream( const String& rEleName ) const; + virtual sal_Bool IsStorage( const String& rEleName ) const; + virtual sal_Bool IsContained( const String& rEleName ) const; + virtual sal_Bool Remove( const String & rEleName ); + virtual sal_Bool Rename( const String & rEleName, const String & rNewName ); + virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); + virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); + virtual sal_Bool ValidateFAT(); + virtual sal_Bool Validate( sal_Bool=sal_False ) const; + virtual sal_Bool ValidateMode( StreamMode ) const; virtual const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorage& rStream ) const; - BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ); + virtual sal_Bool Equals( const BaseStorage& rStream ) const; + sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ); // HACK to avoid incompatible build, can be done since this feature is only for development // should be removed before release @@ -377,10 +377,10 @@ public: //#if _SOLAR__PRIVATE UCBStorageElement_Impl* FindElement_Impl( const String& rName ) const; - BOOL CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, + sal_Bool CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, BaseStorage* pDest, const String& rNew ) const; BaseStorage* OpenStorage_Impl( const String & rEleName, - StreamMode, BOOL bDirect, BOOL bForceUCBStorage ); + StreamMode, sal_Bool bDirect, sal_Bool bForceUCBStorage ); //#endif }; diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index 893837abac88..1e78865a3ef0 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -66,9 +66,9 @@ friend class SotStorage; friend class ImpStream; BaseStorageStream * pOwnStm;// Zeiger auf den eigenen Stream protected: - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); + virtual sal_uLong GetData( void* pData, sal_uLong nSize ); + virtual sal_uLong PutData( const void* pData, sal_uLong nSize ); + virtual sal_uLong SeekPos( sal_uLong nPos ); virtual void FlushData(); ~SotStorageStream(); public: @@ -86,13 +86,13 @@ public: virtual void ResetError(); - virtual void SetSize( ULONG nNewSize ); - UINT32 GetSize() const; - BOOL CopyTo( SotStorageStream * pDestStm ); - virtual BOOL Commit(); - virtual BOOL Revert(); - BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); + virtual void SetSize( sal_uLong nNewSize ); + sal_uInt32 GetSize() const; + sal_Bool CopyTo( SotStorageStream * pDestStm ); + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); + sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetXInputStream() const; }; @@ -120,21 +120,21 @@ friend class ::binfilter::SvStorage; BaseStorage * m_pTmpStg; // Temp-Storage fuer Transacted, nur auf diesem schreiben! ??? Useless ??? BaseStorage * m_pOwnStg; // Zielstorage SvStream * m_pStorStm; // nur fuer SDSTORAGES - ULONG m_nError; + sal_uLong m_nError; String m_aName; // Name des Storage - BOOL m_bIsRoot:1, // z.B.: File-Storage + sal_Bool m_bIsRoot:1, // z.B.: File-Storage m_bDelStm:1; ByteString m_aKey; // aKey.Len != 0 -> Verschluesselung long m_nVersion; protected: ~SotStorage(); - void CreateStorage( BOOL bUCBStorage, StreamMode, StorageMode ); + void CreateStorage( sal_Bool bUCBStorage, StreamMode, StorageMode ); public: SotStorage( const String &, StreamMode = STREAM_STD_READWRITE, StorageMode = 0 ); - SotStorage( BOOL bUCBStorage, const String &, + SotStorage( sal_Bool bUCBStorage, const String &, StreamMode = STREAM_STD_READWRITE, StorageMode = 0 ); SotStorage( const ::ucbhelper::Content& rContent, const String &, @@ -142,8 +142,8 @@ public: StorageMode = 0 ); SotStorage( BaseStorage * ); SotStorage( SvStream & rStm ); - SotStorage( BOOL bUCBStorage, SvStream & rStm ); - SotStorage( SvStream * pStm, BOOL bDelete ); + SotStorage( sal_Bool bUCBStorage, SvStream & rStm ); + SotStorage( SvStream * pStm, sal_Bool bDelete ); SotStorage(); SO2_DECL_BASIC_CLASS_DLL(SotStorage,SOTDATA()) SO2_DECL_INVARIANT() @@ -151,12 +151,12 @@ public: SvMemoryStream * CreateMemoryStream(); const SvStream * GetSvStream(); - static BOOL IsStorageFile( const String & rFileName ); - static BOOL IsStorageFile( SvStream* pStream ); + static sal_Bool IsStorageFile( const String & rFileName ); + static sal_Bool IsStorageFile( SvStream* pStream ); virtual const String & GetName() const; - virtual BOOL Validate(); + virtual sal_Bool Validate(); void SetKey( const ByteString& rKey ); const ByteString & GetKey() const { return m_aKey; } @@ -170,37 +170,37 @@ public: return m_nVersion; } - ULONG GetErrorCode() const { return m_nError; } - ULONG GetError() const { return ERRCODE_TOERROR(m_nError); } - void SetError( ULONG nErrorCode ) + sal_uLong GetErrorCode() const { return m_nError; } + sal_uLong GetError() const { return ERRCODE_TOERROR(m_nError); } + void SetError( sal_uLong nErrorCode ) { if( m_nError == SVSTREAM_OK ) m_nError = nErrorCode; } virtual void ResetError(); - BOOL IsRoot() const { return m_bIsRoot; } - void SignAsRoot( BOOL b = TRUE ) { m_bIsRoot = b; } - void SetDeleteStream( BOOL bDelete ) { m_bDelStm = bDelete; } + sal_Bool IsRoot() const { return m_bIsRoot; } + void SignAsRoot( sal_Bool b = sal_True ) { m_bIsRoot = b; } + void SetDeleteStream( sal_Bool bDelete ) { m_bDelStm = bDelete; } // eigener Datenbereich virtual void SetClass( const SvGlobalName & rClass, - ULONG bOriginalClipFormat, + sal_uLong bOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG bOriginalClipFormat, + sal_uLong bOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName();// Typ der Daten im Storage - virtual ULONG GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); - virtual BOOL ShouldConvert(); + virtual sal_Bool ShouldConvert(); void SetName( const String& rName ); // Liste aller Elemente virtual void FillInfoList( SvStorageInfoList * ) const; - virtual BOOL CopyTo( SotStorage * pDestStg ); - virtual BOOL Commit(); - virtual BOOL Revert(); + virtual sal_Bool CopyTo( SotStorage * pDestStg ); + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); /* Element Methoden */ // Stream mit Verbindung zu Storage erzeugen, @@ -221,26 +221,26 @@ public: StreamMode = STREAM_STD_READWRITE, StorageMode = STORAGE_TRANSACTED ); // Abfrage auf Storage oder Stream - virtual BOOL IsStream( const String & rEleName ) const; - virtual BOOL IsStorage( const String & rEleName ) const; - virtual BOOL IsContained( const String & rEleName ) const; + virtual sal_Bool IsStream( const String & rEleName ) const; + virtual sal_Bool IsStorage( const String & rEleName ) const; + virtual sal_Bool IsContained( const String & rEleName ) const; // Element loeschen - virtual BOOL Remove( const String & rEleName ); + virtual sal_Bool Remove( const String & rEleName ); // Elementnamen aendern - virtual BOOL Rename( const String & rEleName, + virtual sal_Bool Rename( const String & rEleName, const String & rNewName ); - virtual BOOL CopyTo( const String & rEleName, SotStorage * pDest, + virtual sal_Bool CopyTo( const String & rEleName, SotStorage * pDest, const String & rNewName ); - virtual BOOL MoveTo( const String & rEleName, SotStorage * pDest, + virtual sal_Bool MoveTo( const String & rEleName, SotStorage * pDest, const String & rNewName ); SvStream* GetTargetSvStream() const; - BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ); - BOOL IsOLEStorage() const; - static BOOL IsOLEStorage( const String & rFileName ); - static BOOL IsOLEStorage( SvStream* pStream ); + sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ); + sal_Bool IsOLEStorage() const; + static sal_Bool IsOLEStorage( const String & rFileName ); + static sal_Bool IsOLEStorage( SvStream* pStream ); // this is temporary HACK, _MUST_ be removed before release ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > diff --git a/sot/inc/storinfo.hxx b/sot/inc/sot/storinfo.hxx index af3c0ca15b95..0d7c73d3717c 100644 --- a/sot/inc/storinfo.hxx +++ b/sot/inc/sot/storinfo.hxx @@ -40,14 +40,14 @@ class SvStorageInfo friend class SvStorage; String aName; SvGlobalName aClassName; - ULONG nSize; - BOOL bStream:1, + sal_uLong nSize; + sal_Bool bStream:1, bStorage:1; SvStorageInfo(){}; // Fuer SvStorage public: SvStorageInfo( const StgDirEntry& ); - SvStorageInfo( const String& rName, ULONG nSz, BOOL bIsStorage ) + SvStorageInfo( const String& rName, sal_uLong nSz, sal_Bool bIsStorage ) : aName( rName ) , nSize( nSz ) , bStream( !bIsStorage ) @@ -56,9 +56,9 @@ public: const SvGlobalName & GetClassName() const { return aClassName; } const String & GetName() const { return aName; } - BOOL IsStream() const { return bStream; } - BOOL IsStorage() const { return bStorage; } - ULONG GetSize() const { return nSize; } + sal_Bool IsStream() const { return bStream; } + sal_Bool IsStorage() const { return bStorage; } + sal_uLong GetSize() const { return nSize; } }; class SOT_DLLPUBLIC SvStorageInfoList @@ -67,8 +67,8 @@ class SOT_DLLPUBLIC SvStorageInfoList const SvStorageInfo * Get( const String & rName ); }; -SOT_DLLPUBLIC ULONG ReadClipboardFormat( SvStream & rStm ); -SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ); +SOT_DLLPUBLIC sal_uLong ReadClipboardFormat( SvStream & rStm ); +SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ); #endif // _STORINFO_HXX diff --git a/sot/prj/build.lst b/sot/prj/build.lst index f2696155fd97..63f7a94cf054 100644..100755 --- a/sot/prj/build.lst +++ b/sot/prj/build.lst @@ -1,8 +1,2 @@ to sot : tools ucbhelper unotools NULL -to sot usr1 - all sot_mkout NULL -to sot\inc nmake - all sot_inc NULL -to sot\prj get - all sot_prj NULL -to sot\source\base nmake - all sot_base sot_inc NULL -to sot\source\sdstor nmake - all sot_sdst sot_inc NULL -to sot\source\unoolestorage nmake - all sot_unoolestor sot_inc NULL -to sot\util nmake - all sot_ut sot_base sot_sdst sot_unoolestor NULL +to sot\prj nmake - all sot_prj NULL diff --git a/sot/prj/d.lst b/sot/prj/d.lst index 528b6863ef3c..e69de29bb2d1 100644 --- a/sot/prj/d.lst +++ b/sot/prj/d.lst @@ -1,27 +0,0 @@ -mkdir: %_DEST%\inc%_EXT%\sot -..\inc\clsids.hxx %_DEST%\inc%_EXT%\sot\clsids.hxx -..\inc\sot\object.hxx %_DEST%\inc%_EXT%\sot\object.hxx -..\inc\sot\factory.hxx %_DEST%\inc%_EXT%\sot\factory.hxx -..\inc\sot\sotdata.hxx %_DEST%\inc%_EXT%\sot\sotdata.hxx -..\inc\agg.hxx %_DEST%\inc%_EXT%\sot\agg.hxx -..\inc\sot\storage.hxx %_DEST%\inc%_EXT%\sot\storage.hxx -..\inc\storinfo.hxx %_DEST%\inc%_EXT%\sot\storinfo.hxx -..\inc\sot\sotref.hxx %_DEST%\inc%_EXT%\sot\sotref.hxx -..\inc\sot\exchange.hxx %_DEST%\inc%_EXT%\sot\exchange.hxx -..\inc\sot\formats.hxx %_DEST%\inc%_EXT%\sot\formats.hxx -..\inc\absdev.hxx %_DEST%\inc%_EXT%\sot\absdev.hxx -..\inc\stg.hxx %_DEST%\inc%_EXT%\sot\stg.hxx -..\inc\filelist.hxx %_DEST%\inc%_EXT%\sot\filelist.hxx -..\inc\sot\sotdllapi.h %_DEST%\inc%_EXT%\sot\sotdllapi.h - -..\%__SRC%\inc\sdintern.hxx %_DEST%\inc%_EXT%\sot\sdintern.hxx -..\%__SRC%\lib\sot.lib %_DEST%\lib%_EXT%\sot.lib -..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT% -..\%__SRC%\lib\lib*.so.* %_DEST%\lib%_EXT% -..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib -..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl -..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a -..\%__SRC%\slb\sot.lib %_DEST%\lib%_EXT%\xsot.lib -..\%__SRC%\bin\sot?????.dll %_DEST%\bin%_EXT%\sot?????.dll -..\%__SRC%\bin\sot?????.sym %_DEST%\bin%_EXT%\sot?????.sym -..\%__SRC%\misc\sot?????.map %_DEST%\bin%_EXT%\sot?????.map diff --git a/sot/util/makefile.pmk b/sot/prj/makefile.mk index 2d79b8068815..e312a7ccab65 100644 --- a/sot/util/makefile.pmk +++ b/sot/prj/makefile.mk @@ -25,7 +25,16 @@ # #************************************************************************* -# define SOT_DLLIMPLEMENTATION (see @ = sotdllapi.h) -CDEFS += -DSOT_DLLIMPLEMENTATION +PRJ=.. +TARGET=prj -VISIBILITY_HIDDEN=TRUE +.INCLUDE : settings.mk + +.IF "$(VERBOSE)"!="" +VERBOSEFLAG := +.ELSE +VERBOSEFLAG := -s +.ENDIF + +all: + cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog diff --git a/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java b/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java index 054480d377d1..2824b0fcbffa 100644 --- a/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java +++ b/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java @@ -26,42 +26,85 @@ ************************************************************************/ package complex.olesimplestorage; -import complexlib.ComplexTestCase; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + /* Document. */ -public class OLESimpleStorageUnitTest extends ComplexTestCase { +public class OLESimpleStorageUnitTest /* extends ComplexTestCase */ +{ private XMultiServiceFactory m_xMSF = null; - public String[] getTestMethodNames() { - return new String[] { - "ExecuteTest01"}; - } - - public String getTestObjectName() { - return "OLESimpleStorageUnitTest"; - } +// public String[] getTestMethodNames() { +// return new String[] { +// "ExecuteTest01"}; +// } +// +// public String getTestObjectName() { +// return "OLESimpleStorageUnitTest"; +// } - public void before () { + @Before public void before () { + System.out.println("before()"); try { - m_xMSF = (XMultiServiceFactory)param.getMSF(); + m_xMSF = getMSF(); } catch ( Exception e ){ - failed ( "Cannot create service factory!" ); + fail( "Cannot create service factory!" ); } if ( m_xMSF == null ) { - failed ( "Cannot create service factory!" ); + fail( "Cannot create service factory!" ); } } - public void after () { + @After public void after () { + System.out.println("after()"); m_xMSF = null; } - public void ExecuteTest01() { - OLESimpleStorageTest aTest = new Test01( m_xMSF, log ); - assure( "Test01 failed!", aTest.test() ); + @Test public void ExecuteTest01() { + System.out.println("ExecuteTest01()"); + OLESimpleStorageTest aTest = new Test01( m_xMSF ); + assertTrue( "Test01 failed!", aTest.test() ); } + + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { +// try +// { +// Thread.sleep(5000); +// } +// catch (java.lang.InterruptedException e) +// { +// } + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + }
\ No newline at end of file diff --git a/sot/qa/complex/olesimplestorage/Test01.java b/sot/qa/complex/olesimplestorage/Test01.java index c9010e61231a..ad32e6e55a6b 100644 --- a/sot/qa/complex/olesimplestorage/Test01.java +++ b/sot/qa/complex/olesimplestorage/Test01.java @@ -1,6 +1,6 @@ package complex.olesimplestorage; -import complexlib.ComplexTestCase; + import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.io.XInputStream; @@ -10,7 +10,7 @@ import com.sun.star.embed.XOLESimpleStorage; import com.sun.star.uno.UnoRuntime; import java.util.Random; -import share.LogWriter; + public class Test01 implements OLESimpleStorageTest { @@ -19,10 +19,10 @@ public class Test01 implements OLESimpleStorageTest final int pStreamCnt = 5; final int pBytesCnt = 10; - public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test01 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test01: "); + m_aTestHelper = new TestHelper ("Test01: "); } public boolean test () @@ -31,7 +31,7 @@ public class Test01 implements OLESimpleStorageTest { //create a new temporary stream Object oTempFile = m_xMSF.createInstance ( "com.sun.star.io.TempFile" ); - XTempFile xTempFile = (XTempFile) UnoRuntime.queryInterface ( XTempFile.class, oTempFile ); + XTempFile xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile); m_aTestHelper.Message ( "A new temporary stream created." ); //create OLESimpleStorage based on it @@ -39,7 +39,7 @@ public class Test01 implements OLESimpleStorageTest pArgs[0] = (Object) xTempFile; pArgs[1] = new Boolean( true ); Object oOLESimpleStorage = m_xMSF.createInstanceWithArguments ( "com.sun.star.embed.OLESimpleStorage", pArgs ); - XOLESimpleStorage xOLESimpleStorage = (XOLESimpleStorage) UnoRuntime.queryInterface ( XOLESimpleStorage.class, oOLESimpleStorage ); + XOLESimpleStorage xOLESimpleStorage = UnoRuntime.queryInterface(XOLESimpleStorage.class, oOLESimpleStorage); m_aTestHelper.Message ( "OLESimpleStorage based on XStream created." ); //fill it with some streams @@ -53,7 +53,7 @@ public class Test01 implements OLESimpleStorageTest { oRandom.nextBytes (pBytesOut[i]); oStream[i] = m_xMSF.createInstance ( "com.sun.star.io.TempFile" ); - xTempStream[i] = (XTempFile) UnoRuntime.queryInterface ( XTempFile.class, oStream[i] ); + xTempStream[i] = UnoRuntime.queryInterface(XTempFile.class, oStream[i]); xTempStream[i].getOutputStream ().writeBytes (pBytesOut[i]); xTempStream[i].seek (0); m_aTestHelper.Message ( "Substream " + i + " initialized." ); @@ -83,7 +83,7 @@ public class Test01 implements OLESimpleStorageTest //open the same stream with the constructor for inputstream pArgs[0] = (Object)xTempFile.getInputStream (); oOLESimpleStorage = m_xMSF.createInstanceWithArguments ( "com.sun.star.embed.OLESimpleStorage", pArgs ); - xOLESimpleStorage = (XOLESimpleStorage)UnoRuntime.queryInterface ( XOLESimpleStorage.class, oOLESimpleStorage ); + xOLESimpleStorage = UnoRuntime.queryInterface(XOLESimpleStorage.class, oOLESimpleStorage); m_aTestHelper.Message ( "Storage reopened, based on XInputStream." ); //check that all the streams contain correct information @@ -92,8 +92,7 @@ public class Test01 implements OLESimpleStorageTest { if ( xOLESimpleStorage.hasByName (sSubStreamPrefix + i) ) { - xTempStream[i] = (XTempFile)UnoRuntime.queryInterface ( - XTempFile.class, xOLESimpleStorage.getByName (sSubStreamPrefix + i) ); + xTempStream[i] = UnoRuntime.queryInterface(XTempFile.class, xOLESimpleStorage.getByName(sSubStreamPrefix + i)); xTempStream[i].seek (0); xTempStream[i].getInputStream ().readBytes (pBytesIn[i], pBytesIn[i][0].length + 1 ); for ( int j = 0; j < pBytesCnt; ++j ) @@ -120,6 +119,7 @@ public class Test01 implements OLESimpleStorageTest catch ( Exception e ) { m_aTestHelper.Error ( "Exception: " + e ); + return false; } return true; } diff --git a/sot/qa/complex/olesimplestorage/TestHelper.java b/sot/qa/complex/olesimplestorage/TestHelper.java index 4b29ed15e393..e9e14f8d68c0 100644 --- a/sot/qa/complex/olesimplestorage/TestHelper.java +++ b/sot/qa/complex/olesimplestorage/TestHelper.java @@ -1,26 +1,27 @@ package complex.olesimplestorage; -import share.LogWriter; public class TestHelper { - LogWriter m_aLogWriter; + String m_sTestPrefix; - /** Creates a new instance of TestHelper */ - public TestHelper ( LogWriter aLogWriter, String sTestPrefix ) + /** Creates a new instance of TestHelper + * @param sTestPrefix + */ + public TestHelper ( String sTestPrefix ) { - m_aLogWriter = aLogWriter; + m_sTestPrefix = sTestPrefix; } public void Error ( String sError ) { - m_aLogWriter.println ( m_sTestPrefix + "Error: " + sError ); + System.out.println ( m_sTestPrefix + "Error: " + sError ); } public void Message ( String sMessage ) { - m_aLogWriter.println ( m_sTestPrefix + sMessage ); + System.out.println ( m_sTestPrefix + sMessage ); } } diff --git a/sot/qa/complex/olesimplestorage/makefile.mk b/sot/qa/complex/olesimplestorage/makefile.mk deleted file mode 100644 index 3420d798c9bc..000000000000 --- a/sot/qa/complex/olesimplestorage/makefile.mk +++ /dev/null @@ -1,84 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/.. -TARGET = OLESimpleStorageUnitTest -PRJNAME = sot -PACKAGE = complex$/olesimplestorage - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar - -JAVAFILES =\ - OLESimpleStorageUnitTest.java\ - OLESimpleStorageTest.java\ - TestHelper.java\ - Test01.java - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF - -# test base is java complex -CT_TESTBASE = -TestBase java_complex - -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) - -# start the runner application -CT_APP = org.openoffice.Runner - -# --- Targets ------------------------------------------------------ - -.INCLUDE: target.mk - -RUN: run - -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) - - diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index 2524e0c9b30a..04a0f22cf29d 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -39,7 +39,7 @@ #include <sot/sotdata.hxx> #include <sot/exchange.hxx> #include <sot/formats.hxx> -#include <clsids.hxx> +#include <sot/clsids.hxx> #include <rtl/instance.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/datatransfer/DataFlavor.hpp> @@ -239,11 +239,11 @@ static List& InitFormats_Impl() |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::RegisterFormatName( const String& rName ) +sal_uLong SotExchange::RegisterFormatName( const String& rName ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); // teste zuerst die Standard - Name - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( COMPARE_EQUAL == rName.CompareToAscii( pFormatArray_Impl[ i ].pName ) ) return i; @@ -279,11 +279,11 @@ ULONG SotExchange::RegisterFormatName( const String& rName ) return nMax + SOT_FORMATSTR_ID_USER_END + 1; } -ULONG SotExchange::RegisterFormatMimeType( const String& rMimeType ) +sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); // teste zuerst die Standard - Name - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) return i; @@ -320,9 +320,9 @@ ULONG SotExchange::RegisterFormatMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::RegisterFormat( const DataFlavor& rFlavor ) +sal_uLong SotExchange::RegisterFormat( const DataFlavor& rFlavor ) { - ULONG nRet = GetFormat( rFlavor ); + sal_uLong nRet = GetFormat( rFlavor ); if( !nRet ) { @@ -340,7 +340,7 @@ ULONG SotExchange::RegisterFormat( const DataFlavor& rFlavor ) |* *************************************************************************/ -sal_Bool SotExchange::GetFormatDataFlavor( ULONG nFormat, DataFlavor& rFlavor ) +sal_Bool SotExchange::GetFormatDataFlavor( sal_uLong nFormat, DataFlavor& rFlavor ) { sal_Bool bRet; @@ -378,11 +378,11 @@ sal_Bool SotExchange::GetFormatDataFlavor( ULONG nFormat, DataFlavor& rFlavor ) /************************************************************************* |* -|* SotExchange::GetFormatMimeType( ULONG nFormat ) +|* SotExchange::GetFormatMimeType( sal_uLong nFormat ) |* *************************************************************************/ -String SotExchange::GetFormatMimeType( ULONG nFormat ) +String SotExchange::GetFormatMimeType( sal_uLong nFormat ) { String sMimeType; if( SOT_FORMATSTR_ID_USER_END >= nFormat ) @@ -408,10 +408,10 @@ String SotExchange::GetFormatMimeType( ULONG nFormat ) |* *************************************************************************/ -ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) +sal_uLong SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) return i; @@ -445,12 +445,12 @@ ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::GetFormat( const DataFlavor& rFlavor ) +sal_uLong SotExchange::GetFormat( const DataFlavor& rFlavor ) { // teste zuerst die Standard - Name const ::rtl::OUString& rMimeType = rFlavor.MimeType; const String aMimeType( rMimeType ); - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( aMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) @@ -484,7 +484,7 @@ ULONG SotExchange::GetFormat( const DataFlavor& rFlavor ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -String SotExchange::GetFormatName( ULONG nFormat ) +String SotExchange::GetFormatName( sal_uLong nFormat ) { DataFlavor aFlavor; String aRet; @@ -495,7 +495,7 @@ String SotExchange::GetFormatName( ULONG nFormat ) return aRet; } -BOOL SotExchange::IsInternal( const SvGlobalName& rName ) +sal_Bool SotExchange::IsInternal( const SvGlobalName& rName ) { if ( rName == SvGlobalName(SO3_SW_CLASSID_60) || rName == SvGlobalName(SO3_SC_CLASSID_60) || @@ -505,8 +505,8 @@ BOOL SotExchange::IsInternal( const SvGlobalName& rName ) rName == SvGlobalName(SO3_SM_CLASSID_60) || rName == SvGlobalName(SO3_SWWEB_CLASSID_60) || rName == SvGlobalName(SO3_SWGLOB_CLASSID_60) ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index b510a0618137..904c6a7f90f8 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -37,7 +37,7 @@ #include <tools/string.hxx> #include <sot/object.hxx> #include <sot/sotdata.hxx> -#include <clsids.hxx> +#include <sot/clsids.hxx> #include <rtl/instance.hxx> #include <com/sun/star/datatransfer/DataFlavor.hpp> @@ -104,7 +104,7 @@ void SotFactory::DeInit() if( pSotData->pDataFlavorList ) { - for( ULONG i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ ) + for( sal_uLong i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ ) delete (::com::sun::star::datatransfer::DataFlavor*) pSotData->pDataFlavorList->GetObject( i ); delete pSotData->pDataFlavorList; pSotData->pDataFlavorList = NULL; @@ -160,7 +160,7 @@ SotFactory::~SotFactory() |* |* Beschreibung Zugriffsmethoden auf SotData_Impl-Daten *************************************************************************/ -UINT32 SotFactory::GetSvObjectCount() +sal_uInt32 SotFactory::GetSvObjectCount() { return SOTDATA()->nSvObjCount; } @@ -259,10 +259,10 @@ void SotFactory::TestInvariant() SotData_Impl * pSotData = SOTDATA(); if( pSotData->pObjectList ) { - ULONG nCount = pSotData->pObjectList->Count(); - for( ULONG i = 0; i < nCount ; i++ ) + sal_uLong nCount = pSotData->pObjectList->Count(); + for( sal_uLong i = 0; i < nCount ; i++ ) { - pSotData->pObjectList->GetObject( i )->TestInvariant( FALSE ); + pSotData->pObjectList->GetObject( i )->TestInvariant( sal_False ); } } #endif @@ -308,61 +308,22 @@ void * SotFactory::CastAndAddRef return pObj ? pObj->CastAndAddRef( this ) : NULL; } -//========================================================================= -void * SotFactory::AggCastAndAddRef -( - SotObject * pObj /* Das Objekt von dem der Typ gepr"uft wird. */ -) const -/* [Beschreibung] - - Ist eine Optimierung, damit die Ref-Klassen k"urzer implementiert - werden k"onnen. pObj wird auf den Typ der Factory gecastet. - In c++ (wenn es immer erlaubt w"are) w"urde der void * wie im - Beispiel gebildet. - Factory der Klasse SvPersist. - void * p = (void *)(SvPersist *)pObj; - Hinzu kommt noch, dass ein Objekt aus meheren c++ Objekten - zusammengesetzt sein kann. Diese Methode sucht nach einem - passenden Objekt. - - [R"uckgabewert] - - void *, NULL, pObj war NULL oder das Objekt war nicht vom Typ - der Factory. - Ansonsten wird pObj zuerst auf den Typ der Factory - gecastet und dann auf void *. - - [Querverweise] - - <SvObject::AggCast> -*/ -{ - void * pRet = NULL; - if( pObj ) - { - pRet = pObj->AggCast( this ); - if( pRet ) - pObj->AddRef(); - } - return pRet; -} - /************************************************************************* |* SotFactory::Is() |* |* Beschreibung *************************************************************************/ -BOOL SotFactory::Is( const SotFactory * pSuperCl ) const +sal_Bool SotFactory::Is( const SotFactory * pSuperCl ) const { if( this == pSuperCl ) - return TRUE; + return sal_True; - for( USHORT i = 0; i < nSuperCount; i++ ) + for( sal_uInt16 i = 0; i < nSuperCount; i++ ) { if( pSuperClasses[ i ]->Is( pSuperCl ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx index 771f88b3980e..8ee2a30765c7 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -33,7 +33,7 @@ #include <tools/string.hxx> #include <tools/rtti.hxx> #include <sot/exchange.hxx> -#include <filelist.hxx> +#include<sot/filelist.hxx> #include <osl/thread.h> TYPEINIT1_AUTOFACTORY( FileList, SvDataCopyStream ); @@ -75,7 +75,7 @@ FileList& FileList::operator=( const FileList& rFileList ) |* \*************************************************************************/ -ULONG FileList::GetFormat() +sal_uLong FileList::GetFormat() { return FORMAT_FILE_LIST; } diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index b310bf103647..4bb8800f10e0 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -35,8 +35,8 @@ #include <sot/exchange.hxx> #include <sot/formats.hxx> -#include "filelist.hxx" -#include "clsids.hxx" +#include "sot/filelist.hxx" +#include "sot/clsids.hxx" #include <tools/globname.hxx> #include <com/sun/star/datatransfer/DataFlavor.hpp> @@ -47,9 +47,9 @@ using namespace::com::sun::star::datatransfer; struct SotAction_Impl { - ULONG nFormatId; // Clipboard Id - USHORT nAction; // Action Id - BYTE nContextCheckId; // additional check of content in clipboard + sal_uLong nFormatId; // Clipboard Id + sal_uInt16 nAction; // Action Id + sal_uInt8 nContextCheckId; // additional check of content in clipboard }; @@ -69,7 +69,7 @@ struct SotAction_Impl struct SotDestinationEntry_Impl { - USHORT nDestination; + sal_uInt16 nDestination; const SotAction_Impl* aDefaultActions; const SotAction_Impl* aMoveActions; const SotAction_Impl* aCopyActions; @@ -1284,7 +1284,7 @@ static SotDestinationEntry_Impl const aDestinationArray[] = \ // - new style GetExchange methods - // --------------------------------- -sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, ULONG nId ) +sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_uLong nId ) { DataFlavorExVector::iterator aIter( ( (DataFlavorExVector&) rDataFlavorExVector ).begin() ); DataFlavorExVector::iterator aEnd( ( (DataFlavorExVector&) rDataFlavorExVector ).end() ); @@ -1304,14 +1304,14 @@ sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, ULONG // ----------------------------------------------------------------------------- -static BOOL CheckTransferableContext_Impl( const Reference< XTransferable >* pxTransferable, const SotAction_Impl& +static sal_Bool CheckTransferableContext_Impl( const Reference< XTransferable >* pxTransferable, const SotAction_Impl& #ifdef WNT rEntry #endif ) { DataFlavor aFlavor; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; try { @@ -1324,7 +1324,7 @@ rEntry { case FILEGRPDSC_ONLY_URL: { - bRet = FALSE; + bRet = sal_False; if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_FILECONTENT, aFlavor ) && (*pxTransferable)->isDataFlavorSupported( aFlavor ) && @@ -1368,11 +1368,11 @@ rEntry // ----------------------------------------------------------------------------- -static USHORT GetTransferableAction_Impl( +static sal_uInt16 GetTransferableAction_Impl( const DataFlavorExVector& rDataFlavorExVector, const SotAction_Impl* pArray, - ULONG& rFormat, - ULONG nOnlyTestFormat, + sal_uLong& rFormat, + sal_uLong nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { try @@ -1381,11 +1381,11 @@ static USHORT GetTransferableAction_Impl( { DataFlavor aFlavor; const SotAction_Impl* pArrayStart = pArray; - ULONG nId = pArray->nFormatId; + sal_uLong nId = pArray->nFormatId; #if OSL_DEBUG_LEVEL > 1 // used for testing a specific format - change in the debugger the value - static ULONG nChkFormat = 0; + static sal_uLong nChkFormat = 0; if( nChkFormat ) { for( ; 0xffff != pArray->nFormatId && @@ -1455,13 +1455,13 @@ static USHORT GetTransferableAction_Impl( // ----------------------------------------------------------------------------- -USHORT SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVector, - USHORT nDestination, - USHORT nSourceOptions, - USHORT nUserAction, - ULONG& rFormat, - USHORT& rDefaultAction, - ULONG nOnlyTestFormat, +sal_uInt16 SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVector, + sal_uInt16 nDestination, + sal_uInt16 nSourceOptions, + sal_uInt16 nUserAction, + sal_uLong& rFormat, + sal_uInt16& rDefaultAction, + sal_uLong nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { // hier wird jetzt die oben definierte Tabelle "implementiert" @@ -1569,11 +1569,11 @@ USHORT SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVe // ----------------------------------------------------------------------------- -USHORT SotExchange::GetExchangeAction( +sal_uInt16 SotExchange::GetExchangeAction( const Reference< XTransferable >& rxTransferable, - USHORT nDestination, USHORT nSourceOptions, - USHORT nUserAction, ULONG& rFormat, - USHORT& rDefaultAction, ULONG nOnlyTestFormat ) + sal_uInt16 nDestination, sal_uInt16 nSourceOptions, + sal_uInt16 nUserAction, sal_uLong& rFormat, + sal_uInt16& rDefaultAction, sal_uLong nOnlyTestFormat ) { DataFlavorExVector aVector; @@ -1626,9 +1626,9 @@ USHORT SotExchange::GetExchangeAction( nOnlyTestFormat, &rxTransferable ) ); } -USHORT SotExchange::IsChart( const SvGlobalName& rName ) +sal_uInt16 SotExchange::IsChart( const SvGlobalName& rName ) { - USHORT nRet=0; + sal_uInt16 nRet=0; // if ( rName == SvGlobalName( SO3_SCH_CLASSID_8 ) ) // nRet = SOFFICE_FILEFORMAT_8; // else @@ -1644,9 +1644,9 @@ USHORT SotExchange::IsChart( const SvGlobalName& rName ) return nRet; } -USHORT SotExchange::IsMath( const SvGlobalName& rName ) +sal_uInt16 SotExchange::IsMath( const SvGlobalName& rName ) { - USHORT nRet=0; + sal_uInt16 nRet=0; // if ( rName == SvGlobalName( SO3_SM_CLASSID_8 ) ) // nRet = SOFFICE_FILEFORMAT_8; // else diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 5bd4af29a45b..d1f4e6331397 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -34,11 +34,7 @@ #include <tools/debug.hxx> #include <sot/object.hxx> #include <sot/factory.hxx> -#include <agg.hxx> - -/************** class SvAggregateMemberList *****************************/ -/************************************************************************/ -PRV_SV_IMPL_OWNER_LIST(SvAggregateMemberList,SvAggregate); +#include <sot/agg.hxx> /************** class SotObject ******************************************/ class SotObjectFactory : public SotFactory @@ -64,7 +60,7 @@ SO2_IMPL_INVARIANT(SotObject) |* |* Beschreibung: *************************************************************************/ -void SotObject::TestMemberObjRef( BOOL /*bFree*/ ) +void SotObject::TestMemberObjRef( sal_Bool /*bFree*/ ) { } @@ -74,7 +70,7 @@ void SotObject::TestMemberObjRef( BOOL /*bFree*/ ) |* Beschreibung: *************************************************************************/ #ifdef TEST_INVARIANT -void SotObject::TestMemberInvariant( BOOL /*bPrint*/ ) +void SotObject::TestMemberInvariant( sal_Bool /*bPrint*/ ) { } #endif @@ -85,12 +81,11 @@ void SotObject::TestMemberInvariant( BOOL /*bPrint*/ ) |* Beschreibung *************************************************************************/ SotObject::SotObject() - : pAggList ( NULL ) - , nStrongLockCount( 0 ) + : nStrongLockCount( 0 ) , nOwnerLockCount( 0 ) - , bOwner ( TRUE ) - , bSVObject ( FALSE ) - , bInClose ( FALSE ) + , bOwner ( sal_True ) + , bSVObject ( sal_False ) + , bInClose ( sal_False ) { SotFactory::IncSvObjectCount( this ); } @@ -116,246 +111,11 @@ IUnknown * SotObject::GetInterface( const SvGlobalName & ) } /************************************************************************* -|* SotObject::IsSvClass() -|* -|* Beschreibung -*************************************************************************/ -BOOL SotObject::IsSvObject() const -{ - return Owner() || bSVObject; -} - -/************************************************************************* -|* SotObject::QueryDelete() -|* -|* Beschreibung: Bei allen aggregierten Objekte muss der RefCount auf -|* 0 gehen, damit das Gesammt-Objekt zerstoert wird. Das -|* zerst�ren von Teilen ist verboten. Da der Aggregator -|* (oder Cast-Verwalter) den Zaehler der aggregierten -|* Objekte um 1 erhoeht, muss dies bei der Berechnung -|* des 0-RefCounts beruecksichtigt werden. -*************************************************************************/ -BOOL SotObject::ShouldDelete() -{ - if( !pAggList ) - return TRUE; - - SvAggregate & rMO = pAggList->GetObject( 0 ); - if( rMO.bMainObj ) - { - AddRef(); - pAggList->GetObject( 0 ).pObj->ReleaseRef(); - return FALSE; - } - - ULONG i; - for( i = 1; i < pAggList->Count(); i++ ) - { - SvAggregate & rAgg = pAggList->GetObject( i ); - // Groesser 1, wegen AddRef() bei AddInterface - if( !rAgg.bFactory && rAgg.pObj->GetRefCount() > 1 ) - { - // den eigenen hochzaehelen - AddRef(); - // einen Aggregierten runterzaehlen - rAgg.pObj->ReleaseRef(); - return FALSE; - } - } - AddNextRef(); // rekursion stoppen - for( i = pAggList->Count() -1; i > 0; i-- ) - { - // Referenzen aufloesen - DBG_ASSERT( !pAggList->GetObject( i ).bMainObj, "main object reference is opened" ); - RemoveInterface( i ); - } - delete pAggList; - pAggList = NULL; - // und zerstoeren, dies ist unabhaengig vom RefCount - return TRUE; -} - -/************************************************************************* -|* SotObject::QueryDelete() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::QueryDelete() -{ - if( ShouldDelete() ) - SvRefBase::QueryDelete(); -} - - - -/************************************************************************* -|* SotObject::GetAggList() -|* -|* Beschreibung -*************************************************************************/ -SvAggregateMemberList & SotObject::GetAggList() -{ - if( !pAggList ) - { - pAggList = new SvAggregateMemberList( 2, 1 ); - pAggList->Append( SvAggregate() ); - } - return *pAggList; -} - - -/************************************************************************* -|* SotObject::RemoveInterface() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::RemoveInterface( ULONG nPos ) -{ - SvAggregate & rAgg = pAggList->GetObject( nPos ); - if( !rAgg.bFactory ) - { - DBG_ASSERT( rAgg.pObj->pAggList, "no aggregation list" ); - DBG_ASSERT( rAgg.pObj->pAggList->GetObject( 0 ).pObj == this, - "not owner of aggregated object" ); - // sich selbst als Cast-Verwalter austragen - rAgg.pObj->pAggList->GetObject( 0 ) = SvAggregate(); - // Referenz aufloesen - rAgg.pObj->ReleaseRef(); - // Aus der eigenen List austragen - pAggList->Remove( nPos ); - } -} - -/************************************************************************* -|* SotObject::RemoveInterface() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::RemoveInterface( SotObject * pObjP ) -{ - DBG_ASSERT( pObjP, "null pointer" ); - DBG_ASSERT( pAggList, "no aggregation list" ); - ULONG i; - for( i = 0; i < pAggList->Count(); i++ ) - { - SvAggregate & rAgg = pAggList->GetObject( i ); - if( !rAgg.bFactory && pObjP == rAgg.pObj ) - RemoveInterface( i ); - } - DBG_ASSERT( i < pAggList->Count(), "object not found" ); -} - -/************************************************************************* -|* SotObject::AddInterface() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::AddInterface( SotObject * pObjP ) -{ - pObjP->AddRef(); // Objekt festhalten - GetAggList(); - pAggList->Append( SvAggregate( pObjP, FALSE ) ); - - // sich selbst als Typecast-Verwalter eintragen - SvAggregateMemberList & rAList = pObjP->GetAggList(); - DBG_ASSERT( !rAList.GetObject( 0 ).bMainObj, "try to aggregate twice" ); - rAList[ 0 ] = SvAggregate( this, TRUE ); -} - -/************************************************************************* -|* SotObject::AddInterface() -|* -|* Beschreibung -*************************************************************************/ -void SotObject::AddInterface( SotFactory * pFactP ) -{ - GetAggList(); - pAggList->Append( SvAggregate( pFactP ) ); -} - -/************************************************************************* -|* SotObject::CreateAggObj() -|* -|* Beschreibung -*************************************************************************/ -SotObjectRef SotObject::CreateAggObj( const SotFactory * ) -{ - return SotObjectRef(); -} - - -/************************************************************************* -|* SotObject::DownAggCast() -|* -|* Beschreibung -*************************************************************************/ -void * SotObject::DownAggCast( const SotFactory * pFact ) -{ - void * pCast = NULL; - // geht den Pfad nur Richtung aggregierte Objekte - if( pAggList ) - { - for( ULONG i = 1; !pCast || i < pAggList->Count(); i++ ) - { - SvAggregate & rAgg = pAggList->GetObject( i ); - if( rAgg.bFactory ) - { - if( rAgg.pFact->Is( pFact ) ) - { - // On-Demand erzeugen, wenn Typ gebraucht - SotObjectRef aObj( CreateAggObj( rAgg.pFact ) ); - rAgg.bFactory = FALSE; - rAgg.pObj = aObj; - rAgg.pObj->AddRef(); - - // sich selbst als Typecast-Verwalter eintragen - SvAggregateMemberList & rAList = rAgg.pObj->GetAggList(); - DBG_ASSERT( !rAList.GetObject( 0 ).bMainObj, "try to aggregate twice" ); - rAList[ 0 ] = SvAggregate( this, TRUE ); - } - } - if( !rAgg.bFactory ) - { - // muss der (void *) auf Klasse pFact sein - pCast = rAgg.pObj->Cast( pFact ); - if( !pCast ) - pCast = rAgg.pObj->DownAggCast( pFact ); - if( pCast ) - break; - } - } - } - return pCast; -} - -/************************************************************************* -|* SotObject::AggCast() -|* -|* Beschreibung -*************************************************************************/ -void * SotObject::AggCast( const SotFactory * pFact ) -{ - void * pCast = NULL; - if( pAggList ) - { - SvAggregate & rAgg = pAggList->GetObject( 0 ); - if( rAgg.bMainObj ) - return rAgg.pObj->AggCast( pFact ); - pCast = Cast( pFact ); - if( !pCast ) - pCast = DownAggCast( pFact ); - } - else - pCast = Cast( pFact ); - return pCast; -} - -/************************************************************************* |* SotObject::CastAndAddRef() |* |* Beschreibung *************************************************************************/ -void * SotObject::CastAndAddRef( const SotFactory * pFact ) +void* SotObject::CastAndAddRef( const SotFactory * pFact ) { void * pCast = Cast( pFact ); if( pCast ) @@ -363,52 +123,11 @@ void * SotObject::CastAndAddRef( const SotFactory * pFact ) return pCast; } -/************************************************************************* -|* SotObject::GetMainObj() -|* -|* Beschreibung -*************************************************************************/ -SotObject * SotObject::GetMainObj() const -{ - if( pAggList ) - { - if( pAggList->GetObject( 0 ).bMainObj ) - return pAggList->GetObject( 0 ).pObj->GetMainObj(); - } - return (SotObject *)this; -} - //========================================================================= -USHORT SotObject::FuzzyLock -( - BOOL bLock, /* TRUE, lock. FALSE, unlock. */ - BOOL /*bIntern*/, /* TRUE, es handelt sich um einen internen Lock. - FALSE, der Lock kam von aussen (Ole2, Ipc2) */ - BOOL bClose /* TRUE, Close aufrufen wenn letzte Lock */ -) -/* [Beschreibung] - - Erlaubte Parameterkombinationen: - ( TRUE, TRUE, * ) -> interner Lock. - ( FALSE, TRUE, TRUE ) -> interner Unlock mit Close, - wenn LockCount() == 0 - ( TRUE, FALSE, * ) -> externer Lock. - ( FALSE, FALSE, TRUE ) -> externer Unlock mit Close, - wenn LockCount() == 0 - ( FALSE, FALSE, FALSE ) -> externer Unlock - - F"ur !Owner() wird der Aufruf an das externe Objekt weitergeleitet. - F"ur diese muss das <IOleItemContainer>-Interface zur Vef"ugung stehen. - bIntern und bClose werden dann ignoriert. - Wenn der LockCount auf 0 wechselt, wird <SotObject::DoClose> - gerufen, wenn kein OwnerLock besteht. - - [Anmerkung] - -*/ +sal_uInt16 SotObject::Lock( sal_Bool bLock ) { SotObjectRef xHoldAlive( this ); - USHORT nRet; + sal_uInt16 nRet; if( bLock ) { AddRef(); @@ -420,15 +139,16 @@ USHORT SotObject::FuzzyLock ReleaseRef(); } - if( !nRet && bClose && !nOwnerLockCount ) + if( !nRet && !nOwnerLockCount ) DoClose(); + return nRet; } //========================================================================= void SotObject::OwnerLock ( - BOOL bLock /* TRUE, lock. FALSE, unlock. */ + sal_Bool bLock /* sal_True, lock. sal_False, unlock. */ ) /* [Beschreibung] @@ -464,23 +184,23 @@ void SotObject::RemoveOwnerLock() } //========================================================================= -BOOL SotObject::DoClose() +sal_Bool SotObject::DoClose() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !bInClose ) { SotObjectRef xHoldAlive( this ); - bInClose = TRUE; + bInClose = sal_True; bRet = Close(); - bInClose = FALSE; + bInClose = sal_False; } return bRet; } //========================================================================= -BOOL SotObject::Close() +sal_Bool SotObject::Close() { - return TRUE; + return sal_True; } diff --git a/sot/source/sdstor/makefile.mk b/sot/source/sdstor/makefile.mk deleted file mode 100644 index f5c6d81548c9..000000000000 --- a/sot/source/sdstor/makefile.mk +++ /dev/null @@ -1,64 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=sot -TARGET=sdstor - -# --- Settings ----------------------------------------------------- - -ENABLE_EXCEPTIONS=true - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/unostorageholder.obj \ - $(SLO)$/ucbstorage.obj \ - $(SLO)$/stg.obj \ - $(SLO)$/stgcache.obj \ - $(SLO)$/stgstrms.obj \ - $(SLO)$/stgelem.obj \ - $(SLO)$/stgio.obj \ - $(SLO)$/stgole.obj \ - $(SLO)$/stgdir.obj \ - $(SLO)$/stgavl.obj \ - $(SLO)$/storinfo.obj \ - $(SLO)$/storage.obj - -EXCEPTIONSFILES= \ - $(SLO)$/unostorageholder.obj\ - $(SLO)$/ucbstorage.obj\ - $(SLO)$/storage.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index ef2384e77ea8..1edbd5dee4cb 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sot.hxx" -#include <storinfo.hxx> +#include <sot/storinfo.hxx> #include <osl/file.hxx> #include <tools/tempfile.hxx> #include <tools/ownlist.hxx> @@ -39,7 +39,7 @@ #include <tools/pstm.hxx> #include <tools/debug.hxx> -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" @@ -63,7 +63,7 @@ TYPEINIT1( BaseStorageStream, StorageBase ); TYPEINIT1( BaseStorage, StorageBase ); StorageBase::StorageBase() - : m_bAutoCommit( FALSE ) + : m_bAutoCommit( sal_False ) { m_nMode = STREAM_READ; m_nError = SVSTREAM_OK; @@ -76,14 +76,14 @@ StorageBase::~StorageBase() // The following three methods are declared as const, since they // may be called from within a const method. -ULONG StorageBase::GetError() const +sal_uLong StorageBase::GetError() const { - ULONG n = m_nError; + sal_uLong n = m_nError; ((StorageBase*) this)->m_nError = SVSTREAM_OK; return n; } -void StorageBase::SetError( ULONG n ) const +void StorageBase::SetError( sal_uLong n ) const { if( !m_nError ) ((StorageBase*) this)->m_nError = n; @@ -130,20 +130,20 @@ OLEStorageBase::~OLEStorageBase() // Validate the instance for I/O -BOOL OLEStorageBase::Validate_Impl( BOOL bWrite ) const +sal_Bool OLEStorageBase::Validate_Impl( sal_Bool bWrite ) const { if( pEntry && !pEntry->bInvalid && ( !bWrite || !pEntry->bDirect || ( nStreamMode & STREAM_WRITE ) ) ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } -BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const +sal_Bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const { if( m == INTERNAL_MODE ) - return TRUE; - USHORT nCurMode = ( p && p->nRefCnt ) ? p->nMode : 0xFFFF; + return sal_True; + sal_uInt16 nCurMode = ( p && p->nRefCnt ) ? p->nMode : 0xFFFF; if( ( m & 3 ) == STREAM_READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed @@ -151,7 +151,7 @@ BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) || ( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) - return TRUE; + return sal_True; } else { @@ -160,9 +160,9 @@ BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const // the commit may fail if( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -196,18 +196,18 @@ StorageStream::~StorageStream() pEntry->Commit(); } -BOOL StorageStream::Equals( const BaseStorageStream& rStream ) const +sal_Bool StorageStream::Equals( const BaseStorageStream& rStream ) const { const StorageStream* pOther = PTR_CAST( StorageStream, &rStream ); return pOther && ( pOther->pEntry == pEntry ); } -ULONG StorageStream::Read( void* pData, ULONG nSize ) +sal_uLong StorageStream::Read( void* pData, sal_uLong nSize ) { if( Validate() ) { pEntry->Seek( nPos ); - nSize = pEntry->Read( pData, (INT32) nSize ); + nSize = pEntry->Read( pData, (sal_Int32) nSize ); pIo->MoveError( *this ); nPos += nSize; } @@ -216,12 +216,12 @@ ULONG StorageStream::Read( void* pData, ULONG nSize ) return nSize; } -ULONG StorageStream::Write( const void* pData, ULONG nSize ) +sal_uLong StorageStream::Write( const void* pData, sal_uLong nSize ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { pEntry->Seek( nPos ); - nSize = pEntry->Write( pData, (INT32) nSize ); + nSize = pEntry->Write( pData, (sal_Int32) nSize ); pIo->MoveError( *this ); nPos += nSize; } @@ -230,7 +230,7 @@ ULONG StorageStream::Write( const void* pData, ULONG nSize ) return nSize; } -ULONG StorageStream::Seek( ULONG n ) +sal_uLong StorageStream::Seek( sal_uLong n ) { if( Validate() ) return nPos = pEntry->Seek( n ); @@ -244,26 +244,26 @@ void StorageStream::Flush() Commit(); } -BOOL StorageStream::SetSize( ULONG nNewSize ) +sal_Bool StorageStream::SetSize( sal_uLong nNewSize ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { - BOOL b = pEntry->SetSize( (INT32) nNewSize ); + sal_Bool b = pEntry->SetSize( (sal_Int32) nNewSize ); pIo->MoveError( *this ); return b; } else - return FALSE; + return sal_False; } -BOOL StorageStream::Commit() +sal_Bool StorageStream::Commit() { if( !Validate() ) - return FALSE; + return sal_False; if( !( m_nMode & STREAM_WRITE ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } else { @@ -273,22 +273,22 @@ BOOL StorageStream::Commit() } } -BOOL StorageStream::Revert() +sal_Bool StorageStream::Revert() { pEntry->Revert(); pIo->MoveError( *this ); return Good(); } -BOOL StorageStream::CopyTo( BaseStorageStream* pDest ) +sal_Bool StorageStream::CopyTo( BaseStorageStream* pDest ) { - if( !Validate() || !pDest->Validate( TRUE ) || Equals( *pDest ) ) - return FALSE; + if( !Validate() || !pDest->Validate( sal_True ) || Equals( *pDest ) ) + return sal_False; pEntry->Copy( *pDest ); pDest->Commit(); pIo->MoveError( *this ); SetError( pDest->GetError() ); - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } const SvStream* StorageStream::GetSvStream() const @@ -296,25 +296,25 @@ const SvStream* StorageStream::GetSvStream() const return GetSvStream_Impl(); } -BOOL StorageStream::Validate( BOOL bValidate ) const +sal_Bool StorageStream::Validate( sal_Bool bValidate ) const { - BOOL bRet = Validate_Impl( bValidate ); + sal_Bool bRet = Validate_Impl( bValidate ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL StorageStream::ValidateMode( StreamMode nMode ) const +sal_Bool StorageStream::ValidateMode( StreamMode nMode ) const { - BOOL bRet = ValidateMode_Impl( nMode, NULL ); + sal_Bool bRet = ValidateMode_Impl( nMode, NULL ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const +sal_Bool StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const { - BOOL bRet = ValidateMode_Impl( nMode, p ); + sal_Bool bRet = ValidateMode_Impl( nMode, p ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; @@ -325,26 +325,26 @@ BOOL StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const SvStorageInfo::SvStorageInfo( const StgDirEntry& rE ) { rE.aEntry.GetName( aName ); - bStorage = BOOL( rE.aEntry.GetType() == STG_STORAGE ); - bStream = BOOL( rE.aEntry.GetType() == STG_STREAM ); + bStorage = sal_Bool( rE.aEntry.GetType() == STG_STORAGE ); + bStream = sal_Bool( rE.aEntry.GetType() == STG_STREAM ); nSize = bStorage ? 0 : rE.aEntry.GetSize(); } /////////////////////////// class Storage //////////////////////////////// -BOOL Storage::IsStorageFile( const String & rFileName ) +sal_Bool Storage::IsStorageFile( const String & rFileName ) { StgIo aIo; if( aIo.Open( rFileName, STREAM_STD_READ ) ) return aIo.Load(); - return FALSE; + return sal_False; } -BOOL Storage::IsStorageFile( SvStream* pStream ) +sal_Bool Storage::IsStorageFile( SvStream* pStream ) { StgHeader aHdr; - ULONG nPos = pStream->Tell(); - BOOL bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); + sal_uLong nPos = pStream->Tell(); + sal_Bool bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); // It's not a stream error if it is too small for a OLE storage header if ( pStream->GetErrorCode() == ERRCODE_IO_CANTSEEK ) @@ -358,21 +358,21 @@ BOOL Storage::IsStorageFile( SvStream* pStream ) TYPEINIT1( Storage, BaseStorage ); -Storage::Storage( const String& rFile, StreamMode m, BOOL bDirect ) - : OLEStorageBase( new StgIo, NULL, m_nMode ), aName( rFile ), bIsRoot( FALSE ) +Storage::Storage( const String& rFile, StreamMode m, sal_Bool bDirect ) + : OLEStorageBase( new StgIo, NULL, m_nMode ), aName( rFile ), bIsRoot( sal_False ) { - BOOL bTemp = FALSE; + sal_Bool bTemp = sal_False; if( !aName.Len() ) { // no name = temporary name! aName = TempFile::CreateTempName(); - bTemp = TRUE; + bTemp = sal_True; } // the root storage creates the I/O system m_nMode = m; if( pIo->Open( aName, m ) ) { - Init( BOOL( ( m & ( STREAM_TRUNC | STREAM_NOCREATE ) ) == STREAM_TRUNC ) ); + Init( sal_Bool( ( m & ( STREAM_TRUNC | STREAM_NOCREATE ) ) == STREAM_TRUNC ) ); if( pEntry ) { pEntry->bDirect = bDirect; @@ -389,19 +389,19 @@ Storage::Storage( const String& rFile, StreamMode m, BOOL bDirect ) // Create a storage on a given stream. -Storage::Storage( SvStream& r, BOOL bDirect ) - : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( FALSE ) +Storage::Storage( SvStream& r, sal_Bool bDirect ) + : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( sal_False ) { m_nMode = STREAM_READ; if( r.IsWritable() ) m_nMode = STREAM_READ | STREAM_WRITE; if( r.GetError() == SVSTREAM_OK ) { - pIo->SetStrm( &r, FALSE ); - ULONG nSize = r.Seek( STREAM_SEEK_TO_END ); + pIo->SetStrm( &r, sal_False ); + sal_uLong nSize = r.Seek( STREAM_SEEK_TO_END ); r.Seek( 0L ); // Initializing is OK if the stream is empty - Init( BOOL( nSize == 0 ) ); + Init( sal_Bool( nSize == 0 ) ); if( pEntry ) { pEntry->bDirect = bDirect; @@ -417,8 +417,8 @@ Storage::Storage( SvStream& r, BOOL bDirect ) } -Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) - : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( FALSE ) +Storage::Storage( UCBStorageStream& rStrm, sal_Bool bDirect ) + : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( sal_False ) { m_nMode = STREAM_READ; @@ -432,7 +432,7 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) SvStream* pStream = rStrm.GetModifySvStream(); if ( !pStream ) { - OSL_ENSURE( FALSE, "UCBStorageStream can not provide SvStream implementation!\n" ); + OSL_ENSURE( sal_False, "UCBStorageStream can not provide SvStream implementation!\n" ); SetError( SVSTREAM_GENERALERROR ); pEntry = NULL; return; @@ -443,10 +443,10 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) pIo->SetStrm( &rStrm ); - ULONG nSize = pStream->Seek( STREAM_SEEK_TO_END ); + sal_uLong nSize = pStream->Seek( STREAM_SEEK_TO_END ); pStream->Seek( 0L ); // Initializing is OK if the stream is empty - Init( BOOL( nSize == 0 ) ); + Init( sal_Bool( nSize == 0 ) ); if( pEntry ) { pEntry->bDirect = bDirect; @@ -459,14 +459,14 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) // Perform common code for both ctors above. -void Storage::Init( BOOL bCreate ) +void Storage::Init( sal_Bool bCreate ) { pEntry = NULL; - BOOL bHdrLoaded = FALSE; - bIsRoot = TRUE; + sal_Bool bHdrLoaded = sal_False; + bIsRoot = sal_True; if( pIo->Good() ) { - ULONG nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); + sal_uLong nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); pIo->GetStrm()->Seek( 0L ); if( nSize ) { @@ -495,7 +495,7 @@ void Storage::Init( BOOL bCreate ) // Internal ctor Storage::Storage( StgIo* p, StgDirEntry* q, StreamMode m ) - : OLEStorageBase( p, q, m_nMode ), bIsRoot( FALSE ) + : OLEStorageBase( p, q, m_nMode ), bIsRoot( sal_False ) { if( q ) q->aEntry.GetName( aName ); @@ -558,7 +558,7 @@ void Storage::FillInfoList( SvStorageInfoList* pList ) const // Open or create a substorage -BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, BOOL bDirect ) +BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, sal_Bool bDirect ) { OSL_FAIL("Not supported!"); /* @@ -569,31 +569,31 @@ BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, BOOL bD return OpenStorage( rName, m, bDirect ); } -BaseStorage* Storage::OpenOLEStorage( const String& rName, StreamMode m, BOOL bDirect ) +BaseStorage* Storage::OpenOLEStorage( const String& rName, StreamMode m, sal_Bool bDirect ) { return OpenStorage( rName, m, bDirect ); } -BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, BOOL bDirect ) +BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, sal_Bool bDirect ) { if( !Validate() || !ValidateMode( m ) ) return new Storage( pIo, NULL, m ); if( bDirect && !pEntry->bDirect ) - bDirect = FALSE; + bDirect = sal_False; StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( !p ) { if( !( m & STREAM_NOCREATE ) ) { - BOOL bTemp = FALSE; + sal_Bool bTemp = sal_False; // create a new storage String aNewName = rName; if( !aNewName.Len() ) { aNewName.AssignAscii( "Temp Stg " ); aNewName.Append( String::CreateFromInt32( ++nTmpCount ) ); - bTemp = TRUE; + bTemp = sal_True; } p = pIo->pTOC->Create( *pEntry, aNewName, STG_STORAGE ); if( p ) @@ -623,13 +623,13 @@ BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, BOOL bDire } Storage* pStg = new Storage( pIo, p, m ); pIo->MoveError( *pStg ); - if( m & STREAM_WRITE ) pStg->m_bAutoCommit = TRUE; + if( m & STREAM_WRITE ) pStg->m_bAutoCommit = sal_True; return pStg; } // Open a stream -BaseStorageStream* Storage::OpenStream( const String& rName, StreamMode m, BOOL, +BaseStorageStream* Storage::OpenStream( const String& rName, StreamMode m, sal_Bool, const ByteString* #ifdef DBG_UTIL pB @@ -641,7 +641,7 @@ pB if( !Validate() || !ValidateMode( m ) ) return new StorageStream( pIo, NULL, m ); StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); - BOOL bTemp = FALSE; + sal_Bool bTemp = sal_False; if( !p ) { if( !( m & STREAM_NOCREATE ) ) @@ -653,7 +653,7 @@ pB { aNewName.AssignAscii( "Temp Strm " ); aNewName.Append( String::CreateFromInt32( ++nTmpCount ) ); - bTemp = TRUE; + bTemp = sal_True; } p = pIo->pTOC->Create( *pEntry, aNewName, STG_STREAM ); } @@ -675,50 +675,50 @@ pB } StorageStream* pStm = new StorageStream( pIo, p, m ); if( p && !p->bDirect ) - pStm->SetAutoCommit( TRUE ); + pStm->SetAutoCommit( sal_True ); pIo->MoveError( *pStm ); return pStm; } // Delete a stream or substorage by setting the temp bit. -BOOL Storage::Remove( const String& rName ) +sal_Bool Storage::Remove( const String& rName ) { - if( !Validate( TRUE ) ) - return FALSE; + if( !Validate( sal_True ) ) + return sal_False; StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( p ) { - p->Invalidate( TRUE ); - return TRUE; + p->Invalidate( sal_True ); + return sal_True; } else { SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } } // Rename a storage element -BOOL Storage::Rename( const String& rOld, const String& rNew ) +sal_Bool Storage::Rename( const String& rOld, const String& rNew ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { - BOOL b = pIo->pTOC->Rename( *pEntry, rOld, rNew ); + sal_Bool b = pIo->pTOC->Rename( *pEntry, rOld, rNew ); pIo->MoveError( *this ); return b; } else - return FALSE; + return sal_False; } // Copy one element -BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNew ) +sal_Bool Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNew ) { - if( !Validate() || !pDest || !pDest->Validate( TRUE ) ) - return FALSE; + if( !Validate() || !pDest || !pDest->Validate( sal_True ) ) + return sal_False; StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem ); if( pElem ) { @@ -727,7 +727,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe if( !pElem->IsContained( pDest->pEntry ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } */ if( pElem->aEntry.GetType() == STG_STORAGE ) @@ -736,7 +736,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe BaseStorage* p1 = OpenStorage( rElem, INTERNAL_MODE ); BaseStorage* p2 = pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); - ULONG nTmpErr = p2->GetError(); + sal_uLong nTmpErr = p2->GetError(); if( !nTmpErr ) { p2->SetClassId( p1->GetClassId() ); @@ -754,7 +754,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe delete p1; delete p2; - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } else { @@ -762,7 +762,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe BaseStorageStream* p1 = OpenStream( rElem, INTERNAL_MODE ); BaseStorageStream* p2 = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); - ULONG nTmpErr = p2->GetError(); + sal_uLong nTmpErr = p2->GetError(); if( !nTmpErr ) { p1->CopyTo( p2 ); @@ -779,58 +779,58 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe delete p1; delete p2; - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } } SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } -BOOL Storage::CopyTo( BaseStorage* pDest ) const +sal_Bool Storage::CopyTo( BaseStorage* pDest ) const { - if( !Validate() || !pDest || !pDest->Validate( TRUE ) || Equals( *pDest ) ) + if( !Validate() || !pDest || !pDest->Validate( sal_True ) || Equals( *pDest ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } Storage* pThis = (Storage*) this; /* if( !pThis->pEntry->IsContained( pDest->pEntry ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } */ pDest->SetClassId( GetClassId() ); pDest->SetDirty(); SvStorageInfoList aList; FillInfoList( &aList ); - BOOL bRes = TRUE; - for( USHORT i = 0; i < aList.Count() && bRes; i++ ) + sal_Bool bRes = sal_True; + for( sal_uInt16 i = 0; i < aList.Count() && bRes; i++ ) { SvStorageInfo& rInfo = aList.GetObject( i ); bRes = pThis->CopyTo( rInfo.GetName(), pDest, rInfo.GetName() ); } if( !bRes ) SetError( pDest->GetError() ); - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } // Move one element -BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rNew ) +sal_Bool Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rNew ) { - if( !Validate() || !pODest || !pODest->Validate( TRUE ) || Equals( *pODest ) ) + if( !Validate() || !pODest || !pODest->Validate( sal_True ) || Equals( *pODest ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem ); if( pElem ) { // Simplest case: both storages share the same file - BOOL bRes; + sal_Bool bRes; Storage *pOther = PTR_CAST( Storage, pODest ); if( pOther && pIo == pOther->pIo && rElem == rNew ) { @@ -841,14 +841,14 @@ BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rN { // cyclic move SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } bRes = pIo->pTOC->Move( *pEntry, *pDest->pEntry, rNew ); if( !bRes ) { pIo->MoveError( *this ); pDest->pIo->MoveError( *pDest ); - ULONG nErr = GetError(); + sal_uLong nErr = GetError(); if( !nErr ) nErr = pDest->GetError(); SetError( nErr ); @@ -866,51 +866,51 @@ BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rN return bRes; } SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } -BOOL Storage::IsStorage( const String& rName ) const +sal_Bool Storage::IsStorage( const String& rName ) const { if( Validate() ) { StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( p ) - return BOOL( p->aEntry.GetType() == STG_STORAGE ); + return sal_Bool( p->aEntry.GetType() == STG_STORAGE ); } - return FALSE; + return sal_False; } -BOOL Storage::IsStream( const String& rName ) const +sal_Bool Storage::IsStream( const String& rName ) const { if( Validate() ) { StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( p ) - return BOOL( p->aEntry.GetType() == STG_STREAM ); + return sal_Bool( p->aEntry.GetType() == STG_STREAM ); } - return FALSE; + return sal_False; } -BOOL Storage::IsContained( const String& rName ) const +sal_Bool Storage::IsContained( const String& rName ) const { if( Validate() ) - return BOOL( pIo->pTOC->Find( *pEntry, rName ) != NULL ); + return sal_Bool( pIo->pTOC->Find( *pEntry, rName ) != NULL ); else - return FALSE; + return sal_False; } // Commit all sub-elements within this storage. If this is // the root, commit the FAT, the TOC and the header as well. -BOOL Storage::Commit() +sal_Bool Storage::Commit() { - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; if( !Validate() ) - return FALSE; + return sal_False; if( !( m_nMode & STREAM_WRITE ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } else { @@ -929,9 +929,9 @@ BOOL Storage::Commit() return bRes; } -BOOL Storage::Revert() +sal_Bool Storage::Revert() { - return TRUE; + return sal_True; } ///////////////////////////// OLE Support //////////////////////////////// @@ -939,16 +939,16 @@ BOOL Storage::Revert() // Set the storage type void Storage::SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { // set the class name in the root entry pEntry->aEntry.SetClassId( (const ClsId&) rClass.GetCLSID() ); pEntry->SetDirty(); // then create the streams - StgCompObjStream aCompObj( *this, TRUE ); + StgCompObjStream aCompObj( *this, sal_True ); aCompObj.GetClsId() = (const ClsId&) rClass.GetCLSID(); aCompObj.GetCbFormat() = nOriginalClipFormat; aCompObj.GetUserName() = rUserTypeName; @@ -966,14 +966,14 @@ void Storage::SetClass( const SvGlobalName & rClass, } void Storage::SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { SetClass( rConvertClass, nOriginalClipFormat, rUserTypeName ); // plus the convert flag: - StgOleStream aOle( *this, TRUE ); + StgOleStream aOle( *this, sal_True ); aOle.GetFlags() |= 4; if( !aOle.Store() ) SetError( aOle.GetError() ); @@ -982,7 +982,7 @@ void Storage::SetConvertClass( const SvGlobalName & rConvertClass, SvGlobalName Storage::GetClassName() { - StgCompObjStream aCompObj( *this, FALSE ); + StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) return SvGlobalName( (const CLSID&) aCompObj.GetClsId() ); pIo->ResetError(); @@ -993,9 +993,9 @@ SvGlobalName Storage::GetClassName() return SvGlobalName(); } -ULONG Storage::GetFormat() +sal_uLong Storage::GetFormat() { - StgCompObjStream aCompObj( *this, FALSE ); + StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) return aCompObj.GetCbFormat(); pIo->ResetError(); @@ -1004,26 +1004,26 @@ ULONG Storage::GetFormat() String Storage::GetUserName() { - StgCompObjStream aCompObj( *this, FALSE ); + StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) return aCompObj.GetUserName(); pIo->ResetError(); return String(); } -BOOL Storage::ShouldConvert() +sal_Bool Storage::ShouldConvert() { - StgOleStream aOle( *this, FALSE ); + StgOleStream aOle( *this, sal_False ); if( aOle.Load() ) - return BOOL( ( aOle.GetFlags() & 4 ) != 0 ); + return sal_Bool( ( aOle.GetFlags() & 4 ) != 0 ); else { pIo->ResetError(); - return FALSE; + return sal_False; } } -BOOL Storage::ValidateFAT() +sal_Bool Storage::ValidateFAT() { Link aLink = StgIo::GetErrorLink(); ErrCode nErr = pIo->ValidateFATs(); @@ -1051,31 +1051,31 @@ const SvStream* Storage::GetSvStream() const return GetSvStream_Impl(); } -BOOL Storage::Validate( BOOL bValidate ) const +sal_Bool Storage::Validate( sal_Bool bValidate ) const { - BOOL bRet = Validate_Impl( bValidate ); + sal_Bool bRet = Validate_Impl( bValidate ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL Storage::ValidateMode( StreamMode nMode ) const +sal_Bool Storage::ValidateMode( StreamMode nMode ) const { - BOOL bRet = ValidateMode_Impl( nMode ); + sal_Bool bRet = ValidateMode_Impl( nMode ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL Storage::ValidateMode( StreamMode nMode, StgDirEntry* p ) const +sal_Bool Storage::ValidateMode( StreamMode nMode, StgDirEntry* p ) const { - BOOL bRet = ValidateMode_Impl( nMode, p ); + sal_Bool bRet = ValidateMode_Impl( nMode, p ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL Storage::Equals( const BaseStorage& rStorage ) const +sal_Bool Storage::Equals( const BaseStorage& rStorage ) const { const Storage* pOther = PTR_CAST( Storage, &rStorage ); return pOther && ( pOther->pEntry == pEntry ); diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx index a2e4a9162e02..c411b845e0a2 100644 --- a/sot/source/sdstor/stgavl.cxx +++ b/sot/source/sdstor/stgavl.cxx @@ -213,7 +213,7 @@ StgAvlNode* StgAvlNode::RotRL() // Remove a tree element. Return the removed element or NULL. -StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, BOOL bPtrs ) +StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, sal_Bool bPtrs ) { if( *p ) { @@ -280,21 +280,21 @@ void StgAvlNode::StgEnum( short& n ) } // Add node to AVL tree. -// Return FALSE if the element already exists. +// Return sal_False if the element already exists. -BOOL StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns ) +sal_Bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns ) { StgAvlNode* pPivot, *pHeavy, *pNewRoot, *pParent, *pPrev; // special case - empty tree if( *pRoot == NULL ) { *pRoot = pIns; - return TRUE; + return sal_True; } // find insertion point and return if already present short nRes = (*pRoot)->Locate( pIns, &pPivot, &pParent, &pPrev ); if( !nRes ) - return FALSE; + return sal_False; // add new node if( nRes < 0 ) pPrev->pLeft = pIns; @@ -324,19 +324,19 @@ BOOL StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns ) else if( pPivot == pParent->pRight ) pParent->pRight = pNewRoot; } - return TRUE; + return sal_True; } -// Remove node from tree. Returns TRUE is found and removed. +// Remove node from tree. Returns sal_True is found and removed. // Actually delete if bDel -BOOL StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, BOOL bDel ) +sal_Bool StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, sal_Bool bDel ) { // special case - empty tree if( *pRoot == NULL ) - return FALSE; + return sal_False; // delete the element - pDel = Rem( pRoot, pDel, FALSE ); + pDel = Rem( pRoot, pDel, sal_False ); if( pDel ) { if( bDel ) @@ -346,30 +346,30 @@ BOOL StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, BOOL bDel ) /* StgAvlNode* pNew = NULL; while( *pRoot ) { - StgAvlNode* p = Rem( pRoot, *pRoot, FALSE ); + StgAvlNode* p = Rem( pRoot, *pRoot, sal_False ); Insert( &pNew, p ); } *pRoot = pNew;*/ - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } -// Move node to a different tree. Returns TRUE is found and moved. This routine +// Move node to a different tree. Returns sal_True is found and moved. This routine // may be called when the key has changed. -BOOL StgAvlNode::Move +sal_Bool StgAvlNode::Move ( StgAvlNode** pRoot1, StgAvlNode** pRoot2, StgAvlNode* pMove ) { // special case - empty tree if( *pRoot1 == NULL ) - return FALSE; - pMove = Rem( pRoot1, pMove, FALSE ); + return sal_False; + pMove = Rem( pRoot1, pMove, sal_False ); if( pMove ) return Insert( pRoot2, pMove ); else - return FALSE; + return sal_False; } ////////////////////////// class AvlIterator ///////////////////////// diff --git a/sot/source/sdstor/stgavl.hxx b/sot/source/sdstor/stgavl.hxx index 0c2f75d3d2be..8bd48ef8b62e 100644 --- a/sot/source/sdstor/stgavl.hxx +++ b/sot/source/sdstor/stgavl.hxx @@ -45,7 +45,7 @@ private: StgAvlNode* RotRR(); StgAvlNode* RotRL(); void StgEnum( short& ); - static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, BOOL ); + static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, sal_Bool ); protected: short nId; // iterator ID short nBalance; // indicates tree balance @@ -54,9 +54,9 @@ protected: public: virtual ~StgAvlNode(); StgAvlNode* Find( StgAvlNode* ); - static BOOL Insert( StgAvlNode**, StgAvlNode* ); - static BOOL Remove( StgAvlNode**, StgAvlNode*, BOOL bDel = TRUE ); - static BOOL Move( StgAvlNode**, StgAvlNode**, StgAvlNode* ); + static sal_Bool Insert( StgAvlNode**, StgAvlNode* ); + static sal_Bool Remove( StgAvlNode**, StgAvlNode*, sal_Bool bDel = sal_True ); + static sal_Bool Move( StgAvlNode**, StgAvlNode**, StgAvlNode* ); virtual short Compare( const StgAvlNode* ) const = 0; }; diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index ffee054f7257..d9b5884473b0 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -41,7 +41,7 @@ #include <osl/endian.h> #include <tools/string.hxx> -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" @@ -52,10 +52,10 @@ //----------------------------------------------------------------------------- typedef boost::unordered_map < - INT32, + sal_Int32, StgPage *, - boost::hash< INT32 >, - std::equal_to< INT32 > + boost::hash< sal_Int32 >, + std::equal_to< sal_Int32 > > UsrStgPagePtr_Impl; #ifdef _MSC_VER #pragma warning( disable: 4786 ) @@ -73,9 +73,9 @@ StgPage::StgPage( StgCache* p, short n ) { pCache = p; nData = n; - bDirty = FALSE; + bDirty = sal_False; nPage = 0; - pData = new BYTE[ nData ]; + pData = new sal_uInt8[ nData ]; pNext1 = pNext2 = pLast1 = @@ -88,15 +88,15 @@ StgPage::~StgPage() delete [] pData; } -void StgPage::SetPage( short nOff, INT32 nVal ) +void StgPage::SetPage( short nOff, sal_Int32 nVal ) { - if( ( nOff < (short) ( nData / sizeof( INT32 ) ) ) && nOff >= 0 ) + if( ( nOff < (short) ( nData / sizeof( sal_Int32 ) ) ) && nOff >= 0 ) { #ifdef OSL_BIGENDIAN nVal = SWAPLONG(nVal); #endif - ((INT32*) pData )[ nOff ] = nVal; - bDirty = TRUE; + ((sal_Int32*) pData )[ nOff ] = nVal; + bDirty = sal_True; } } @@ -105,7 +105,7 @@ void StgPage::SetPage( short nOff, INT32 nVal ) // The disk cache holds the cached sectors. The sector type differ according // to their purpose. -INT32 lcl_GetPageCount( ULONG nFileSize, short nPageSize ) +sal_Int32 lcl_GetPageCount( sal_uLong nFileSize, short nPageSize ) { // return (nFileSize >= 512) ? (nFileSize - 512) / nPageSize : 0; // #i61980# reallife: last page may be incomplete, return number of *started* pages @@ -119,8 +119,8 @@ StgCache::StgCache() pCur = pElem1 = NULL; nPageSize = 512; nError = SVSTREAM_OK; - bMyStream = FALSE; - bFile = FALSE; + bMyStream = sal_False; + bFile = sal_False; pLRUCache = NULL; pStorageStream = NULL; } @@ -128,15 +128,15 @@ StgCache::StgCache() StgCache::~StgCache() { Clear(); - SetStrm( NULL, FALSE ); + SetStrm( NULL, sal_False ); delete (UsrStgPagePtr_Impl*)pLRUCache; } void StgCache::SetPhysPageSize( short n ) { nPageSize = n; - ULONG nPos = pStrm->Tell(); - ULONG nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); + sal_uLong nPos = pStrm->Tell(); + sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); nPages = lcl_GetPageCount( nFileSize, nPageSize ); pStrm->Seek( nPos ); } @@ -144,7 +144,7 @@ void StgCache::SetPhysPageSize( short n ) // Create a new cache element // pCur points to this element -StgPage* StgCache::Create( INT32 nPg ) +StgPage* StgCache::Create( sal_Int32 nPg ) { StgPage* pElem = new StgPage( this, nPageSize ); pElem->nPage = nPg; @@ -227,7 +227,7 @@ void StgCache::Clear() // Look for a cached page -StgPage* StgCache::Find( INT32 nPage ) +StgPage* StgCache::Find( sal_Int32 nPage ) { if( !pLRUCache ) return NULL; @@ -255,7 +255,7 @@ StgPage* StgCache::Find( INT32 nPage ) // Load a page into the cache -StgPage* StgCache::Get( INT32 nPage, BOOL bForce ) +StgPage* StgCache::Get( sal_Int32 nPage, sal_Bool bForce ) { StgPage* p = Find( nPage ); if( !p ) @@ -275,7 +275,7 @@ StgPage* StgCache::Get( INT32 nPage, BOOL bForce ) // to duplicate an existing stream or to create new entries. // The new page is initially marked dirty. No owner is copied. -StgPage* StgCache::Copy( INT32 nNew, INT32 nOld ) +StgPage* StgCache::Copy( sal_Int32 nNew, sal_Int32 nOld ) { StgPage* p = Find( nNew ); if( !p ) @@ -283,7 +283,7 @@ StgPage* StgCache::Copy( INT32 nNew, INT32 nOld ) if( nOld >= 0 ) { // old page: we must have this data! - StgPage* q = Get( nOld, TRUE ); + StgPage* q = Get( nOld, sal_True ); if( q ) memcpy( p->pData, q->pData, p->nData ); } @@ -293,17 +293,17 @@ StgPage* StgCache::Copy( INT32 nNew, INT32 nOld ) // Flush the cache whose owner is given. NULL flushes all. -BOOL StgCache::Commit( StgDirEntry* ) +sal_Bool StgCache::Commit( StgDirEntry* ) { StgPage* p = pElem1; if( p ) do { if( p->bDirty ) { - BOOL b = Write( p->nPage, p->pData, 1 ); + sal_Bool b = Write( p->nPage, p->pData, 1 ); if( !b ) - return FALSE; - p->bDirty = FALSE; + return sal_False; + p->bDirty = sal_False; } p = p->pNext2; } while( p != pElem1 ); @@ -316,10 +316,10 @@ BOOL StgCache::Commit( StgDirEntry* ) if( p->bDirty ) { ErrorBox( NULL, WB_OK, String("SO2: Dirty Block in Ordered List") ).Execute(); - BOOL b = Write( p->nPage, p->pData, 1 ); + sal_Bool b = Write( p->nPage, p->pData, 1 ); if( !b ) - return FALSE; - p->bDirty = FALSE; + return sal_False; + p->bDirty = sal_False; } p = p->pNext2; } while( p != pElem1 ); @@ -329,15 +329,15 @@ BOOL StgCache::Commit( StgDirEntry* ) if( p->bDirty ) { ErrorBox( NULL, WB_OK, String("SO2: Dirty Block in LRU List") ).Execute(); - BOOL b = Write( p->nPage, p->pData, 1 ); + sal_Bool b = Write( p->nPage, p->pData, 1 ); if( !b ) - return FALSE; - p->bDirty = FALSE; + return sal_False; + p->bDirty = sal_False; } p = p->pNext1; } while( p != pElem1 ); #endif - return TRUE; + return sal_True; } void StgCache::Revert( StgDirEntry* ) @@ -345,7 +345,7 @@ void StgCache::Revert( StgDirEntry* ) // Set a stream -void StgCache::SetStrm( SvStream* p, BOOL bMy ) +void StgCache::SetStrm( SvStream* p, sal_Bool bMy ) { if( pStorageStream ) { @@ -376,34 +376,34 @@ void StgCache::SetStrm( UCBStorageStream* pStgStream ) pStrm = pStorageStream->GetModifySvStream(); } - bMyStream = FALSE; + bMyStream = sal_False; } // Open/close the disk file -BOOL StgCache::Open( const String& rName, StreamMode nMode ) +sal_Bool StgCache::Open( const String& rName, StreamMode nMode ) { // do not open in exclusive mode! if( nMode & STREAM_SHARE_DENYALL ) nMode = ( ( nMode & ~STREAM_SHARE_DENYALL ) | STREAM_SHARE_DENYWRITE ); SvFileStream* pFileStrm = new SvFileStream( rName, nMode ); // SvStream "Feature" Write Open auch erfolgreich, wenns nicht klappt - BOOL bAccessDenied = FALSE; + sal_Bool bAccessDenied = sal_False; if( ( nMode & STREAM_WRITE ) && !pFileStrm->IsWritable() ) { pFileStrm->Close(); - bAccessDenied = TRUE; + bAccessDenied = sal_True; } - SetStrm( pFileStrm, TRUE ); + SetStrm( pFileStrm, sal_True ); if( pFileStrm->IsOpen() ) { - ULONG nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); + sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); nPages = lcl_GetPageCount( nFileSize, nPageSize ); pStrm->Seek( 0L ); } else nPages = 0; - bFile = TRUE; + bFile = sal_True; SetError( bAccessDenied ? ERRCODE_IO_ACCESSDENIED : pStrm->GetError() ); return Good(); } @@ -419,7 +419,7 @@ void StgCache::Close() // low level I/O -BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg ) +sal_Bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) { if( Good() ) { @@ -431,9 +431,9 @@ BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg ) SetError( SVSTREAM_READ_ERROR ); else if ( nPage < nPages ) { - ULONG nPos = Page2Pos( nPage ); - INT32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; - ULONG nBytes = nPg2 * nPageSize; + sal_uLong nPos = Page2Pos( nPage ); + sal_Int32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; + sal_uLong nBytes = nPg2 * nPageSize; // fixed address and size for the header if( nPage == -1 ) { @@ -458,12 +458,12 @@ BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg ) return Good(); } -BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg ) +sal_Bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) { if( Good() ) { - ULONG nPos = Page2Pos( nPage ); - ULONG nBytes = nPg * nPageSize; + sal_uLong nPos = Page2Pos( nPage ); + sal_uLong nBytes = nPg * nPageSize; // fixed address and size for the header if( nPage == -1 ) nPos = 0L, nBytes = 512; @@ -475,16 +475,16 @@ BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg ) #endif } } - ULONG nRes = pStrm->Write( pBuf, nBytes ); + sal_uLong nRes = pStrm->Write( pBuf, nBytes ); if( nRes != nBytes ) SetError( SVSTREAM_WRITE_ERROR ); else SetError( pStrm->GetError() ); #ifdef READ_AFTER_WRITE - BYTE cBuf[ 512 ]; + sal_uInt8 cBuf[ 512 ]; pStrm->Flush(); pStrm->Seek( nPos ); - BOOL bRes = ( pStrm->Read( cBuf, 512 ) == 512 ); + sal_Bool bRes = ( pStrm->Read( cBuf, 512 ) == 512 ); if( bRes ) bRes = !memcmp( cBuf, pBuf, 512 ); if( !bRes ) @@ -499,10 +499,10 @@ BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg ) // set the file size in pages -BOOL StgCache::SetSize( INT32 n ) +sal_Bool StgCache::SetSize( sal_Int32 n ) { // Add the file header - INT32 nSize = n * nPageSize + 512; + sal_Int32 nSize = n * nPageSize + 512; pStrm->SetStreamSize( nSize ); SetError( pStrm->GetError() ); if( !nError ) @@ -510,7 +510,7 @@ BOOL StgCache::SetSize( INT32 n ) return Good(); } -void StgCache::SetError( ULONG n ) +void StgCache::SetError( sal_uLong n ) { if( n && !nError ) nError = n; @@ -533,13 +533,13 @@ void StgCache::MoveError( StorageBase& r ) // Utility functions -INT32 StgCache::Page2Pos( INT32 nPage ) +sal_Int32 StgCache::Page2Pos( sal_Int32 nPage ) { if( nPage < 0 ) nPage = 0; return( nPage * nPageSize ) + nPageSize; } -INT32 StgCache::Pos2Page( INT32 nPos ) +sal_Int32 StgCache::Pos2Page( sal_Int32 nPos ) { return ( ( nPos + nPageSize - 1 ) / nPageSize ) * nPageSize - 1; } diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx index 38e8e3428331..9b47cffed6c8 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -44,9 +44,9 @@ class StorageBase; class StgCache { StgPage* pCur; // top of LRU list StgPage* pElem1; // top of ordered list - ULONG nError; // error code - INT32 nPages; // size of data area in pages - USHORT nRef; // reference count + sal_uLong nError; // error code + sal_Int32 nPages; // size of data area in pages + sal_uInt16 nRef; // reference count void * pLRUCache; // hash table of cached objects short nPageSize; // page size of the file UCBStorageStream* pStorageStream; // holds reference to UCB storage stream @@ -54,40 +54,40 @@ class StgCache { void Erase( StgPage* ); // delete a cache element void InsertToLRU( StgPage* ); // insert into LRU list void InsertToOrdered( StgPage* ); // insert into ordered list - StgPage* Create( INT32 ); // create a cached page + StgPage* Create( sal_Int32 ); // create a cached page protected: SvStream* pStrm; // physical stream - BOOL bMyStream; // TRUE: delete stream in dtor - BOOL bFile; // TRUE: file stream - INT32 Page2Pos( INT32 ); // page address --> file position - INT32 Pos2Page( INT32 ); // file position --> page address + sal_Bool bMyStream; // sal_True: delete stream in dtor + sal_Bool bFile; // sal_True: file stream + sal_Int32 Page2Pos( sal_Int32 ); // page address --> file position + sal_Int32 Pos2Page( sal_Int32 ); // file position --> page address public: StgCache(); ~StgCache(); void IncRef() { nRef++; } - USHORT DecRef() { return --nRef; } + sal_uInt16 DecRef() { return --nRef; } void SetPhysPageSize( short ); - INT32 GetPhysPages() { return nPages; } + sal_Int32 GetPhysPages() { return nPages; } short GetPhysPageSize() { return nPageSize; } SvStream* GetStrm() { return pStrm; } - void SetStrm( SvStream*, BOOL ); + void SetStrm( SvStream*, sal_Bool ); void SetStrm( UCBStorageStream* ); - BOOL IsWritable() { return pStrm->IsWritable(); } - BOOL Good() { return BOOL( nError == SVSTREAM_OK ); } - BOOL Bad() { return BOOL( nError != SVSTREAM_OK ); } - ULONG GetError() { return nError; } + sal_Bool IsWritable() { return pStrm->IsWritable(); } + sal_Bool Good() { return sal_Bool( nError == SVSTREAM_OK ); } + sal_Bool Bad() { return sal_Bool( nError != SVSTREAM_OK ); } + sal_uLong GetError() { return nError; } void MoveError( StorageBase& ); - void SetError( ULONG ); + void SetError( sal_uLong ); void ResetError(); - BOOL Open( const String& rName, StreamMode ); + sal_Bool Open( const String& rName, StreamMode ); void Close(); - BOOL Read( INT32 nPage, void* pBuf, INT32 nPages ); - BOOL Write( INT32 nPage, void* pBuf, INT32 nPages ); - BOOL SetSize( INT32 nPages ); - StgPage* Find( INT32 ); // find a cached page - StgPage* Get( INT32, BOOL ); // get a cached page - StgPage* Copy( INT32, INT32=STG_FREE ); // copy a page - BOOL Commit( StgDirEntry* = NULL ); // flush all pages + sal_Bool Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPages ); + sal_Bool Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPages ); + sal_Bool SetSize( sal_Int32 nPages ); + StgPage* Find( sal_Int32 ); // find a cached page + StgPage* Get( sal_Int32, sal_Bool ); // get a cached page + StgPage* Copy( sal_Int32, sal_Int32=STG_FREE ); // copy a page + sal_Bool Commit( StgDirEntry* = NULL ); // flush all pages void Revert( StgDirEntry* = NULL ); // revert dirty pages void Clear(); // clear the cache }; @@ -98,32 +98,32 @@ class StgPage { StgPage *pNext1, *pLast1; // LRU chain StgPage *pNext2, *pLast2; // ordered chain StgDirEntry* pOwner; // owner - INT32 nPage; // page # - BYTE* pData; // nPageSize characters + sal_Int32 nPage; // page # + sal_uInt8* pData; // nPageSize characters short nData; // size of this page - BOOL bDirty; // dirty flag + sal_Bool bDirty; // dirty flag StgPage( StgCache*, short ); ~StgPage(); public: - void SetDirty() { bDirty = TRUE; } - INT32 GetPage() { return nPage; } + void SetDirty() { bDirty = sal_True; } + sal_Int32 GetPage() { return nPage; } void* GetData() { return pData; } short GetSize() { return nData; } void SetOwner( StgDirEntry* p ) { pOwner = p; } // routines for accessing FAT pages // Assume that the data is a FAT page and get/put FAT data. - INT32 GetPage( short nOff ) + sal_Int32 GetPage( short nOff ) { - if( ( nOff >= (short) ( nData / sizeof( INT32 ) ) ) || nOff < 0 ) + if( ( nOff >= (short) ( nData / sizeof( sal_Int32 ) ) ) || nOff < 0 ) return -1; - INT32 n = ((INT32*) pData )[ nOff ]; + sal_Int32 n = ((sal_Int32*) pData )[ nOff ]; #ifdef OSL_BIGENDIAN return SWAPLONG(n); #else return n; #endif } - void SetPage( short, INT32 ); // put an element + void SetPage( short, sal_Int32 ); // put an element }; #endif diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index f1c33338429b..4951daa70a6c 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -31,7 +31,7 @@ #include <string.h> // memcpy() -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" @@ -55,7 +55,7 @@ // Problem der Implementation: Keine Hierarchischen commits. Daher nur // insgesamt transaktionsorientert oder direkt. -StgDirEntry::StgDirEntry( const void* pFrom, BOOL * pbOk ) : StgAvlNode() +StgDirEntry::StgDirEntry( const void* pFrom, sal_Bool * pbOk ) : StgAvlNode() { *pbOk = aEntry.Load( pFrom ); @@ -82,14 +82,14 @@ void StgDirEntry::InitMembers() nEntry = nRefCnt = 0; nMode = STREAM_READ; - bDirect = TRUE; + bDirect = sal_True; bInvalid = bCreated = bRenamed = bRemoved = bTemp = bDirty = - bZombie = FALSE; + bZombie = sal_False; } StgDirEntry::~StgDirEntry() @@ -114,9 +114,9 @@ short StgDirEntry::Compare( const StgAvlNode* p ) const // the TOC tree into the TOC stream. Remember that aSave is // stored, not aEntry. -void StgDirEntry::Enum( INT32& n ) +void StgDirEntry::Enum( sal_Int32& n ) { - INT32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE; + sal_Int32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE; nEntry = n++; if( pLeft ) { @@ -138,17 +138,17 @@ void StgDirEntry::Enum( INT32& n ) // Delete all temporary entries before writing the TOC stream. // Until now Deltem is never called with bForce True -void StgDirEntry::DelTemp( BOOL bForce ) +void StgDirEntry::DelTemp( sal_Bool bForce ) { if( pLeft ) - ((StgDirEntry*) pLeft)->DelTemp( FALSE ); + ((StgDirEntry*) pLeft)->DelTemp( sal_False ); if( pRight ) - ((StgDirEntry*) pRight)->DelTemp( FALSE ); + ((StgDirEntry*) pRight)->DelTemp( sal_False ); if( pDown ) { // If the storage is dead, of course all elements are dead, too if( bInvalid && aEntry.GetType() == STG_STORAGE ) - bForce = TRUE; + bForce = sal_True; pDown->DelTemp( bForce ); } if( ( bForce || bInvalid ) @@ -158,12 +158,12 @@ void StgDirEntry::DelTemp( BOOL bForce ) if( pUp ) { // this deletes the element if refcnt == 0! - BOOL bDel = nRefCnt == 0; + sal_Bool bDel = nRefCnt == 0; StgAvlNode::Remove( (StgAvlNode**) &pUp->pDown, this, bDel ); if( !bDel ) { pLeft = pRight = pDown = 0; - bInvalid = bZombie = TRUE; + bInvalid = bZombie = sal_True; } } } @@ -171,26 +171,26 @@ void StgDirEntry::DelTemp( BOOL bForce ) // Save the tree into the given dir stream -BOOL StgDirEntry::Store( StgDirStrm& rStrm ) +sal_Bool StgDirEntry::Store( StgDirStrm& rStrm ) { - void* pEntry = rStrm.GetEntry( nEntry, TRUE ); + void* pEntry = rStrm.GetEntry( nEntry, sal_True ); if( !pEntry ) - return FALSE; + return sal_False; // Do not store the current (maybe not commited) entry aSave.Store( pEntry ); if( pLeft ) if( !((StgDirEntry*) pLeft)->Store( rStrm ) ) - return FALSE; + return sal_False; if( pRight ) if( !((StgDirEntry*) pRight)->Store( rStrm ) ) - return FALSE; + return sal_False; if( pDown ) if( !pDown->Store( rStrm ) ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL StgDirEntry::StoreStream( StgIo& rIo ) +sal_Bool StgDirEntry::StoreStream( StgIo& rIo ) { if( aEntry.GetType() == STG_STREAM || aEntry.GetType() == STG_ROOT ) { @@ -207,27 +207,27 @@ BOOL StgDirEntry::StoreStream( StgIo& rIo ) } // or write the data stream else if( !Tmp2Strm() ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } // Save all dirty streams -BOOL StgDirEntry::StoreStreams( StgIo& rIo ) +sal_Bool StgDirEntry::StoreStreams( StgIo& rIo ) { if( !StoreStream( rIo ) ) - return FALSE; + return sal_False; if( pLeft ) if( !((StgDirEntry*) pLeft)->StoreStreams( rIo ) ) - return FALSE; + return sal_False; if( pRight ) if( !((StgDirEntry*) pRight)->StoreStreams( rIo ) ) - return FALSE; + return sal_False; if( pDown ) if( !pDown->StoreStreams( rIo ) ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } // Revert all directory entries after failure to write the TOC stream @@ -245,24 +245,24 @@ void StgDirEntry::RevertAll() // Look if any element of the tree is dirty -BOOL StgDirEntry::IsDirty() +sal_Bool StgDirEntry::IsDirty() { if( bDirty || bInvalid ) - return TRUE; + return sal_True; if( pLeft && ((StgDirEntry*) pLeft)->IsDirty() ) - return TRUE; + return sal_True; if( pRight && ((StgDirEntry*) pRight)->IsDirty() ) - return TRUE; + return sal_True; if( pDown && pDown->IsDirty() ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } // Set up a stream. -void StgDirEntry::OpenStream( StgIo& rIo, BOOL bForceBig ) +void StgDirEntry::OpenStream( StgIo& rIo, sal_Bool bForceBig ) { - INT32 nThreshold = (USHORT) rIo.aHdr.GetThreshold(); + sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold(); delete pStgStrm; if( !bForceBig && aEntry.GetSize() < nThreshold ) pStgStrm = new StgSmallStrm( rIo, this ); @@ -272,7 +272,7 @@ void StgDirEntry::OpenStream( StgIo& rIo, BOOL bForceBig ) { // This entry has invalid data, so delete that data SetSize( 0L ); -// bRemoved = bInvalid = FALSE; +// bRemoved = bInvalid = sal_False; } nPos = 0; } @@ -292,9 +292,9 @@ void StgDirEntry::Close() // Get the current stream size -INT32 StgDirEntry::GetSize() +sal_Int32 StgDirEntry::GetSize() { - INT32 n; + sal_Int32 n; if( pTmpStrm ) n = pTmpStrm->GetSize(); else if( pCurStrm ) @@ -305,14 +305,14 @@ INT32 StgDirEntry::GetSize() // Set the stream size. This means also creating a temp stream. -BOOL StgDirEntry::SetSize( INT32 nNewSize ) +sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize ) { if ( !( nMode & STREAM_WRITE ) || (!bDirect && !pTmpStrm && !Strm2Tmp()) ) { - return FALSE; + return sal_False; } if( nNewSize < nPos ) @@ -321,26 +321,26 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) { pTmpStrm->SetSize( nNewSize ); pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); - return BOOL( pTmpStrm->GetError() == SVSTREAM_OK ); + return sal_Bool( pTmpStrm->GetError() == SVSTREAM_OK ); } else { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; StgIo& rIo = pStgStrm->GetIo(); - INT32 nThreshold = rIo.aHdr.GetThreshold(); + sal_Int32 nThreshold = rIo.aHdr.GetThreshold(); // ensure the correct storage stream! StgStrm* pOld = NULL; - USHORT nOldSize = 0; + sal_uInt16 nOldSize = 0; if( nNewSize >= nThreshold && pStgStrm->IsSmallStrm() ) { pOld = pStgStrm; - nOldSize = (USHORT) pOld->GetSize(); + nOldSize = (sal_uInt16) pOld->GetSize(); pStgStrm = new StgDataStrm( rIo, STG_EOF, 0 ); } else if( nNewSize < nThreshold && !pStgStrm->IsSmallStrm() ) { pOld = pStgStrm; - nOldSize = (USHORT) nNewSize; + nOldSize = (sal_uInt16) nNewSize; pStgStrm = new StgSmallStrm( rIo, STG_EOF, 0 ); } // now set the new size @@ -352,16 +352,16 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) // if so, we probably need to copy the old data if( nOldSize ) { - void* pBuf = new BYTE[ nOldSize ]; + void* pBuf = new sal_uInt8[ nOldSize ]; pOld->Pos2Page( 0L ); pStgStrm->Pos2Page( 0L ); if( pOld->Read( pBuf, nOldSize ) && pStgStrm->Write( pBuf, nOldSize ) ) - bRes = TRUE; - delete[] static_cast<BYTE*>(pBuf); + bRes = sal_True; + delete[] static_cast<sal_uInt8*>(pBuf); } else - bRes = TRUE; + bRes = sal_True; if( bRes ) { pOld->SetSize( 0 ); @@ -379,7 +379,7 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) else { pStgStrm->Pos2Page( nPos ); - bRes = TRUE; + bRes = sal_True; } } return bRes; @@ -388,7 +388,7 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) // Seek. On negative values, seek to EOF. -INT32 StgDirEntry::Seek( INT32 nNew ) +sal_Int32 StgDirEntry::Seek( sal_Int32 nNew ) { if( pTmpStrm ) { @@ -404,7 +404,7 @@ INT32 StgDirEntry::Seek( INT32 nNew ) } else { - INT32 nSize = aEntry.GetSize(); + sal_Int32 nSize = aEntry.GetSize(); if( nNew < 0 ) nNew = nSize; @@ -428,7 +428,7 @@ INT32 StgDirEntry::Seek( INT32 nNew ) // Read -INT32 StgDirEntry::Read( void* p, INT32 nLen ) +sal_Int32 StgDirEntry::Read( void* p, sal_Int32 nLen ) { if( nLen <= 0 ) return 0; @@ -444,7 +444,7 @@ INT32 StgDirEntry::Read( void* p, INT32 nLen ) // Write -INT32 StgDirEntry::Write( const void* p, INT32 nLen ) +sal_Int32 StgDirEntry::Write( const void* p, sal_Int32 nLen ) { if( nLen <= 0 || !( nMode & STREAM_WRITE ) ) return 0; @@ -462,7 +462,7 @@ INT32 StgDirEntry::Write( const void* p, INT32 nLen ) } else { - INT32 nNew = nPos + nLen; + sal_Int32 nNew = nPos + nLen; if( nNew > pStgStrm->GetSize() ) { if( !SetSize( nNew ) ) @@ -479,16 +479,16 @@ INT32 StgDirEntry::Write( const void* p, INT32 nLen ) void StgDirEntry::Copy( StgDirEntry& rDest ) { - INT32 n = GetSize(); + sal_Int32 n = GetSize(); if( rDest.SetSize( n ) && n ) { - BYTE aTempBytes[ 4096 ]; + sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast<void*>( aTempBytes ); Seek( 0L ); rDest.Seek( 0L ); while( n ) { - INT32 nn = n; + sal_Int32 nn = n; if( nn > 4096 ) nn = 4096; if( Read( p, nn ) != nn ) @@ -502,22 +502,22 @@ void StgDirEntry::Copy( StgDirEntry& rDest ) void StgDirEntry::Copy( BaseStorageStream& rDest ) { - INT32 n = GetSize(); + sal_Int32 n = GetSize(); if( rDest.SetSize( n ) && n ) { - ULONG Pos = rDest.Tell(); - BYTE aTempBytes[ 4096 ]; + sal_uLong Pos = rDest.Tell(); + sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast<void*>( aTempBytes ); Seek( 0L ); rDest.Seek( 0L ); while( n ) { - INT32 nn = n; + sal_Int32 nn = n; if( nn > 4096 ) nn = 4096; if( Read( p, nn ) != nn ) break; - if( sal::static_int_cast<INT32>(rDest.Write( p, nn )) != nn ) + if( sal::static_int_cast<sal_Int32>(rDest.Write( p, nn )) != nn ) break; n -= nn; } @@ -527,12 +527,12 @@ void StgDirEntry::Copy( BaseStorageStream& rDest ) // Commit this entry -BOOL StgDirEntry::Commit() +sal_Bool StgDirEntry::Commit() { // OSL_ENSURE( nMode & STREAM_WRITE, "Trying to commit readonly stream!" ); aSave = aEntry; - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; if( aEntry.GetType() == STG_STREAM ) { if( pTmpStrm ) @@ -553,7 +553,7 @@ BOOL StgDirEntry::Commit() // Revert the entry -BOOL StgDirEntry::Revert() +sal_Bool StgDirEntry::Revert() { aEntry = aSave; switch( aEntry.GetType() ) @@ -564,24 +564,24 @@ BOOL StgDirEntry::Revert() break; case STG_STORAGE: { - BOOL bSomeRenamed = FALSE; + sal_Bool bSomeRenamed = sal_False; StgIterator aOIter( *this ); StgDirEntry* op = aOIter.First(); while( op ) { op->aEntry = op->aSave; - op->bDirty = FALSE; - bSomeRenamed = BOOL( bSomeRenamed | op->bRenamed ); + op->bDirty = sal_False; + bSomeRenamed = sal_Bool( bSomeRenamed | op->bRenamed ); // Remove any new entries if( op->bCreated ) { - op->bCreated = FALSE; + op->bCreated = sal_False; op->Close(); - op->bInvalid = TRUE; + op->bInvalid = sal_True; } // Reactivate any removed entries else if( op->bRemoved ) - op->bRemoved = op->bInvalid = op->bTemp = FALSE; + op->bRemoved = op->bInvalid = op->bTemp = sal_False; op = aOIter.Next(); } // Resort all renamed entries @@ -596,12 +596,12 @@ BOOL StgDirEntry::Revert() StgAvlNode::Move ( (StgAvlNode**) &p->pUp->pDown, (StgAvlNode**) &p->pUp->pDown, p ); - p->bRenamed = FALSE; + p->bRenamed = sal_False; } p = aIter.Next(); } } - DelTemp( FALSE ); + DelTemp( sal_False ); break; } case STG_EMPTY: @@ -610,22 +610,22 @@ BOOL StgDirEntry::Revert() case STG_ROOT: break; } - return TRUE; + return sal_True; } // Copy the stg stream to the temp stream -BOOL StgDirEntry::Strm2Tmp() +sal_Bool StgDirEntry::Strm2Tmp() { if( !pTmpStrm ) { - ULONG n = 0; + sal_uLong n = 0; if( pCurStrm ) { // It was already commited once pTmpStrm = new StgTmpStrm; if( pTmpStrm->GetError() == SVSTREAM_OK && pTmpStrm->Copy( *pCurStrm ) ) - return TRUE; + return sal_True; n = 1; // indicates error } else @@ -636,15 +636,15 @@ BOOL StgDirEntry::Strm2Tmp() { if( n ) { - BYTE aTempBytes[ 4096 ]; + sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast<void*>( aTempBytes ); pStgStrm->Pos2Page( 0L ); while( n ) { - ULONG nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; - if( (ULONG) pStgStrm->Read( p, nn ) != nn ) + if( (sal_uLong) pStgStrm->Read( p, nn ) != nn ) break; if( pTmpStrm->Write( p, nn ) != nn ) break; @@ -662,41 +662,41 @@ BOOL StgDirEntry::Strm2Tmp() pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); delete pTmpStrm; pTmpStrm = NULL; - return FALSE; + return sal_False; } } - return TRUE; + return sal_True; } // Copy the temp stream to the stg stream during the final commit -BOOL StgDirEntry::Tmp2Strm() +sal_Bool StgDirEntry::Tmp2Strm() { // We did commit once, but have not written since then if( !pTmpStrm ) pTmpStrm = pCurStrm, pCurStrm = NULL; if( pTmpStrm ) { - ULONG n = pTmpStrm->GetSize(); + sal_uLong n = pTmpStrm->GetSize(); StgStrm* pNewStrm; StgIo& rIo = pStgStrm->GetIo(); - ULONG nThreshold = (ULONG) rIo.aHdr.GetThreshold(); + sal_uLong nThreshold = (sal_uLong) rIo.aHdr.GetThreshold(); if( n < nThreshold ) pNewStrm = new StgSmallStrm( rIo, STG_EOF, 0 ); else pNewStrm = new StgDataStrm( rIo, STG_EOF, 0 ); if( pNewStrm->SetSize( n ) ) { - BYTE p[ 4096 ]; + sal_uInt8 p[ 4096 ]; pTmpStrm->Seek( 0L ); while( n ) { - ULONG nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; if( pTmpStrm->Read( p, nn ) != nn ) break; - if( (ULONG) pNewStrm->Write( p, nn ) != nn ) + if( (sal_uLong) pNewStrm->Write( p, nn ) != nn ) break; n -= nn; } @@ -705,7 +705,7 @@ BOOL StgDirEntry::Tmp2Strm() pTmpStrm->Seek( nPos ); pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); delete pNewStrm; - return FALSE; + return sal_False; } else { @@ -721,12 +721,12 @@ BOOL StgDirEntry::Tmp2Strm() } } } - return TRUE; + return sal_True; } // Check if the given entry is contained in this entry -BOOL StgDirEntry::IsContained( StgDirEntry* pStg ) +sal_Bool StgDirEntry::IsContained( StgDirEntry* pStg ) { if( aEntry.GetType() == STG_STORAGE ) { @@ -735,25 +735,25 @@ BOOL StgDirEntry::IsContained( StgDirEntry* pStg ) while( p ) { if( !p->aEntry.Compare( pStg->aEntry ) ) - return FALSE; + return sal_False; if( p->aEntry.GetType() == STG_STORAGE ) if( !p->IsContained( pStg ) ) - return FALSE; + return sal_False; p = aIter.Next(); } } - return TRUE; + return sal_True; } // Invalidate all open entries by setting the RefCount to 0. If the bDel // flag is set, also set the invalid flag to indicate deletion during the // next dir stream flush. -void StgDirEntry::Invalidate( BOOL bDel ) +void StgDirEntry::Invalidate( sal_Bool bDel ) { // nRefCnt = 0; if( bDel ) - bRemoved = bInvalid = TRUE; + bRemoved = bInvalid = sal_True; switch( aEntry.GetType() ) { case STG_STORAGE: @@ -808,12 +808,12 @@ StgDirStrm::~StgDirStrm() // Recursively parse the directory tree during reading the TOC stream -void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper ) +void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper ) { void* p = ( n == STG_FREE ) ? NULL : GetEntry( n ); if( p ) { - BOOL bOk(FALSE); + sal_Bool bOk(sal_False); StgDirEntry* pCur = new StgDirEntry( p, &bOk ); if( !bOk ) @@ -828,10 +828,10 @@ void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper ) if( !pUpper ) pCur->aEntry.SetType( STG_ROOT ); - INT32 nLeft = pCur->aEntry.GetLeaf( STG_LEFT ); - INT32 nRight = pCur->aEntry.GetLeaf( STG_RIGHT ); + sal_Int32 nLeft = pCur->aEntry.GetLeaf( STG_LEFT ); + sal_Int32 nRight = pCur->aEntry.GetLeaf( STG_RIGHT ); // substorage? - INT32 nLeaf = STG_FREE; + sal_Int32 nLeaf = STG_FREE; if( pCur->aEntry.GetType() == STG_STORAGE || pCur->aEntry.GetType() == STG_ROOT ) { nLeaf = pCur->aEntry.GetLeaf( STG_CHILD ); @@ -866,7 +866,7 @@ void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper ) // Extend or shrink the directory stream. -BOOL StgDirStrm::SetSize( INT32 nBytes ) +sal_Bool StgDirStrm::SetSize( sal_Int32 nBytes ) { // Always allocate full pages nBytes = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize; @@ -875,72 +875,75 @@ BOOL StgDirStrm::SetSize( INT32 nBytes ) // Save the TOC stream into a new substream after saving all data streams -BOOL StgDirStrm::Store() +sal_Bool StgDirStrm::Store() { if( !pRoot->IsDirty() ) - return TRUE; + return sal_True; if( !pRoot->StoreStreams( rIo ) ) - return FALSE; + return sal_False; // After writing all streams, the data FAT stream has changed, // so we have to commit the root again pRoot->Commit(); // We want a completely new stream, so fake an empty stream - INT32 nOldStart = nStart; // save for later deletion - INT32 nOldSize = nSize; + sal_Int32 nOldStart = nStart; // save for later deletion + sal_Int32 nOldSize = nSize; nStart = nPage = STG_EOF; nSize = nPos = 0; nOffset = 0; // Delete all temporary entries - pRoot->DelTemp( FALSE ); + pRoot->DelTemp( sal_False ); // set the entry numbers - INT32 n = 0; + sal_Int32 n = 0; pRoot->Enum( n ); if( !SetSize( n * STGENTRY_SIZE ) ) { nStart = nOldStart; nSize = nOldSize; pRoot->RevertAll(); - return FALSE; + return sal_False; } // set up the cache elements for the new stream if( !Copy( STG_FREE, nSize ) ) { pRoot->RevertAll(); - return FALSE; + return sal_False; } // Write the data to the new stream if( !pRoot->Store( *this ) ) { pRoot->RevertAll(); - return FALSE; + return sal_False; } // fill any remaining entries with empty data - INT32 ne = nSize / STGENTRY_SIZE; + sal_Int32 ne = nSize / STGENTRY_SIZE; StgEntry aEmpty; aEmpty.Init(); while( n < ne ) { - void* p = GetEntry( n++, TRUE ); + void* p = GetEntry( n++, sal_True ); if( !p ) { pRoot->RevertAll(); - return FALSE; + return sal_False; } aEmpty.Store( p ); } // Now we can release the old stream - pFat->FreePages( nOldStart, TRUE ); + pFat->FreePages( nOldStart, sal_True ); rIo.aHdr.SetTOCStart( nStart ); - return TRUE; + return sal_True; } // Get a dir entry. -void* StgDirStrm::GetEntry( INT32 n, BOOL bDirty ) +void* StgDirStrm::GetEntry( sal_Int32 n, sal_Bool bDirty ) { + if( n < 0 ) + return NULL; + n *= STGENTRY_SIZE; - if( n >= nSize ) + if( n < 0 && n >= nSize ) return NULL; - return GetPtr( n, TRUE, bDirty ); + return GetPtr( n, sal_True, bDirty ); } // Find a dir entry. @@ -987,9 +990,9 @@ StgDirEntry* StgDirStrm::Create } pRes->bInvalid = pRes->bRemoved = - pRes->bTemp = FALSE; + pRes->bTemp = sal_False; pRes->bCreated = - pRes->bDirty = TRUE; + pRes->bDirty = sal_True; } else { @@ -999,7 +1002,7 @@ StgDirEntry* StgDirStrm::Create pRes->pUp = &rStg; pRes->ppRoot = &pRoot; pRes->bCreated = - pRes->bDirty = TRUE; + pRes->bDirty = sal_True; } else { @@ -1012,44 +1015,44 @@ StgDirEntry* StgDirStrm::Create // Rename the given entry. -BOOL StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew ) +sal_Bool StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew ) { StgDirEntry* p = Find( rStg, rOld ); if( p ) { - if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, FALSE ) ) - return FALSE; + if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, sal_False ) ) + return sal_False; p->aEntry.SetName( rNew ); if( !StgAvlNode::Insert( (StgAvlNode**) &rStg.pDown, p ) ) - return FALSE; - p->bRenamed = p->bDirty = TRUE; - return TRUE; + return sal_False; + p->bRenamed = p->bDirty = sal_True; + return sal_True; } else { rIo.SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } } // Move the given entry to a different storage. -BOOL StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName ) +sal_Bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName ) { StgDirEntry* p = Find( rStg1, rName ); if( p ) { if( !StgAvlNode::Move ( (StgAvlNode**) &rStg1.pDown, (StgAvlNode**) &rStg2.pDown, p ) ) - return FALSE; - p->bDirty = TRUE; - return TRUE; + return sal_False; + p->bDirty = sal_True; + return sal_True; } else { rIo.SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } } diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx index d0ed802be683..ccb12c4762d7 100644 --- a/sot/source/sdstor/stgdir.hxx +++ b/sot/source/sdstor/stgdir.hxx @@ -50,52 +50,52 @@ class StgDirEntry : public StgAvlNode StgStrm* pStgStrm; // storage stream StgTmpStrm* pTmpStrm; // temporary stream StgTmpStrm* pCurStrm; // temp stream after commit - INT32 nEntry; // entry # in TOC stream (temp) - INT32 nPos; // current position - BOOL bDirty; // dirty directory entry - BOOL bCreated; // newly created entry - BOOL bRemoved; // removed per Invalidate() - BOOL bRenamed; // renamed + sal_Int32 nEntry; // entry # in TOC stream (temp) + sal_Int32 nPos; // current position + sal_Bool bDirty; // dirty directory entry + sal_Bool bCreated; // newly created entry + sal_Bool bRemoved; // removed per Invalidate() + sal_Bool bRenamed; // renamed void InitMembers(); // ctor helper virtual short Compare( const StgAvlNode* ) const; - BOOL StoreStream( StgIo& ); // store the stream - BOOL StoreStreams( StgIo& ); // store all streams + sal_Bool StoreStream( StgIo& ); // store the stream + sal_Bool StoreStreams( StgIo& ); // store all streams void RevertAll(); // revert the whole tree - BOOL Strm2Tmp(); // copy stgstream to temp file - BOOL Tmp2Strm(); // copy temp file to stgstream + sal_Bool Strm2Tmp(); // copy stgstream to temp file + sal_Bool Tmp2Strm(); // copy temp file to stgstream public: StgEntry aEntry; // entry data - INT32 nRefCnt; // reference count + sal_Int32 nRefCnt; // reference count StreamMode nMode; // open mode - BOOL bTemp; // TRUE: delete on dir flush - BOOL bDirect; // TRUE: direct mode - BOOL bZombie; // TRUE: Removed From StgIo - BOOL bInvalid; // TRUE: invalid entry - StgDirEntry( const void*, BOOL * pbOk ); + sal_Bool bTemp; // sal_True: delete on dir flush + sal_Bool bDirect; // sal_True: direct mode + sal_Bool bZombie; // sal_True: Removed From StgIo + sal_Bool bInvalid; // sal_True: invalid entry + StgDirEntry( const void*, sal_Bool * pbOk ); StgDirEntry( const StgEntry& ); ~StgDirEntry(); - void Invalidate( BOOL=FALSE ); // invalidate all open entries - void Enum( INT32& ); // enumerate entries for iteration - void DelTemp( BOOL ); // delete temporary entries - BOOL Store( StgDirStrm& ); // save entry into dir strm - BOOL IsContained( StgDirEntry* ); // check if subentry + void Invalidate( sal_Bool=sal_False ); // invalidate all open entries + void Enum( sal_Int32& ); // enumerate entries for iteration + void DelTemp( sal_Bool ); // delete temporary entries + sal_Bool Store( StgDirStrm& ); // save entry into dir strm + sal_Bool IsContained( StgDirEntry* ); // check if subentry - void SetDirty() { bDirty = TRUE; } - BOOL IsDirty(); + void SetDirty() { bDirty = sal_True; } + sal_Bool IsDirty(); void ClearDirty(); - BOOL Commit(); - BOOL Revert(); + sal_Bool Commit(); + sal_Bool Revert(); - void OpenStream( StgIo&, BOOL=FALSE ); // set up an approbiate stream + void OpenStream( StgIo&, sal_Bool=sal_False ); // set up an approbiate stream void Close(); - INT32 GetSize(); - BOOL SetSize( INT32 ); - INT32 Seek( INT32 ); - INT32 Tell() { return nPos; } - INT32 Read( void*, INT32 ); - INT32 Write( const void*, INT32 ); + sal_Int32 GetSize(); + sal_Bool SetSize( sal_Int32 ); + sal_Int32 Seek( sal_Int32 ); + sal_Int32 Tell() { return nPos; } + sal_Int32 Read( void*, sal_Int32 ); + sal_Int32 Write( const void*, sal_Int32 ); void Copy( StgDirEntry& ); void Copy( BaseStorageStream& ); }; @@ -105,19 +105,19 @@ class StgDirStrm : public StgDataStrm friend class StgIterator; StgDirEntry* pRoot; // root of dir tree short nEntries; // entries per page - void SetupEntry( INT32, StgDirEntry* ); + void SetupEntry( sal_Int32, StgDirEntry* ); public: StgDirStrm( StgIo& ); ~StgDirStrm(); - virtual BOOL SetSize( INT32 ); // change the size - BOOL Store(); - void* GetEntry( INT32 n, BOOL=FALSE );// get an entry + virtual sal_Bool SetSize( sal_Int32 ); // change the size + sal_Bool Store(); + void* GetEntry( sal_Int32 n, sal_Bool=sal_False );// get an entry StgDirEntry* GetRoot() { return pRoot; } StgDirEntry* Find( StgDirEntry&, const String& ); StgDirEntry* Create( StgDirEntry&, const String&, StgEntryType ); - BOOL Remove( StgDirEntry&, const String& ); - BOOL Rename( StgDirEntry&, const String&, const String& ); - BOOL Move( StgDirEntry&, StgDirEntry&, const String& ); + sal_Bool Remove( StgDirEntry&, const String& ); + sal_Bool Rename( StgDirEntry&, const String&, const String& ); + sal_Bool Move( StgDirEntry&, StgDirEntry&, const String& ); }; class StgIterator : public StgAvlIterator diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index e6b318da7148..bfde32ade4c0 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -33,14 +33,14 @@ #include <rtl/ustring.hxx> #include <com/sun/star/lang/Locale.hpp> #include <unotools/charclass.hxx> -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" #include "stgdir.hxx" #include "stgio.hxx" -static BYTE cStgSignature[ 8 ] = { 0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A,0xE1 }; +static sal_uInt8 cStgSignature[ 8 ] = { 0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A,0xE1 }; ////////////////////////////// struct ClsId ///////////////////////////// @@ -63,17 +63,17 @@ SvStream& operator >>( SvStream& r, ClsId& rId ) SvStream& operator <<( SvStream& r, const ClsId& rId ) { return - r << (INT32) rId.n1 - << (INT16) rId.n2 - << (INT16) rId.n3 - << (UINT8) rId.n4 - << (UINT8) rId.n5 - << (UINT8) rId.n6 - << (UINT8) rId.n7 - << (UINT8) rId.n8 - << (UINT8) rId.n9 - << (UINT8) rId.n10 - << (UINT8) rId.n11; + r << (sal_Int32) rId.n1 + << (sal_Int16) rId.n2 + << (sal_Int16) rId.n3 + << (sal_uInt8) rId.n4 + << (sal_uInt8) rId.n5 + << (sal_uInt8) rId.n6 + << (sal_uInt8) rId.n7 + << (sal_uInt8) rId.n8 + << (sal_uInt8) rId.n9 + << (sal_uInt8) rId.n10 + << (sal_uInt8) rId.n11; } ///////////////////////////// class StgHeader //////////////////////////// @@ -100,14 +100,14 @@ void StgHeader::Init() SetFATPage( i, STG_FREE ); } -BOOL StgHeader::Load( StgIo& rIo ) +sal_Bool StgHeader::Load( StgIo& rIo ) { SvStream& r = *rIo.GetStrm(); Load( r ); return rIo.Good(); } -BOOL StgHeader::Load( SvStream& r ) +sal_Bool StgHeader::Load( SvStream& r ) { r.Seek( 0L ); r.Read( cSignature, 8 ); @@ -130,10 +130,10 @@ BOOL StgHeader::Load( SvStream& r ) return r.GetErrorCode() == ERRCODE_NONE; } -BOOL StgHeader::Store( StgIo& rIo ) +sal_Bool StgHeader::Store( StgIo& rIo ) { if( !bDirty ) - return TRUE; + return sal_True; SvStream& r = *rIo.GetStrm(); r.Seek( 0L ); r.Write( cSignature, 8 + 16 ); @@ -141,7 +141,7 @@ BOOL StgHeader::Store( StgIo& rIo ) << nByteOrder // 1C Unicode byte order indicator << nPageSize // 1E 1 << nPageSize = block size << nDataPageSize // 20 1 << this size == data block size - << (INT32) 0 << (INT32) 0 << (INT16) 0 + << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int16) 0 << nFATSize // 2C total number of FAT pages << nTOCstrm // 30 starting page for the TOC stream << nReserved // 34 @@ -153,7 +153,7 @@ BOOL StgHeader::Store( StgIo& rIo ) for( short i = 0; i < 109; i++ ) r << nMasterFAT[ i ]; bDirty = !rIo.Good(); - return BOOL( !bDirty ); + return sal_Bool( !bDirty ); } static bool lcl_wontoverflow(short shift) @@ -162,15 +162,15 @@ static bool lcl_wontoverflow(short shift) } // Perform thorough checks also on unknown variables -BOOL StgHeader::Check() +sal_Bool StgHeader::Check() { - return BOOL( memcmp( cSignature, cStgSignature, 8 ) == 0 + return sal_Bool( memcmp( cSignature, cStgSignature, 8 ) == 0 && (short) ( nVersion >> 16 ) == 3 ) && lcl_wontoverflow(nPageSize) && lcl_wontoverflow(nDataPageSize); } -INT32 StgHeader::GetFATPage( short n ) const +sal_Int32 StgHeader::GetFATPage( short n ) const { if( n >= 0 && n < 109 ) return nMasterFAT[ n ]; @@ -178,50 +178,50 @@ INT32 StgHeader::GetFATPage( short n ) const return STG_EOF; } -void StgHeader::SetFATPage( short n, INT32 nb ) +void StgHeader::SetFATPage( short n, sal_Int32 nb ) { if( n >= 0 && n < 109 ) { if( nMasterFAT[ n ] != nb ) - bDirty = TRUE, nMasterFAT[ n ] = nb; + bDirty = sal_True, nMasterFAT[ n ] = nb; } } void StgHeader::SetClassId( const ClsId& r ) { if( memcmp( &aClsId, &r, sizeof( ClsId ) ) ) - bDirty = TRUE, memcpy( &aClsId, &r, sizeof( ClsId ) ); + bDirty = sal_True, memcpy( &aClsId, &r, sizeof( ClsId ) ); } -void StgHeader::SetTOCStart( INT32 n ) +void StgHeader::SetTOCStart( sal_Int32 n ) { - if( n != nTOCstrm ) bDirty = TRUE, nTOCstrm = n; + if( n != nTOCstrm ) bDirty = sal_True, nTOCstrm = n; } -void StgHeader::SetDataFATStart( INT32 n ) +void StgHeader::SetDataFATStart( sal_Int32 n ) { - if( n != nDataFAT ) bDirty = TRUE, nDataFAT = n; + if( n != nDataFAT ) bDirty = sal_True, nDataFAT = n; } -void StgHeader::SetDataFATSize( INT32 n ) +void StgHeader::SetDataFATSize( sal_Int32 n ) { - if( n != nDataFATSize ) bDirty = TRUE, nDataFATSize = n; + if( n != nDataFATSize ) bDirty = sal_True, nDataFATSize = n; } -void StgHeader::SetFATSize( INT32 n ) +void StgHeader::SetFATSize( sal_Int32 n ) { - if( n != nFATSize ) bDirty = TRUE, nFATSize = n; + if( n != nFATSize ) bDirty = sal_True, nFATSize = n; } -void StgHeader::SetFATChain( INT32 n ) +void StgHeader::SetFATChain( sal_Int32 n ) { if( n != nMasterChain ) - bDirty = TRUE, nMasterChain = n; + bDirty = sal_True, nMasterChain = n; } -void StgHeader::SetMasters( INT32 n ) +void StgHeader::SetMasters( sal_Int32 n ) { - if( n != nMaster ) bDirty = TRUE, nMaster = n; + if( n != nMaster ) bDirty = sal_True, nMaster = n; } ///////////////////////////// class StgEntry ///////////////////////////// @@ -238,11 +238,11 @@ void ToUnicode_Impl( String& rName ) rName.Erase( 32 ); rName.Convert( ::GetSystemCharSet(), CHARSET_ANSI ); // brute force is OK - BYTE* p = (BYTE*) rName.GetCharStr(); - for( USHORT i = 0; i < rName.Len(); i++, p++ ) + sal_uInt8* p = (sal_uInt8*) rName.GetCharStr(); + for( sal_uInt16 i = 0; i < rName.Len(); i++, p++ ) { // check each character and substitute blanks for illegal ones - BYTE cChar = *p; + sal_uInt8 cChar = *p; if( cChar == '!' || cChar == ':' || cChar == '\\' || cChar == '/' ) *p = ' '; } @@ -254,14 +254,14 @@ static void FromUnicode( String& rName ) rName.Convert( CHARSET_ANSI, ::GetSystemCharSet() ); } */ -BOOL StgEntry::Init() +sal_Bool StgEntry::Init() { memset( this, 0, sizeof (StgEntry) - sizeof( String ) ); SetLeaf( STG_LEFT, STG_FREE ); SetLeaf( STG_RIGHT, STG_FREE ); SetLeaf( STG_CHILD, STG_FREE ); SetLeaf( STG_DATA, STG_EOF ); - return TRUE; + return sal_True; } static String ToUpperUnicode( const String & rStr ) @@ -279,7 +279,7 @@ static String ToUpperUnicode( const String & rStr ) } -BOOL StgEntry::SetName( const String& rName ) +sal_Bool StgEntry::SetName( const String& rName ) { // I don't know the locale, so en_US is hopefully fine aName = ToUpperUnicode( rName ); @@ -291,12 +291,12 @@ BOOL StgEntry::SetName( const String& rName ) while( i < 32 ) nName[ i++ ] = 0; nNameLen = ( aName.Len() + 1 ) << 1; - return TRUE; + return sal_True; } -INT32 StgEntry::GetLeaf( StgEntryRef eRef ) const +sal_Int32 StgEntry::GetLeaf( StgEntryRef eRef ) const { - INT32 n = -1; + sal_Int32 n = -1; switch( eRef ) { case STG_LEFT: n = nLeft; break; @@ -307,7 +307,7 @@ INT32 StgEntry::GetLeaf( StgEntryRef eRef ) const return n; } -void StgEntry::SetLeaf( StgEntryRef eRef, INT32 nPage ) +void StgEntry::SetLeaf( StgEntryRef eRef, sal_Int32 nPage ) { switch( eRef ) { @@ -318,12 +318,12 @@ void StgEntry::SetLeaf( StgEntryRef eRef, INT32 nPage ) } } -const INT32* StgEntry::GetTime( StgEntryTime eTime ) const +const sal_Int32* StgEntry::GetTime( StgEntryTime eTime ) const { return( eTime == STG_MODIFIED ) ? nMtime : nAtime; } -void StgEntry::SetTime( StgEntryTime eTime, INT32* pTime ) +void StgEntry::SetTime( StgEntryTime eTime, sal_Int32* pTime ) { if( eTime == STG_MODIFIED ) nMtime[ 0 ] = *pTime++, nMtime[ 1 ] = *pTime; @@ -338,7 +338,7 @@ void StgEntry::SetClassId( const ClsId& r ) void StgEntry::GetName( String& rName ) const { - UINT16 n = nNameLen; + sal_uInt16 n = nNameLen; if( n ) n = ( n >> 1 ) - 1; rName = String( nName, n ); @@ -363,7 +363,7 @@ short StgEntry::Compare( const StgEntry& r ) const // These load/store operations are a bit more complicated, // since they have to copy their contents into a packed structure. -BOOL StgEntry::Load( const void* pFrom ) +sal_Bool StgEntry::Load( const void* pFrom ) { SvMemoryStream r( (sal_Char*) pFrom, 128, STREAM_READ ); for( short i = 0; i < 32; i++ ) @@ -384,14 +384,14 @@ BOOL StgEntry::Load( const void* pFrom ) >> nSize // 78 file size >> nUnknown; // 7C unknown - UINT16 n = nNameLen; + sal_uInt16 n = nNameLen; if( n ) n = ( n >> 1 ) - 1; if( n > 31 || (nSize < 0 && cType != STG_STORAGE) ) { // the size makes no sence for the substorage // TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb - return FALSE; + return sal_False; } aName = String( nName, n ); @@ -399,7 +399,7 @@ BOOL StgEntry::Load( const void* pFrom ) aName = ToUpperUnicode( aName ); aName.Erase( 31 ); - return TRUE; + return sal_True; } void StgEntry::Store( void* pTo ) diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx index 314852e3dd06..7ef8c4772f36 100644 --- a/sot/source/sdstor/stgelem.hxx +++ b/sot/source/sdstor/stgelem.hxx @@ -34,7 +34,7 @@ #include <tools/solar.h> -#include <stg.hxx> +#include <sot/stg.hxx> class StgIo; class SvStream; @@ -45,51 +45,51 @@ SvStream& operator<<( SvStream&, const ClsId& ); class StgHeader { - BYTE cSignature[ 8 ]; // 00 signature (see below) + sal_uInt8 cSignature[ 8 ]; // 00 signature (see below) ClsId aClsId; // 08 Class ID - INT32 nVersion; // 18 version number - UINT16 nByteOrder; // 1C Unicode byte order indicator - INT16 nPageSize; // 1E 1 << nPageSize = block size - INT16 nDataPageSize; // 20 1 << this size == data block size - BYTE bDirty; // 22 internal dirty flag - BYTE cReserved[ 9 ]; // 23 - INT32 nFATSize; // 2C total number of FAT pages - INT32 nTOCstrm; // 30 starting page for the TOC stream - INT32 nReserved; // 34 - INT32 nThreshold; // 38 minimum file size for big data - INT32 nDataFAT; // 3C page # of 1st data FAT block - INT32 nDataFATSize; // 40 # of data fat blocks - INT32 nMasterChain; // 44 chain to the next master block - INT32 nMaster; // 48 # of additional master blocks - INT32 nMasterFAT[ 109 ]; // 4C first 109 master FAT pages + sal_Int32 nVersion; // 18 version number + sal_uInt16 nByteOrder; // 1C Unicode byte order indicator + sal_Int16 nPageSize; // 1E 1 << nPageSize = block size + sal_Int16 nDataPageSize; // 20 1 << this size == data block size + sal_uInt8 bDirty; // 22 internal dirty flag + sal_uInt8 cReserved[ 9 ]; // 23 + sal_Int32 nFATSize; // 2C total number of FAT pages + sal_Int32 nTOCstrm; // 30 starting page for the TOC stream + sal_Int32 nReserved; // 34 + sal_Int32 nThreshold; // 38 minimum file size for big data + sal_Int32 nDataFAT; // 3C page # of 1st data FAT block + sal_Int32 nDataFATSize; // 40 # of data fat blocks + sal_Int32 nMasterChain; // 44 chain to the next master block + sal_Int32 nMaster; // 48 # of additional master blocks + sal_Int32 nMasterFAT[ 109 ]; // 4C first 109 master FAT pages public: StgHeader(); void Init(); // initialize the header - BOOL Load( StgIo& ); - BOOL Load( SvStream& ); - BOOL Store( StgIo& ); - BOOL Check(); // check the signature and version + sal_Bool Load( StgIo& ); + sal_Bool Load( SvStream& ); + sal_Bool Store( StgIo& ); + sal_Bool Check(); // check the signature and version short GetByteOrder() const { return nByteOrder; } - INT32 GetTOCStart() const { return nTOCstrm; } - void SetTOCStart( INT32 n ); - INT32 GetDataFATStart() const { return nDataFAT; } - void SetDataFATStart( INT32 n ); - INT32 GetDataFATSize() const { return nDataFATSize; } - void SetDataFATSize( INT32 n ); - INT32 GetThreshold() const { return nThreshold; } + sal_Int32 GetTOCStart() const { return nTOCstrm; } + void SetTOCStart( sal_Int32 n ); + sal_Int32 GetDataFATStart() const { return nDataFAT; } + void SetDataFATStart( sal_Int32 n ); + sal_Int32 GetDataFATSize() const { return nDataFATSize; } + void SetDataFATSize( sal_Int32 n ); + sal_Int32 GetThreshold() const { return nThreshold; } short GetPageSize() const { return nPageSize; } short GetDataPageSize() const { return nDataPageSize; } - INT32 GetFATSize() const { return nFATSize; } - void SetFATSize( INT32 n ); - INT32 GetFATChain() const { return nMasterChain; } - void SetFATChain( INT32 n ); - INT32 GetMasters() const { return nMaster; } - void SetMasters( INT32 n ); + sal_Int32 GetFATSize() const { return nFATSize; } + void SetFATSize( sal_Int32 n ); + sal_Int32 GetFATChain() const { return nMasterChain; } + void SetFATChain( sal_Int32 n ); + sal_Int32 GetMasters() const { return nMaster; } + void SetMasters( sal_Int32 n ); short GetFAT1Size() const { return 109; } const ClsId& GetClassId() const { return aClsId; } void SetClassId( const ClsId& ); - INT32 GetFATPage( short ) const; - void SetFATPage( short, INT32 ); + sal_Int32 GetFATPage( short ) const; + void SetFATPage( short, sal_Int32 ); }; enum StgEntryType { // dir entry types: @@ -118,42 +118,42 @@ class StgStream; #define STGENTRY_SIZE 128 class StgEntry { // directory enty - UINT16 nName[ 32 ]; // 00 name as WCHAR - INT16 nNameLen; // 40 size of name in bytes including 00H - BYTE cType; // 42 entry type - BYTE cFlags; // 43 0 or 1 (tree balance?) - INT32 nLeft; // 44 left node entry - INT32 nRight; // 48 right node entry - INT32 nChild; // 4C 1st child entry if storage + sal_uInt16 nName[ 32 ]; // 00 name as WCHAR + sal_Int16 nNameLen; // 40 size of name in bytes including 00H + sal_uInt8 cType; // 42 entry type + sal_uInt8 cFlags; // 43 0 or 1 (tree balance?) + sal_Int32 nLeft; // 44 left node entry + sal_Int32 nRight; // 48 right node entry + sal_Int32 nChild; // 4C 1st child entry if storage ClsId aClsId; // 50 class ID (optional) - INT32 nFlags; // 60 state flags(?) - INT32 nMtime[ 2 ]; // 64 modification time - INT32 nAtime[ 2 ]; // 6C creation and access time - INT32 nPage1; // 74 starting block (either direct or translated) - INT32 nSize; // 78 file size - INT32 nUnknown; // 7C unknown + sal_Int32 nFlags; // 60 state flags(?) + sal_Int32 nMtime[ 2 ]; // 64 modification time + sal_Int32 nAtime[ 2 ]; // 6C creation and access time + sal_Int32 nPage1; // 74 starting block (either direct or translated) + sal_Int32 nSize; // 78 file size + sal_Int32 nUnknown; // 7C unknown String aName; // Name as Compare String (ascii, upper) public: - BOOL Init(); // initialize the data - BOOL SetName( const String& ); // store a name (ASCII, up to 32 chars) + sal_Bool Init(); // initialize the data + sal_Bool SetName( const String& ); // store a name (ASCII, up to 32 chars) void GetName( String& rName ) const; // fill in the name short Compare( const StgEntry& ) const; // compare two entries - BOOL Load( const void* ); + sal_Bool Load( const void* ); void Store( void* ); StgEntryType GetType() const { return (StgEntryType) cType; } - INT32 GetStartPage() const { return nPage1; } - void SetType( StgEntryType t ) { cType = (BYTE) t; } - BYTE GetFlags() const { return cFlags; } - void SetFlags( BYTE c ) { cFlags = c; } - INT32 GetSize() const { return nSize; } - void SetSize( INT32 n ) { nSize = n; } + sal_Int32 GetStartPage() const { return nPage1; } + void SetType( StgEntryType t ) { cType = (sal_uInt8) t; } + sal_uInt8 GetFlags() const { return cFlags; } + void SetFlags( sal_uInt8 c ) { cFlags = c; } + sal_Int32 GetSize() const { return nSize; } + void SetSize( sal_Int32 n ) { nSize = n; } const ClsId& GetClassId() const { return aClsId; } void SetClassId( const ClsId& ); - INT32 GetLeaf( StgEntryRef ) const; - void SetLeaf( StgEntryRef, INT32 ); - const INT32* GetTime( StgEntryTime ) const; - void SetTime( StgEntryTime, INT32* ); + sal_Int32 GetLeaf( StgEntryRef ) const; + void SetLeaf( StgEntryRef, sal_Int32 ); + const sal_Int32* GetTime( StgEntryTime ) const; + void SetTime( StgEntryTime, sal_Int32* ); }; diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 6b5972e4ef98..654f456c5e10 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sot.hxx" -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" @@ -47,7 +47,7 @@ StgIo::StgIo() : StgCache() pDataFAT = NULL; pDataStrm = NULL; pFAT = NULL; - bCopied = FALSE; + bCopied = sal_False; } StgIo::~StgIo() @@ -60,7 +60,7 @@ StgIo::~StgIo() // Load the header. Do not set an error code if the header is invalid. -BOOL StgIo::Load() +sal_Bool StgIo::Load() { if( pStrm ) { @@ -69,7 +69,7 @@ BOOL StgIo::Load() if( aHdr.Check() ) SetupStreams(); else - return FALSE; + return sal_False; } } return Good(); @@ -77,7 +77,7 @@ BOOL StgIo::Load() // Set up an initial, empty storage -BOOL StgIo::Init() +sal_Bool StgIo::Init() { aHdr.Init(); SetupStreams(); @@ -123,7 +123,7 @@ short StgIo::GetDataPageSize() // Commit everything -BOOL StgIo::CommitAll() +sal_Bool StgIo::CommitAll() { // Store the data (all streams and the TOC) if( pTOC->Store() ) @@ -136,81 +136,81 @@ BOOL StgIo::CommitAll() if( aHdr.Store( *this ) ) { pStrm->Flush(); - ULONG n = pStrm->GetError(); + sal_uLong n = pStrm->GetError(); SetError( n ); #ifdef DBG_UTIL if( n==0 ) ValidateFATs(); #endif - return BOOL( n == 0 ); + return sal_Bool( n == 0 ); } } } SetError( SVSTREAM_WRITE_ERROR ); - return FALSE; + return sal_False; } class EasyFat { - INT32 *pFat; - BOOL *pFree; - INT32 nPages; - INT32 nPageSize; + sal_Int32 *pFat; + sal_Bool *pFree; + sal_Int32 nPages; + sal_Int32 nPageSize; public: - EasyFat( StgIo & rIo, StgStrm *pFatStream, INT32 nPSize ); + EasyFat( StgIo & rIo, StgStrm *pFatStream, sal_Int32 nPSize ); ~EasyFat() { delete[] pFat; delete[] pFree; } - INT32 GetPageSize() { return nPageSize; } - INT32 Count() { return nPages; } - INT32 operator[]( INT32 nOffset ) { return pFat[ nOffset ]; } + sal_Int32 GetPageSize() { return nPageSize; } + sal_Int32 Count() { return nPages; } + sal_Int32 operator[]( sal_Int32 nOffset ) { return pFat[ nOffset ]; } - ULONG Mark( INT32 nPage, INT32 nCount, INT32 nExpect ); - BOOL HasUnrefChains(); + sal_uLong Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ); + sal_Bool HasUnrefChains(); }; -EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, INT32 nPSize ) +EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, sal_Int32 nPSize ) { nPages = pFatStream->GetSize() >> 2; nPageSize = nPSize; - pFat = new INT32[ nPages ]; - pFree = new BOOL[ nPages ]; + pFat = new sal_Int32[ nPages ]; + pFree = new sal_Bool[ nPages ]; StgPage *pPage = NULL; - INT32 nFatPageSize = (1 << rIo.aHdr.GetPageSize()) - 2; + sal_Int32 nFatPageSize = (1 << rIo.aHdr.GetPageSize()) - 2; - for( INT32 nPage = 0; nPage < nPages; nPage++ ) + for( sal_Int32 nPage = 0; nPage < nPages; nPage++ ) { if( ! (nPage % nFatPageSize) ) { pFatStream->Pos2Page( nPage << 2 ); - INT32 nPhysPage = pFatStream->GetPage(); - pPage = rIo.Get( nPhysPage, TRUE ); + sal_Int32 nPhysPage = pFatStream->GetPage(); + pPage = rIo.Get( nPhysPage, sal_True ); } pFat[ nPage ] = pPage->GetPage( short( nPage % nFatPageSize ) ); - pFree[ nPage ] = TRUE; + pFree[ nPage ] = sal_True; } } -BOOL EasyFat::HasUnrefChains() +sal_Bool EasyFat::HasUnrefChains() { - for( INT32 nPage = 0; nPage < nPages; nPage++ ) + for( sal_Int32 nPage = 0; nPage < nPages; nPage++ ) { if( pFree[ nPage ] && pFat[ nPage ] != -1 ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -ULONG EasyFat::Mark( INT32 nPage, INT32 nCount, INT32 nExpect ) +sal_uLong EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ) { if( nCount > 0 ) --nCount /= GetPageSize(), nCount++; - INT32 nCurPage = nPage; + sal_Int32 nCurPage = nPage; while( nCount != 0 ) { - pFree[ nCurPage ] = FALSE; + pFree[ nCurPage ] = sal_False; nCurPage = pFat[ nCurPage ]; //Stream zu lang if( nCurPage != nExpect && nCount == 1 ) @@ -232,22 +232,22 @@ ULONG EasyFat::Mark( INT32 nPage, INT32 nCount, INT32 nExpect ) class Validator { - ULONG nError; + sal_uLong nError; EasyFat aSmallFat; EasyFat aFat; StgIo &rIo; - ULONG ValidateMasterFATs(); - ULONG ValidateDirectoryEntries(); - ULONG FindUnrefedChains(); - ULONG MarkAll( StgDirEntry *pEntry ); + sal_uLong ValidateMasterFATs(); + sal_uLong ValidateDirectoryEntries(); + sal_uLong FindUnrefedChains(); + sal_uLong MarkAll( StgDirEntry *pEntry ); public: Validator( StgIo &rIo ); - BOOL IsError() { return nError != 0; } + sal_Bool IsError() { return nError != 0; } }; Validator::Validator( StgIo &rIoP ) @@ -255,7 +255,7 @@ Validator::Validator( StgIo &rIoP ) aFat( rIoP, rIoP.pFAT, 1 << rIoP.aHdr.GetPageSize() ), rIo( rIoP ) { - ULONG nErr = nError = FAT_OK; + sal_uLong nErr = nError = FAT_OK; if( ( nErr = ValidateMasterFATs() ) != FAT_OK ) nError = nErr; @@ -265,13 +265,13 @@ Validator::Validator( StgIo &rIoP ) nError = nErr; } -ULONG Validator::ValidateMasterFATs() +sal_uLong Validator::ValidateMasterFATs() { - INT32 nCount = rIo.aHdr.GetFATSize(); - ULONG nErr; - for( INT32 i = 0; i < nCount; i++ ) + sal_Int32 nCount = rIo.aHdr.GetFATSize(); + sal_uLong nErr; + for( sal_Int32 i = 0; i < nCount; i++ ) { - if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), FALSE ), aFat.GetPageSize(), -3 )) != FAT_OK ) + if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), sal_False ), aFat.GetPageSize(), -3 )) != FAT_OK ) return nErr; } if( rIo.aHdr.GetMasters() ) @@ -280,10 +280,10 @@ ULONG Validator::ValidateMasterFATs() return FAT_OK; } -ULONG Validator::MarkAll( StgDirEntry *pEntry ) +sal_uLong Validator::MarkAll( StgDirEntry *pEntry ) { StgIterator aIter( *pEntry ); - ULONG nErr = FAT_OK; + sal_uLong nErr = FAT_OK; for( StgDirEntry* p = aIter.First(); p ; p = aIter.Next() ) { if( p->aEntry.GetType() == STG_STORAGE ) @@ -294,7 +294,7 @@ ULONG Validator::MarkAll( StgDirEntry *pEntry ) } else { - INT32 nSize = p->aEntry.GetSize(); + sal_Int32 nSize = p->aEntry.GetSize(); if( nSize < rIo.aHdr.GetThreshold() ) nErr = aSmallFat.Mark( p->aEntry.GetStartPage(),nSize, -2 ); else @@ -306,10 +306,10 @@ ULONG Validator::MarkAll( StgDirEntry *pEntry ) return FAT_OK; } -ULONG Validator::ValidateDirectoryEntries() +sal_uLong Validator::ValidateDirectoryEntries() { // Normale DirEntries - ULONG nErr = MarkAll( rIo.pTOC->GetRoot() ); + sal_uLong nErr = MarkAll( rIo.pTOC->GetRoot() ); if( nErr != FAT_OK ) return nErr; // Small Data @@ -329,7 +329,7 @@ ULONG Validator::ValidateDirectoryEntries() return nErr; } -ULONG Validator::FindUnrefedChains() +sal_uLong Validator::FindUnrefedChains() { if( aSmallFat.HasUnrefChains() || aFat.HasUnrefChains() ) @@ -350,12 +350,12 @@ const Link& StgIo::GetErrorLink() return ErrorLink::get(); } -ULONG StgIo::ValidateFATs() +sal_uLong StgIo::ValidateFATs() { if( bFile ) { Validator *pV = new Validator( *this ); - BOOL bRet1 = !pV->IsError(), bRet2 = TRUE ; + sal_Bool bRet1 = !pV->IsError(), bRet2 = sal_True ; delete pV; SvFileStream *pFileStrm = ( SvFileStream *) GetStrm(); StgIo aIo; @@ -368,7 +368,7 @@ ULONG StgIo::ValidateFATs() delete pV; } - ULONG nErr; + sal_uLong nErr; if( bRet1 != bRet2 ) nErr = bRet1 ? FAT_ONFILEERROR : FAT_INMEMORYERROR; else nErr = bRet1 ? FAT_OK : FAT_BOTHERROR; @@ -378,7 +378,7 @@ ULONG StgIo::ValidateFATs() aArg.aFile = pFileStrm->GetFileName(); aArg.nErr = nErr; ErrorLink::get().Call( &aArg ); - bCopied = TRUE; + bCopied = sal_True; } // DBG_ASSERT( nErr == FAT_OK ,"Storage kaputt"); return nErr; diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx index d307eb6454af..91c32c7f0e1b 100644 --- a/sot/source/sdstor/stgio.hxx +++ b/sot/source/sdstor/stgio.hxx @@ -54,12 +54,12 @@ enum FAT_ERROR struct StgLinkArg { String aFile; - ULONG nErr; + sal_uLong nErr; }; class StgIo : public StgCache { void SetupStreams(); // load all internal streams - BOOL bCopied; + sal_Bool bCopied; public: StgIo(); ~StgIo(); @@ -69,13 +69,13 @@ public: StgDataStrm* pDataFAT; // small data FAT stream StgDataStrm* pDataStrm; // small data stream short GetDataPageSize(); // get the logical data page size - BOOL Load(); // load a storage file - BOOL Init(); // set up an empty file - BOOL CommitAll(); // commit everything (root commit) + sal_Bool Load(); // load a storage file + sal_Bool Init(); // set up an empty file + sal_Bool CommitAll(); // commit everything (root commit) static void SetErrorLink( const Link& ); static const Link& GetErrorLink(); - ULONG ValidateFATs( ); + sal_uLong ValidateFATs( ); }; #endif diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index c6604376f1fd..8ae6af18f7b7 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -32,7 +32,7 @@ #include "rtl/string.h" #include "rtl/string.h" #include "stgole.hxx" -#include "storinfo.hxx" // Read/WriteClipboardFormat() +#include "sot/storinfo.hxx" // Read/WriteClipboardFormat() #include <tools/debug.hxx> #if defined(_MSC_VER) && (_MSC_VER>=1400) @@ -41,10 +41,10 @@ ///////////////////////// class StgInternalStream //////////////////////// StgInternalStream::StgInternalStream - ( BaseStorage& rStg, const String& rName, BOOL bWr ) + ( BaseStorage& rStg, const String& rName, sal_Bool bWr ) { - bIsWritable = TRUE; - USHORT nMode = bWr + bIsWritable = sal_True; + sal_uInt16 nMode = bWr ? STREAM_WRITE | STREAM_SHARE_DENYALL : STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE; pStrm = rStg.OpenStream( rName, nMode ); @@ -59,7 +59,7 @@ StgInternalStream::~StgInternalStream() delete pStrm; } -ULONG StgInternalStream::GetData( void* pData, ULONG nSize ) +sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize ) { if( pStrm ) { @@ -71,7 +71,7 @@ ULONG StgInternalStream::GetData( void* pData, ULONG nSize ) return 0; } -ULONG StgInternalStream::PutData( const void* pData, ULONG nSize ) +sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize ) { if( pStrm ) { @@ -83,7 +83,7 @@ ULONG StgInternalStream::PutData( const void* pData, ULONG nSize ) return 0; } -ULONG StgInternalStream::SeekPos( ULONG nPos ) +sal_uLong StgInternalStream::SeekPos( sal_uLong nPos ) { return pStrm ? pStrm->Seek( nPos ) : 0; } @@ -105,32 +105,32 @@ void StgInternalStream::Commit() ///////////////////////// class StgCompObjStream ///////////////////////// -StgCompObjStream::StgCompObjStream( BaseStorage& rStg, BOOL bWr ) +StgCompObjStream::StgCompObjStream( BaseStorage& rStg, sal_Bool bWr ) : StgInternalStream( rStg, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1CompObj" ) ), bWr ) { memset( &aClsId, 0, sizeof( ClsId ) ); nCbFormat = 0; } -BOOL StgCompObjStream::Load() +sal_Bool StgCompObjStream::Load() { memset( &aClsId, 0, sizeof( ClsId ) ); nCbFormat = 0; aUserName.Erase(); if( GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; Seek( 8L ); // skip the first part - INT32 nMarker = 0; + sal_Int32 nMarker = 0; *this >> nMarker; if( nMarker == -1L ) { *this >> aClsId; - INT32 nLen1 = 0; + sal_Int32 nLen1 = 0; *this >> nLen1; // higher bits are ignored nLen1 &= 0xFFFF; - sal_Char* p = new sal_Char[ (USHORT) nLen1 ]; - if( Read( p, nLen1 ) == (ULONG) nLen1 ) + sal_Char* p = new sal_Char[ (sal_uInt16) nLen1 ]; + if( Read( p, nLen1 ) == (sal_uLong) nLen1 ) { //The encoding here is "ANSI", which is pretty useless seeing as //the actual codepage used doesn't seem to be specified/stored @@ -145,60 +145,60 @@ BOOL StgCompObjStream::Load() SetError( SVSTREAM_GENERALERROR ); delete [] p; } - return BOOL( GetError() == SVSTREAM_OK ); + return sal_Bool( GetError() == SVSTREAM_OK ); } -BOOL StgCompObjStream::Store() +sal_Bool StgCompObjStream::Store() { if( GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; Seek( 0L ); ByteString aAsciiUserName( aUserName, RTL_TEXTENCODING_MS_1252 ); - *this << (INT16) 1 // Version? - << (INT16) -2 // 0xFFFE = Byte Order Indicator - << (INT32) 0x0A03 // Windows 3.10 - << (INT32) -1L + *this << (sal_Int16) 1 // Version? + << (sal_Int16) -2 // 0xFFFE = Byte Order Indicator + << (sal_Int32) 0x0A03 // Windows 3.10 + << (sal_Int32) -1L << aClsId // Class ID - << (INT32) (aAsciiUserName.Len() + 1) + << (sal_Int32) (aAsciiUserName.Len() + 1) << (const char *)aAsciiUserName.GetBuffer() - << (UINT8) 0; // string terminator + << (sal_uInt8) 0; // string terminator WriteClipboardFormat( *this, nCbFormat ); - *this << (INT32) 0; // terminator + *this << (sal_Int32) 0; // terminator Commit(); - return BOOL( GetError() == SVSTREAM_OK ); + return sal_Bool( GetError() == SVSTREAM_OK ); } /////////////////////////// class StgOleStream /////////////////////////// -StgOleStream::StgOleStream( BaseStorage& rStg, BOOL bWr ) +StgOleStream::StgOleStream( BaseStorage& rStg, sal_Bool bWr ) : StgInternalStream( rStg, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole" ) ), bWr ) { nFlags = 0; } -BOOL StgOleStream::Load() +sal_Bool StgOleStream::Load() { nFlags = 0; if( GetError() != SVSTREAM_OK ) - return FALSE; - INT32 version = 0; + return sal_False; + sal_Int32 version = 0; Seek( 0L ); *this >> version >> nFlags; - return BOOL( GetError() == SVSTREAM_OK ); + return sal_Bool( GetError() == SVSTREAM_OK ); } -BOOL StgOleStream::Store() +sal_Bool StgOleStream::Store() { if( GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; Seek( 0L ); - *this << (INT32) 0x02000001 // OLE version, format - << (INT32) nFlags // Object flags - << (INT32) 0 // Update Options - << (INT32) 0 // reserved - << (INT32) 0; // Moniker 1 + *this << (sal_Int32) 0x02000001 // OLE version, format + << (sal_Int32) nFlags // Object flags + << (sal_Int32) 0 // Update Options + << (sal_Int32) 0 // reserved + << (sal_Int32) 0; // Moniker 1 Commit(); - return BOOL( GetError() == SVSTREAM_OK ); + return sal_Bool( GetError() == SVSTREAM_OK ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 7883ac7fa1c9..bf936b6ad734 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -31,18 +31,18 @@ #include <string.h> // memset() -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" class StgInternalStream : public SvStream { BaseStorageStream* pStrm; - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); + virtual sal_uLong GetData( void* pData, sal_uLong nSize ); + virtual sal_uLong PutData( const void* pData, sal_uLong nSize ); + virtual sal_uLong SeekPos( sal_uLong nPos ); virtual void FlushData(); public: - StgInternalStream( BaseStorage&, const String&, BOOL ); + StgInternalStream( BaseStorage&, const String&, sal_Bool ); ~StgInternalStream(); void Commit(); }; @@ -53,14 +53,14 @@ class StgCompObjStream : public StgInternalStream { ClsId aClsId; String aUserName; - ULONG nCbFormat; + sal_uLong nCbFormat; public: - StgCompObjStream( BaseStorage&, BOOL ); + StgCompObjStream( BaseStorage&, sal_Bool ); ClsId& GetClsId() { return aClsId; } String& GetUserName() { return aUserName; } - ULONG& GetCbFormat() { return nCbFormat; } - BOOL Load(); - BOOL Store(); + sal_uLong& GetCbFormat() { return nCbFormat; } + sal_Bool Load(); + sal_Bool Store(); }; // standard stream "\1Ole" @@ -69,10 +69,10 @@ class StgOleStream : public StgInternalStream { sal_uInt32 nFlags; public: - StgOleStream( BaseStorage&, BOOL ); + StgOleStream( BaseStorage&, sal_Bool ); sal_uInt32& GetFlags() { return nFlags; } - BOOL Load(); - BOOL Store(); + sal_Bool Load(); + sal_Bool Store(); }; #endif diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index a9275e307fc6..fe40be155b9e 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -35,28 +35,22 @@ #include <tools/tempfile.hxx> #include <tools/debug.hxx> -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" #include "stgdir.hxx" #include "stgio.hxx" -#if defined(W31) - #include <tools/svwin.h> - #define memcpy hmemcpy - #define __HUGE _huge -#else - #define __HUGE -#endif +#define __HUGE ///////////////////////////// class StgFAT /////////////////////////////// // The FAT class performs FAT operations on an underlying storage stream. -// This stream is either the master FAT stream (m == TRUE ) or a normal +// This stream is either the master FAT stream (m == sal_True ) or a normal // storage stream, which then holds the FAT for small data allocations. -StgFAT::StgFAT( StgStrm& r, BOOL m ) : rStrm( r ) +StgFAT::StgFAT( StgStrm& r, sal_Bool m ) : rStrm( r ) { bPhys = m; nPageSize = rStrm.GetIo().GetPhysPageSize(); @@ -68,7 +62,7 @@ StgFAT::StgFAT( StgStrm& r, BOOL m ) : rStrm( r ) // Retrieve the physical page for a given byte offset. -StgPage* StgFAT::GetPhysPage( INT32 nByteOff ) +StgPage* StgFAT::GetPhysPage( sal_Int32 nByteOff ) { StgPage* pPg = NULL; // Position within the underlying stream @@ -76,16 +70,16 @@ StgPage* StgFAT::GetPhysPage( INT32 nByteOff ) if( rStrm.Pos2Page( nByteOff ) ) { nOffset = rStrm.GetOffset(); - INT32 nPhysPage = rStrm.GetPage(); + sal_Int32 nPhysPage = rStrm.GetPage(); // get the physical page (must be present) - pPg = rStrm.GetIo().Get( nPhysPage, TRUE ); + pPg = rStrm.GetIo().Get( nPhysPage, sal_True ); } return pPg; } // Get the follow page for a certain FAT page. -INT32 StgFAT::GetNextPage( INT32 nPg ) +sal_Int32 StgFAT::GetNextPage( sal_Int32 nPg ) { if( nPg >= 0 ) { @@ -101,16 +95,16 @@ INT32 StgFAT::GetNextPage( INT32 nPg ) // underlying stream size. It is treated as a recommendation // to abort the search to inhibit excessive file growth. -INT32 StgFAT::FindBlock( INT32& nPgs ) +sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs ) { - INT32 nMinStart = STG_EOF, nMinLen = 0; - INT32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL; - INT32 nTmpStart = STG_EOF, nTmpLen = 0; - INT32 nPages = rStrm.GetSize() >> 2; - BOOL bFound = FALSE; + sal_Int32 nMinStart = STG_EOF, nMinLen = 0; + sal_Int32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL; + sal_Int32 nTmpStart = STG_EOF, nTmpLen = 0; + sal_Int32 nPages = rStrm.GetSize() >> 2; + sal_Bool bFound = sal_False; StgPage* pPg = NULL; short nEntry = 0; - for( INT32 i = 0; i < nPages; i++, nEntry++ ) + for( sal_Int32 i = 0; i < nPages; i++, nEntry++ ) { if( !( nEntry % nEntries ) ) { @@ -120,7 +114,7 @@ INT32 StgFAT::FindBlock( INT32& nPgs ) if( !pPg ) return STG_EOF; } - INT32 nCur = pPg->GetPage( nEntry ); + sal_Int32 nCur = pPg->GetPage( nEntry ); if( nCur == STG_FREE ) { // count the size of this area @@ -138,12 +132,12 @@ INT32 StgFAT::FindBlock( INT32& nPgs ) { if( nTmpLen > nPgs && nTmpLen < nMaxLen ) // block > requested size - nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = TRUE; + nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = sal_True; else if( nTmpLen >= nMinLen ) { // block < requested size nMinLen = nTmpLen, nMinStart = nTmpStart; - bFound = TRUE; + bFound = sal_True; if( nTmpLen == nPgs ) break; } @@ -164,8 +158,8 @@ INT32 StgFAT::FindBlock( INT32& nPgs ) if( nMinStart != STG_EOF && nMaxStart != STG_EOF ) { // two areas found; return the best fit area - INT32 nMinDiff = nPgs - nMinLen; - INT32 nMaxDiff = nMaxLen - nPgs; + sal_Int32 nMinDiff = nPgs - nMinLen; + sal_Int32 nMaxDiff = nMaxLen - nPgs; if( nMinDiff > nMaxDiff ) nMinStart = STG_EOF; } @@ -181,19 +175,19 @@ INT32 StgFAT::FindBlock( INT32& nPgs ) // Set up the consecutive chain for a given block. -BOOL StgFAT::MakeChain( INT32 nStart, INT32 nPgs ) +sal_Bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs ) { - INT32 nPos = nStart << 2; + sal_Int32 nPos = nStart << 2; StgPage* pPg = GetPhysPage( nPos ); if( !pPg || !nPgs ) - return FALSE; + return sal_False; while( --nPgs ) { if( nOffset >= nPageSize ) { pPg = GetPhysPage( nPos ); if( !pPg ) - return FALSE; + return sal_False; } pPg->SetPage( nOffset >> 2, ++nStart ); nOffset += 4; @@ -203,22 +197,22 @@ BOOL StgFAT::MakeChain( INT32 nStart, INT32 nPgs ) { pPg = GetPhysPage( nPos ); if( !pPg ) - return FALSE; + return sal_False; } pPg->SetPage( nOffset >> 2, STG_EOF ); - return TRUE; + return sal_True; } // Allocate a block of data from the given page number on. // It the page number is != STG_EOF, chain the block. -INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs ) +sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs ) { - INT32 nOrig = nBgn; - INT32 nLast = nBgn; - INT32 nBegin = STG_EOF; - INT32 nAlloc; - INT32 nPages = rStrm.GetSize() >> 2; + sal_Int32 nOrig = nBgn; + sal_Int32 nLast = nBgn; + sal_Int32 nBegin = STG_EOF; + sal_Int32 nAlloc; + sal_Int32 nPages = rStrm.GetSize() >> 2; short nPasses = 0; // allow for two passes while( nPasses < 2 ) @@ -254,7 +248,7 @@ INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs ) if( !rStrm.SetSize( ( nPages + nPgs ) << 2 ) ) return STG_EOF; if( !bPhys && !InitNew( nPages ) ) - return FALSE; + return sal_False; nPages = rStrm.GetSize() >> 2; nPasses++; } @@ -274,9 +268,9 @@ INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs ) // It can be assumed that the stream size is always on // a page boundary -BOOL StgFAT::InitNew( INT32 nPage1 ) +sal_Bool StgFAT::InitNew( sal_Int32 nPage1 ) { - INT32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries; + sal_Int32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries; while( n-- ) { StgPage* pPg = NULL; @@ -286,29 +280,29 @@ BOOL StgFAT::InitNew( INT32 nPage1 ) // Initialize the page pPg = rStrm.GetIo().Copy( rStrm.GetPage(), STG_FREE ); if ( !pPg ) - return FALSE; + return sal_False; for( short i = 0; i < nEntries; i++ ) pPg->SetPage( i, STG_FREE ); nPage1++; } - return TRUE; + return sal_True; } // Release a chain -BOOL StgFAT::FreePages( INT32 nStart, BOOL bAll ) +sal_Bool StgFAT::FreePages( sal_Int32 nStart, sal_Bool bAll ) { while( nStart >= 0 ) { StgPage* pPg = GetPhysPage( nStart << 2 ); if( !pPg ) - return FALSE; + return sal_False; nStart = pPg->GetPage( nOffset >> 2 ); // The first released page is either set to EOF or FREE pPg->SetPage( nOffset >> 2, bAll ? STG_FREE : STG_EOF ); - bAll = TRUE; + bAll = sal_True; } - return TRUE; + return sal_True; } ///////////////////////////// class StgStrm //////////////////////////////// @@ -346,21 +340,21 @@ void StgStrm::SetEntry( StgDirEntry& r ) // If the position is behind the size, set the stream right // behind the EOF. -BOOL StgStrm::Pos2Page( INT32 nBytePos ) +sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) { - INT32 nRel, nBgn; + sal_Int32 nRel, nBgn; // Values < 0 seek to the end if( nBytePos < 0 || nBytePos >= nSize ) nBytePos = nSize; // Adjust the position back to offset 0 nPos -= nOffset; - INT32 nMask = ~( nPageSize - 1 ); - INT32 nOld = nPos & nMask; - INT32 nNew = nBytePos & nMask; + sal_Int32 nMask = ~( nPageSize - 1 ); + sal_Int32 nOld = nPos & nMask; + sal_Int32 nNew = nBytePos & nMask; nOffset = (short) ( nBytePos & ~nMask ); nPos = nBytePos; if( nOld == nNew ) - return TRUE; + return sal_True; if( nNew > nOld ) { // the new position is behind the current, so an incremental @@ -377,7 +371,7 @@ BOOL StgStrm::Pos2Page( INT32 nBytePos ) } // now, traverse the FAT chain. nRel /= nPageSize; - INT32 nLast = STG_EOF; + sal_Int32 nLast = STG_EOF; while( nRel && nBgn >= 0 ) { nLast = nBgn; @@ -395,12 +389,12 @@ BOOL StgStrm::Pos2Page( INT32 nBytePos ) nOffset = nPageSize; } nPage = nBgn; - return BOOL( nRel == 0 && nPage >= 0 ); + return sal_Bool( nRel == 0 && nPage >= 0 ); } // Retrieve the physical page for a given byte offset. -StgPage* StgStrm::GetPhysPage( INT32 nBytePos, BOOL bForce ) +StgPage* StgStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce ) { if( !Pos2Page( nBytePos ) ) return NULL; @@ -410,16 +404,16 @@ StgPage* StgStrm::GetPhysPage( INT32 nBytePos, BOOL bForce ) // Copy an entire stream. Both streams are allocated in the FAT. // The target stream is this stream. -BOOL StgStrm::Copy( INT32 nFrom, INT32 nBytes ) +sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes ) { - INT32 nTo = nStart; - INT32 nPgs = ( nBytes + nPageSize - 1 ) / nPageSize; + sal_Int32 nTo = nStart; + sal_Int32 nPgs = ( nBytes + nPageSize - 1 ) / nPageSize; while( nPgs-- ) { if( nTo < 0 ) { rIo.SetError( SVSTREAM_FILEFORMAT_ERROR ); - return FALSE; + return sal_False; } rIo.Copy( nTo, nFrom ); if( nFrom >= 0 ) @@ -428,34 +422,34 @@ BOOL StgStrm::Copy( INT32 nFrom, INT32 nBytes ) if( nFrom < 0 ) { rIo.SetError( SVSTREAM_FILEFORMAT_ERROR ); - return FALSE; + return sal_False; } } nTo = pFat->GetNextPage( nTo ); } - return TRUE; + return sal_True; } -BOOL StgStrm::SetSize( INT32 nBytes ) +sal_Bool StgStrm::SetSize( sal_Int32 nBytes ) { // round up to page size - INT32 nOld = ( ( nSize + nPageSize - 1 ) / nPageSize ) * nPageSize; - INT32 nNew = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize; + sal_Int32 nOld = ( ( nSize + nPageSize - 1 ) / nPageSize ) * nPageSize; + sal_Int32 nNew = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize; if( nNew > nOld ) { if( !Pos2Page( nSize ) ) - return FALSE; - INT32 nBgn = pFat->AllocPages( nPage, ( nNew - nOld ) / nPageSize ); + return sal_False; + sal_Int32 nBgn = pFat->AllocPages( nPage, ( nNew - nOld ) / nPageSize ); if( nBgn == STG_EOF ) - return FALSE; + return sal_False; if( nStart == STG_EOF ) nStart = nPage = nBgn; } else if( nNew < nOld ) { - BOOL bAll = BOOL( nBytes == 0 ); + sal_Bool bAll = sal_Bool( nBytes == 0 ); if( !Pos2Page( nBytes ) || !pFat->FreePages( nPage, bAll ) ) - return FALSE; + return sal_False; if( bAll ) nStart = nPage = STG_EOF; } @@ -469,12 +463,12 @@ BOOL StgStrm::SetSize( INT32 nBytes ) } nSize = nBytes; pFat->SetLimit( GetPages() ); - return TRUE; + return sal_True; } // Return the # of allocated pages -INT32 StgStrm::GetPages() +sal_Int32 StgStrm::GetPages() { return ( nSize + nPageSize - 1 ) / nPageSize; } @@ -487,11 +481,11 @@ INT32 StgStrm::GetPages() StgFATStrm::StgFATStrm( StgIo& r ) : StgStrm( r ) { - pFat = new StgFAT( *this, TRUE ); + pFat = new StgFAT( *this, sal_True ); nSize = rIo.aHdr.GetFATSize() * nPageSize; } -BOOL StgFATStrm::Pos2Page( INT32 nBytePos ) +sal_Bool StgFATStrm::Pos2Page( sal_Int32 nBytePos ) { // Values < 0 seek to the end if( nBytePos < 0 || nBytePos >= nSize ) @@ -499,38 +493,38 @@ BOOL StgFATStrm::Pos2Page( INT32 nBytePos ) nPage = nBytePos / nPageSize; nOffset = (short) ( nBytePos % nPageSize ); nPos = nBytePos; - nPage = GetPage( (short) nPage, FALSE ); - return BOOL( nPage >= 0 ); + nPage = GetPage( (short) nPage, sal_False ); + return sal_Bool( nPage >= 0 ); } // Retrieve the physical page for a given byte offset. // Since Pos2Page() already has computed the physical offset, // use the byte offset directly. -StgPage* StgFATStrm::GetPhysPage( INT32 nBytePos, BOOL bForce ) +StgPage* StgFATStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce ) { return rIo.Get( nBytePos / ( nPageSize >> 2 ), bForce ); } // Get the page number entry for the given page offset. -INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc ) +sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterAlloc ) { if( pnMasterAlloc ) *pnMasterAlloc = 0; if( nOff < rIo.aHdr.GetFAT1Size() ) return rIo.aHdr.GetFATPage( nOff ); - INT32 nMaxPage = nSize >> 2; + sal_Int32 nMaxPage = nSize >> 2; nOff = nOff - rIo.aHdr.GetFAT1Size(); // Anzahl der Masterpages, durch die wir iterieren muessen - USHORT nMasterCount = ( nPageSize >> 2 ) - 1; - USHORT nBlocks = nOff / nMasterCount; + sal_uInt16 nMasterCount = ( nPageSize >> 2 ) - 1; + sal_uInt16 nBlocks = nOff / nMasterCount; // Offset in letzter Masterpage nOff = nOff % nMasterCount; StgPage* pOldPage = 0; StgPage* pMaster = 0; - INT32 nFAT = rIo.aHdr.GetFATChain(); - for( USHORT nCount = 0; nCount <= nBlocks; nCount++ ) + sal_Int32 nFAT = rIo.aHdr.GetFATChain(); + for( sal_uInt16 nCount = 0; nCount <= nBlocks; nCount++ ) { if( nFAT == STG_EOF || nFAT == STG_FREE ) { @@ -557,7 +551,7 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc ) { if( !Pos2Page( nFAT << 2 ) ) return STG_EOF; - StgPage* pPg = rIo.Get( nPage, TRUE ); + StgPage* pPg = rIo.Get( nPage, sal_True ); if( !pPg ) return STG_EOF; pPg->SetPage( nOffset >> 2, STG_MASTER ); @@ -571,7 +565,7 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc ) } else { - pMaster = rIo.Get( nFAT, TRUE ); + pMaster = rIo.Get( nFAT, sal_True ); if ( pMaster ) { nFAT = pMaster->GetPage( nMasterCount ); @@ -588,30 +582,30 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc ) // Set the page number entry for the given page offset. -BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage ) +sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage ) { - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; if( nOff < rIo.aHdr.GetFAT1Size() ) rIo.aHdr.SetFATPage( nOff, nNewPage ); else { nOff = nOff - rIo.aHdr.GetFAT1Size(); // Anzahl der Masterpages, durch die wir iterieren muessen - USHORT nMasterCount = ( nPageSize >> 2 ) - 1; - USHORT nBlocks = nOff / nMasterCount; + sal_uInt16 nMasterCount = ( nPageSize >> 2 ) - 1; + sal_uInt16 nBlocks = nOff / nMasterCount; // Offset in letzter Masterpage nOff = nOff % nMasterCount; StgPage* pMaster = 0; - INT32 nFAT = rIo.aHdr.GetFATChain(); - for( USHORT nCount = 0; nCount <= nBlocks; nCount++ ) + sal_Int32 nFAT = rIo.aHdr.GetFATChain(); + for( sal_uInt16 nCount = 0; nCount <= nBlocks; nCount++ ) { if( nFAT == STG_EOF || nFAT == STG_FREE ) { pMaster = 0; break; } - pMaster = rIo.Get( nFAT, TRUE ); + pMaster = rIo.Get( nFAT, sal_True ); if ( pMaster ) nFAT = pMaster->GetPage( nMasterCount ); } @@ -620,7 +614,7 @@ BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage ) else { rIo.SetError( SVSTREAM_GENERALERROR ); - bRes = FALSE; + bRes = sal_False; } } @@ -628,16 +622,16 @@ BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage ) if( bRes ) { Pos2Page( nNewPage << 2 ); - StgPage* pPg = rIo.Get( nPage, TRUE ); + StgPage* pPg = rIo.Get( nPage, sal_True ); if( pPg ) pPg->SetPage( nOffset >> 2, STG_FAT ); else - bRes = FALSE; + bRes = sal_False; } return bRes; } -BOOL StgFATStrm::SetSize( INT32 nBytes ) +sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes ) { // Set the number of entries to a multiple of the page size short nOld = (short) ( ( nSize + ( nPageSize - 1 ) ) / nPageSize ); @@ -655,17 +649,17 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) { // allocate master pages // find a free master page slot - INT32 nPg = 0; - USHORT nMasterAlloc = 0; - nPg = GetPage( nOld, TRUE, &nMasterAlloc ); + sal_Int32 nPg = 0; + sal_uInt16 nMasterAlloc = 0; + nPg = GetPage( nOld, sal_True, &nMasterAlloc ); if( nPg == STG_EOF ) - return FALSE; + return sal_False; // 4 Bytes have been used for Allocation of each MegaMasterPage nBytes += nMasterAlloc << 2; // find a free page using the FAT allocator - INT32 n = 1; - INT32 nNewPage = pFat->FindBlock( n ); + sal_Int32 n = 1; + sal_Int32 nNewPage = pFat->FindBlock( n ); if( nNewPage == STG_EOF ) { // no free pages found; create a new page @@ -678,12 +672,12 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) // adjust the file size if necessary if( nNewPage >= rIo.GetPhysPages() ) if( !rIo.SetSize( nNewPage + 1 ) ) - return FALSE; + return sal_False; } // Set up the page with empty entries StgPage* pPg = rIo.Copy( nNewPage, STG_FREE ); if ( !pPg ) - return FALSE; + return sal_False; for( short j = 0; j < ( nPageSize >> 2 ); j++ ) pPg->SetPage( j, STG_FREE ); @@ -694,22 +688,22 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) // MegaMasterPages were created, mark it them as used - UINT32 nMax = rIo.aHdr.GetMasters( ); - UINT32 nFAT = rIo.aHdr.GetFATChain(); + sal_uInt32 nMax = rIo.aHdr.GetMasters( ); + sal_uInt32 nFAT = rIo.aHdr.GetFATChain(); if( nMasterAlloc ) - for( USHORT nCount = 0; nCount < nMax; nCount++ ) + for( sal_uInt16 nCount = 0; nCount < nMax; nCount++ ) { if( !Pos2Page( nFAT << 2 ) ) - return FALSE; + return sal_False; if( nMax - nCount <= nMasterAlloc ) { - StgPage* piPg = rIo.Get( nPage, TRUE ); + StgPage* piPg = rIo.Get( nPage, sal_True ); if( !piPg ) - return FALSE; + return sal_False; piPg->SetPage( nOffset >> 2, STG_MASTER ); } - StgPage* pPage = rIo.Get( nFAT, TRUE ); - if( !pPage ) return FALSE; + StgPage* pPage = rIo.Get( nFAT, sal_True ); + if( !pPage ) return sal_False; nFAT = pPage->GetPage( (nPageSize >> 2 ) - 1 ); } @@ -722,7 +716,7 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) } nSize = nNew * nPageSize; rIo.aHdr.SetFATSize( nNew ); - return TRUE; + return sal_True; } /////////////////////////// class StgDataStrm ////////////////////////////// @@ -732,7 +726,7 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) // The stream has a size increment which normally is 1, but which can be // set to any value is you want the size to be incremented by certain values. -StgDataStrm::StgDataStrm( StgIo& r, INT32 nBgn, INT32 nLen ) : StgStrm( r ) +StgDataStrm::StgDataStrm( StgIo& r, sal_Int32 nBgn, sal_Int32 nLen ) : StgStrm( r ) { Init( nBgn, nLen ); } @@ -744,9 +738,9 @@ StgDataStrm::StgDataStrm( StgIo& r, StgDirEntry* p ) : StgStrm( r ) p->aEntry.GetSize() ); } -void StgDataStrm::Init( INT32 nBgn, INT32 nLen ) +void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen ) { - pFat = new StgFAT( *rIo.pFAT, TRUE ); + pFat = new StgFAT( *rIo.pFAT, sal_True ); nStart = nPage = nBgn; nSize = nLen; nIncr = 1; @@ -756,7 +750,7 @@ void StgDataStrm::Init( INT32 nBgn, INT32 nLen ) // determine the actual size of the stream by scanning // the FAT chain and counting the # of pages allocated nSize = 0; - INT32 nOldBgn = -1; + sal_Int32 nOldBgn = -1; while( nBgn >= 0 && nBgn != nOldBgn ) { nOldBgn = nBgn; @@ -770,18 +764,18 @@ void StgDataStrm::Init( INT32 nBgn, INT32 nLen ) // Set the size of a physical stream. -BOOL StgDataStrm::SetSize( INT32 nBytes ) +sal_Bool StgDataStrm::SetSize( sal_Int32 nBytes ) { nBytes = ( ( nBytes + nIncr - 1 ) / nIncr ) * nIncr; - INT32 nOldSz = nSize; + sal_Int32 nOldSz = nSize; if( ( nOldSz != nBytes ) ) { if( !StgStrm::SetSize( nBytes ) ) - return FALSE; - INT32 nMaxPage = pFat->GetMaxPage(); + return sal_False; + sal_Int32 nMaxPage = pFat->GetMaxPage(); if( nMaxPage > rIo.GetPhysPages() ) if( !rIo.SetSize( nMaxPage ) ) - return FALSE; + return sal_False; // If we only allocated one page or less, create this // page in the cache for faster throughput. The current // position is the former EOF point. @@ -792,14 +786,14 @@ BOOL StgDataStrm::SetSize( INT32 nBytes ) rIo.Copy( nPage, STG_FREE ); } } - return TRUE; + return sal_True; } // Get the address of the data byte at a specified offset. -// If bForce = TRUE, a read of non-existent data causes +// If bForce = sal_True, a read of non-existent data causes // a read fault. -void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty ) +void* StgDataStrm::GetPtr( sal_Int32 Pos, sal_Bool bForce, sal_Bool bDirty ) { if( Pos2Page( Pos ) ) { @@ -809,7 +803,7 @@ void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty ) pPg->SetOwner( pEntry ); if( bDirty ) pPg->SetDirty(); - return ((BYTE *)pPg->GetData()) + nOffset; + return ((sal_uInt8 *)pPg->GetData()) + nOffset; } } return NULL; @@ -819,24 +813,24 @@ void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty ) // the amount of consecutable blocks before doing a read. The result // is the number of bytes read. No error is generated on EOF. -INT32 StgDataStrm::Read( void* pBuf, INT32 n ) +sal_Int32 StgDataStrm::Read( void* pBuf, sal_Int32 n ) { if ( n < 0 ) return 0; if( ( nPos + n ) > nSize ) n = nSize - nPos; - INT32 nDone = 0; + sal_Int32 nDone = 0; while( n ) { short nBytes = nPageSize - nOffset; StgPage* pPg; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { short nRes; - void *p = (BYTE *) pBuf + nDone; + void *p = (sal_uInt8 *) pBuf + nDone; if( nBytes == nPageSize ) { pPg = rIo.Find( nPage ); @@ -854,11 +848,11 @@ INT32 StgDataStrm::Read( void* pBuf, INT32 n ) else { // partial block read thru the cache. - pPg = rIo.Get( nPage, FALSE ); + pPg = rIo.Get( nPage, sal_False ); if( !pPg ) break; pPg->SetOwner( pEntry ); - memcpy( p, (BYTE*)pPg->GetData() + nOffset, nBytes ); + memcpy( p, (sal_uInt8*)pPg->GetData() + nOffset, nBytes ); nRes = nBytes; } nDone += nRes; @@ -875,26 +869,26 @@ INT32 StgDataStrm::Read( void* pBuf, INT32 n ) return nDone; } -INT32 StgDataStrm::Write( const void* pBuf, INT32 n ) +sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n ) { - INT32 nDone = 0; + sal_Int32 nDone = 0; if( ( nPos + n ) > nSize ) { - INT32 nOld = nPos; + sal_Int32 nOld = nPos; if( !SetSize( nPos + n ) ) - return FALSE; + return sal_False; Pos2Page( nOld ); } while( n ) { short nBytes = nPageSize - nOffset; StgPage* pPg; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { short nRes; - const void *p = (const BYTE *) pBuf + nDone; + const void *p = (const sal_uInt8 *) pBuf + nDone; if( nBytes == nPageSize ) { pPg = rIo.Find( nPage ); @@ -913,11 +907,11 @@ INT32 StgDataStrm::Write( const void* pBuf, INT32 n ) else { // partial block read thru the cache. - pPg = rIo.Get( nPage, FALSE ); + pPg = rIo.Get( nPage, sal_False ); if( !pPg ) break; pPg->SetOwner( pEntry ); - memcpy( (BYTE*)pPg->GetData() + nOffset, p, nBytes ); + memcpy( (sal_uInt8*)pPg->GetData() + nOffset, p, nBytes ); pPg->SetDirty(); nRes = nBytes; } @@ -942,7 +936,7 @@ INT32 StgDataStrm::Write( const void* pBuf, INT32 n ) // is also a StgStream. The start of the FAT is in the header at DataRootPage, // the stream itself is pointed to by the root entry (it holds start & size). -StgSmallStrm::StgSmallStrm( StgIo& r, INT32 nBgn, INT32 nLen ) : StgStrm( r ) +StgSmallStrm::StgSmallStrm( StgIo& r, sal_Int32 nBgn, sal_Int32 nLen ) : StgStrm( r ) { Init( nBgn, nLen ); } @@ -954,9 +948,9 @@ StgSmallStrm::StgSmallStrm( StgIo& r, StgDirEntry* p ) : StgStrm( r ) p->aEntry.GetSize() ); } -void StgSmallStrm::Init( INT32 nBgn, INT32 nLen ) +void StgSmallStrm::Init( sal_Int32 nBgn, sal_Int32 nLen ) { - pFat = new StgFAT( *rIo.pDataFAT, FALSE ); + pFat = new StgFAT( *rIo.pDataFAT, sal_False ); pData = rIo.pDataStrm; nPageSize = rIo.GetDataPageSize(); nStart = @@ -968,7 +962,7 @@ void StgSmallStrm::Init( INT32 nBgn, INT32 nLen ) // the amount of consecutable blocks before doing a read. The result // is the number of bytes read. No error is generated on EOF. -INT32 StgSmallStrm::Read( void* pBuf, INT32 n ) +sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n ) { // We can safely assume that reads are not huge, since the // small stream is likely to be < 64 KBytes. @@ -978,14 +972,14 @@ INT32 StgSmallStrm::Read( void* pBuf, INT32 n ) while( n ) { short nBytes = nPageSize - nOffset; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { if( !pData->Pos2Page( nPage * nPageSize + nOffset ) ) break; // all reading thru the stream - short nRes = (short) pData->Read( (BYTE*)pBuf + nDone, nBytes ); + short nRes = (short) pData->Read( (sal_uInt8*)pBuf + nDone, nBytes ); nDone = nDone + nRes; nPos += nRes; n -= nRes; @@ -1001,33 +995,33 @@ INT32 StgSmallStrm::Read( void* pBuf, INT32 n ) return nDone; } -INT32 StgSmallStrm::Write( const void* pBuf, INT32 n ) +sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) { // you can safely assume that reads are not huge, since the // small stream is likely to be < 64 KBytes. short nDone = 0; if( ( nPos + n ) > nSize ) { - INT32 nOld = nPos; + sal_Int32 nOld = nPos; if( !SetSize( nPos + n ) ) - return FALSE; + return sal_False; Pos2Page( nOld ); } while( n ) { short nBytes = nPageSize - nOffset; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { // all writing goes thru the stream - INT32 nDataPos = nPage * nPageSize + nOffset; + sal_Int32 nDataPos = nPage * nPageSize + nOffset; if( pData->GetSize() < ( nDataPos + nBytes ) ) if( !pData->SetSize( nDataPos + nBytes ) ) break; if( !pData->Pos2Page( nDataPos ) ) break; - short nRes = (short) pData->Write( (BYTE*)pBuf + nDone, nBytes ); + short nRes = (short) pData->Write( (sal_uInt8*)pBuf + nDone, nBytes ); nDone = nDone + nRes; nPos += nRes; n -= nRes; @@ -1050,7 +1044,7 @@ INT32 StgSmallStrm::Write( const void* pBuf, INT32 n ) #define THRESHOLD 32768L -StgTmpStrm::StgTmpStrm( ULONG nInitSize ) +StgTmpStrm::StgTmpStrm( sal_uLong nInitSize ) : SvMemoryStream( nInitSize > THRESHOLD ? 16 : ( nInitSize ? nInitSize : 16 ), 4096 ) @@ -1062,19 +1056,19 @@ StgTmpStrm::StgTmpStrm( ULONG nInitSize ) SetSize( nInitSize ); } -BOOL StgTmpStrm::Copy( StgTmpStrm& rSrc ) +sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) { - ULONG n = rSrc.GetSize(); - ULONG nCur = rSrc.Tell(); + sal_uLong n = rSrc.GetSize(); + sal_uLong nCur = rSrc.Tell(); SetSize( n ); if( GetError() == SVSTREAM_OK ) { - BYTE* p = new BYTE[ 4096 ]; + sal_uInt8* p = new sal_uInt8[ 4096 ]; rSrc.Seek( 0L ); Seek( 0L ); while( n ) { - ULONG nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; if( rSrc.Read( p, nn ) != nn ) @@ -1086,10 +1080,10 @@ BOOL StgTmpStrm::Copy( StgTmpStrm& rSrc ) delete [] p; rSrc.Seek( nCur ); Seek( nCur ); - return BOOL( n == 0 ); + return sal_Bool( n == 0 ); } else - return FALSE; + return sal_False; } StgTmpStrm::~StgTmpStrm() @@ -1102,12 +1096,12 @@ StgTmpStrm::~StgTmpStrm() } } -ULONG StgTmpStrm::GetSize() const +sal_uLong StgTmpStrm::GetSize() const { - ULONG n; + sal_uLong n; if( pStrm ) { - ULONG old = pStrm->Tell(); + sal_uLong old = pStrm->Tell(); n = pStrm->Seek( STREAM_SEEK_TO_END ); pStrm->Seek( old ); } @@ -1116,7 +1110,7 @@ ULONG StgTmpStrm::GetSize() const return n; } -void StgTmpStrm::SetSize( ULONG n ) +void StgTmpStrm::SetSize( sal_uLong n ) { if( pStrm ) pStrm->SetStreamSize( n ); @@ -1126,15 +1120,15 @@ void StgTmpStrm::SetSize( ULONG n ) { aName = TempFile::CreateTempName(); SvFileStream* s = new SvFileStream( aName, STREAM_READWRITE ); - ULONG nCur = Tell(); - ULONG i = nEndOfData; + sal_uLong nCur = Tell(); + sal_uLong i = nEndOfData; if( i ) { - BYTE* p = new BYTE[ 4096 ]; + sal_uInt8* p = new sal_uInt8[ 4096 ]; Seek( 0L ); while( i ) { - ULONG nb = ( i > 4096 ) ? 4096 : i; + sal_uLong nb = ( i > 4096 ) ? 4096 : i; if( Read( p, nb ) == nb && s->Write( p, nb ) == nb ) i -= nb; @@ -1170,9 +1164,9 @@ void StgTmpStrm::SetSize( ULONG n ) { if( n > nEndOfData ) { - ULONG nCur = Tell(); + sal_uLong nCur = Tell(); Seek( nEndOfData - 1 ); - *this << (BYTE) 0; + *this << (sal_uInt8) 0; Seek( nCur ); } else @@ -1181,7 +1175,7 @@ void StgTmpStrm::SetSize( ULONG n ) } } -ULONG StgTmpStrm::GetData( void* pData, ULONG n ) +sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n ) { if( pStrm ) { @@ -1193,10 +1187,10 @@ ULONG StgTmpStrm::GetData( void* pData, ULONG n ) return SvMemoryStream::GetData( (sal_Char *)pData, n ); } -ULONG StgTmpStrm::PutData( const void* pData, ULONG n ) +sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n ) { - UINT32 nCur = Tell(); - UINT32 nNew = nCur + n; + sal_uInt32 nCur = Tell(); + sal_uInt32 nNew = nCur + n; if( nNew > THRESHOLD && !pStrm ) { SetSize( nNew ); @@ -1213,7 +1207,7 @@ ULONG StgTmpStrm::PutData( const void* pData, ULONG n ) return nNew; } -ULONG StgTmpStrm::SeekPos( ULONG n ) +sal_uLong StgTmpStrm::SeekPos( sal_uLong n ) { if( n == STREAM_SEEK_TO_END ) n = GetSize(); diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 47301a90f9f6..a6a0ad108da9 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -37,29 +37,29 @@ class StgPage; class StgDirEntry; // The FAT class performs FAT operations on an underlying storage stream. -// This stream is either the physical FAT stream (bPhys == TRUE ) or a normal +// This stream is either the physical FAT stream (bPhys == sal_True ) or a normal // storage stream, which then holds the FAT for small data allocations. class StgFAT { // FAT allocator StgStrm& rStrm; // underlying stream - INT32 nMaxPage; // highest page allocated so far + sal_Int32 nMaxPage; // highest page allocated so far short nPageSize; // physical page size short nEntries; // FAT entries per page short nOffset; // current offset within page - INT32 nLimit; // search limit recommendation - BOOL bPhys; // TRUE: physical FAT - StgPage* GetPhysPage( INT32 nPage ); - BOOL MakeChain( INT32 nStart, INT32 nPages ); - BOOL InitNew( INT32 nPage1 ); + sal_Int32 nLimit; // search limit recommendation + sal_Bool bPhys; // sal_True: physical FAT + StgPage* GetPhysPage( sal_Int32 nPage ); + sal_Bool MakeChain( sal_Int32 nStart, sal_Int32 nPages ); + sal_Bool InitNew( sal_Int32 nPage1 ); public: - StgFAT( StgStrm& rStrm, BOOL bMark ); - INT32 FindBlock( INT32& nPages ); - INT32 GetNextPage( INT32 nPg ); - INT32 AllocPages( INT32 nStart, INT32 nPages ); - BOOL FreePages( INT32 nStart, BOOL bAll ); - INT32 GetMaxPage() { return nMaxPage; } - void SetLimit( INT32 n ) { nLimit = n; } + StgFAT( StgStrm& rStrm, sal_Bool bMark ); + sal_Int32 FindBlock( sal_Int32& nPages ); + sal_Int32 GetNextPage( sal_Int32 nPg ); + sal_Int32 AllocPages( sal_Int32 nStart, sal_Int32 nPages ); + sal_Bool FreePages( sal_Int32 nStart, sal_Bool bAll ); + sal_Int32 GetMaxPage() { return nMaxPage; } + void SetLimit( sal_Int32 n ) { nLimit = n; } }; // The base stream class provides basic functionality for seeking @@ -71,31 +71,31 @@ protected: StgIo& rIo; // I/O system StgFAT* pFat; // FAT stream for allocations StgDirEntry* pEntry; // dir entry (for ownership) - INT32 nStart; // 1st data page - INT32 nSize; // stream size in bytes - INT32 nPos; // current byte position - INT32 nPage; // current logical page + sal_Int32 nStart; // 1st data page + sal_Int32 nSize; // stream size in bytes + sal_Int32 nPos; // current byte position + sal_Int32 nPage; // current logical page short nOffset; // offset into current page short nPageSize; // logical page size - BOOL Copy( INT32 nFrom, INT32 nBytes ); + sal_Bool Copy( sal_Int32 nFrom, sal_Int32 nBytes ); StgStrm( StgIo& ); public: virtual ~StgStrm(); StgIo& GetIo() { return rIo; } - INT32 GetPos() { return nPos; } - INT32 GetStart() { return nStart; } - INT32 GetSize() { return nSize; } - INT32 GetPage() { return nPage; } + sal_Int32 GetPos() { return nPos; } + sal_Int32 GetStart() { return nStart; } + sal_Int32 GetSize() { return nSize; } + sal_Int32 GetPage() { return nPage; } short GetPageSize() { return nPageSize; } - INT32 GetPages(); + sal_Int32 GetPages(); short GetOffset() { return nOffset;} void SetEntry( StgDirEntry& ); - virtual BOOL SetSize( INT32 ); - virtual BOOL Pos2Page( INT32 nBytePos ); - virtual INT32 Read( void*, INT32 ) { return 0; } - virtual INT32 Write( const void*, INT32 ) { return 0; } - virtual StgPage* GetPhysPage( INT32 nBytePos, BOOL bForce = FALSE ); - virtual BOOL IsSmallStrm() { return FALSE; } + virtual sal_Bool SetSize( sal_Int32 ); + virtual sal_Bool Pos2Page( sal_Int32 nBytePos ); + virtual sal_Int32 Read( void*, sal_Int32 ) { return 0; } + virtual sal_Int32 Write( const void*, sal_Int32 ) { return 0; } + virtual StgPage* GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False ); + virtual sal_Bool IsSmallStrm() { return sal_False; } }; // The FAT stream class provides physical access to the master FAT. @@ -103,15 +103,15 @@ public: // FAT allocator. class StgFATStrm : public StgStrm { // the master FAT stream - virtual BOOL Pos2Page( INT32 nBytePos ); - BOOL SetPage( short, INT32 ); + virtual sal_Bool Pos2Page( sal_Int32 nBytePos ); + sal_Bool SetPage( short, sal_Int32 ); public: StgFATStrm( StgIo& ); virtual ~StgFATStrm() {} using StgStrm::GetPage; - INT32 GetPage( short, BOOL, USHORT *pnMasterAlloc = 0); - virtual BOOL SetSize( INT32 ); - virtual StgPage* GetPhysPage( INT32 nBytePos, BOOL bForce = FALSE ); + sal_Int32 GetPage( short, sal_Bool, sal_uInt16 *pnMasterAlloc = 0); + virtual sal_Bool SetSize( sal_Int32 ); + virtual StgPage* GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False ); }; // The stream has a size increment which normally is 1, but which can be @@ -120,15 +120,15 @@ public: class StgDataStrm : public StgStrm // a physical data stream { short nIncr; // size adjust increment - void Init( INT32 nBgn, INT32 nLen ); + void Init( sal_Int32 nBgn, sal_Int32 nLen ); public: - StgDataStrm( StgIo&, INT32 nBgn, INT32 nLen=-1 ); + StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 ); StgDataStrm( StgIo&, StgDirEntry* ); - void* GetPtr( INT32 nPos, BOOL bForce, BOOL bDirty ); + void* GetPtr( sal_Int32 nPos, sal_Bool bForce, sal_Bool bDirty ); void SetIncrement( short n ) { nIncr = n ; } - virtual BOOL SetSize( INT32 ); - virtual INT32 Read( void*, INT32 ); - virtual INT32 Write( const void*, INT32 ); + virtual sal_Bool SetSize( sal_Int32 ); + virtual sal_Int32 Read( void*, sal_Int32 ); + virtual sal_Int32 Write( const void*, sal_Int32 ); }; // The small stream class provides access to streams with a size < 4096 bytes. @@ -139,13 +139,13 @@ public: class StgSmallStrm : public StgStrm // a logical data stream { StgStrm* pData; // the data stream - void Init( INT32 nBgn, INT32 nLen ); + void Init( sal_Int32 nBgn, sal_Int32 nLen ); public: - StgSmallStrm( StgIo&, INT32 nBgn, INT32 nLen ); + StgSmallStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen ); StgSmallStrm( StgIo&, StgDirEntry* ); - virtual INT32 Read( void*, INT32 ); - virtual INT32 Write( const void*, INT32 ); - virtual BOOL IsSmallStrm() { return TRUE; } + virtual sal_Int32 Read( void*, sal_Int32 ); + virtual sal_Int32 Write( const void*, sal_Int32 ); + virtual sal_Bool IsSmallStrm() { return sal_True; } }; class StgTmpStrm : public SvMemoryStream @@ -153,17 +153,17 @@ class StgTmpStrm : public SvMemoryStream String aName; SvFileStream* pStrm; using SvMemoryStream::GetData; - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); + virtual sal_uLong GetData( void* pData, sal_uLong nSize ); + virtual sal_uLong PutData( const void* pData, sal_uLong nSize ); + virtual sal_uLong SeekPos( sal_uLong nPos ); virtual void FlushData(); public: - StgTmpStrm( ULONG=16 ); + StgTmpStrm( sal_uLong=16 ); ~StgTmpStrm(); - BOOL Copy( StgTmpStrm& ); - void SetSize( ULONG ); - ULONG GetSize() const; + sal_Bool Copy( StgTmpStrm& ); + void SetSize( sal_uLong ); + sal_uLong GetSize() const; }; #endif diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 1764d3c7bdec..c88a2d2c969e 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -36,8 +36,8 @@ #include <rtl/digest.h> #include <osl/file.hxx> -#include <stg.hxx> -#include <storinfo.hxx> +#include <sot/stg.hxx> +#include <sot/storinfo.hxx> #include <sot/storage.hxx> #include <sot/formats.hxx> #include <sot/exchange.hxx> @@ -74,12 +74,12 @@ SO2_IMPL_BASIC_CLASS1_DLL(SotStorageStream,SotStorageStreamFactory,SotObject, SO2_IMPL_INVARIANT(SotStorageStream) -void SotStorageStream::TestMemberObjRef( BOOL /*bFree*/ ) +void SotStorageStream::TestMemberObjRef( sal_Bool /*bFree*/ ) { } #ifdef TEST_INVARIANT -void SotStorageStream::TestMemberInvariant( BOOL /*bPrint*/ ) +void SotStorageStream::TestMemberInvariant( sal_Bool /*bPrint*/ ) { } #endif @@ -95,12 +95,12 @@ SvLockBytesRef MakeLockBytes_Impl( const String & rName, StreamMode nMode ) if( rName.Len() ) { SvStream * pFileStm = new SvFileStream( rName, nMode ); - xLB = new SvLockBytes( pFileStm, TRUE ); + xLB = new SvLockBytes( pFileStm, sal_True ); } else { SvStream * pCacheStm = new SvCacheStream(); - xLB = new SvLockBytes( pCacheStm, TRUE ); + xLB = new SvLockBytes( pCacheStm, sal_True ); } return xLB; } @@ -115,9 +115,9 @@ SotStorageStream::SotStorageStream( const String & rName, StreamMode nMode, , pOwnStm( NULL ) { if( nMode & STREAM_WRITE ) - bIsWritable = TRUE; + bIsWritable = sal_True; else - bIsWritable = FALSE; + bIsWritable = sal_False; DBG_ASSERT( !nStorageMode,"StorageModes ignored" ); } @@ -127,9 +127,9 @@ SotStorageStream::SotStorageStream( BaseStorageStream * pStm ) if( pStm ) { if( STREAM_WRITE & pStm->GetMode() ) - bIsWritable = TRUE; + bIsWritable = sal_True; else - bIsWritable = FALSE; + bIsWritable = sal_False; pOwnStm = pStm; SetError( pStm->GetError() ); @@ -138,7 +138,7 @@ SotStorageStream::SotStorageStream( BaseStorageStream * pStm ) else { pOwnStm = NULL; - bIsWritable = TRUE; + bIsWritable = sal_True; SetError( SVSTREAM_INVALID_PARAMETER ); } } @@ -147,7 +147,7 @@ SotStorageStream::SotStorageStream() : pOwnStm( NULL ) { // ??? wenn Init virtuell ist, entsprechen setzen - bIsWritable = TRUE; + bIsWritable = sal_True; } /************************************************************************ @@ -172,7 +172,7 @@ void SotStorageStream::SyncSvStream() if( pOwnStm ) { pOwnStm->Flush(); - ULONG nPos = pOwnStm->Tell(); + sal_uLong nPos = pOwnStm->Tell(); SetError( pOwnStm->GetError() ); SvStream::SyncSvStream( nPos ); } @@ -195,9 +195,9 @@ void SotStorageStream::ResetError() |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::GetData( void* pData, ULONG nSize ) +sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize ) { - ULONG nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -214,9 +214,9 @@ ULONG SotStorageStream::GetData( void* pData, ULONG nSize ) |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::PutData( const void* pData, ULONG nSize ) +sal_uLong SotStorageStream::PutData( const void* pData, sal_uLong nSize ) { - ULONG nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -233,9 +233,9 @@ ULONG SotStorageStream::PutData( const void* pData, ULONG nSize ) |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::SeekPos( ULONG nPos ) +sal_uLong SotStorageStream::SeekPos( sal_uLong nPos ) { - ULONG nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -268,9 +268,9 @@ void SotStorageStream::FlushData() |* |* Beschreibung *************************************************************************/ -void SotStorageStream::SetSize( ULONG nNewSize ) +void SotStorageStream::SetSize( sal_uLong nNewSize ) { - ULONG nPos = Tell(); + sal_uLong nPos = Tell(); if( pOwnStm ) { pOwnStm->SetSize( nNewSize ); @@ -293,11 +293,11 @@ void SotStorageStream::SetSize( ULONG nNewSize ) |* Beschreibung |* *************************************************************************/ -UINT32 SotStorageStream::GetSize() const +sal_uInt32 SotStorageStream::GetSize() const { - ULONG nPos = Tell(); + sal_uLong nPos = Tell(); ((SotStorageStream *)this)->Seek( STREAM_SEEK_TO_END ); - ULONG nSize = Tell(); + sal_uLong nSize = Tell(); ((SotStorageStream *)this)->Seek( nPos ); return nSize; } @@ -307,19 +307,19 @@ UINT32 SotStorageStream::GetSize() const |* |* Beschreibung *************************************************************************/ -BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm ) +sal_Bool SotStorageStream::CopyTo( SotStorageStream * pDestStm ) { Flush(); // alle Daten schreiben pDestStm->ClearBuffer(); if( !pOwnStm || !pDestStm->pOwnStm ) { // Wenn Ole2 oder nicht nur eigene StorageStreams - ULONG nPos = Tell(); // Position merken + sal_uLong nPos = Tell(); // Position merken Seek( 0L ); pDestStm->SetSize( 0 ); // Ziel-Stream leeren - void * pMem = new BYTE[ 8192 ]; - ULONG nRead; + void * pMem = new sal_uInt8[ 8192 ]; + sal_uLong nRead; while( 0 != (nRead = Read( pMem, 8192 )) ) { if( nRead != pDestStm->Write( pMem, nRead ) ) @@ -328,7 +328,7 @@ BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm ) break; } } - delete [] static_cast<BYTE*>(pMem); + delete [] static_cast<sal_uInt8*>(pMem); // Position setzen pDestStm->Seek( nPos ); Seek( nPos ); @@ -359,7 +359,7 @@ BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorageStream::Commit() +sal_Bool SotStorageStream::Commit() { if( pOwnStm ) { @@ -371,7 +371,7 @@ BOOL SotStorageStream::Commit() return GetError() == SVSTREAM_OK; } -BOOL SotStorageStream::Revert() +sal_Bool SotStorageStream::Revert() { if( !pOwnStm ) { @@ -381,7 +381,7 @@ BOOL SotStorageStream::Revert() return GetError() == SVSTREAM_OK; } -BOOL SotStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) { UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm ); if ( pStg ) @@ -391,11 +391,11 @@ BOOL SotStorageStream::SetProperty( const String& rName, const ::com::sun::star: else { OSL_FAIL("Not implemented!"); - return FALSE; + return sal_False; } } -BOOL SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) { UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm ); if ( pStg ) @@ -405,7 +405,7 @@ BOOL SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno:: else { OSL_FAIL("Not implemented!"); - return FALSE; + return sal_False; } } @@ -452,12 +452,12 @@ SO2_IMPL_INVARIANT(SotStorage) |* |* Beschreibung *************************************************************************/ -void SotStorage::TestMemberObjRef( BOOL /*bFree*/ ) +void SotStorage::TestMemberObjRef( sal_Bool /*bFree*/ ) { } #ifdef TEST_INVARIANT -void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ ) +void SotStorage::TestMemberInvariant( sal_Bool /*bPrint*/ ) { } #endif @@ -469,7 +469,7 @@ void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ ) |* Beschreibung Es muss ein I... Objekt an SvObject uebergeben |* werden, da es sonst selbst ein IUnknown anlegt und |* festlegt, dass alle weiteren I... Objekte mit -|* delete zerstoert werden (Owner() == TRUE). +|* delete zerstoert werden (Owner() == sal_True). |* Es werden aber nur IStorage Objekte benutzt und nicht |* selbst implementiert, deshalb wird so getan, als ob |* das IStorage Objekt von aussen kam und es wird mit @@ -487,8 +487,8 @@ void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ ) : m_pOwnStg( NULL ) \ , m_pStorStm( NULL ) \ , m_nError( SVSTREAM_OK ) \ - , m_bIsRoot( FALSE ) \ - , m_bDelStm( FALSE ) \ + , m_bIsRoot( sal_False ) \ + , m_bDelStm( sal_False ) \ , m_nVersion( SOFFICE_FILEFORMAT_CURRENT ) SotStorage::SotStorage() @@ -506,7 +506,7 @@ SotStorage::SotStorage( const ::ucbhelper::Content& rContent, const String & rNa INIT_SotStorage() { m_aName = rName; // Namen merken - m_pOwnStg = new UCBStorage( rContent, m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new UCBStorage( rContent, m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); SetError( m_pOwnStg->GetError() ); @@ -520,12 +520,12 @@ SotStorage::SotStorage( const String & rName, StreamMode nMode, StorageMode nSto INIT_SotStorage() { m_aName = rName; // Namen merken - CreateStorage( TRUE, nMode, nStorageMode ); + CreateStorage( sal_True, nMode, nStorageMode ); if ( IsOLEStorage() ) m_nVersion = SOFFICE_FILEFORMAT_50; } -void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, StorageMode nStorageMode ) +void SotStorage::CreateStorage( sal_Bool bForceUCBStorage, StreamMode nMode, StorageMode nStorageMode ) { DBG_ASSERT( !m_pStorStm && !m_pOwnStg, "Use only in ctor!" ); if( m_aName.Len() ) @@ -551,11 +551,11 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage if ( aURL.Len() ) { ::ucbhelper::Content aContent( aURL, ::com::sun::star::uno::Reference < ::com::sun::star::ucb::XCommandEnvironment >() ); - m_pOwnStg = new UCBStorage( aContent, aURL, nMode, FALSE ); + m_pOwnStg = new UCBStorage( aContent, aURL, nMode, sal_False ); } else { - m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); SetError( ERRCODE_IO_NOTSUPPORTED ); } } @@ -569,7 +569,7 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage if ( m_pStorStm ) { // try as UCBStorage, next try as OLEStorage - BOOL bIsUCBStorage = UCBStorage::IsStorageFile( m_pStorStm ); + sal_Bool bIsUCBStorage = UCBStorage::IsStorageFile( m_pStorStm ); if ( !bIsUCBStorage && bForceUCBStorage ) // if UCBStorage has priority, it should not be used only if it is really an OLEStorage bIsUCBStorage = !Storage::IsStorageFile( m_pStorStm ); @@ -579,8 +579,8 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage if ( UCBStorage::GetLinkedFile( *m_pStorStm ).Len() ) { // detect special unpacked storages - m_pOwnStg = new UCBStorage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); - m_bDelStm = TRUE; + m_pOwnStg = new UCBStorage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); + m_bDelStm = sal_True; } else { @@ -590,24 +590,24 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage // UCBStorage always works directly on the UCB content, so discard the stream first DELETEZ( m_pStorStm ); - m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); } } else { // OLEStorage can be opened with a stream - m_pOwnStg = new Storage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); - m_bDelStm = TRUE; + m_pOwnStg = new Storage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); + m_bDelStm = sal_True; } } else if ( bForceUCBStorage ) { - m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); SetError( ERRCODE_IO_NOTSUPPORTED ); } else { - m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); SetError( ERRCODE_IO_NOTSUPPORTED ); } } @@ -616,9 +616,9 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage { // temporary storage if ( bForceUCBStorage ) - m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); else - m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); m_aName = m_pOwnStg->GetName(); } @@ -627,7 +627,7 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage SignAsRoot( m_pOwnStg->IsRoot() ); } -SotStorage::SotStorage( BOOL bUCBStorage, const String & rName, StreamMode nMode, StorageMode nStorageMode ) +SotStorage::SotStorage( sal_Bool bUCBStorage, const String & rName, StreamMode nMode, StorageMode nStorageMode ) INIT_SotStorage() { m_aName = rName; @@ -647,22 +647,22 @@ SotStorage::SotStorage( BaseStorage * pStor ) } m_pOwnStg = pStor; - ULONG nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE; + sal_uLong nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE; SetError( nErr ); if ( IsOLEStorage() ) m_nVersion = SOFFICE_FILEFORMAT_50; } -SotStorage::SotStorage( BOOL bUCBStorage, SvStream & rStm ) +SotStorage::SotStorage( sal_Bool bUCBStorage, SvStream & rStm ) INIT_SotStorage() { SetError( rStm.GetError() ); // try as UCBStorage, next try as OLEStorage if ( UCBStorage::IsStorageFile( &rStm ) || bUCBStorage ) - m_pOwnStg = new UCBStorage( rStm, FALSE ); + m_pOwnStg = new UCBStorage( rStm, sal_False ); else - m_pOwnStg = new Storage( rStm, FALSE ); + m_pOwnStg = new Storage( rStm, sal_False ); SetError( m_pOwnStg->GetError() ); @@ -679,9 +679,9 @@ SotStorage::SotStorage( SvStream & rStm ) // try as UCBStorage, next try as OLEStorage if ( UCBStorage::IsStorageFile( &rStm ) ) - m_pOwnStg = new UCBStorage( rStm, FALSE ); + m_pOwnStg = new UCBStorage( rStm, sal_False ); else - m_pOwnStg = new Storage( rStm, FALSE ); + m_pOwnStg = new Storage( rStm, sal_False ); SetError( m_pOwnStg->GetError() ); @@ -691,16 +691,16 @@ SotStorage::SotStorage( SvStream & rStm ) SignAsRoot( m_pOwnStg->IsRoot() ); } -SotStorage::SotStorage( SvStream * pStm, BOOL bDelete ) +SotStorage::SotStorage( SvStream * pStm, sal_Bool bDelete ) INIT_SotStorage() { SetError( pStm->GetError() ); // try as UCBStorage, next try as OLEStorage if ( UCBStorage::IsStorageFile( pStm ) ) - m_pOwnStg = new UCBStorage( *pStm, FALSE ); + m_pOwnStg = new UCBStorage( *pStm, sal_False ); else - m_pOwnStg = new Storage( *pStm, FALSE ); + m_pOwnStg = new Storage( *pStm, sal_False ); SetError( m_pOwnStg->GetError() ); @@ -794,7 +794,7 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String& UCBStorage* pChildUCBStg = PTR_CAST( UCBStorage, pChildStorage->m_pOwnStg ); if ( pChildUCBStg ) { - UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, FALSE, TRUE ); + UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, sal_False, sal_True ); if ( pTempStorage ) { pChildUCBStg->CopyTo( pTempStorage ); @@ -892,7 +892,7 @@ SvMemoryStream * SotStorage::CreateMemoryStream() |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::IsStorageFile( const String & rFileName ) +sal_Bool SotStorage::IsStorageFile( const String & rFileName ) { String aName( rFileName ); INetURLObject aObj( aName ); @@ -905,25 +905,25 @@ BOOL SotStorage::IsStorageFile( const String & rFileName ) } SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READ ); - BOOL bRet = SotStorage::IsStorageFile( pStm ); + sal_Bool bRet = SotStorage::IsStorageFile( pStm ); delete pStm; return bRet; } -BOOL SotStorage::IsStorageFile( SvStream* pStream ) +sal_Bool SotStorage::IsStorageFile( SvStream* pStream ) { /** code for new storages must come first! **/ if ( pStream ) { long nPos = pStream->Tell(); - BOOL bRet = UCBStorage::IsStorageFile( pStream ); + sal_Bool bRet = UCBStorage::IsStorageFile( pStream ); if ( !bRet ) bRet = Storage::IsStorageFile( pStream ); pStream->Seek( nPos ); return bRet; } else - return FALSE; + return sal_False; } /************************************************************************* |* SotStorage::GetStorage() @@ -969,7 +969,7 @@ void SotStorage::ResetError() |* Beschreibung *************************************************************************/ void SotStorage::SetClass( const SvGlobalName & rName, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -980,7 +980,7 @@ void SotStorage::SetClass( const SvGlobalName & rName, } void SotStorage::SetConvertClass( const SvGlobalName & rName, - ULONG nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1009,9 +1009,9 @@ SvGlobalName SotStorage::GetClassName() return aGN; } -ULONG SotStorage::GetFormat() +sal_uLong SotStorage::GetFormat() { - ULONG nFormat = 0; + sal_uLong nFormat = 0; DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) nFormat = m_pOwnStg->GetFormat(); @@ -1031,14 +1031,14 @@ String SotStorage::GetUserName() return aName; } -BOOL SotStorage::ShouldConvert() +sal_Bool SotStorage::ShouldConvert() { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) return m_pOwnStg->ShouldConvert(); else SetError( SVSTREAM_GENERALERROR ); - return FALSE; + return sal_False; } /************************************************************************* @@ -1058,7 +1058,7 @@ void SotStorage::FillInfoList( SvStorageInfoList * pFillList ) const |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::CopyTo( SotStorage * pDestStg ) +sal_Bool SotStorage::CopyTo( SotStorage * pDestStg ) { DBG_ASSERT( Owner(), "must be owner" ); DBG_ASSERT( pDestStg->Owner(), "must be owner" ); @@ -1079,7 +1079,7 @@ BOOL SotStorage::CopyTo( SotStorage * pDestStg ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Commit() +sal_Bool SotStorage::Commit() { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1097,7 +1097,7 @@ BOOL SotStorage::Commit() |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Revert() +sal_Bool SotStorage::Revert() { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1129,7 +1129,7 @@ SotStorageStream * SotStorage::OpenEncryptedSotStream( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorageStream* p = m_pOwnStg->OpenStream( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE, &rKey ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True, &rKey ); pStm = new SotStorageStream( p ); if( !nE ) @@ -1156,7 +1156,7 @@ SotStorageStream * SotStorage::OpenSotStream( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorageStream * p = m_pOwnStg->OpenStream( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); pStm = new SotStorageStream( p ); if( !nE ) @@ -1185,7 +1185,7 @@ SotStorage * SotStorage::OpenSotStorage( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorage * p = m_pOwnStg->OpenStorage( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); if( p ) { pStor = new SotStorage( p ); @@ -1212,7 +1212,7 @@ SotStorage * SotStorage::OpenUCBStorage( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorage * p = m_pOwnStg->OpenUCBStorage( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); pStor = new SotStorage( p ); if( !nE ) m_pOwnStg->ResetError(); // kein Fehler setzen @@ -1233,7 +1233,7 @@ SotStorage * SotStorage::OpenOLEStorage( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorage * p = m_pOwnStg->OpenOLEStorage( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); pStor = new SotStorage( p ); if( !nE ) m_pOwnStg->ResetError(); // kein Fehler setzen @@ -1250,31 +1250,31 @@ SotStorage * SotStorage::OpenOLEStorage( const String & rEleName, |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::IsStorage( const String & rEleName ) const +sal_Bool SotStorage::IsStorage( const String & rEleName ) const { DBG_ASSERT( Owner(), "must be owner" ); // ein bisschen schneller if( m_pOwnStg ) return m_pOwnStg->IsStorage( rEleName ); - return FALSE; + return sal_False; } -BOOL SotStorage::IsStream( const String & rEleName ) const +sal_Bool SotStorage::IsStream( const String & rEleName ) const { DBG_ASSERT( Owner(), "must be owner" ); // ein bisschen schneller if( m_pOwnStg ) return m_pOwnStg->IsStream( rEleName ); - return FALSE; + return sal_False; } -BOOL SotStorage::IsContained( const String & rEleName ) const +sal_Bool SotStorage::IsContained( const String & rEleName ) const { DBG_ASSERT( Owner(), "must be owner" ); // ein bisschen schneller if( m_pOwnStg ) return m_pOwnStg->IsContained( rEleName ); - return FALSE; + return sal_False; } /************************************************************************* @@ -1282,7 +1282,7 @@ BOOL SotStorage::IsContained( const String & rEleName ) const |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Remove( const String & rEleName ) +sal_Bool SotStorage::Remove( const String & rEleName ) { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1300,7 +1300,7 @@ BOOL SotStorage::Remove( const String & rEleName ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Rename( const String & rEleName, const String & rNewName ) +sal_Bool SotStorage::Rename( const String & rEleName, const String & rNewName ) { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1318,7 +1318,7 @@ BOOL SotStorage::Rename( const String & rEleName, const String & rNewName ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::CopyTo( const String & rEleName, +sal_Bool SotStorage::CopyTo( const String & rEleName, SotStorage * pNewSt, const String & rNewName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1339,7 +1339,7 @@ BOOL SotStorage::CopyTo( const String & rEleName, |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::MoveTo( const String & rEleName, +sal_Bool SotStorage::MoveTo( const String & rEleName, SotStorage * pNewSt, const String & rNewName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1374,16 +1374,16 @@ SvStream* SotStorage::GetTargetSvStream() const } -BOOL SotStorage::Validate() +sal_Bool SotStorage::Validate() { DBG_ASSERT( m_bIsRoot, "Validate nur an Rootstorage" ); if( m_pOwnStg ) return m_pOwnStg->ValidateFAT(); else - return TRUE; + return sal_True; } -BOOL SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); if ( pStg ) @@ -1393,11 +1393,11 @@ BOOL SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno:: else { DBG_WARNING("W1:Not implemented!"); - return FALSE; + return sal_False; } } -BOOL SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); if ( pStg ) @@ -1407,20 +1407,20 @@ BOOL SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& r else if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL ) { String aStr = SotExchange::GetFormatMimeType( GetFormat() ); - USHORT nPos = aStr.Search(';'); + sal_uInt16 nPos = aStr.Search(';'); if ( nPos != STRING_NOTFOUND ) aStr = aStr.Copy( 0, nPos ); rValue <<= (::rtl::OUString) aStr; - return TRUE; + return sal_True; } else { DBG_WARNING("W1:Not implemented!"); - return FALSE; + return sal_False; } } -BOOL SotStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ) { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); if ( pStg ) @@ -1430,22 +1430,22 @@ BOOL SotStorage::GetProperty( const String& rEleName, const String& rName, ::com else { DBG_WARNING("W1:Not implemented!"); - return FALSE; + return sal_False; } } -BOOL SotStorage::IsOLEStorage() const +sal_Bool SotStorage::IsOLEStorage() const { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); return !pStg; } -BOOL SotStorage::IsOLEStorage( const String & rFileName ) +sal_Bool SotStorage::IsOLEStorage( const String & rFileName ) { return Storage::IsStorageFile( rFileName ); } -BOOL SotStorage::IsOLEStorage( SvStream* pStream ) +sal_Bool SotStorage::IsOLEStorage( SvStream* pStream ) { return Storage::IsStorageFile( pStream ); } @@ -1502,7 +1502,7 @@ SotStorage* SotStorage::OpenOLEStorage( const com::sun::star::uno::Reference < c pStream->SetError( ERRCODE_IO_GENERAL ); } - return new SotStorage( pStream, TRUE ); + return new SotStorage( pStream, sal_True ); } sal_Int32 SotStorage::GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ) diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 3859bcd5ee6c..1cdde1a45104 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -29,8 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sot.hxx" -#include <stg.hxx> -#include <storinfo.hxx> +#include <sot/stg.hxx> +#include <sot/storinfo.hxx> #include <sot/exchange.hxx> @@ -40,7 +40,7 @@ PRV_SV_IMPL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) { - for( ULONG i = 0; i < Count(); i++ ) + for( sal_uLong i = 0; i < Count(); i++ ) { const SvStorageInfo & rType = GetObject( i ); if( rType.GetName() == rEleName ) @@ -51,10 +51,10 @@ const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) /************** class SvStorageInfo ************************************** *************************************************************************/ -ULONG ReadClipboardFormat( SvStream & rStm ) +sal_uLong ReadClipboardFormat( SvStream & rStm ) { sal_uInt32 nFormat = 0; - INT32 nLen = 0; + sal_Int32 nLen = 0; rStm >> nLen; if( rStm.IsEof() ) rStm.SetError( SVSTREAM_GENERALERROR ); @@ -62,7 +62,7 @@ ULONG ReadClipboardFormat( SvStream & rStm ) { // get a string name sal_Char * p = new sal_Char[ nLen ]; - if( rStm.Read( p, nLen ) == (ULONG) nLen ) + if( rStm.Read( p, nLen ) == (sal_uLong) nLen ) { nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( p, short(nLen-1) ) ); } @@ -89,7 +89,7 @@ ULONG ReadClipboardFormat( SvStream & rStm ) return nFormat; } -void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ) +void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ) { // determine the clipboard format string String aCbFmt; @@ -98,15 +98,15 @@ void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ) if( aCbFmt.Len() ) { ByteString aAsciiCbFmt( aCbFmt, RTL_TEXTENCODING_ASCII_US ); - rStm << (INT32) (aAsciiCbFmt.Len() + 1); + rStm << (sal_Int32) (aAsciiCbFmt.Len() + 1); rStm << (const char *)aAsciiCbFmt.GetBuffer(); - rStm << (UINT8) 0; + rStm << (sal_uInt8) 0; } else if( nFormat ) - rStm << (INT32) -1 // for Windows - << (INT32) nFormat; + rStm << (sal_Int32) -1 // for Windows + << (sal_Int32) nFormat; else - rStm << (INT32) 0; // no clipboard format + rStm << (sal_Int32) 0; // no clipboard format } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 0d0163f20252..d234ec236415 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -66,12 +66,12 @@ #include <cppuhelper/implbase2.hxx> #include <ucbhelper/commandenvironment.hxx> -#include "stg.hxx" -#include "storinfo.hxx" +#include "sot/stg.hxx" +#include "sot/storinfo.hxx" #include <sot/storage.hxx> #include <sot/exchange.hxx> #include <sot/formats.hxx> -#include "clsids.hxx" +#include "sot/clsids.hxx" #include "unostorageholder.hxx" @@ -426,10 +426,10 @@ class UCBStorageStream_Impl : public SvRefBase, public SvStream ~UCBStorageStream_Impl(); public: - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); - virtual void SetSize( ULONG nSize ); + virtual sal_uLong GetData( void* pData, sal_uLong nSize ); + virtual sal_uLong PutData( const void* pData, sal_uLong nSize ); + virtual sal_uLong SeekPos( sal_uLong nPos ); + virtual void SetSize( sal_uLong nSize ); virtual void FlushData(); virtual void ResetError(); @@ -449,29 +449,29 @@ public: RepresentModes m_nRepresentMode; // should it be used as XInputStream or as SvStream long m_nError; StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing ) - BOOL m_bSourceRead; // Source still contains useful information - BOOL m_bModified; // only modified streams will be sent to the original content - BOOL m_bCommited; // sending the streams is coordinated by the root storage of the package - BOOL m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages + sal_Bool m_bSourceRead; // Source still contains useful information + sal_Bool m_bModified; // only modified streams will be sent to the original content + sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package + sal_Bool m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages // this means that the root storage does an autocommit when its external // reference is destroyed - BOOL m_bIsOLEStorage;// an OLEStorage on a UCBStorageStream makes this an Autocommit-stream + sal_Bool m_bIsOLEStorage;// an OLEStorage on a UCBStorageStream makes this an Autocommit-stream - UCBStorageStream_Impl( const String&, StreamMode, UCBStorageStream*, BOOL, const ByteString* pKey=0, BOOL bRepair = FALSE, Reference< XProgressHandler > xProgress = Reference< XProgressHandler >() ); + UCBStorageStream_Impl( const String&, StreamMode, UCBStorageStream*, sal_Bool, const ByteString* pKey=0, sal_Bool bRepair = sal_False, Reference< XProgressHandler > xProgress = Reference< XProgressHandler >() ); void Free(); - BOOL Init(); - BOOL Clear(); + sal_Bool Init(); + sal_Bool Clear(); sal_Int16 Commit(); // if modified and commited: transfer an XInputStream to the content - BOOL Revert(); // discard all changes + sal_Bool Revert(); // discard all changes BaseStorage* CreateStorage();// create an OLE Storage on the UCBStorageStream - ULONG GetSize(); + sal_uLong GetSize(); - ULONG ReadSourceWriteTemporary( ULONG aLength ); // read aLength from source and copy to temporary, + sal_uLong ReadSourceWriteTemporary( sal_uLong aLength ); // read aLength from source and copy to temporary, // no seeking is produced - ULONG ReadSourceWriteTemporary(); // read source till the end and copy to temporary, + sal_uLong ReadSourceWriteTemporary(); // read source till the end and copy to temporary, - ULONG CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() + sal_uLong CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() // but the writing is done at the end of temporary // pointer position is not changed Reference<XInputStream> GetXInputStream(); // return XInputStream, after that @@ -503,34 +503,34 @@ public: SvStream* m_pSource; // original stream, only for storages on a stream long m_nError; StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing ) - BOOL m_bModified; // only modified elements will be sent to the original content - BOOL m_bCommited; // sending the streams is coordinated by the root storage of the package - BOOL m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages + sal_Bool m_bModified; // only modified elements will be sent to the original content + sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package + sal_Bool m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages // this means that the root storage does an autocommit when its external // reference is destroyed - BOOL m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts - BOOL m_bDirty; // ??? - BOOL m_bIsLinked; - BOOL m_bListCreated; - ULONG m_nFormat; + sal_Bool m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts + sal_Bool m_bDirty; // ??? + sal_Bool m_bIsLinked; + sal_Bool m_bListCreated; + sal_uLong m_nFormat; String m_aUserTypeName; SvGlobalName m_aClassId; UCBStorageElementList_Impl m_aChildrenList; - BOOL m_bRepairPackage; + sal_Bool m_bRepairPackage; Reference< XProgressHandler > m_xProgressHandler; UNOStorageHolderList* m_pUNOStorageHolderList; - UCBStorage_Impl( const ::ucbhelper::Content&, const String&, StreamMode, UCBStorage*, BOOL, BOOL, BOOL = FALSE, Reference< XProgressHandler > = Reference< XProgressHandler >() ); - UCBStorage_Impl( const String&, StreamMode, UCBStorage*, BOOL, BOOL, BOOL = FALSE, Reference< XProgressHandler > = Reference< XProgressHandler >() ); - UCBStorage_Impl( SvStream&, UCBStorage*, BOOL ); + UCBStorage_Impl( const ::ucbhelper::Content&, const String&, StreamMode, UCBStorage*, sal_Bool, sal_Bool, sal_Bool = sal_False, Reference< XProgressHandler > = Reference< XProgressHandler >() ); + UCBStorage_Impl( const String&, StreamMode, UCBStorage*, sal_Bool, sal_Bool, sal_Bool = sal_False, Reference< XProgressHandler > = Reference< XProgressHandler >() ); + UCBStorage_Impl( SvStream&, UCBStorage*, sal_Bool ); void Init(); sal_Int16 Commit(); - BOOL Revert(); - BOOL Insert( ::ucbhelper::Content *pContent ); - UCBStorage_Impl* OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect ); - UCBStorageStream_Impl* OpenStream( UCBStorageElement_Impl*, StreamMode, BOOL, const ByteString* pKey=0 ); + sal_Bool Revert(); + sal_Bool Insert( ::ucbhelper::Content *pContent ); + UCBStorage_Impl* OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect ); + UCBStorageStream_Impl* OpenStream( UCBStorageElement_Impl*, StreamMode, sal_Bool, const ByteString* pKey=0 ); void SetProps( const Sequence < Sequence < PropertyValue > >& rSequence, const String& ); void GetProps( sal_Int32&, Sequence < Sequence < PropertyValue > >& rSequence, const String& ); sal_Int32 GetObjectCount(); @@ -565,32 +565,32 @@ struct UCBStorageElement_Impl { String m_aName; // the actual URL relative to the root "folder" String m_aOriginalName;// the original name in the content - ULONG m_nSize; - BOOL m_bIsFolder; // Only TRUE when it is a UCBStorage ! - BOOL m_bIsStorage; // Also TRUE when it is an OLEStorage ! - BOOL m_bIsRemoved; // element will be removed on commit - BOOL m_bIsInserted; // element will be removed on revert + sal_uLong m_nSize; + sal_Bool m_bIsFolder; // Only sal_True when it is a UCBStorage ! + sal_Bool m_bIsStorage; // Also sal_True when it is an OLEStorage ! + sal_Bool m_bIsRemoved; // element will be removed on commit + sal_Bool m_bIsInserted; // element will be removed on revert UCBStorage_ImplRef m_xStorage; // reference to the "real" storage UCBStorageStream_ImplRef m_xStream; // reference to the "real" stream UCBStorageElement_Impl( const ::rtl::OUString& rName, - BOOL bIsFolder = FALSE, ULONG nSize = 0 ) + sal_Bool bIsFolder = sal_False, sal_uLong nSize = 0 ) : m_aName( rName ) , m_aOriginalName( rName ) , m_nSize( nSize ) , m_bIsFolder( bIsFolder ) , m_bIsStorage( bIsFolder ) - , m_bIsRemoved( FALSE ) - , m_bIsInserted( FALSE ) + , m_bIsRemoved( sal_False ) + , m_bIsInserted( sal_False ) { } ::ucbhelper::Content* GetContent(); - BOOL IsModified(); + sal_Bool IsModified(); String GetContentType(); void SetContentType( const String& ); String GetOriginalContentType(); - BOOL IsLoaded() + sal_Bool IsLoaded() { return m_xStream.Is() || m_xStorage.Is(); } }; @@ -640,9 +640,9 @@ String UCBStorageElement_Impl::GetOriginalContentType() return String(); } -BOOL UCBStorageElement_Impl::IsModified() +sal_Bool UCBStorageElement_Impl::IsModified() { - BOOL bModified = m_bIsRemoved || m_bIsInserted || m_aName != m_aOriginalName; + sal_Bool bModified = m_bIsRemoved || m_bIsInserted || m_aName != m_aOriginalName; if ( bModified ) { if ( m_xStream.Is() ) @@ -654,7 +654,7 @@ BOOL UCBStorageElement_Impl::IsModified() return bModified; } -UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nMode, UCBStorageStream* pStream, BOOL bDirect, const ByteString* pKey, BOOL bRepair, Reference< XProgressHandler > xProgress ) +UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nMode, UCBStorageStream* pStream, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress ) : m_pAntiImpl( pStream ) , m_aURL( rName ) , m_pContent( NULL ) @@ -663,10 +663,10 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM , m_nError( 0 ) , m_nMode( nMode ) , m_bSourceRead( !( nMode & STREAM_TRUNC ) ) - , m_bModified( FALSE ) - , m_bCommited( FALSE ) + , m_bModified( sal_False ) + , m_bCommited( sal_False ) , m_bDirect( bDirect ) - , m_bIsOLEStorage( FALSE ) + , m_bIsOLEStorage( sal_False ) { // name is last segment in URL INetURLObject aObj( rName ); @@ -751,7 +751,7 @@ Reference<XInputStream> UCBStorageStream_Impl::GetXInputStream() CopySourceToTemporary(); // owner transfer of stream to wrapper - aResult = new ::utl::OInputStreamWrapper( m_pStream, TRUE ); + aResult = new ::utl::OInputStreamWrapper( m_pStream, sal_True ); m_pStream->Seek(0); if( aResult.is() ) @@ -788,13 +788,13 @@ Reference<XInputStream> UCBStorageStream_Impl::GetXInputStream() return aResult; } -BOOL UCBStorageStream_Impl::Init() +sal_Bool UCBStorageStream_Impl::Init() { if( m_nRepresentMode == xinputstream ) { OSL_FAIL( "XInputStream misuse!" ); SetError( ERRCODE_IO_ACCESSDENIED ); - return FALSE; + return sal_False; } if( !m_pStream ) @@ -816,7 +816,7 @@ BOOL UCBStorageStream_Impl::Init() { OSL_FAIL( "Suspicious temporary stream creation!" ); SetError( SVSTREAM_CANNOT_MAKE ); - return FALSE; + return sal_False; } SetError( m_pStream->GetError() ); @@ -847,12 +847,12 @@ BOOL UCBStorageStream_Impl::Init() catch( BufferSizeExceededException& ) { // the temporary stream already contain all the data - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } catch( Exception& ) { // something is really wrong - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; OSL_FAIL( "Can not operate original stream!" ); SetError( SVSTREAM_CANNOT_MAKE ); } @@ -862,7 +862,7 @@ BOOL UCBStorageStream_Impl::Init() else { // if the new file is edited than no source exist - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; //SetError( SVSTREAM_CANNOT_MAKE ); } } @@ -872,12 +872,12 @@ BOOL UCBStorageStream_Impl::Init() return sal_True; } -ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() +sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary() { // read source stream till the end and copy all the data to // the current position of the temporary stream - ULONG aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { @@ -885,7 +885,7 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() try { - ULONG aReaded; + sal_uLong aReaded; do { aReaded = m_rSource->readBytes( aData, 32000 ); @@ -895,7 +895,7 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -903,18 +903,18 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() } } - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; return aResult; } -ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) +sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength ) { // read aLength bite from the source stream and copy them to the current // position of the temporary stream - ULONG aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { @@ -923,22 +923,22 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) try { - ULONG aReaded = 32000; + sal_uLong aReaded = 32000; - for( ULONG pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) + for( sal_uLong pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) { - ULONG aToCopy = min( aLength - pInd, 32000 ); + sal_uLong aToCopy = min( aLength - pInd, 32000 ); aReaded = m_rSource->readBytes( aData, aToCopy ); aResult += m_pStream->Write( aData.getArray(), aReaded ); } if( aResult < aLength ) - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -949,14 +949,14 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) return aResult; } -ULONG UCBStorageStream_Impl::CopySourceToTemporary() +sal_uLong UCBStorageStream_Impl::CopySourceToTemporary() { // current position of the temporary stream is not changed - ULONG aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { - ULONG aPos = m_pStream->Tell(); + sal_uLong aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary(); m_pStream->Seek( aPos ); @@ -968,9 +968,9 @@ ULONG UCBStorageStream_Impl::CopySourceToTemporary() // UCBStorageStream_Impl must have a SvStream interface, because it then can be used as underlying stream // of an OLEStorage; so every write access caused by storage operations marks the UCBStorageStream as modified -ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize ) +sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) { - ULONG aResult = 0; + sal_uLong aResult = 0; if( !Init() ) return 0; @@ -983,20 +983,20 @@ ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize ) // read the tail of the data from original stream // copy this tail to the temporary stream - ULONG aToRead = nSize - aResult; + sal_uLong aToRead = nSize - aResult; pData = (void*)( (char*)pData + aResult ); try { Sequence<sal_Int8> aData( aToRead ); - ULONG aReaded = m_rSource->readBytes( aData, aToRead ); + sal_uLong aReaded = m_rSource->readBytes( aData, aToRead ); aResult += m_pStream->Write( (void*)aData.getArray(), aReaded ); memcpy( pData, aData.getArray(), aReaded ); } #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -1004,13 +1004,13 @@ ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize ) } if( aResult < nSize ) - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } return aResult; } -ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize ) +sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1021,7 +1021,7 @@ ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize ) if( !nSize || !Init() ) return 0; - ULONG aResult = m_pStream->Write( pData, nSize ); + sal_uLong aResult = m_pStream->Write( pData, nSize ); m_bModified = aResult > 0; @@ -1029,12 +1029,12 @@ ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize ) } -ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) +sal_uLong UCBStorageStream_Impl::SeekPos( sal_uLong nPos ) { if( !Init() ) return 0; - ULONG aResult; + sal_uLong aResult; if( nPos == STREAM_SEEK_TO_END ) { @@ -1065,7 +1065,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) { aResult += ReadSourceWriteTemporary( nPos - aResult ); if( aResult < nPos ) - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; DBG_ASSERT( aResult == m_pStream->Tell(), "Error in stream arithmetic!\n" ); } @@ -1086,7 +1086,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) return aResult; } -void UCBStorageStream_Impl::SetSize( ULONG nSize ) +void UCBStorageStream_Impl::SetSize( sal_uLong nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1097,11 +1097,11 @@ void UCBStorageStream_Impl::SetSize( ULONG nSize ) if( !Init() ) return; - m_bModified = TRUE; + m_bModified = sal_True; if( m_bSourceRead ) { - ULONG aPos = m_pStream->Tell(); + sal_uLong aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); if( m_pStream->Tell() < nSize ) ReadSourceWriteTemporary( nSize - m_pStream->Tell() ); @@ -1109,7 +1109,7 @@ void UCBStorageStream_Impl::SetSize( ULONG nSize ) } m_pStream->SetStreamSize( nSize ); - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } void UCBStorageStream_Impl::FlushData() @@ -1120,7 +1120,7 @@ void UCBStorageStream_Impl::FlushData() m_pStream->Flush(); } - m_bCommited = TRUE; + m_bCommited = sal_True; } void UCBStorageStream_Impl::SetError( sal_uInt32 nErr ) @@ -1141,15 +1141,15 @@ void UCBStorageStream_Impl::ResetError() m_pAntiImpl->ResetError(); } -ULONG UCBStorageStream_Impl::GetSize() +sal_uLong UCBStorageStream_Impl::GetSize() { if( !Init() ) return 0; - ULONG nPos = m_pStream->Tell(); + sal_uLong nPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); ReadSourceWriteTemporary(); - ULONG nRet = m_pStream->Tell(); + sal_uLong nRet = m_pStream->Tell(); m_pStream->Seek( nPos ); return nRet; @@ -1209,8 +1209,8 @@ sal_Int16 UCBStorageStream_Impl::Commit() INetURLObject aObj( m_aURL ); aObj.SetName( m_aName ); m_aURL = aObj.GetMainURL( INetURLObject::NO_DECODE ); - m_bModified = FALSE; - m_bSourceRead = TRUE; + m_bModified = sal_False; + m_bSourceRead = sal_True; } catch ( CommandAbortedException& ) { @@ -1231,7 +1231,7 @@ sal_Int16 UCBStorageStream_Impl::Commit() return COMMIT_RESULT_FAILURE; } - m_bCommited = FALSE; + m_bCommited = sal_False; return COMMIT_RESULT_SUCCESS; } } @@ -1239,13 +1239,13 @@ sal_Int16 UCBStorageStream_Impl::Commit() return COMMIT_RESULT_NOTHING_TO_DO; } -BOOL UCBStorageStream_Impl::Revert() +sal_Bool UCBStorageStream_Impl::Revert() { // if an OLEStorage is created on this stream, no "revert" is neccessary because OLEStorages do nothing on "Revert" ! if ( m_bCommited ) { OSL_FAIL("Revert while commit is in progress!" ); - return FALSE; // ??? + return sal_False; // ??? } Free(); @@ -1255,7 +1255,7 @@ BOOL UCBStorageStream_Impl::Revert() m_aTempURL.Erase(); } - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; try { m_rSource = m_pContent->openStream(); @@ -1263,11 +1263,11 @@ BOOL UCBStorageStream_Impl::Revert() { if ( m_pAntiImpl && ( m_nMode & STREAM_TRUNC ) ) // stream is in use and should be truncated - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; else { m_nMode &= ~STREAM_TRUNC; - m_bSourceRead = TRUE; + m_bSourceRead = sal_True; } } else @@ -1285,15 +1285,15 @@ BOOL UCBStorageStream_Impl::Revert() { } - m_bModified = FALSE; + m_bModified = sal_False; m_aName = m_aOriginalName; m_aContentType = m_aOriginalContentType; return ( GetError() == ERRCODE_NONE ); } -BOOL UCBStorageStream_Impl::Clear() +sal_Bool UCBStorageStream_Impl::Clear() { - BOOL bRet = ( m_pAntiImpl == NULL ); + sal_Bool bRet = ( m_pAntiImpl == NULL ); DBG_ASSERT( bRet, "Removing used stream!" ); if( bRet ) { @@ -1344,7 +1344,7 @@ void UCBStorageStream_Impl::PrepareCachedForReopen( StreamMode nMode ) } } -UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey ) +UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorageStream ! @@ -1353,7 +1353,7 @@ UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL StorageBase::m_nMode = pImp->m_nMode; } -UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey, BOOL bRepair, Reference< XProgressHandler > xProgress ) +UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorageStream ! @@ -1380,13 +1380,13 @@ UCBStorageStream::~UCBStorageStream() pImp->ReleaseRef(); } -ULONG UCBStorageStream::Read( void * pData, ULONG nSize ) +sal_uLong UCBStorageStream::Read( void * pData, sal_uLong nSize ) { //return pImp->m_pStream->Read( pData, nSize ); return pImp->GetData( pData, nSize ); } -ULONG UCBStorageStream::Write( const void* pData, ULONG nSize ) +sal_uLong UCBStorageStream::Write( const void* pData, sal_uLong nSize ) { /* // mba: does occur in writer ! @@ -1396,18 +1396,18 @@ ULONG UCBStorageStream::Write( const void* pData, ULONG nSize ) return 0; } */ - // pImp->m_bModified = TRUE; + // pImp->m_bModified = sal_True; //return pImp->m_pStream->Write( pData, nSize ); return pImp->PutData( pData, nSize ); } -ULONG UCBStorageStream::Seek( ULONG nPos ) +sal_uLong UCBStorageStream::Seek( sal_uLong nPos ) { //return pImp->m_pStream->Seek( nPos ); return pImp->Seek( nPos ); } -ULONG UCBStorageStream::Tell() +sal_uLong UCBStorageStream::Tell() { if( !pImp->Init() ) return 0; @@ -1420,32 +1420,32 @@ void UCBStorageStream::Flush() Commit(); } -BOOL UCBStorageStream::SetSize( ULONG nNewSize ) +sal_Bool UCBStorageStream::SetSize( sal_uLong nNewSize ) { /* if ( pImp->m_bCommited ) { OSL_FAIL("Changing stream size while commit is in progress!" ); - return FALSE; + return sal_False; } */ - // pImp->m_bModified = TRUE; + // pImp->m_bModified = sal_True; //return pImp->m_pStream->SetStreamSize( nNewSize ); pImp->SetSize( nNewSize ); return !pImp->GetError(); } -BOOL UCBStorageStream::Validate( BOOL bWrite ) const +sal_Bool UCBStorageStream::Validate( sal_Bool bWrite ) const { return ( !bWrite || ( pImp->m_nMode & STREAM_WRITE ) ); } -BOOL UCBStorageStream::ValidateMode( StreamMode m ) const +sal_Bool UCBStorageStream::ValidateMode( StreamMode m ) const { // ??? if( m == ( STREAM_READ | STREAM_TRUNC ) ) // from stg.cxx - return TRUE; - USHORT nCurMode = 0xFFFF; + return sal_True; + sal_uInt16 nCurMode = 0xFFFF; if( ( m & 3 ) == STREAM_READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed @@ -1453,7 +1453,7 @@ BOOL UCBStorageStream::ValidateMode( StreamMode m ) const && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) || ( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) - return TRUE; + return sal_True; } else { @@ -1462,10 +1462,10 @@ BOOL UCBStorageStream::ValidateMode( StreamMode m ) const // the commit may fail if( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) - return TRUE; + return sal_True; } - return TRUE; + return sal_True; } const SvStream* UCBStorageStream::GetSvStream() const @@ -1487,28 +1487,28 @@ Reference< XInputStream > UCBStorageStream::GetXInputStream() const return pImp->GetXInputStream(); } -BOOL UCBStorageStream::Equals( const BaseStorageStream& rStream ) const +sal_Bool UCBStorageStream::Equals( const BaseStorageStream& rStream ) const { // ??? return ((BaseStorageStream*) this ) == &rStream; } -BOOL UCBStorageStream::Commit() +sal_Bool UCBStorageStream::Commit() { // mark this stream for sending it on root commit pImp->FlushData(); - return TRUE; + return sal_True; } -BOOL UCBStorageStream::Revert() +sal_Bool UCBStorageStream::Revert() { return pImp->Revert(); } -BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm ) +sal_Bool UCBStorageStream::CopyTo( BaseStorageStream* pDestStm ) { if( !pImp->Init() ) - return FALSE; + return sal_False; UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pDestStm ); if ( pStg ) @@ -1516,18 +1516,18 @@ BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm ) pDestStm->SetSize( 0 ); Seek( STREAM_SEEK_TO_END ); - INT32 n = Tell(); + sal_Int32 n = Tell(); if( n < 0 ) - return FALSE; + return sal_False; if( pDestStm->SetSize( n ) && n ) { - BYTE* p = new BYTE[ 4096 ]; + sal_uInt8* p = new sal_uInt8[ 4096 ]; Seek( 0L ); pDestStm->Seek( 0L ); while( n ) { - UINT32 nn = n; + sal_uInt32 nn = n; if( nn > 4096 ) nn = 4096; if( Read( p, nn ) != nn ) @@ -1540,13 +1540,13 @@ BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm ) delete[] p; } - return TRUE; + return sal_True; } -BOOL UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) { if ( rName.CompareToAscii("Title") == COMPARE_EQUAL ) - return FALSE; + return sal_False; if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL ) { @@ -1560,34 +1560,34 @@ BOOL UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star: if ( pImp->m_pContent ) { pImp->m_pContent->setPropertyValue( rName, rValue ); - return TRUE; + return sal_True; } } catch ( Exception& ) { } - return FALSE; + return sal_False; } -BOOL UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) { try { if ( pImp->m_pContent ) { rValue = pImp->m_pContent->getPropertyValue( rName ); - return TRUE; + return sal_True; } } catch ( Exception& ) { } - return FALSE; + return sal_False; } -UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect ) +UCBStorage::UCBStorage( SvStream& rStrm, sal_Bool bDirect ) { String aURL = GetLinkedFile( rStrm ); if ( aURL.Len() ) @@ -1597,7 +1597,7 @@ UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect ) nMode = STREAM_READ | STREAM_WRITE; ::ucbhelper::Content aContent( aURL, Reference < XCommandEnvironment >() ); - pImp = new UCBStorage_Impl( aContent, aURL, nMode, this, bDirect, TRUE ); + pImp = new UCBStorage_Impl( aContent, aURL, nMode, this, bDirect, sal_True ); } else { @@ -1611,7 +1611,7 @@ UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect ) StorageBase::m_nMode = pImp->m_nMode; } -UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot ) +UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorage ! @@ -1621,7 +1621,7 @@ UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rNam StorageBase::m_nMode = pImp->m_nMode; } -UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler ) +UCBStorage::UCBStorage( const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorage ! @@ -1631,7 +1631,7 @@ UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOO StorageBase::m_nMode = pImp->m_nMode; } -UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot ) +UCBStorage::UCBStorage( const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorage ! @@ -1660,7 +1660,7 @@ UCBStorage::~UCBStorage() pImp->ReleaseRef(); } -UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, UCBStorage* pStorage, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler ) +UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, UCBStorage* pStorage, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler ) : m_pAntiImpl( pStorage ) , m_pContent( new ::ucbhelper::Content( rContent ) ) , m_pTempFile( NULL ) @@ -1668,13 +1668,13 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const St //, m_pStream( NULL ) , m_nError( 0 ) , m_nMode( nMode ) - , m_bModified( FALSE ) - , m_bCommited( FALSE ) + , m_bModified( sal_False ) + , m_bCommited( sal_False ) , m_bDirect( bDirect ) , m_bIsRoot( bIsRoot ) - , m_bDirty( FALSE ) - , m_bIsLinked( TRUE ) - , m_bListCreated( FALSE ) + , m_bDirty( sal_False ) + , m_bIsLinked( sal_True ) + , m_bListCreated( sal_False ) , m_nFormat( 0 ) , m_aClassId( SvGlobalName() ) , m_bRepairPackage( bIsRepair ) @@ -1688,14 +1688,14 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const St // no name given = use temporary name! DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); m_pTempFile = new ::utl::TempFile; - m_pTempFile->EnableKillingFile( TRUE ); + m_pTempFile->EnableKillingFile( sal_True ); m_aName = m_aOriginalName = aName = m_pTempFile->GetURL(); } m_aURL = rName; } -UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStorage* pStorage, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler ) +UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStorage* pStorage, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler ) : m_pAntiImpl( pStorage ) , m_pContent( NULL ) , m_pTempFile( NULL ) @@ -1703,13 +1703,13 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor //, m_pStream( NULL ) , m_nError( 0 ) , m_nMode( nMode ) - , m_bModified( FALSE ) - , m_bCommited( FALSE ) + , m_bModified( sal_False ) + , m_bCommited( sal_False ) , m_bDirect( bDirect ) , m_bIsRoot( bIsRoot ) - , m_bDirty( FALSE ) - , m_bIsLinked( FALSE ) - , m_bListCreated( FALSE ) + , m_bDirty( sal_False ) + , m_bIsLinked( sal_False ) + , m_bListCreated( sal_False ) , m_nFormat( 0 ) , m_aClassId( SvGlobalName() ) , m_bRepairPackage( bIsRepair ) @@ -1722,7 +1722,7 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor // no name given = use temporary name! DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); m_pTempFile = new ::utl::TempFile; - m_pTempFile->EnableKillingFile( TRUE ); + m_pTempFile->EnableKillingFile( sal_True ); m_aName = m_aOriginalName = aName = m_pTempFile->GetURL(); } @@ -1745,31 +1745,31 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor // substorages are opened like streams: the URL is a "child URL" of the root package URL m_aURL = rName; if ( m_aURL.CompareToAscii( "vnd.sun.star.pkg://", 19 ) != 0 ) - m_bIsLinked = TRUE; + m_bIsLinked = sal_True; } } -UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, BOOL bDirect ) +UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, sal_Bool bDirect ) : m_pAntiImpl( pStorage ) , m_pContent( NULL ) , m_pTempFile( new ::utl::TempFile ) , m_pSource( &rStream ) , m_nError( 0 ) - , m_bModified( FALSE ) - , m_bCommited( FALSE ) + , m_bModified( sal_False ) + , m_bCommited( sal_False ) , m_bDirect( bDirect ) - , m_bIsRoot( TRUE ) - , m_bDirty( FALSE ) - , m_bIsLinked( FALSE ) - , m_bListCreated( FALSE ) + , m_bIsRoot( sal_True ) + , m_bDirty( sal_False ) + , m_bIsLinked( sal_False ) + , m_bListCreated( sal_False ) , m_nFormat( 0 ) , m_aClassId( SvGlobalName() ) - , m_bRepairPackage( FALSE ) + , m_bRepairPackage( sal_False ) , m_pUNOStorageHolderList( NULL ) { // opening in direct mode is too fuzzy because the data is transferred to the stream in the Commit() call, // which will be called in the storages' dtor - m_pTempFile->EnableKillingFile( TRUE ); + m_pTempFile->EnableKillingFile( sal_True ); DBG_ASSERT( !bDirect, "Storage on a stream must not be opened in direct mode!" ); // UCBStorages work on a content, so a temporary file for a content must be created, even if the stream is only @@ -1930,7 +1930,7 @@ void UCBStorage_Impl::ReadContent() if ( m_bListCreated ) return; - m_bListCreated = TRUE; + m_bListCreated = sal_True; // create cursor for access to children Sequence< ::rtl::OUString > aProps(4); @@ -1968,9 +1968,9 @@ void UCBStorage_Impl::ReadContent() aContentType = xRow->getString(3); } - BOOL bIsFolder( xRow->getBoolean(2) ); + sal_Bool bIsFolder( xRow->getBoolean(2) ); sal_Int64 nSize = xRow->getLong(4); - UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (ULONG) nSize ); + UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (sal_uLong) nSize ); m_aChildrenList.push_back( pElement ); sal_Bool bIsOfficeDocument = m_bIsLinked || ( m_aClassId != SvGlobalName() ); @@ -2001,13 +2001,13 @@ void UCBStorage_Impl::ReadContent() ::rtl::OUString aMediaType; Any aAny = aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); if ( ( aAny >>= aMediaType ) && ( aMediaType.compareToAscii("application/vnd.sun.star.oleobject") == 0 ) ) - pElement->m_bIsStorage = TRUE; + pElement->m_bIsStorage = sal_True; else if ( !aMediaType.getLength() ) { // older files didn't have that special content type, so they must be detected OpenStream( pElement, STREAM_STD_READ, m_bDirect ); if ( Storage::IsStorageFile( pElement->m_xStream ) ) - pElement->m_bIsStorage = TRUE; + pElement->m_bIsStorage = sal_True; else pElement->m_xStream->Free(); } @@ -2074,7 +2074,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount() ::rtl::OUString Find_Impl( const Sequence < Sequence < PropertyValue > >& rSequence, const ::rtl::OUString& rPath ) { - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; for ( sal_Int32 nSeqs=0; nSeqs<rSequence.getLength(); nSeqs++ ) { const Sequence < PropertyValue >& rMyProps = rSequence[nSeqs]; @@ -2087,7 +2087,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount() { rtl::OUString aTmp; if ( ( rAny.Value >>= aTmp ) && aTmp == rPath ) - bFound = TRUE; + bFound = sal_True; if ( aType.getLength() ) break; } @@ -2217,11 +2217,11 @@ UCBStorage_Impl::~UCBStorage_Impl() delete m_pTempFile; } -BOOL UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent ) +sal_Bool UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent ) { // a new substorage is inserted into a UCBStorage ( given by the parameter pContent ) // it must be inserted with a title and a type - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; try { @@ -2258,7 +2258,7 @@ BOOL UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent ) // remove old content, create an "empty" new one and initialize it with the new inserted DELETEZ( m_pContent ); m_pContent = new ::ucbhelper::Content( aNewFolder ); - bRet = TRUE; + bRet = sal_True; } } } @@ -2297,11 +2297,11 @@ sal_Int16 UCBStorage_Impl::Commit() { UCBStorageElement_Impl* pElement = m_aChildrenList[ i ]; ::ucbhelper::Content* pContent = pElement->GetContent(); - BOOL bDeleteContent = FALSE; + sal_Bool bDeleteContent = sal_False; if ( !pContent && pElement->IsModified() ) { // if the element has never been opened, no content has been created until now - bDeleteContent = TRUE; // remember to delete it later + bDeleteContent = sal_True; // remember to delete it later String aName( m_aURL ); aName += '/'; aName += pElement->m_aOriginalName; @@ -2349,7 +2349,7 @@ sal_Int16 UCBStorage_Impl::Commit() // OLE storage should be stored encrytped, if the storage uses encryption pElement->m_xStream->m_aContentType = String::CreateFromAscii("application/vnd.sun.star.oleobject"); Any aValue; - aValue <<= (BOOL) TRUE; + aValue <<= (sal_Bool) sal_True; pElement->m_xStream->m_pContent->setPropertyValue(String::CreateFromAscii("Encrypted"), aValue ); } @@ -2429,7 +2429,7 @@ sal_Int16 UCBStorage_Impl::Commit() // write a manifest file // first create a subfolder "META-inf" Content aNewSubFolder; - BOOL bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, String::CreateFromAscii("META-INF"), aNewSubFolder ); + sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, String::CreateFromAscii("META-INF"), aNewSubFolder ); if ( bRet ) { // create a stream to write the manifest file - use a temp file @@ -2542,24 +2542,24 @@ sal_Int16 UCBStorage_Impl::Commit() else { pInnerElement->m_aOriginalName = pInnerElement->m_aName; - pInnerElement->m_bIsInserted = FALSE; + pInnerElement->m_bIsInserted = sal_False; ++i; } } } - m_bCommited = FALSE; + m_bCommited = sal_False; } return nRet; } -BOOL UCBStorage_Impl::Revert() +sal_Bool UCBStorage_Impl::Revert() { for ( size_t i = 0; i < m_aChildrenList.size(); ) { UCBStorageElement_Impl* pElement = m_aChildrenList[ i ]; - pElement->m_bIsRemoved = FALSE; + pElement->m_bIsRemoved = sal_False; if ( pElement->m_bIsInserted ) { UCBStorageElementList_Impl::iterator it = m_aChildrenList.begin(); @@ -2581,11 +2581,11 @@ BOOL UCBStorage_Impl::Revert() } pElement->m_aName = pElement->m_aOriginalName; - pElement->m_bIsRemoved = FALSE; + pElement->m_bIsRemoved = sal_False; ++i; } } - return TRUE; + return sal_True; } const String& UCBStorage::GetName() const @@ -2593,17 +2593,17 @@ const String& UCBStorage::GetName() const return pImp->m_aName; // pImp->m_aURL ?! } -BOOL UCBStorage::IsRoot() const +sal_Bool UCBStorage::IsRoot() const { return pImp->m_bIsRoot; } void UCBStorage::SetDirty() { - pImp->m_bDirty = TRUE; + pImp->m_bDirty = sal_True; } -void UCBStorage::SetClass( const SvGlobalName & rClass, ULONG nOriginalClipFormat, const String & rUserTypeName ) +void UCBStorage::SetClass( const SvGlobalName & rClass, sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { pImp->m_aClassId = rClass; pImp->m_nFormat = nOriginalClipFormat; @@ -2642,15 +2642,15 @@ const ClsId& UCBStorage::GetClassId() const return ( const ClsId& ) pImp->m_aClassId.GetCLSID(); } -void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, ULONG /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) +void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, sal_uLong /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) { // ??? } -BOOL UCBStorage::ShouldConvert() +sal_Bool UCBStorage::ShouldConvert() { // ??? - return FALSE; + return sal_False; } SvGlobalName UCBStorage::GetClassName() @@ -2658,7 +2658,7 @@ SvGlobalName UCBStorage::GetClassName() return pImp->m_aClassId; } -ULONG UCBStorage::GetFormat() +sal_uLong UCBStorage::GetFormat() { return pImp->m_nFormat; } @@ -2678,7 +2678,7 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const if ( !pElement->m_bIsRemoved ) { // problem: what about the size of a substorage ?! - ULONG nSize = pElement->m_nSize; + sal_uLong nSize = pElement->m_nSize; if ( pElement->m_xStream.Is() ) nSize = pElement->m_xStream->GetSize(); SvStorageInfo aInfo( pElement->m_aName, nSize, pElement->m_bIsStorage ); @@ -2687,7 +2687,7 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const } } -BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, BaseStorage* pDest, const String& rNew ) const +sal_Bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, BaseStorage* pDest, const String& rNew ) const { // insert stream or storage into the list or stream of the destination storage // not into the content, this will be done on commit ! @@ -2698,7 +2698,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base // the destination stream must not be open BaseStorageStream* pOtherStream = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect ); BaseStorageStream* pStream = NULL; - BOOL bDeleteStream = FALSE; + sal_Bool bDeleteStream = sal_False; // if stream is already open, it is allowed to copy it, so be aware of this if ( rElement.m_xStream.Is() ) @@ -2706,7 +2706,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base if ( !pStream ) { pStream = ( const_cast < UCBStorage* > (this) )->OpenStream( rElement.m_aName, STREAM_STD_READ, pImp->m_bDirect ); - bDeleteStream = TRUE; + bDeleteStream = sal_True; } pStream->CopyTo( pOtherStream ); @@ -2727,19 +2727,19 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base BaseStorage* pStorage = NULL; // if stream is already open, it is allowed to copy it, so be aware of this - BOOL bDeleteStorage = FALSE; + sal_Bool bDeleteStorage = sal_False; if ( rElement.m_xStorage.Is() ) pStorage = rElement.m_xStorage->m_pAntiImpl; if ( !pStorage ) { pStorage = ( const_cast < UCBStorage* > (this) )->OpenStorage( rElement.m_aName, pImp->m_nMode, pImp->m_bDirect ); - bDeleteStorage = TRUE; + bDeleteStorage = sal_True; } UCBStorage* pUCBDest = PTR_CAST( UCBStorage, pDest ); UCBStorage* pUCBCopy = PTR_CAST( UCBStorage, pStorage ); - BOOL bOpenUCBStorage = pUCBDest && pUCBCopy; + sal_Bool bOpenUCBStorage = pUCBDest && pUCBCopy; BaseStorage* pOtherStorage = bOpenUCBStorage ? pDest->OpenUCBStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect ) : pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect ); @@ -2764,7 +2764,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base delete pOtherStorage; } - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const String& rName ) const @@ -2779,11 +2779,11 @@ UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const String& rName ) cons return NULL; } -BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const +sal_Bool UCBStorage::CopyTo( BaseStorage* pDestStg ) const { DBG_ASSERT( pDestStg != ((BaseStorage*)this), "Self-Copying is not possible!" ); if ( pDestStg == ((BaseStorage*)this) ) - return FALSE; + return sal_False; // perhaps it's also a problem if one storage is a parent of the other ?! // or if not: could be optimized ?! @@ -2797,7 +2797,7 @@ BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const pDestStg->SetClassId( GetClassId() ); pDestStg->SetDirty(); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; for ( size_t i = 0; i < pImp->GetChildrenList().size() && bRet; ++i ) { UCBStorageElement_Impl* pElement = pImp->GetChildrenList()[ i ]; @@ -2807,18 +2807,18 @@ BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const if( !bRet ) SetError( pDestStg->GetError() ); - return BOOL( Good() && pDestStg->Good() ); + return sal_Bool( Good() && pDestStg->Good() ); } -BOOL UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const String& rNew ) +sal_Bool UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const String& rNew ) { if( !rElemName.Len() ) - return FALSE; + return sal_False; if ( pDest == ((BaseStorage*) this) ) { // can't double an element - return FALSE; + return sal_False; } else { @@ -2829,28 +2829,28 @@ BOOL UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const Stri else { SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } } } -BOOL UCBStorage::Commit() +sal_Bool UCBStorage::Commit() { // mark this storage for sending it on root commit - pImp->m_bCommited = TRUE; + pImp->m_bCommited = sal_True; if ( pImp->m_bIsRoot ) // the root storage coordinates commiting by sending a Commit command to its content return ( pImp->Commit() != COMMIT_RESULT_FAILURE ); else - return TRUE; + return sal_True; } -BOOL UCBStorage::Revert() +sal_Bool UCBStorage::Revert() { return pImp->Revert(); } -BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nMode, BOOL bDirect, const ByteString* pKey ) +BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey ) { if( !rEleName.Len() ) return NULL; @@ -2875,7 +2875,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM { // create a new UCBStorageElement and insert it into the list pElement = new UCBStorageElement_Impl( rEleName ); - pElement->m_bIsInserted = TRUE; + pElement->m_bIsInserted = sal_True; pImp->m_aChildrenList.push_back( pElement ); } } @@ -2919,7 +2919,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM return NULL; } -UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect, const ByteString* pKey ) +UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey ) { String aName( m_aURL ); aName += '/'; @@ -2928,31 +2928,31 @@ UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pEle return pElement->m_xStream; } -BaseStorage* UCBStorage::OpenUCBStorage( const String& rEleName, StreamMode nMode, BOOL bDirect ) +BaseStorage* UCBStorage::OpenUCBStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect ) { if( !rEleName.Len() ) return NULL; - return OpenStorage_Impl( rEleName, nMode, bDirect, TRUE ); + return OpenStorage_Impl( rEleName, nMode, bDirect, sal_True ); } -BaseStorage* UCBStorage::OpenOLEStorage( const String& rEleName, StreamMode nMode, BOOL bDirect ) +BaseStorage* UCBStorage::OpenOLEStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect ) { if( !rEleName.Len() ) return NULL; - return OpenStorage_Impl( rEleName, nMode, bDirect, FALSE ); + return OpenStorage_Impl( rEleName, nMode, bDirect, sal_False ); } -BaseStorage* UCBStorage::OpenStorage( const String& rEleName, StreamMode nMode, BOOL bDirect ) +BaseStorage* UCBStorage::OpenStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect ) { if( !rEleName.Len() ) return NULL; - return OpenStorage_Impl( rEleName, nMode, bDirect, TRUE ); + return OpenStorage_Impl( rEleName, nMode, bDirect, sal_True ); } -BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nMode, BOOL bDirect, BOOL bForceUCBStorage ) +BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nMode, sal_Bool bDirect, sal_Bool bForceUCBStorage ) { // try to find the storage element UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); @@ -2965,8 +2965,8 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM String aName( pImp->m_aURL ); aName += '/'; aName += rEleName; // ??? - UCBStorage *pStorage = new UCBStorage( aName, nMode, bDirect, FALSE, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); - pStorage->pImp->m_bIsRoot = FALSE; + UCBStorage *pStorage = new UCBStorage( aName, nMode, bDirect, sal_False, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); + pStorage->pImp->m_bIsRoot = sal_False; pStorage->pImp->m_bListCreated = sal_True; // the storage is pretty new, nothing to read pStorage->SetError( GetError() ); return pStorage; @@ -2976,7 +2976,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM // problem: perhaps an OLEStorage should be created ?! // Because nothing is known about the element that should be created, an external parameter is needed ! pElement = new UCBStorageElement_Impl( rEleName ); - pElement->m_bIsInserted = TRUE; + pElement->m_bIsInserted = sal_True; pImp->m_aChildrenList.push_back( pElement ); } @@ -3003,7 +3003,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM pElement->m_xStream->PrepareCachedForReopen( nMode ); pElement->m_xStream->Init(); - pElement->m_bIsStorage = TRUE; + pElement->m_bIsStorage = sal_True; return pElement->m_xStream->CreateStorage(); // can only be created in transacted mode } else if ( pElement->m_xStorage.Is() ) @@ -3016,13 +3016,13 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM } else { - BOOL bIsWritable = (( pElement->m_xStorage->m_nMode & STREAM_WRITE ) != 0); + sal_Bool bIsWritable = (( pElement->m_xStorage->m_nMode & STREAM_WRITE ) != 0); if ( !bIsWritable && (( nMode & STREAM_WRITE ) != 0 )) { String aName( pImp->m_aURL ); aName += '/'; aName += pElement->m_aOriginalName; - UCBStorage* pStorage = new UCBStorage( aName, nMode, bDirect, FALSE, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); + UCBStorage* pStorage = new UCBStorage( aName, nMode, bDirect, sal_False, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); pElement->m_xStorage = pStorage->pImp; return pStorage; } @@ -3035,7 +3035,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM else if ( !pElement->m_xStream.Is() ) { // storage is opened the first time - BOOL bIsWritable = (( pImp->m_nMode & STREAM_WRITE ) != 0 ); + sal_Bool bIsWritable = (( pImp->m_nMode & STREAM_WRITE ) != 0 ); if ( pImp->m_bIsLinked && pImp->m_bIsRoot && bIsWritable ) { // make sure that the root storage object has been created before substorages will be created @@ -3045,7 +3045,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM Content aFolder( aFolderObj.GetMainURL( INetURLObject::NO_DECODE ), Reference < XCommandEnvironment >() ); pImp->m_pContent = new Content; - BOOL bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, pImp->m_aName, *pImp->m_pContent ); + sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, pImp->m_aName, *pImp->m_pContent ); if ( !bRet ) { SetError( SVSTREAM_CANNOT_MAKE ); @@ -3066,31 +3066,31 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM return NULL; } -UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect ) +UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect ) { UCBStorage_Impl* pRet = NULL; String aName( m_aURL ); aName += '/'; aName += pElement->m_aOriginalName; // ??? - pElement->m_bIsStorage = pElement->m_bIsFolder = TRUE; + pElement->m_bIsStorage = pElement->m_bIsFolder = sal_True; if ( m_bIsLinked && !::utl::UCBContentHelper::Exists( aName ) ) { Content aNewFolder; - BOOL bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, pElement->m_aOriginalName, aNewFolder ); + sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, pElement->m_aOriginalName, aNewFolder ); if ( bRet ) - pRet = new UCBStorage_Impl( aNewFolder, aName, nMode, NULL, bDirect, FALSE, m_bRepairPackage, m_xProgressHandler ); + pRet = new UCBStorage_Impl( aNewFolder, aName, nMode, NULL, bDirect, sal_False, m_bRepairPackage, m_xProgressHandler ); } else { - pRet = new UCBStorage_Impl( aName, nMode, NULL, bDirect, FALSE, m_bRepairPackage, m_xProgressHandler ); + pRet = new UCBStorage_Impl( aName, nMode, NULL, bDirect, sal_False, m_bRepairPackage, m_xProgressHandler ); } if ( pRet ) { pRet->m_bIsLinked = m_bIsLinked; - pRet->m_bIsRoot = FALSE; + pRet->m_bIsRoot = sal_False; // if name has been changed before creating the stream: set name! pRet->m_aName = pElement->m_aOriginalName; @@ -3103,41 +3103,41 @@ UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement, return pRet; } -BOOL UCBStorage::IsStorage( const String& rEleName ) const +sal_Bool UCBStorage::IsStorage( const String& rEleName ) const { if( !rEleName.Len() ) - return FALSE; + return sal_False; const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); return ( pElement && pElement->m_bIsStorage ); } -BOOL UCBStorage::IsStream( const String& rEleName ) const +sal_Bool UCBStorage::IsStream( const String& rEleName ) const { if( !rEleName.Len() ) - return FALSE; + return sal_False; const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); return ( pElement && !pElement->m_bIsStorage ); } -BOOL UCBStorage::IsContained( const String & rEleName ) const +sal_Bool UCBStorage::IsContained( const String & rEleName ) const { if( !rEleName.Len() ) - return FALSE; + return sal_False; const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); return ( pElement != NULL ); } -BOOL UCBStorage::Remove( const String& rEleName ) +sal_Bool UCBStorage::Remove( const String& rEleName ) { if( !rEleName.Len() ) - return FALSE; + return sal_False; UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); if ( pElement ) { - pElement->m_bIsRemoved = TRUE; + pElement->m_bIsRemoved = sal_True; } else SetError( SVSTREAM_FILE_NOT_FOUND ); @@ -3145,16 +3145,16 @@ BOOL UCBStorage::Remove( const String& rEleName ) return ( pElement != NULL ); } -BOOL UCBStorage::Rename( const String& rEleName, const String& rNewName ) +sal_Bool UCBStorage::Rename( const String& rEleName, const String& rNewName ) { if( !rEleName.Len()|| !rNewName.Len() ) - return FALSE; + return sal_False; UCBStorageElement_Impl *pAlreadyExisting = FindElement_Impl( rNewName ); if ( pAlreadyExisting ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; // can't change to a name that is already used + return sal_False; // can't change to a name that is already used } UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); @@ -3168,10 +3168,10 @@ BOOL UCBStorage::Rename( const String& rEleName, const String& rNewName ) return pElement != NULL; } -BOOL UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const String& rNewName ) +sal_Bool UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const String& rNewName ) { if( !rEleName.Len() || !rNewName.Len() ) - return FALSE; + return sal_False; if ( pNewSt == ((BaseStorage*) this) && !FindElement_Impl( rNewName ) ) { @@ -3195,31 +3195,31 @@ BOOL UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const Stri } */ // MoveTo is done by first copying to the new destination and then removing the old element - BOOL bRet = CopyTo( rEleName, pNewSt, rNewName ); + sal_Bool bRet = CopyTo( rEleName, pNewSt, rNewName ); if ( bRet ) bRet = Remove( rEleName ); return bRet; } } -BOOL UCBStorage::ValidateFAT() +sal_Bool UCBStorage::ValidateFAT() { // ??? - return TRUE; + return sal_True; } -BOOL UCBStorage::Validate( BOOL bWrite ) const +sal_Bool UCBStorage::Validate( sal_Bool bWrite ) const { // ??? return ( !bWrite || ( pImp->m_nMode & STREAM_WRITE ) ); } -BOOL UCBStorage::ValidateMode( StreamMode m ) const +sal_Bool UCBStorage::ValidateMode( StreamMode m ) const { // ??? if( m == ( STREAM_READ | STREAM_TRUNC ) ) // from stg.cxx - return TRUE; - USHORT nCurMode = 0xFFFF; + return sal_True; + sal_uInt16 nCurMode = 0xFFFF; if( ( m & 3 ) == STREAM_READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed @@ -3227,7 +3227,7 @@ BOOL UCBStorage::ValidateMode( StreamMode m ) const && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) || ( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) - return TRUE; + return sal_True; } else { @@ -3236,10 +3236,10 @@ BOOL UCBStorage::ValidateMode( StreamMode m ) const // the commit may fail if( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) - return TRUE; + return sal_True; } - return TRUE; + return sal_True; } const SvStream* UCBStorage::GetSvStream() const @@ -3249,13 +3249,13 @@ const SvStream* UCBStorage::GetSvStream() const return pImp->m_pSource; } -BOOL UCBStorage::Equals( const BaseStorage& rStorage ) const +sal_Bool UCBStorage::Equals( const BaseStorage& rStorage ) const { // ??? return ((BaseStorage*)this) == &rStorage; } -BOOL UCBStorage::IsStorageFile( const String& rFileName ) +sal_Bool UCBStorage::IsStorageFile( const String& rFileName ) { String aFileURL = rFileName; INetURLObject aObj( aFileURL ); @@ -3267,27 +3267,27 @@ BOOL UCBStorage::IsStorageFile( const String& rFileName ) } SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aFileURL, STREAM_STD_READ ); - BOOL bRet = UCBStorage::IsStorageFile( pStm ); + sal_Bool bRet = UCBStorage::IsStorageFile( pStm ); delete pStm; return bRet; } -BOOL UCBStorage::IsStorageFile( SvStream* pFile ) +sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) { if ( !pFile ) - return FALSE; + return sal_False; - ULONG nPos = pFile->Tell(); + sal_uLong nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); if ( pFile->Tell() < 4 ) - return FALSE; + return sal_False; pFile->Seek(0); - UINT32 nBytes; + sal_uInt32 nBytes; *pFile >> nBytes; // search for the magic bytes - BOOL bRet = ( nBytes == 0x04034b50 ); + sal_Bool bRet = ( nBytes == 0x04034b50 ); if ( !bRet ) { // disk spanned file have an additional header in front of the usual one @@ -3303,22 +3303,22 @@ BOOL UCBStorage::IsStorageFile( SvStream* pFile ) return bRet; } -BOOL UCBStorage::IsDiskSpannedFile( SvStream* pFile ) +sal_Bool UCBStorage::IsDiskSpannedFile( SvStream* pFile ) { if ( !pFile ) - return FALSE; + return sal_False; - ULONG nPos = pFile->Tell(); + sal_uLong nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); if ( !pFile->Tell() ) - return FALSE; + return sal_False; pFile->Seek(0); - UINT32 nBytes; + sal_uInt32 nBytes; *pFile >> nBytes; // disk spanned file have an additional header in front of the usual one - BOOL bRet = ( nBytes == 0x08074b50 ); + sal_Bool bRet = ( nBytes == 0x08074b50 ); if ( bRet ) { *pFile >> nBytes; @@ -3332,13 +3332,13 @@ BOOL UCBStorage::IsDiskSpannedFile( SvStream* pFile ) String UCBStorage::GetLinkedFile( SvStream &rStream ) { String aString; - ULONG nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); rStream.Seek( STREAM_SEEK_TO_END ); if ( !rStream.Tell() ) return aString; rStream.Seek(0); - UINT32 nBytes; + sal_uInt32 nBytes; rStream >> nBytes; if( nBytes == 0x04034b50 ) { @@ -3368,7 +3368,7 @@ String UCBStorage::CreateLinkFile( const String& rName ) SvStream* pStream = pTempFile->GetStream( STREAM_STD_READWRITE | STREAM_TRUNC ); // write header - *pStream << ( UINT32 ) 0x04034b50; + *pStream << ( sal_uInt32 ) 0x04034b50; // assemble a new folder name in the destination folder INetURLObject aObj( rName ); @@ -3379,7 +3379,7 @@ String UCBStorage::CreateLinkFile( const String& rName ) // create a folder and store its URL Content aFolder( aFolderURL, Reference < XCommandEnvironment >() ); Content aNewFolder; - BOOL bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, aTitle, aNewFolder ); + sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, aTitle, aNewFolder ); if ( !bRet ) { aFolderObj.insertName( aTitle ); @@ -3425,15 +3425,15 @@ String UCBStorage::CreateLinkFile( const String& rName ) return aURL; } - pTempFile->EnableKillingFile( TRUE ); + pTempFile->EnableKillingFile( sal_True ); delete pTempFile; return String(); } -BOOL UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) { if ( rName.CompareToAscii("Title") == COMPARE_EQUAL ) - return FALSE; + return sal_False; if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL ) { @@ -3447,38 +3447,38 @@ BOOL UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno:: if ( pImp->GetContent() ) { pImp->m_pContent->setPropertyValue( rName, rValue ); - return TRUE; + return sal_True; } } catch ( Exception& ) { } - return FALSE; + return sal_False; } -BOOL UCBStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) { try { if ( pImp->GetContent() ) { rValue = pImp->m_pContent->getPropertyValue( rName ); - return TRUE; + return sal_True; } } catch ( Exception& ) { } - return FALSE; + return sal_False; } -BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ) { UCBStorageElement_Impl *pEle = FindElement_Impl( rEleName ); if ( !pEle ) - return FALSE; + return sal_False; if ( !pEle->m_bIsFolder ) { @@ -3487,7 +3487,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com if ( pEle->m_xStream->m_nError ) { pEle->m_xStream.Clear(); - return FALSE; + return sal_False; } try @@ -3495,7 +3495,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com if ( pEle->m_xStream->m_pContent ) { rValue = pEle->m_xStream->m_pContent->getPropertyValue( rName ); - return TRUE; + return sal_True; } } catch ( Exception& ) @@ -3509,7 +3509,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com if ( pEle->m_xStorage->m_nError ) { pEle->m_xStorage.Clear(); - return FALSE; + return sal_False; } try @@ -3517,7 +3517,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com if ( pEle->m_xStorage->GetContent() ) { rValue = pEle->m_xStorage->m_pContent->getPropertyValue( rName ); - return TRUE; + return sal_True; } } catch ( Exception& ) @@ -3525,7 +3525,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com } } - return FALSE; + return sal_False; } UNOStorageHolderList* UCBStorage::GetUNOStorageHolderList() diff --git a/sot/source/sdstor/unostorageholder.cxx b/sot/source/sdstor/unostorageholder.cxx index 4e593a066d83..dcfdfa134480 100644 --- a/sot/source/sdstor/unostorageholder.cxx +++ b/sot/source/sdstor/unostorageholder.cxx @@ -37,7 +37,7 @@ #include <comphelper/processfactory.hxx> #include "unostorageholder.hxx" -#include <storinfo.hxx> +#include <sot/storinfo.hxx> using namespace ::com::sun::star; @@ -134,7 +134,7 @@ void SAL_CALL UNOStorageHolder::commited( const lang::EventObject& /*aEvent*/ ) xComp->dispose(); - SotStorageRef rTempStorage = new SotStorage( TRUE, aTmpStorFile.GetURL(), STREAM_WRITE, STORAGE_TRANSACTED ); + SotStorageRef rTempStorage = new SotStorage( sal_True, aTmpStorFile.GetURL(), STREAM_WRITE, STORAGE_TRANSACTED ); if ( !rTempStorage.Is() || rTempStorage->GetError() != ERRCODE_NONE ) throw uno::RuntimeException(); diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index a3676da700d3..696e0cefed93 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -70,34 +70,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImp return pRet; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) ); - - uno::Reference< registry::XRegistryKey > xNewKey; - - xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - OLESimpleStorage::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); - - const uno::Sequence< ::rtl::OUString > &rServices = OLESimpleStorage::impl_staticGetSupportedServiceNames(); - for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ ) - xNewKey->createKey( rServices.getConstArray()[ind] ); - - return sal_True; - } - catch (registry::InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} - } // extern "C" /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index 059857be6e5d..a50bfb9ae227 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -40,7 +40,7 @@ #include <cppuhelper/exc_hlp.hxx> -#include <storinfo.hxx> +#include <sot/storinfo.hxx> #include "xolesimplestorage.hxx" diff --git a/sot/source/unoolestorage/xolesimplestorage.hxx b/sot/source/unoolestorage/xolesimplestorage.hxx index 816119f844ad..3761807acca3 100644 --- a/sot/source/unoolestorage/xolesimplestorage.hxx +++ b/sot/source/unoolestorage/xolesimplestorage.hxx @@ -44,7 +44,7 @@ #include <osl/mutex.hxx> -#include <stg.hxx> +#include <sot/stg.hxx> class OLESimpleStorage : public ::cppu::WeakImplHelper3 diff --git a/sot/util/makefile.mk b/sot/util/makefile.mk deleted file mode 100644 index 60b34c356217..000000000000 --- a/sot/util/makefile.mk +++ /dev/null @@ -1,81 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -PRJNAME=sot -TARGET=sot - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -LIB1TARGET= $(SLB)$/$(TARGET).lib -.IF "$(GUI)$(COM)"=="WNTGCC" -LIB1ARCHIV= $(LB)$/lib$(TARGET)$(DLLPOSTFIX)_static.a -.ELSE -LIB1ARCHIV= $(LB)$/lib$(TARGET)$(DLLPOSTFIX).a -.ENDIF -LIB1FILES= $(SLB)$/base.lib \ - $(SLB)$/sdstor.lib \ - $(SLB)$/unoolestorage.lib - -SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -SHL1IMPLIB= $(TARGET) -SHL1USE_EXPORTS=name -SHL1LIBS= $(SLB)$/$(TARGET).lib - -SHL1STDLIBS=$(TOOLSLIB) $(SALLIB) $(UNOTOOLSLIB) $(CPPUHELPERLIB) $(COMPHELPERLIB) $(UCBHELPERLIB) $(CPPULIB) - -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME =$(SHL1TARGET) -DEF1DEPN =$(MISC)$/$(SHL1TARGET).flt \ - $(PRJ)$/inc$/absdev.hxx \ - $(PRJ)$/inc$/agg.hxx \ - $(PRJ)$/inc$/sot$/exchange.hxx \ - $(PRJ)$/inc$/sot$/factory.hxx \ - $(PRJ)$/inc$/sot$/object.hxx \ - $(PRJ)$/inc$/sot$/sotdata.hxx \ - $(PRJ)$/inc$/sot$/sotref.hxx \ - $(PRJ)$/inc$/stg.hxx \ - $(PRJ)$/inc$/sot$/storage.hxx \ - $(PRJ)$/inc$/storinfo.hxx -DEFLIB1NAME =$(TARGET) -DEF1DES =StarObjectsTools - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - -$(MISC)$/$(SHL1TARGET).flt: makefile.mk - @echo ------------------------------ - @echo Making: $@ - $(TYPE) sot.flt > $@ - diff --git a/sot/util/sot.component b/sot/util/sot.component new file mode 100644 index 000000000000..7d17c7d54475 --- /dev/null +++ b/sot/util/sot.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.embed.OLESimpleStorage"> + <service name="com.sun.star.embed.OLESimpleStorage"/> + </implementation> +</component> |