From c2c78301270fb56b405f31b215c4acbb44669f10 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 20 Apr 2010 08:42:04 +0200 Subject: CWS gnumake2: move all delivered sot headers to inc/sot --- sot/inc/absdev.hxx | 48 --- sot/inc/agg.hxx | 68 ----- sot/inc/clsids.hxx | 33 -- sot/inc/filelist.hxx | 76 ----- sot/inc/sot/absdev.hxx | 48 +++ sot/inc/sot/agg.hxx | 68 +++++ sot/inc/sot/clsids.hxx | 33 ++ sot/inc/sot/filelist.hxx | 76 +++++ sot/inc/sot/stg.hxx | 398 +++++++++++++++++++++++++ sot/inc/sot/storinfo.hxx | 72 +++++ sot/inc/stg.hxx | 398 ------------------------- sot/inc/storinfo.hxx | 72 ----- sot/prj/d.lst | 17 +- sot/source/base/exchange.cxx | 2 +- sot/source/base/factory.cxx | 2 +- sot/source/base/filelist.cxx | 2 +- sot/source/base/formats.cxx | 4 +- sot/source/base/object.cxx | 2 +- sot/source/sdstor/sdintern.hdb | 22 -- sot/source/sdstor/stg.cxx | 4 +- sot/source/sdstor/stgcache.cxx | 2 +- sot/source/sdstor/stgdir.cxx | 2 +- sot/source/sdstor/stgelem.cxx | 2 +- sot/source/sdstor/stgelem.hxx | 2 +- sot/source/sdstor/stgio.cxx | 2 +- sot/source/sdstor/stgole.cxx | 2 +- sot/source/sdstor/stgole.hxx | 2 +- sot/source/sdstor/stgstrms.cxx | 2 +- sot/source/sdstor/storage.cxx | 4 +- sot/source/sdstor/storinfo.cxx | 4 +- sot/source/sdstor/ucbstorage.cxx | 6 +- sot/source/sdstor/unostorageholder.cxx | 2 +- sot/source/unoolestorage/xolesimplestorage.cxx | 2 +- sot/source/unoolestorage/xolesimplestorage.hxx | 2 +- sot/util/makefile.mk | 8 +- 35 files changed, 727 insertions(+), 762 deletions(-) delete mode 100644 sot/inc/absdev.hxx delete mode 100644 sot/inc/agg.hxx delete mode 100644 sot/inc/clsids.hxx delete mode 100644 sot/inc/filelist.hxx create mode 100644 sot/inc/sot/absdev.hxx create mode 100644 sot/inc/sot/agg.hxx create mode 100644 sot/inc/sot/clsids.hxx create mode 100644 sot/inc/sot/filelist.hxx create mode 100644 sot/inc/sot/stg.hxx create mode 100644 sot/inc/sot/storinfo.hxx delete mode 100644 sot/inc/stg.hxx delete mode 100644 sot/inc/storinfo.hxx delete mode 100644 sot/source/sdstor/sdintern.hdb (limited to 'sot') diff --git a/sot/inc/absdev.hxx b/sot/inc/absdev.hxx deleted file mode 100644 index 3d251d98e0b6..000000000000 --- a/sot/inc/absdev.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SOT_ABSDEV_HXX -#define _SOT_ABSDEV_HXX - -#ifndef _TOOLS_SOLAR_H -#include -#endif - -class JobSetup; -class AbstractDeviceData -{ -protected: - JobSetup * pJobSetup; -public: - virtual ~AbstractDeviceData() {} - virtual AbstractDeviceData * Copy() const = 0; - virtual BOOL Equals( const AbstractDeviceData & ) const = 0; - - JobSetup * GetJobSetup() const { return pJobSetup; } -}; - -#endif // _SOT_ABSDEV_HXX diff --git a/sot/inc/agg.hxx b/sot/inc/agg.hxx deleted file mode 100644 index 2f8cc7587458..000000000000 --- a/sot/inc/agg.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SOT_AGG_HXX -#define _SOT_AGG_HXX - -#include - -/************** class SvAggregate ***************************************/ -/************************************************************************/ -class SotFactory; -class SotObject; -struct SvAggregate -{ - union - { - SotFactory * pFact; - SotObject * pObj; - }; - BOOL bFactory; - BOOL bMainObj; // TRUE, das Objekt, welches das casting steuert - - SvAggregate() - : pFact( NULL ) - , bFactory( FALSE ) - , bMainObj( FALSE ) {} - SvAggregate( SotObject * pObjP, BOOL bMainP ) - : pObj( pObjP ) - , bFactory( FALSE ) - , bMainObj( bMainP ) {} - SvAggregate( SotFactory * pFactP ) - : pFact( pFactP ) - , bFactory( TRUE ) - , bMainObj( FALSE ) {} -}; - -/************** class SvAggregateMemberList *****************************/ -/************************************************************************/ -class SvAggregateMemberList -{ - PRV_SV_DECL_OWNER_LIST(SvAggregateMemberList,SvAggregate) -}; - -#endif // _AGG_HXX diff --git a/sot/inc/clsids.hxx b/sot/inc/clsids.hxx deleted file mode 100644 index a64df510dd07..000000000000 --- a/sot/inc/clsids.hxx +++ /dev/null @@ -1,33 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SOT_CLSIDS_HXX -#define _SOT_CLSIDS_HXX - -// all the definitions of the class ids are moved to the comphelper -#include - -#endif diff --git a/sot/inc/filelist.hxx b/sot/inc/filelist.hxx deleted file mode 100644 index 4c6c55534319..000000000000 --- a/sot/inc/filelist.hxx +++ /dev/null @@ -1,76 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _FILELIST_HXX -#define _FILELIST_HXX - -#include -#include "sot/sotdllapi.h" - -class FileStringList; - -class SOT_DLLPUBLIC FileList : public SvDataCopyStream -{ - FileStringList* pStrList; - -protected: - - // SvData-Methoden - virtual void Load( SvStream& ); - virtual void Save( SvStream& ); - virtual void Assign( const SvDataCopyStream& ); - - // Liste loeschen; - void ClearAll( void ); - -public: - - TYPEINFO(); - FileList(); - ~FileList(); - - // Zuweisungsoperator - FileList& operator=( const FileList& rFileList ); - - - // Im-/Export - SOT_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const FileList& rFileList ); - SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList ); - - // Clipboard, D&D usw. - static ULONG GetFormat(); - - - // Liste fuellen/abfragen - void AppendFile( const String& rStr ); - String GetFile( ULONG i ) const; - ULONG Count( void ) const; - -}; - -#endif // _FILELIST_HXX - diff --git a/sot/inc/sot/absdev.hxx b/sot/inc/sot/absdev.hxx new file mode 100644 index 000000000000..3d251d98e0b6 --- /dev/null +++ b/sot/inc/sot/absdev.hxx @@ -0,0 +1,48 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SOT_ABSDEV_HXX +#define _SOT_ABSDEV_HXX + +#ifndef _TOOLS_SOLAR_H +#include +#endif + +class JobSetup; +class AbstractDeviceData +{ +protected: + JobSetup * pJobSetup; +public: + virtual ~AbstractDeviceData() {} + virtual AbstractDeviceData * Copy() const = 0; + virtual BOOL Equals( const AbstractDeviceData & ) const = 0; + + JobSetup * GetJobSetup() const { return pJobSetup; } +}; + +#endif // _SOT_ABSDEV_HXX diff --git a/sot/inc/sot/agg.hxx b/sot/inc/sot/agg.hxx new file mode 100644 index 000000000000..2f8cc7587458 --- /dev/null +++ b/sot/inc/sot/agg.hxx @@ -0,0 +1,68 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SOT_AGG_HXX +#define _SOT_AGG_HXX + +#include + +/************** class SvAggregate ***************************************/ +/************************************************************************/ +class SotFactory; +class SotObject; +struct SvAggregate +{ + union + { + SotFactory * pFact; + SotObject * pObj; + }; + BOOL bFactory; + BOOL bMainObj; // TRUE, das Objekt, welches das casting steuert + + SvAggregate() + : pFact( NULL ) + , bFactory( FALSE ) + , bMainObj( FALSE ) {} + SvAggregate( SotObject * pObjP, BOOL bMainP ) + : pObj( pObjP ) + , bFactory( FALSE ) + , bMainObj( bMainP ) {} + SvAggregate( SotFactory * pFactP ) + : pFact( pFactP ) + , bFactory( TRUE ) + , bMainObj( FALSE ) {} +}; + +/************** class SvAggregateMemberList *****************************/ +/************************************************************************/ +class SvAggregateMemberList +{ + PRV_SV_DECL_OWNER_LIST(SvAggregateMemberList,SvAggregate) +}; + +#endif // _AGG_HXX diff --git a/sot/inc/sot/clsids.hxx b/sot/inc/sot/clsids.hxx new file mode 100644 index 000000000000..a64df510dd07 --- /dev/null +++ b/sot/inc/sot/clsids.hxx @@ -0,0 +1,33 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SOT_CLSIDS_HXX +#define _SOT_CLSIDS_HXX + +// all the definitions of the class ids are moved to the comphelper +#include + +#endif diff --git a/sot/inc/sot/filelist.hxx b/sot/inc/sot/filelist.hxx new file mode 100644 index 000000000000..4c6c55534319 --- /dev/null +++ b/sot/inc/sot/filelist.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FILELIST_HXX +#define _FILELIST_HXX + +#include +#include "sot/sotdllapi.h" + +class FileStringList; + +class SOT_DLLPUBLIC FileList : public SvDataCopyStream +{ + FileStringList* pStrList; + +protected: + + // SvData-Methoden + virtual void Load( SvStream& ); + virtual void Save( SvStream& ); + virtual void Assign( const SvDataCopyStream& ); + + // Liste loeschen; + void ClearAll( void ); + +public: + + TYPEINFO(); + FileList(); + ~FileList(); + + // Zuweisungsoperator + FileList& operator=( const FileList& rFileList ); + + + // Im-/Export + SOT_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const FileList& rFileList ); + SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList ); + + // Clipboard, D&D usw. + static ULONG GetFormat(); + + + // Liste fuellen/abfragen + void AppendFile( const String& rStr ); + String GetFile( ULONG i ) const; + ULONG Count( void ) const; + +}; + +#endif // _FILELIST_HXX + diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx new file mode 100644 index 000000000000..84373e26d596 --- /dev/null +++ b/sot/inc/sot/stg.hxx @@ -0,0 +1,398 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _STG_HXX +#define _STG_HXX + +#include +#include + +#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_H_ +#include +#endif + +#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_H_ +#include +#endif + +#ifndef _COM_SUN_STAR_EMBED_XSTORAGE_H_ +#include +#endif + + +#include +#ifndef _TOOLS_STREAM_HXX //autogen +#include +#endif +#ifndef _TOOLS_GLOBNAME_HXX //autogen +#include +#endif +#include "sot/sotdllapi.h" + +#include +class UNOStorageHolder; +typedef ::std::list< UNOStorageHolder* > UNOStorageHolderList; + +class Storage; +class StorageStream; +class StgIo; +class StgDirEntry; +class StgStrm; +class SvGlobalName; +struct ClsId +{ + INT32 n1; + INT16 n2, n3; + UINT8 n4, n5, n6, n7, n8, n9, n10, n11; +}; + +class SOT_DLLPUBLIC StorageBase : public SvRefBase +{ +protected: + ULONG m_nError; // error code + StreamMode m_nMode; // open mode + 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; + void ResetError() const; + void SetError( ULONG ) const; + ULONG GetError() const; + BOOL Good() const { return BOOL( m_nError == SVSTREAM_OK ); } + StreamMode GetMode() const { return m_nMode; } + void SetAutoCommit( BOOL bSet ) + { m_bAutoCommit = bSet; } +}; + +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 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; +}; + +class SvStorageInfoList; +class BaseStorage : public StorageBase +{ +public: + TYPEINFO(); + virtual const String& GetName() const = 0; + virtual 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, + const String & rUserTypeName ) = 0; + virtual void SetConvertClass( const SvGlobalName & rConvertClass, + ULONG nOriginalClipFormat, + const String & rUserTypeName ) = 0; + virtual SvGlobalName GetClassName() = 0; + virtual ULONG GetFormat() = 0; + virtual String GetUserName() = 0; + virtual 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 BaseStorageStream* OpenStream( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = TRUE, const ByteString* pKey=0 ) = 0; + virtual BaseStorage* OpenStorage( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = FALSE ) = 0; + virtual BaseStorage* OpenUCBStorage( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = 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; +}; + +class OLEStorageBase +{ +protected: + StreamMode& nStreamMode; // open mode + StgIo* pIo; // I/O subsystem + StgDirEntry* pEntry; // the dir entry + OLEStorageBase( StgIo*, StgDirEntry*, StreamMode& ); + ~OLEStorageBase(); + BOOL Validate_Impl( BOOL=FALSE ) const; + BOOL ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ; + const SvStream* GetSvStream_Impl() const; +public: +}; + +class StorageStream : public BaseStorageStream, public OLEStorageBase +{ +//friend class Storage; + 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 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; + const SvStream* GetSvStream() const; + virtual BOOL Equals( const BaseStorageStream& rStream ) const; +}; + +class UCBStorageStream; + +class SOT_DLLPUBLIC Storage : public BaseStorage, public OLEStorageBase +{ + String aName; + BOOL bIsRoot; + void Init( 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 ); + + static BOOL IsStorageFile( const String & rFileName ); + static BOOL IsStorageFile( SvStream* ); + + virtual const String& GetName() const; + virtual 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, + const String & rUserTypeName ); + virtual void SetConvertClass( const SvGlobalName & rConvertClass, + ULONG nOriginalClipFormat, + const String & rUserTypeName ); + virtual SvGlobalName GetClassName(); + virtual ULONG GetFormat(); + virtual String GetUserName(); + virtual BOOL ShouldConvert(); + virtual void FillInfoList( SvStorageInfoList* ) const; + virtual BOOL CopyTo( BaseStorage* pDestStg ) const; + virtual BOOL Commit(); + virtual BOOL Revert(); + virtual BaseStorageStream* OpenStream( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = TRUE, const ByteString* pKey=0 ); + virtual BaseStorage* OpenStorage( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = FALSE ); + virtual BaseStorage* OpenUCBStorage( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = 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; + virtual const SvStream* GetSvStream() const; + virtual BOOL Equals( const BaseStorage& rStream ) const; +}; + +class UCBStorageStream_Impl; +class UCBStorageStream : public BaseStorageStream +{ +friend class UCBStorage; + + UCBStorageStream_Impl* + pImp; +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( 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 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; + 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 ); + + SvStream* GetModifySvStream(); + + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetXInputStream() const; +}; + +namespace ucbhelper +{ + class Content; +} + +class UCBStorage_Impl; +struct UCBStorageElement_Impl; +class SOT_DLLPUBLIC UCBStorage : public BaseStorage +{ + UCBStorage_Impl* pImp; + +protected: + ~UCBStorage(); +public: + static BOOL IsStorageFile( SvStream* ); + static BOOL IsStorageFile( const String& rName ); + static 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 String& rName, + StreamMode nMode, + BOOL bDirect = TRUE, + BOOL bIsRoot = TRUE ); + + UCBStorage( const String& rName, + StreamMode nMode, + BOOL bDirect, + BOOL bIsRoot, + BOOL bIsRepair, + ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > + xProgressHandler ); + + UCBStorage( UCBStorage_Impl* ); + UCBStorage( SvStream& rStrm, BOOL bDirect = TRUE ); + + TYPEINFO(); + virtual const String& GetName() const; + virtual BOOL IsRoot() const; + virtual void SetClassId( const ClsId& ); + virtual const ClsId& GetClassId() const; + virtual void SetDirty(); + virtual void SetClass( const SvGlobalName & rClass, + ULONG nOriginalClipFormat, + const String & rUserTypeName ); + virtual void SetConvertClass( const SvGlobalName & rConvertClass, + ULONG nOriginalClipFormat, + const String & rUserTypeName ); + virtual SvGlobalName GetClassName(); + virtual ULONG GetFormat(); + virtual String GetUserName(); + virtual BOOL ShouldConvert(); + virtual void FillInfoList( SvStorageInfoList* ) const; + virtual BOOL CopyTo( BaseStorage* pDestStg ) const; + virtual BOOL Commit(); + virtual BOOL Revert(); + virtual BaseStorageStream* OpenStream( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = TRUE, const ByteString* pKey=0 ); + virtual BaseStorage* OpenStorage( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = FALSE ); + virtual BaseStorage* OpenUCBStorage( const String & rEleName, + StreamMode = STREAM_STD_READWRITE, + BOOL bDirect = 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; + 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 ); + + // HACK to avoid incompatible build, can be done since this feature is only for development + // should be removed before release + UNOStorageHolderList* GetUNOStorageHolderList(); + +//#if _SOLAR__PRIVATE + UCBStorageElement_Impl* FindElement_Impl( const String& rName ) const; + BOOL CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, + BaseStorage* pDest, const String& rNew ) const; + BaseStorage* OpenStorage_Impl( const String & rEleName, + StreamMode, BOOL bDirect, BOOL bForceUCBStorage ); +//#endif + +}; + + +#endif diff --git a/sot/inc/sot/storinfo.hxx b/sot/inc/sot/storinfo.hxx new file mode 100644 index 000000000000..dab1f6d4540e --- /dev/null +++ b/sot/inc/sot/storinfo.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SOT_STORINFO_HXX +#define _SOT_STORINFO_HXX + +#include +#include +#include +#include "sot/sotdllapi.h" + +class StgDirEntry; +class SvStorageInfo +{ +friend class SvStorage; + String aName; + SvGlobalName aClassName; + ULONG nSize; + BOOL bStream:1, + bStorage:1; + + SvStorageInfo(){}; // Fuer SvStorage +public: + SvStorageInfo( const StgDirEntry& ); + SvStorageInfo( const String& rName, ULONG nSz, BOOL bIsStorage ) + : aName( rName ) + , nSize( nSz ) + , bStream( !bIsStorage ) + , bStorage( bIsStorage ) + {} + + 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; } +}; + +class SOT_DLLPUBLIC SvStorageInfoList +{ + PRV_SV_DECL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) + const SvStorageInfo * Get( const String & rName ); +}; + +SOT_DLLPUBLIC ULONG ReadClipboardFormat( SvStream & rStm ); +SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ); + +#endif // _STORINFO_HXX diff --git a/sot/inc/stg.hxx b/sot/inc/stg.hxx deleted file mode 100644 index 84373e26d596..000000000000 --- a/sot/inc/stg.hxx +++ /dev/null @@ -1,398 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _STG_HXX -#define _STG_HXX - -#include -#include - -#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_H_ -#include -#endif - -#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_H_ -#include -#endif - -#ifndef _COM_SUN_STAR_EMBED_XSTORAGE_H_ -#include -#endif - - -#include -#ifndef _TOOLS_STREAM_HXX //autogen -#include -#endif -#ifndef _TOOLS_GLOBNAME_HXX //autogen -#include -#endif -#include "sot/sotdllapi.h" - -#include -class UNOStorageHolder; -typedef ::std::list< UNOStorageHolder* > UNOStorageHolderList; - -class Storage; -class StorageStream; -class StgIo; -class StgDirEntry; -class StgStrm; -class SvGlobalName; -struct ClsId -{ - INT32 n1; - INT16 n2, n3; - UINT8 n4, n5, n6, n7, n8, n9, n10, n11; -}; - -class SOT_DLLPUBLIC StorageBase : public SvRefBase -{ -protected: - ULONG m_nError; // error code - StreamMode m_nMode; // open mode - 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; - void ResetError() const; - void SetError( ULONG ) const; - ULONG GetError() const; - BOOL Good() const { return BOOL( m_nError == SVSTREAM_OK ); } - StreamMode GetMode() const { return m_nMode; } - void SetAutoCommit( BOOL bSet ) - { m_bAutoCommit = bSet; } -}; - -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 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; -}; - -class SvStorageInfoList; -class BaseStorage : public StorageBase -{ -public: - TYPEINFO(); - virtual const String& GetName() const = 0; - virtual 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, - const String & rUserTypeName ) = 0; - virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, - const String & rUserTypeName ) = 0; - virtual SvGlobalName GetClassName() = 0; - virtual ULONG GetFormat() = 0; - virtual String GetUserName() = 0; - virtual 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 BaseStorageStream* OpenStream( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ) = 0; - virtual BaseStorage* OpenStorage( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ) = 0; - virtual BaseStorage* OpenUCBStorage( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = 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; -}; - -class OLEStorageBase -{ -protected: - StreamMode& nStreamMode; // open mode - StgIo* pIo; // I/O subsystem - StgDirEntry* pEntry; // the dir entry - OLEStorageBase( StgIo*, StgDirEntry*, StreamMode& ); - ~OLEStorageBase(); - BOOL Validate_Impl( BOOL=FALSE ) const; - BOOL ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ; - const SvStream* GetSvStream_Impl() const; -public: -}; - -class StorageStream : public BaseStorageStream, public OLEStorageBase -{ -//friend class Storage; - 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 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; - const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorageStream& rStream ) const; -}; - -class UCBStorageStream; - -class SOT_DLLPUBLIC Storage : public BaseStorage, public OLEStorageBase -{ - String aName; - BOOL bIsRoot; - void Init( 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 ); - - static BOOL IsStorageFile( const String & rFileName ); - static BOOL IsStorageFile( SvStream* ); - - virtual const String& GetName() const; - virtual 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, - const String & rUserTypeName ); - virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, - const String & rUserTypeName ); - virtual SvGlobalName GetClassName(); - virtual ULONG GetFormat(); - virtual String GetUserName(); - virtual BOOL ShouldConvert(); - virtual void FillInfoList( SvStorageInfoList* ) const; - virtual BOOL CopyTo( BaseStorage* pDestStg ) const; - virtual BOOL Commit(); - virtual BOOL Revert(); - virtual BaseStorageStream* OpenStream( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ); - virtual BaseStorage* OpenStorage( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); - virtual BaseStorage* OpenUCBStorage( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = 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; - virtual const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorage& rStream ) const; -}; - -class UCBStorageStream_Impl; -class UCBStorageStream : public BaseStorageStream -{ -friend class UCBStorage; - - UCBStorageStream_Impl* - pImp; -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( 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 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; - 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 ); - - SvStream* GetModifySvStream(); - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetXInputStream() const; -}; - -namespace ucbhelper -{ - class Content; -} - -class UCBStorage_Impl; -struct UCBStorageElement_Impl; -class SOT_DLLPUBLIC UCBStorage : public BaseStorage -{ - UCBStorage_Impl* pImp; - -protected: - ~UCBStorage(); -public: - static BOOL IsStorageFile( SvStream* ); - static BOOL IsStorageFile( const String& rName ); - static 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 String& rName, - StreamMode nMode, - BOOL bDirect = TRUE, - BOOL bIsRoot = TRUE ); - - UCBStorage( const String& rName, - StreamMode nMode, - BOOL bDirect, - BOOL bIsRoot, - BOOL bIsRepair, - ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > - xProgressHandler ); - - UCBStorage( UCBStorage_Impl* ); - UCBStorage( SvStream& rStrm, BOOL bDirect = TRUE ); - - TYPEINFO(); - virtual const String& GetName() const; - virtual BOOL IsRoot() const; - virtual void SetClassId( const ClsId& ); - virtual const ClsId& GetClassId() const; - virtual void SetDirty(); - virtual void SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, - const String & rUserTypeName ); - virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, - const String & rUserTypeName ); - virtual SvGlobalName GetClassName(); - virtual ULONG GetFormat(); - virtual String GetUserName(); - virtual BOOL ShouldConvert(); - virtual void FillInfoList( SvStorageInfoList* ) const; - virtual BOOL CopyTo( BaseStorage* pDestStg ) const; - virtual BOOL Commit(); - virtual BOOL Revert(); - virtual BaseStorageStream* OpenStream( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ); - virtual BaseStorage* OpenStorage( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); - virtual BaseStorage* OpenUCBStorage( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = 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; - 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 ); - - // HACK to avoid incompatible build, can be done since this feature is only for development - // should be removed before release - UNOStorageHolderList* GetUNOStorageHolderList(); - -//#if _SOLAR__PRIVATE - UCBStorageElement_Impl* FindElement_Impl( const String& rName ) const; - BOOL CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, - BaseStorage* pDest, const String& rNew ) const; - BaseStorage* OpenStorage_Impl( const String & rEleName, - StreamMode, BOOL bDirect, BOOL bForceUCBStorage ); -//#endif - -}; - - -#endif diff --git a/sot/inc/storinfo.hxx b/sot/inc/storinfo.hxx deleted file mode 100644 index dab1f6d4540e..000000000000 --- a/sot/inc/storinfo.hxx +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SOT_STORINFO_HXX -#define _SOT_STORINFO_HXX - -#include -#include -#include -#include "sot/sotdllapi.h" - -class StgDirEntry; -class SvStorageInfo -{ -friend class SvStorage; - String aName; - SvGlobalName aClassName; - ULONG nSize; - BOOL bStream:1, - bStorage:1; - - SvStorageInfo(){}; // Fuer SvStorage -public: - SvStorageInfo( const StgDirEntry& ); - SvStorageInfo( const String& rName, ULONG nSz, BOOL bIsStorage ) - : aName( rName ) - , nSize( nSz ) - , bStream( !bIsStorage ) - , bStorage( bIsStorage ) - {} - - 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; } -}; - -class SOT_DLLPUBLIC SvStorageInfoList -{ - PRV_SV_DECL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) - const SvStorageInfo * Get( const String & rName ); -}; - -SOT_DLLPUBLIC ULONG ReadClipboardFormat( SvStream & rStm ); -SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ); - -#endif // _STORINFO_HXX diff --git a/sot/prj/d.lst b/sot/prj/d.lst index 528b6863ef3c..29c92260e178 100644 --- a/sot/prj/d.lst +++ b/sot/prj/d.lst @@ -1,20 +1,7 @@ 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 +..\inc\sot/*.hxx %_DEST%\inc%_EXT%\sot\*.hxx +..\inc\sot\*.h %_DEST%\inc%_EXT%\sot\*.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% diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index 67c2b64f105f..d860c8b0f572 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index 4934f99e78c6..ca753265b082 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx index 4f854add304d..048f19e65bd7 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include TYPEINIT1_AUTOFACTORY( FileList, SvDataCopyStream ); diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index baddde6e716f..58b08fb53f18 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -34,8 +34,8 @@ #include #include -#include "filelist.hxx" -#include "clsids.hxx" +#include "sot/filelist.hxx" +#include "sot/clsids.hxx" #include #include diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 403a1c6bb61d..9af1b441b37a 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include /************** class SvAggregateMemberList *****************************/ /************************************************************************/ diff --git a/sot/source/sdstor/sdintern.hdb b/sot/source/sdstor/sdintern.hdb deleted file mode 100644 index 4dfbc69be013..000000000000 --- a/sot/source/sdstor/sdintern.hdb +++ /dev/null @@ -1,22 +0,0 @@ -write "/*************************************************************************" -write "* SDINTERN.HXX" -write "* __DATE__" -write "* (c) 1992-1995 STAR DIVISION" -write "*************************************************************************/" -write "#ifndef _SDINTERN_HXX" -write "#define _SDINTERN_HXX" -write "#ifndef _SOLAR_H" -write "#include " -write "#endif" -write "#ifndef _STREAM_HXX" -write "#include " -write "#endif" -file stg.hxx -file stgelem.hxx -file stgcache.hxx -file stgio.hxx -file stgstrms.hxx -file stgavl.hxx -file stgdir.hxx -write "#endif" - diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 1c749aa05cb8..c057b2d0aac0 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sot.hxx" -#include +#include #include #include #include @@ -42,7 +42,7 @@ #include #include -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index 88a8187ee9dd..f4461383c0ba 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -41,7 +41,7 @@ #include #include -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index f093dc60cbe7..504fed55ce4d 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -30,7 +30,7 @@ #include // memcpy() -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index 46d7f1803140..b140c7fb27e2 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -32,7 +32,7 @@ #include #include #include -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx index 7a5b7bc52b26..951d3503adbc 100644 --- a/sot/source/sdstor/stgelem.hxx +++ b/sot/source/sdstor/stgelem.hxx @@ -35,7 +35,7 @@ #include #endif -#include +#include class StgIo; class SvStream; diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 00dd454233e2..fab908716a37 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -28,7 +28,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" diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 148f1e87585c..0bb5887eed76 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -31,7 +31,7 @@ #include "rtl/string.h" #include "rtl/string.h" #include "stgole.hxx" -#include "storinfo.hxx" // Read/WriteClipboardFormat() +#include "sot/storinfo.hxx" // Read/WriteClipboardFormat() #include #if defined(_MSC_VER) && (_MSC_VER>=1400) diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 346f21035f06..a9eebe1aae68 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -30,7 +30,7 @@ #include // memset() -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" class StgInternalStream : public SvStream diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 07711133bf4b..cd56c1f62464 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -34,7 +34,7 @@ #include #include -#include "stg.hxx" +#include "sot/stg.hxx" #include "stgelem.hxx" #include "stgcache.hxx" #include "stgstrms.hxx" diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 136abb29a98e..e09c5fc864fc 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -35,8 +35,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 2aaaadd5a151..f912dc6fc83f 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -28,8 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sot.hxx" -#include -#include +#include +#include #include diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index ea3b656272db..4f265490a05e 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -66,12 +66,12 @@ #include #include -#include "stg.hxx" -#include "storinfo.hxx" +#include "sot/stg.hxx" +#include "sot/storinfo.hxx" #include #include #include -#include "clsids.hxx" +#include "sot/clsids.hxx" #include "unostorageholder.hxx" diff --git a/sot/source/sdstor/unostorageholder.cxx b/sot/source/sdstor/unostorageholder.cxx index 55c205557648..6224925c1820 100644 --- a/sot/source/sdstor/unostorageholder.cxx +++ b/sot/source/sdstor/unostorageholder.cxx @@ -36,7 +36,7 @@ #include #include "unostorageholder.hxx" -#include +#include using namespace ::com::sun::star; diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index 68686ff8c8f5..478309330e80 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -39,7 +39,7 @@ #include -#include +#include #include "xolesimplestorage.hxx" diff --git a/sot/source/unoolestorage/xolesimplestorage.hxx b/sot/source/unoolestorage/xolesimplestorage.hxx index c9f1b5c68b0a..18bd6ee64f9e 100644 --- a/sot/source/unoolestorage/xolesimplestorage.hxx +++ b/sot/source/unoolestorage/xolesimplestorage.hxx @@ -43,7 +43,7 @@ #include -#include +#include class OLESimpleStorage : public ::cppu::WeakImplHelper3 diff --git a/sot/util/makefile.mk b/sot/util/makefile.mk index 60b34c356217..cd1af59a5879 100644 --- a/sot/util/makefile.mk +++ b/sot/util/makefile.mk @@ -57,16 +57,16 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME =$(SHL1TARGET) DEF1DEPN =$(MISC)$/$(SHL1TARGET).flt \ - $(PRJ)$/inc$/absdev.hxx \ - $(PRJ)$/inc$/agg.hxx \ + $(PRJ)$/inc$/sot/absdev.hxx \ + $(PRJ)$/inc$/sot/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/stg.hxx \ $(PRJ)$/inc$/sot$/storage.hxx \ - $(PRJ)$/inc$/storinfo.hxx + $(PRJ)$/inc$/sot/storinfo.hxx DEFLIB1NAME =$(TARGET) DEF1DES =StarObjectsTools -- cgit From 69309ccb20edfb92dc789eb781ed779cd1f2d9b8 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 7 Jun 2010 13:35:35 +0200 Subject: sb123:#i111449# cleanups in sot qa/complex tests --- sot/prj/build.lst | 16 +++-- .../olesimplestorage/OLESimpleStorageUnitTest.java | 79 +++++++++++++++++----- sot/qa/complex/olesimplestorage/Test01.java | 20 +++--- sot/qa/complex/olesimplestorage/TestHelper.java | 15 ++-- sot/qa/complex/olesimplestorage/makefile.mk | 66 ++++++------------ 5 files changed, 110 insertions(+), 86 deletions(-) (limited to 'sot') diff --git a/sot/prj/build.lst b/sot/prj/build.lst index f2696155fd97..c4cbeb1363fb 100644 --- a/sot/prj/build.lst +++ b/sot/prj/build.lst @@ -1,8 +1,10 @@ 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 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\qa\complex\olesimplestorage nmake - all sot_complex sot_ut NULL 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 index 3420d798c9bc..cf3facf94d66 100644 --- a/sot/qa/complex/olesimplestorage/makefile.mk +++ b/sot/qa/complex/olesimplestorage/makefile.mk @@ -25,60 +25,38 @@ # #************************************************************************* -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 ------------------------------ +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -MAXLINELENGTH = 100000 +PRJ = ../../.. +PRJNAME = sot +TARGET = qa_complex_olesimplestorage -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/olesimplestorage +JAVATESTFILES = \ + OLESimpleStorageUnitTest.java -# --- Parameters for the test -------------------------------------- +JAVAFILES = $(JAVATESTFILES) \ + OLESimpleStorageTest.java \ + Test01.java \ + TestHelper.java -# 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 +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END -# test base is java complex -CT_TESTBASE = -TestBase java_complex +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +ALLTAR : javatest -# start the runner application -CT_APP = org.openoffice.Runner +.END -# --- Targets ------------------------------------------------------ -.INCLUDE: target.mk -RUN: run -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) -- cgit From 5965bb52435916c06d1b5a63df4959203b7cf018 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Fri, 25 Jun 2010 13:15:03 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for WIN,W30,W31 --- sot/source/sdstor/stgstrms.cxx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'sot') diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 07711133bf4b..dd6ba6202bbe 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -41,13 +41,7 @@ #include "stgdir.hxx" #include "stgio.hxx" -#if defined(W31) - #include - #define memcpy hmemcpy - #define __HUGE _huge -#else - #define __HUGE -#endif +#define __HUGE ///////////////////////////// class StgFAT /////////////////////////////// -- cgit From c32f1410f9dc305daa7ad589b1347026d5b13bd2 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Fri, 23 Jul 2010 12:20:26 +0200 Subject: sb123:#i111449# fix all run through problems for qa/complex tests --- sot/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sot') diff --git a/sot/prj/build.lst b/sot/prj/build.lst index c4cbeb1363fb..a5ebff311e9c 100644 --- a/sot/prj/build.lst +++ b/sot/prj/build.lst @@ -7,4 +7,4 @@ 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\qa\complex\olesimplestorage nmake - all sot_complex sot_ut NULL +# to sot\qa\complex\olesimplestorage nmake - all sot_complex sot_ut NULL -- cgit From d210c6ccc30466e98240c1409df0550514668d68 Mon Sep 17 00:00:00 2001 From: Xiaofei Zhang Date: Thu, 29 Jul 2010 10:56:19 +0800 Subject: #i112600#: clean up l10ntools, rsc, sot, svl, tools and unotools --- sot/inc/absdev.hxx | 2 +- sot/inc/agg.hxx | 16 +- sot/inc/filelist.hxx | 6 +- sot/inc/sot/exchange.hxx | 180 +++++----- sot/inc/sot/factory.hxx | 10 +- sot/inc/sot/formats.hxx | 276 +++++++-------- sot/inc/sot/object.hxx | 66 ++-- sot/inc/sot/sotdata.hxx | 2 +- sot/inc/sot/storage.hxx | 90 ++--- sot/inc/stg.hxx | 280 +++++++-------- sot/inc/storinfo.hxx | 16 +- sot/source/base/exchange.cxx | 34 +- sot/source/base/factory.cxx | 24 +- sot/source/base/filelist.cxx | 14 +- sot/source/base/formats.cxx | 56 +-- sot/source/base/object.cxx | 74 ++-- sot/source/sdstor/stg.cxx | 296 ++++++++-------- sot/source/sdstor/stgavl.cxx | 36 +- sot/source/sdstor/stgavl.hxx | 8 +- sot/source/sdstor/stgcache.cxx | 108 +++--- sot/source/sdstor/stgcache.hxx | 66 ++-- sot/source/sdstor/stgdir.cxx | 272 +++++++-------- sot/source/sdstor/stgdir.hxx | 78 ++--- sot/source/sdstor/stgelem.cxx | 106 +++--- sot/source/sdstor/stgelem.hxx | 122 +++---- sot/source/sdstor/stgio.cxx | 110 +++--- sot/source/sdstor/stgio.hxx | 12 +- sot/source/sdstor/stgole.cxx | 88 ++--- sot/source/sdstor/stgole.hxx | 24 +- sot/source/sdstor/stgstrms.cxx | 334 +++++++++--------- sot/source/sdstor/stgstrms.hxx | 106 +++--- sot/source/sdstor/storage.cxx | 214 ++++++------ sot/source/sdstor/storinfo.cxx | 20 +- sot/source/sdstor/ucbstorage.cxx | 598 ++++++++++++++++----------------- sot/source/sdstor/unostorageholder.cxx | 2 +- 35 files changed, 1873 insertions(+), 1873 deletions(-) (limited to 'sot') diff --git a/sot/inc/absdev.hxx b/sot/inc/absdev.hxx index 3d251d98e0b6..d882e6fc6b14 100644 --- a/sot/inc/absdev.hxx +++ b/sot/inc/absdev.hxx @@ -40,7 +40,7 @@ protected: public: virtual ~AbstractDeviceData() {} virtual AbstractDeviceData * Copy() const = 0; - virtual BOOL Equals( const AbstractDeviceData & ) const = 0; + virtual sal_Bool Equals( const AbstractDeviceData & ) const = 0; JobSetup * GetJobSetup() const { return pJobSetup; } }; diff --git a/sot/inc/agg.hxx b/sot/inc/agg.hxx index 2f8cc7587458..cf07f6a8faff 100644 --- a/sot/inc/agg.hxx +++ b/sot/inc/agg.hxx @@ -41,21 +41,21 @@ struct SvAggregate SotFactory * pFact; SotObject * pObj; }; - BOOL bFactory; - BOOL bMainObj; // TRUE, das Objekt, welches das casting steuert + sal_Bool bFactory; + sal_Bool bMainObj; // sal_True, das Objekt, welches das casting steuert SvAggregate() : pFact( NULL ) - , bFactory( FALSE ) - , bMainObj( FALSE ) {} - SvAggregate( SotObject * pObjP, BOOL bMainP ) + , bFactory( sal_False ) + , bMainObj( sal_False ) {} + SvAggregate( SotObject * pObjP, sal_Bool bMainP ) : pObj( pObjP ) - , bFactory( FALSE ) + , bFactory( sal_False ) , bMainObj( bMainP ) {} SvAggregate( SotFactory * pFactP ) : pFact( pFactP ) - , bFactory( TRUE ) - , bMainObj( FALSE ) {} + , bFactory( sal_True ) + , bMainObj( sal_False ) {} }; /************** class SvAggregateMemberList *****************************/ diff --git a/sot/inc/filelist.hxx b/sot/inc/filelist.hxx index 4c6c55534319..fc04e92cb3d7 100644 --- a/sot/inc/filelist.hxx +++ b/sot/inc/filelist.hxx @@ -62,13 +62,13 @@ public: SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList ); // Clipboard, D&D usw. - static ULONG GetFormat(); + static sal_uIntPtr GetFormat(); // Liste fuellen/abfragen void AppendFile( const String& rStr ); - String GetFile( ULONG i ) const; - ULONG Count( void ) const; + String GetFile( sal_uIntPtr i ) const; + sal_uIntPtr Count( void ) const; }; diff --git a/sot/inc/sot/exchange.hxx b/sot/inc/sot/exchange.hxx index dc67e72a4f82..d079d9bfec2c 100644 --- a/sot/inc/sot/exchange.hxx +++ b/sot/inc/sot/exchange.hxx @@ -52,7 +52,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer { // - SotFormatStringId - // --------------------- -typedef ULONG SotFormatStringId; +typedef sal_uIntPtr SotFormatStringId; // ---------------- // - DataFlavorEx - @@ -77,7 +77,7 @@ typedef ::std::list< ::com::sun::star::datatransfer::DataFlavor > DataFlavorLi typedef ::std::list< DataFlavorEx > DataFlavorExList; SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, - ULONG nId ); + sal_uIntPtr nId ); // ------------------------- // - Vordefinierte Formate - @@ -97,70 +97,70 @@ SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorE #define FORMAT_RTF 10 // Source-Options -#define EXCHG_SOURCE_MOVEABLE ((USHORT)0x0001) -#define EXCHG_SOURCE_COPYABLE ((USHORT)0x0002) -#define EXCHG_SOURCE_LINKABLE ((USHORT)0x0004) -#define EXCHG_SOURCE_PRINTABLE ((USHORT)0x0008) -#define EXCHG_SOURCE_DISCARDABLE ((USHORT)0x0010) -#define EXCHG_SOURCE_ALL ((USHORT)0x001F) -#define EXCHG_SOURCE_DEF_COPYABLE ((USHORT)0x0020) +#define EXCHG_SOURCE_MOVEABLE ((sal_uInt16)0x0001) +#define EXCHG_SOURCE_COPYABLE ((sal_uInt16)0x0002) +#define EXCHG_SOURCE_LINKABLE ((sal_uInt16)0x0004) +#define EXCHG_SOURCE_PRINTABLE ((sal_uInt16)0x0008) +#define EXCHG_SOURCE_DISCARDABLE ((sal_uInt16)0x0010) +#define EXCHG_SOURCE_ALL ((sal_uInt16)0x001F) +#define EXCHG_SOURCE_DEF_COPYABLE ((sal_uInt16)0x0020) // Aktionen -#define EXCHG_ACTION_MASK ((USHORT)0x00FF) -#define EXCHG_INOUT_ACTION_NONE ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE) +#define EXCHG_ACTION_MASK ((sal_uInt16)0x00FF) +#define EXCHG_INOUT_ACTION_NONE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE) #define EXCHG_IN_ACTION_DEFAULT EXCHG_INOUT_ACTION_NONE -#define EXCHG_IN_ACTION_MOVE ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE) -#define EXCHG_IN_ACTION_COPY ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY) -#define EXCHG_IN_ACTION_LINK ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK) -#define EXCHG_INOUT_ACTION_PRINT ((USHORT)8) -#define EXCHG_INOUT_ACTION_DISCARD ((USHORT)16) -#define EXCHG_OUT_ACTION_INSERT_OBJ ((USHORT)17) -#define EXCHG_OUT_ACTION_INSERT_BOOKMARK ((USHORT)18) -#define EXCHG_OUT_ACTION_INSERT_FILELINK ((USHORT)19) -#define EXCHG_OUT_ACTION_INSERT_FILE ((USHORT)20) -#define EXCHG_OUT_ACTION_INSERT_FILELIST ((USHORT)21) -#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP ((USHORT)22) -#define EXCHG_OUT_ACTION_INSERT_OLE ((USHORT)23) -#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE ((USHORT)24) -#define EXCHG_OUT_ACTION_INSERT_URLBUTTON ((USHORT)25) -#define EXCHG_OUT_ACTION_INSERT_CHAOSOBJ ((USHORT)26) // OBSOLET ab 500.b ? -#define EXCHG_OUT_ACTION_REPLACE_OBJ ((USHORT)27) -#define EXCHG_OUT_ACTION_REPLACE_LINK ((USHORT)28) -#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP ((USHORT)29) -#define EXCHG_OUT_ACTION_GET_ATTRIBUTES ((USHORT)30) -#define EXCHG_OUT_ACTION_UPLOAD ((USHORT)31) // OBSOLET ab 500.b ? -#define EXCHG_OUT_ACTION_MOVE_FILE ((USHORT)32) -#define EXCHG_OUT_ACTION_MOVE_FILELIST ((USHORT)33) -#define EXCHG_OUT_ACTION_UPDATE_RANGE ((USHORT)34) -#define EXCHG_OUT_ACTION_INSERT_PRIVATE ((USHORT)35) -#define EXCHG_OUT_ACTION_INSERT_HTML ((USHORT)36) -#define EXCHG_OUT_ACTION_MOVE_PRIVATE ((USHORT)37) -#define EXCHG_OUT_ACTION_INSERT_STRING ((USHORT)38) -#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ ((USHORT)39) -#define EXCHG_OUT_ACTION_INSERT_SVXB ((USHORT)40) -#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE ((USHORT)41) -#define EXCHG_OUT_ACTION_INSERT_BITMAP ((USHORT)42) -#define EXCHG_OUT_ACTION_INSERT_DDE ((USHORT)43) -#define EXCHG_OUT_ACTION_INSERT_HYPERLINK ((USHORT)44) -#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ ((USHORT)45) -#define EXCHG_OUT_ACTION_REPLACE_SVXB ((USHORT)46) -#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE ((USHORT)47) -#define EXCHG_OUT_ACTION_REPLACE_BITMAP ((USHORT)48) -#define EXCHG_OUT_ACTION_REPLACE_GRAPH ((USHORT)49) -#define EXCHG_OUT_ACTION_INSERT_GRAPH ((USHORT)50) -#define EXCHG_OUT_ACTION_INSERT_MSGATTACH ((USHORT)51) // obsolet ab 500.b ? -#define EXCHG_OUT_ACTION_COPY_CHAOSOBJ ((USHORT)52) -#define EXCHG_OUT_ACTION_MOVE_CHAOSOBJ ((USHORT)53) -#define EXCHG_OUT_ACTION_COPY_MSGATTACH ((USHORT)54) -#define EXCHG_OUT_ACTION_COPY_BOOKMARK ((USHORT)55) -#define EXCHG_OUT_ACTION_COPY_FILE ((USHORT)56) - -#define EXCHG_OUT_ACTION_FLAG_CREATE_THEME ((USHORT)0x0100) -#define EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE ((USHORT)0x0200) -#define EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP ((USHORT)0x0400) -#define EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP ((USHORT)0x0800) -#define EXCHG_OUT_ACTION_FLAG_FILL ((USHORT)0x1000) -#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((USHORT)0x2000) +#define EXCHG_IN_ACTION_MOVE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE) +#define EXCHG_IN_ACTION_COPY ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY) +#define EXCHG_IN_ACTION_LINK ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK) +#define EXCHG_INOUT_ACTION_PRINT ((sal_uInt16)8) +#define EXCHG_INOUT_ACTION_DISCARD ((sal_uInt16)16) +#define EXCHG_OUT_ACTION_INSERT_OBJ ((sal_uInt16)17) +#define EXCHG_OUT_ACTION_INSERT_BOOKMARK ((sal_uInt16)18) +#define EXCHG_OUT_ACTION_INSERT_FILELINK ((sal_uInt16)19) +#define EXCHG_OUT_ACTION_INSERT_FILE ((sal_uInt16)20) +#define EXCHG_OUT_ACTION_INSERT_FILELIST ((sal_uInt16)21) +#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP ((sal_uInt16)22) +#define EXCHG_OUT_ACTION_INSERT_OLE ((sal_uInt16)23) +#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE ((sal_uInt16)24) +#define EXCHG_OUT_ACTION_INSERT_URLBUTTON ((sal_uInt16)25) +#define EXCHG_OUT_ACTION_INSERT_CHAOSOBJ ((sal_uInt16)26) // OBSOLET ab 500.b ? +#define EXCHG_OUT_ACTION_REPLACE_OBJ ((sal_uInt16)27) +#define EXCHG_OUT_ACTION_REPLACE_LINK ((sal_uInt16)28) +#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP ((sal_uInt16)29) +#define EXCHG_OUT_ACTION_GET_ATTRIBUTES ((sal_uInt16)30) +#define EXCHG_OUT_ACTION_UPLOAD ((sal_uInt16)31) // OBSOLET ab 500.b ? +#define EXCHG_OUT_ACTION_MOVE_FILE ((sal_uInt16)32) +#define EXCHG_OUT_ACTION_MOVE_FILELIST ((sal_uInt16)33) +#define EXCHG_OUT_ACTION_UPDATE_RANGE ((sal_uInt16)34) +#define EXCHG_OUT_ACTION_INSERT_PRIVATE ((sal_uInt16)35) +#define EXCHG_OUT_ACTION_INSERT_HTML ((sal_uInt16)36) +#define EXCHG_OUT_ACTION_MOVE_PRIVATE ((sal_uInt16)37) +#define EXCHG_OUT_ACTION_INSERT_STRING ((sal_uInt16)38) +#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ ((sal_uInt16)39) +#define EXCHG_OUT_ACTION_INSERT_SVXB ((sal_uInt16)40) +#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE ((sal_uInt16)41) +#define EXCHG_OUT_ACTION_INSERT_BITMAP ((sal_uInt16)42) +#define EXCHG_OUT_ACTION_INSERT_DDE ((sal_uInt16)43) +#define EXCHG_OUT_ACTION_INSERT_HYPERLINK ((sal_uInt16)44) +#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ ((sal_uInt16)45) +#define EXCHG_OUT_ACTION_REPLACE_SVXB ((sal_uInt16)46) +#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE ((sal_uInt16)47) +#define EXCHG_OUT_ACTION_REPLACE_BITMAP ((sal_uInt16)48) +#define EXCHG_OUT_ACTION_REPLACE_GRAPH ((sal_uInt16)49) +#define EXCHG_OUT_ACTION_INSERT_GRAPH ((sal_uInt16)50) +#define EXCHG_OUT_ACTION_INSERT_MSGATTACH ((sal_uInt16)51) // obsolet ab 500.b ? +#define EXCHG_OUT_ACTION_COPY_CHAOSOBJ ((sal_uInt16)52) +#define EXCHG_OUT_ACTION_MOVE_CHAOSOBJ ((sal_uInt16)53) +#define EXCHG_OUT_ACTION_COPY_MSGATTACH ((sal_uInt16)54) +#define EXCHG_OUT_ACTION_COPY_BOOKMARK ((sal_uInt16)55) +#define EXCHG_OUT_ACTION_COPY_FILE ((sal_uInt16)56) + +#define EXCHG_OUT_ACTION_FLAG_CREATE_THEME ((sal_uInt16)0x0100) +#define EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE ((sal_uInt16)0x0200) +#define EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP ((sal_uInt16)0x0400) +#define EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP ((sal_uInt16)0x0800) +#define EXCHG_OUT_ACTION_FLAG_FILL ((sal_uInt16)0x1000) +#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((sal_uInt16)0x2000) // Ziele #define EXCHG_DEST_DOC_OLEOBJ 1 @@ -188,66 +188,66 @@ class SvGlobalName; class SOT_DLLPUBLIC SotExchange { public: - static ULONG RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static ULONG RegisterFormatName( const String& rName ); - static ULONG RegisterFormatMimeType( const String& rMimeType ); + static sal_uIntPtr RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static sal_uIntPtr RegisterFormatName( const String& rName ); + static sal_uIntPtr RegisterFormatMimeType( const String& rMimeType ); - static ULONG GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static String GetFormatName( ULONG nFormat ); - static sal_Bool GetFormatDataFlavor( ULONG nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static String GetFormatMimeType( ULONG nFormat ); - static BOOL IsInternal( const SvGlobalName& ); - static ULONG GetFormatIdFromMimeType( const String& rMimeType ); + static sal_uIntPtr GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static String GetFormatName( sal_uIntPtr nFormat ); + static sal_Bool GetFormatDataFlavor( sal_uIntPtr nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static String GetFormatMimeType( sal_uIntPtr nFormat ); + static sal_Bool IsInternal( const SvGlobalName& ); + static sal_uIntPtr GetFormatIdFromMimeType( const String& rMimeType ); // bestimme die SotFormatStringId von dem registrierten Format //JP 12.11.98: diese 3 Methoden sind ab sofort ueberfluessig, da // die ClipboardIds statisch sind und aequivalent zur // SotFormatStringId ist! - static SotFormatStringId GetFormatStringId( ULONG nFormat ) + static SotFormatStringId GetFormatStringId( sal_uIntPtr nFormat ) { return nFormat; } static SotFormatStringId GetFormatStringId( const String& rName ) { return SotExchange::RegisterFormatMimeType( rName ); } - static ULONG RegisterSotFormatName( SotFormatStringId nId ) + static sal_uIntPtr RegisterSotFormatName( SotFormatStringId nId ) { return nId; } // same for XTransferable interface - static USHORT GetExchangeAction( + static sal_uInt16 GetExchangeAction( // XTransferable const DataFlavorExVector& rDataFlavorExVector, // Ziel der Aktion (EXCHG_DEST_*) - USHORT nDestination, + sal_uInt16 nDestination, // Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...) - USHORT nSourceOptions, + sal_uInt16 nSourceOptions, // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) - USHORT nUserAction, + sal_uInt16 nUserAction, // In:- Out: Zu benutzendes Format - ULONG& rFormat, + sal_uIntPtr& rFormat, // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) - USHORT& rDefaultAction, + sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - ULONG nOnlyTestFormat = 0, + sal_uIntPtr nOnlyTestFormat = 0, // In:- optional - check the contents of Xtransferable const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >* pxTransferable = NULL ); // same for XTransferable interface - static USHORT GetExchangeAction( + static sal_uInt16 GetExchangeAction( // XTransferable const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable, // Ziel der Aktion (EXCHG_DEST_*) - USHORT nDestination, + sal_uInt16 nDestination, // Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...) - USHORT nSourceOptions, + sal_uInt16 nSourceOptions, // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) - USHORT nUserAction, + sal_uInt16 nUserAction, // In:- Out: Zu benutzendes Format - ULONG& rFormat, + sal_uIntPtr& rFormat, // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) - USHORT& rDefaultAction, + sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - ULONG nOnlyTestFormat = 0 ); + sal_uIntPtr nOnlyTestFormat = 0 ); - static USHORT IsChart( const SvGlobalName& rName ); - static USHORT IsMath( const SvGlobalName& rName ); + static sal_uInt16 IsChart( const SvGlobalName& rName ); + static sal_uInt16 IsMath( const SvGlobalName& rName ); }; #endif // _EXCHANGE_HXX diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx index 08dd21a88aa5..58cd26e3b5a0 100644 --- a/sot/inc/sot/factory.hxx +++ b/sot/inc/sot/factory.hxx @@ -47,13 +47,13 @@ typedef void * (*CreateInstanceType)( SotObject ** ); //==================class SotFactory======================================= class SOT_DLLPUBLIC SotFactory : public SvGlobalName { - USHORT nSuperCount; // Anzahl der Superklassen + sal_uInt16 nSuperCount; // Anzahl der Superklassen const SotFactory ** pSuperClasses; // Superklassen CreateInstanceType pCreateFunc; String aClassName; - static BOOL ExistTest( const SvGlobalName & ); + static sal_Bool ExistTest( const SvGlobalName & ); protected: virtual ~SotFactory(); public: @@ -61,7 +61,7 @@ public: static void DeInit(); static void IncSvObjectCount( SotObject * = NULL ); static void DecSvObjectCount( SotObject * = NULL ); - static UINT32 GetSvObjectCount(); + static sal_uInt32 GetSvObjectCount(); static void TestInvariant(); static const SotFactory * Find( const SvGlobalName & ); @@ -75,8 +75,8 @@ public: void * CastAndAddRef( SotObject * ) const; void * AggCastAndAddRef( SotObject * ) const; - BOOL Is( const SotFactory * pSuperClass ) const; - const SotFactory * GetSuper( USHORT nPos ) const + sal_Bool Is( const SotFactory * pSuperClass ) const; + const SotFactory * GetSuper( sal_uInt16 nPos ) const { return nPos < nSuperCount ? pSuperClasses[ nPos ] diff --git a/sot/inc/sot/formats.hxx b/sot/inc/sot/formats.hxx index c9d7a3e69d78..8a61884c88e7 100644 --- a/sot/inc/sot/formats.hxx +++ b/sot/inc/sot/formats.hxx @@ -46,145 +46,145 @@ #endif #include -#define SOT_FORMAT_SYSTEM_START ((ULONG)0) -#define SOT_FORMAT_STRING ((ULONG)FORMAT_STRING) -#define SOT_FORMAT_BITMAP ((ULONG)FORMAT_BITMAP) -#define SOT_FORMAT_GDIMETAFILE ((ULONG)FORMAT_GDIMETAFILE) -#define SOT_FORMAT_PRIVATE ((ULONG)FORMAT_PRIVATE) -#define SOT_FORMAT_FILE ((ULONG)FORMAT_FILE) -#define SOT_FORMAT_FILE_LIST ((ULONG)FORMAT_FILE_LIST) -#define SOT_FORMAT_RTF ((ULONG)FORMAT_RTF) +#define SOT_FORMAT_SYSTEM_START ((sal_uIntPtr)0) +#define SOT_FORMAT_STRING ((sal_uIntPtr)FORMAT_STRING) +#define SOT_FORMAT_BITMAP ((sal_uIntPtr)FORMAT_BITMAP) +#define SOT_FORMAT_GDIMETAFILE ((sal_uIntPtr)FORMAT_GDIMETAFILE) +#define SOT_FORMAT_PRIVATE ((sal_uIntPtr)FORMAT_PRIVATE) +#define SOT_FORMAT_FILE ((sal_uIntPtr)FORMAT_FILE) +#define SOT_FORMAT_FILE_LIST ((sal_uIntPtr)FORMAT_FILE_LIST) +#define SOT_FORMAT_RTF ((sal_uIntPtr)FORMAT_RTF) -#define SOT_FORMATSTR_ID_DRAWING ((ULONG)11) -#define SOT_FORMATSTR_ID_SVXB ((ULONG)12) -#define SOT_FORMATSTR_ID_SVIM ((ULONG)13) -#define SOT_FORMATSTR_ID_XFA ((ULONG)14) -#define SOT_FORMATSTR_ID_EDITENGINE ((ULONG)15) -#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((ULONG)16) -#define SOT_FORMATSTR_ID_SOLK ((ULONG)17) -#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((ULONG)18) -#define SOT_FORMATSTR_ID_TREELISTBOX ((ULONG)19) -#define SOT_FORMATSTR_ID_NATIVE ((ULONG)20) -#define SOT_FORMATSTR_ID_OWNERLINK ((ULONG)21) -#define SOT_FORMATSTR_ID_STARSERVER ((ULONG)22) -#define SOT_FORMATSTR_ID_STAROBJECT ((ULONG)23) -#define SOT_FORMATSTR_ID_APPLETOBJECT ((ULONG)24) -#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((ULONG)25) -#define SOT_FORMATSTR_ID_STARWRITER_30 ((ULONG)26) -#define SOT_FORMATSTR_ID_STARWRITER_40 ((ULONG)27) -#define SOT_FORMATSTR_ID_STARWRITER_50 ((ULONG)28) -#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((ULONG)29) -#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((ULONG)30) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((ULONG)31) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((ULONG)32) -#define SOT_FORMATSTR_ID_STARDRAW ((ULONG)33) -#define SOT_FORMATSTR_ID_STARDRAW_40 ((ULONG)34) -#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((ULONG)35) -#define SOT_FORMATSTR_ID_STARDRAW_50 ((ULONG)36) -#define SOT_FORMATSTR_ID_STARCALC ((ULONG)37) -#define SOT_FORMATSTR_ID_STARCALC_40 ((ULONG)38) -#define SOT_FORMATSTR_ID_STARCALC_50 ((ULONG)39) -#define SOT_FORMATSTR_ID_STARCHART ((ULONG)40) -#define SOT_FORMATSTR_ID_STARCHART_40 ((ULONG)41) -#define SOT_FORMATSTR_ID_STARCHART_50 ((ULONG)42) -#define SOT_FORMATSTR_ID_STARIMAGE ((ULONG)43) -#define SOT_FORMATSTR_ID_STARIMAGE_40 ((ULONG)44) -#define SOT_FORMATSTR_ID_STARIMAGE_50 ((ULONG)45) -#define SOT_FORMATSTR_ID_STARMATH ((ULONG)46) -#define SOT_FORMATSTR_ID_STARMATH_40 ((ULONG)47) -#define SOT_FORMATSTR_ID_STARMATH_50 ((ULONG)48) -#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((ULONG)49) -#define SOT_FORMATSTR_ID_FILLED_AREA ((ULONG)50) -#define SOT_FORMATSTR_ID_HTML ((ULONG)51) -#define SOT_FORMATSTR_ID_HTML_SIMPLE ((ULONG)52) -#define SOT_FORMATSTR_ID_CHAOS ((ULONG)53) -#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((ULONG)54) -#define SOT_FORMATSTR_ID_BIFF_5 ((ULONG)55) -#define SOT_FORMATSTR_ID_BIFF__5 ((ULONG)56) -#define SOT_FORMATSTR_ID_SYLK ((ULONG)57) -#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((ULONG)58) -#define SOT_FORMATSTR_ID_LINK ((ULONG)59) -#define SOT_FORMATSTR_ID_DIF ((ULONG)60) -#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((ULONG)61) -#define SOT_FORMATSTR_ID_SONLK ((ULONG)62) -#define SOT_FORMATSTR_ID_MSWORD_DOC ((ULONG)63) -#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((ULONG)64) -#define SOT_FORMATSTR_ID_OFFICE_DOC ((ULONG)65) -#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((ULONG)66) -#define SOT_FORMATSTR_ID_NOTES_HNOTE ((ULONG)67) -#define SOT_FORMATSTR_ID_NOTES_NATIVE ((ULONG)68) -#define SOT_FORMATSTR_ID_SFX_DOC ((ULONG)69) -#define SOT_FORMATSTR_ID_EVDF ((ULONG)70) -#define SOT_FORMATSTR_ID_ESDF ((ULONG)71) -#define SOT_FORMATSTR_ID_IDF ((ULONG)72) -#define SOT_FORMATSTR_ID_EFTP ((ULONG)73) -#define SOT_FORMATSTR_ID_EFD ((ULONG)74) -#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((ULONG)75) -#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((ULONG)76) -#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((ULONG)77) -#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((ULONG)78) -#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((ULONG)79) -#define SOT_FORMATSTR_ID_SBA_TABED ((ULONG)80) -#define SOT_FORMATSTR_ID_SBA_TABID ((ULONG)81) -#define SOT_FORMATSTR_ID_SBA_JOIN ((ULONG)82) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((ULONG)83) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((ULONG)84) -#define SOT_FORMATSTR_ID_EMBED_SOURCE ((ULONG)85) -#define SOT_FORMATSTR_ID_LINK_SOURCE ((ULONG)86) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((ULONG)87) -#define SOT_FORMATSTR_ID_FILECONTENT ((ULONG)88) -#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((ULONG)89) -#define SOT_FORMATSTR_ID_FILENAME ((ULONG)90) -#define SOT_FORMATSTR_ID_SD_OLE ((ULONG)91) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((ULONG)92) -#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((ULONG)93) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((ULONG)94) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((ULONG)95) -#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((ULONG)96) -#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((ULONG)97) -#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((ULONG)98) -#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((ULONG)99) -#define SOT_FORMATSTR_ID_INET_IMAGE ((ULONG)100) -#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((ULONG)101) -#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((ULONG)102) -#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((ULONG)103) -#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((ULONG)104) -#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((ULONG)105) -#define SOT_FORMATSTR_ID_GRAPHOBJ ((ULONG)106) -#define SOT_FORMATSTR_ID_STARWRITER_60 ((ULONG)107) -#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((ULONG)108) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((ULONG)109) -#define SOT_FORMATSTR_ID_STARDRAW_60 ((ULONG)110) -#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((ULONG)111) -#define SOT_FORMATSTR_ID_STARCALC_60 ((ULONG)112) -#define SOT_FORMATSTR_ID_STARCHART_60 ((ULONG)113) -#define SOT_FORMATSTR_ID_STARMATH_60 ((ULONG)114) -#define SOT_FORMATSTR_ID_WMF ((ULONG)115) -#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((ULONG)116) -#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((ULONG)117) -#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((ULONG)118) -#define SOT_FORMATSTR_ID_DIALOG_60 ((ULONG)119) -#define SOT_FORMATSTR_ID_EMF ((ULONG)120) -#define SOT_FORMATSTR_ID_BIFF_8 ((ULONG)121) -#define SOT_FORMATSTR_ID_BMP ((ULONG)122) -#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((ULONG)123) -#define SOT_FORMATSTR_ID_STARWRITER_8 ((ULONG)124) -#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((ULONG)125) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((ULONG)126) -#define SOT_FORMATSTR_ID_STARDRAW_8 ((ULONG)127) -#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((ULONG)128) -#define SOT_FORMATSTR_ID_STARCALC_8 ((ULONG)129) -#define SOT_FORMATSTR_ID_STARCHART_8 ((ULONG)130) -#define SOT_FORMATSTR_ID_STARMATH_8 ((ULONG)131) -#define SOT_FORMATSTR_ID_XFORMS ((ULONG)132) -#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((ULONG)133) -#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((ULONG)134) -#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((ULONG)135) -#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((ULONG)136) -#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((ULONG)137) -#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((ULONG)138) -#define SOT_FORMATSTR_ID_STARBASE_8 ((ULONG)139) -#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((ULONG)140) +#define SOT_FORMATSTR_ID_DRAWING ((sal_uIntPtr)11) +#define SOT_FORMATSTR_ID_SVXB ((sal_uIntPtr)12) +#define SOT_FORMATSTR_ID_SVIM ((sal_uIntPtr)13) +#define SOT_FORMATSTR_ID_XFA ((sal_uIntPtr)14) +#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uIntPtr)15) +#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uIntPtr)16) +#define SOT_FORMATSTR_ID_SOLK ((sal_uIntPtr)17) +#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uIntPtr)18) +#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uIntPtr)19) +#define SOT_FORMATSTR_ID_NATIVE ((sal_uIntPtr)20) +#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uIntPtr)21) +#define SOT_FORMATSTR_ID_STARSERVER ((sal_uIntPtr)22) +#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uIntPtr)23) +#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uIntPtr)24) +#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uIntPtr)25) +#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uIntPtr)26) +#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uIntPtr)27) +#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uIntPtr)28) +#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uIntPtr)29) +#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uIntPtr)30) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uIntPtr)31) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uIntPtr)32) +#define SOT_FORMATSTR_ID_STARDRAW ((sal_uIntPtr)33) +#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uIntPtr)34) +#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uIntPtr)35) +#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uIntPtr)36) +#define SOT_FORMATSTR_ID_STARCALC ((sal_uIntPtr)37) +#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uIntPtr)38) +#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uIntPtr)39) +#define SOT_FORMATSTR_ID_STARCHART ((sal_uIntPtr)40) +#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uIntPtr)41) +#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uIntPtr)42) +#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uIntPtr)43) +#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uIntPtr)44) +#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uIntPtr)45) +#define SOT_FORMATSTR_ID_STARMATH ((sal_uIntPtr)46) +#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uIntPtr)47) +#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uIntPtr)48) +#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uIntPtr)49) +#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uIntPtr)50) +#define SOT_FORMATSTR_ID_HTML ((sal_uIntPtr)51) +#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uIntPtr)52) +#define SOT_FORMATSTR_ID_CHAOS ((sal_uIntPtr)53) +#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uIntPtr)54) +#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uIntPtr)55) +#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uIntPtr)56) +#define SOT_FORMATSTR_ID_SYLK ((sal_uIntPtr)57) +#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uIntPtr)58) +#define SOT_FORMATSTR_ID_LINK ((sal_uIntPtr)59) +#define SOT_FORMATSTR_ID_DIF ((sal_uIntPtr)60) +#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uIntPtr)61) +#define SOT_FORMATSTR_ID_SONLK ((sal_uIntPtr)62) +#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uIntPtr)63) +#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uIntPtr)64) +#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uIntPtr)65) +#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uIntPtr)66) +#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uIntPtr)67) +#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uIntPtr)68) +#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uIntPtr)69) +#define SOT_FORMATSTR_ID_EVDF ((sal_uIntPtr)70) +#define SOT_FORMATSTR_ID_ESDF ((sal_uIntPtr)71) +#define SOT_FORMATSTR_ID_IDF ((sal_uIntPtr)72) +#define SOT_FORMATSTR_ID_EFTP ((sal_uIntPtr)73) +#define SOT_FORMATSTR_ID_EFD ((sal_uIntPtr)74) +#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uIntPtr)75) +#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uIntPtr)76) +#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uIntPtr)77) +#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uIntPtr)78) +#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uIntPtr)79) +#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uIntPtr)80) +#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uIntPtr)81) +#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uIntPtr)82) +#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uIntPtr)83) +#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uIntPtr)84) +#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uIntPtr)85) +#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uIntPtr)86) +#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uIntPtr)87) +#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uIntPtr)88) +#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uIntPtr)89) +#define SOT_FORMATSTR_ID_FILENAME ((sal_uIntPtr)90) +#define SOT_FORMATSTR_ID_SD_OLE ((sal_uIntPtr)91) +#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uIntPtr)92) +#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uIntPtr)93) +#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uIntPtr)94) +#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uIntPtr)95) +#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uIntPtr)96) +#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uIntPtr)97) +#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uIntPtr)98) +#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uIntPtr)99) +#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uIntPtr)100) +#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uIntPtr)101) +#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uIntPtr)102) +#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uIntPtr)103) +#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uIntPtr)104) +#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uIntPtr)105) +#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uIntPtr)106) +#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uIntPtr)107) +#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uIntPtr)108) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uIntPtr)109) +#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uIntPtr)110) +#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uIntPtr)111) +#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uIntPtr)112) +#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uIntPtr)113) +#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uIntPtr)114) +#define SOT_FORMATSTR_ID_WMF ((sal_uIntPtr)115) +#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uIntPtr)116) +#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uIntPtr)117) +#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uIntPtr)118) +#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uIntPtr)119) +#define SOT_FORMATSTR_ID_EMF ((sal_uIntPtr)120) +#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uIntPtr)121) +#define SOT_FORMATSTR_ID_BMP ((sal_uIntPtr)122) +#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uIntPtr)123) +#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uIntPtr)124) +#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uIntPtr)125) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uIntPtr)126) +#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uIntPtr)127) +#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uIntPtr)128) +#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uIntPtr)129) +#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uIntPtr)130) +#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uIntPtr)131) +#define SOT_FORMATSTR_ID_XFORMS ((sal_uIntPtr)132) +#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uIntPtr)133) +#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uIntPtr)134) +#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uIntPtr)135) +#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uIntPtr)136) +#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uIntPtr)137) +#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uIntPtr)138) +#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uIntPtr)139) +#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uIntPtr)140) #define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_HC_GDIMETAFILE #endif // _SOT_FORMATS_HXX diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx index db2ac3b30ffc..5b6cedfbf410 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -43,41 +43,41 @@ #define TEST_INVARIANT #ifdef TEST_INVARIANT #define SO2_DECL_INVARIANT() \ - virtual void TestObjRef( BOOL bFree ); \ - void TestMemberObjRef( BOOL bFree ); \ - virtual void TestInvariant( BOOL bPrint ); \ - void TestMemberInvariant( BOOL bPrint ); + virtual void TestObjRef( sal_Bool bFree ); \ + void TestMemberObjRef( sal_Bool bFree ); \ + virtual void TestInvariant( sal_Bool bPrint ); \ + void TestMemberInvariant( sal_Bool bPrint ); #define SO2_IMPL_INVARIANT(ClassName) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ } #define SO2_IMPL_INVARIANT1(ClassName,Super1) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ } #define SO2_IMPL_INVARIANT2(ClassName,Super1,Super2) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ Super2::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -85,14 +85,14 @@ void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ } #define SO2_IMPL_INVARIANT3(ClassName,Super1,Super2,Super3) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ Super2::TestObjRef( bFree ); \ Super3::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -101,7 +101,7 @@ void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ } #define SO2_IMPL_INVARIANT4(ClassName,Super1,Super2,Super3,Super4) \ -void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ +void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ @@ -109,7 +109,7 @@ void __EXPORT ClassName::TestObjRef( BOOL bFree ) \ Super3::TestObjRef( bFree ); \ Super4::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \ +void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -388,14 +388,14 @@ class SOT_DLLPUBLIC SotObject : virtual public SvRefBase friend class SotFactory; friend class SvObject; SvAggregateMemberList * pAggList; // fuer Aggregation, erstes ist das MainObj - USHORT nStrongLockCount; - USHORT nOwnerLockCount; - BOOL bOwner:1, - bSVObject:1, // Ist Proxy, dann TRUE wenn andere Seite SV ist - bInClose:1; // TRUE, im DoClose + sal_uInt16 nStrongLockCount; + sal_uInt16 nOwnerLockCount; + sal_Bool bOwner:1, + bSVObject:1, // Ist Proxy, dann sal_True wenn andere Seite SV ist + bInClose:1; // sal_True, im DoClose void * DownAggCast( const SotFactory * pFact ); - void RemoveInterface( ULONG ); + void RemoveInterface( sal_uIntPtr ); void RemoveInterface( SotObject * ); #if defined (GCC) && (defined (C281) || defined (C290) || defined (C291)) public: @@ -403,8 +403,8 @@ public: protected: #endif virtual ~SotObject(); - void SetExtern() { bOwner = FALSE; } - virtual BOOL Close(); + void SetExtern() { bOwner = sal_False; } + virtual sal_Bool Close(); public: SotObject(); SO2_DECL_BASIC_CLASS_DLL(SotObject,SOTDATA()) @@ -413,11 +413,11 @@ public: // Nur damit die Makros in So3 nicht ganz ausufern virtual IUnknown * GetInterface( const SvGlobalName & ); - BOOL Owner() const { return bOwner; } - BOOL IsSvObject() const; + sal_Bool Owner() const { return bOwner; } + sal_Bool IsSvObject() const; // Methoden fuer die Aggregation (siehe OLE2-Spec) - BOOL ShouldDelete(); + sal_Bool ShouldDelete(); virtual void QueryDelete(); SvAggregateMemberList & GetAggList(); void AddInterface( SotObject * ); @@ -428,18 +428,18 @@ public: SotObject * GetMainObj() const; // !!! Read the Manual !!! - virtual USHORT FuzzyLock( BOOL bLock, BOOL bIntern, BOOL bClose ); - void Lock( BOOL bLock ) + virtual sal_uInt16 FuzzyLock( sal_Bool bLock, sal_Bool bIntern, sal_Bool bClose ); + void Lock( sal_Bool bLock ) { - FuzzyLock( bLock, TRUE, TRUE ); + FuzzyLock( bLock, sal_True, sal_True ); } - USHORT GetOwnerLockCount() const { return nOwnerLockCount; } - USHORT GetStrongLockCount() const { return nStrongLockCount; } + sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; } + sal_uInt16 GetStrongLockCount() const { return nStrongLockCount; } - void OwnerLock( BOOL bLock ); + void OwnerLock( sal_Bool bLock ); void RemoveOwnerLock(); - BOOL DoClose(); - BOOL IsInClose() const { return bInClose; } + sal_Bool DoClose(); + sal_Bool IsInClose() const { return bInClose; } private: // Kopieren und Zuweisen dieses Objekttyps ist nicht erlaubt diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx index 8d8775b5e181..213eea7f4ed3 100644 --- a/sot/inc/sot/sotdata.hxx +++ b/sot/inc/sot/sotdata.hxx @@ -45,7 +45,7 @@ class SotObjectList; struct SotData_Impl { - UINT32 nSvObjCount; + sal_uInt32 nSvObjCount; SotObjectList * pObjectList; SotFactoryList * pFactoryList; SotFactory * pSotObjectFactory; diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index 572e100c7299..ccfeae4d9193 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -71,9 +71,9 @@ friend class SotStorage; friend class ImpStream; BaseStorageStream * pOwnStm;// Zeiger auf den eigenen Stream protected: - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); + virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); virtual void FlushData(); ~SotStorageStream(); public: @@ -91,13 +91,13 @@ public: virtual void ResetError(); - virtual void SetSize( ULONG nNewSize ); - UINT32 GetSize() const; - BOOL CopyTo( SotStorageStream * pDestStm ); - virtual BOOL Commit(); - virtual BOOL Revert(); - BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); + virtual void SetSize( sal_uIntPtr nNewSize ); + sal_uInt32 GetSize() const; + sal_Bool CopyTo( SotStorageStream * pDestStm ); + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); + sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetXInputStream() const; }; @@ -125,21 +125,21 @@ friend class ::binfilter::SvStorage; BaseStorage * m_pTmpStg; // Temp-Storage fuer Transacted, nur auf diesem schreiben! ??? Useless ??? BaseStorage * m_pOwnStg; // Zielstorage SvStream * m_pStorStm; // nur fuer SDSTORAGES - ULONG m_nError; + sal_uIntPtr m_nError; String m_aName; // Name des Storage - BOOL m_bIsRoot:1, // z.B.: File-Storage + sal_Bool m_bIsRoot:1, // z.B.: File-Storage m_bDelStm:1; ByteString m_aKey; // aKey.Len != 0 -> Verschluesselung long m_nVersion; protected: ~SotStorage(); - void CreateStorage( BOOL bUCBStorage, StreamMode, StorageMode ); + void CreateStorage( sal_Bool bUCBStorage, StreamMode, StorageMode ); public: SotStorage( const String &, StreamMode = STREAM_STD_READWRITE, StorageMode = 0 ); - SotStorage( BOOL bUCBStorage, const String &, + SotStorage( sal_Bool bUCBStorage, const String &, StreamMode = STREAM_STD_READWRITE, StorageMode = 0 ); SotStorage( const ::ucbhelper::Content& rContent, const String &, @@ -147,8 +147,8 @@ public: StorageMode = 0 ); SotStorage( BaseStorage * ); SotStorage( SvStream & rStm ); - SotStorage( BOOL bUCBStorage, SvStream & rStm ); - SotStorage( SvStream * pStm, BOOL bDelete ); + SotStorage( sal_Bool bUCBStorage, SvStream & rStm ); + SotStorage( SvStream * pStm, sal_Bool bDelete ); SotStorage(); SO2_DECL_BASIC_CLASS_DLL(SotStorage,SOTDATA()) SO2_DECL_INVARIANT() @@ -156,12 +156,12 @@ public: SvMemoryStream * CreateMemoryStream(); const SvStream * GetSvStream(); - static BOOL IsStorageFile( const String & rFileName ); - static BOOL IsStorageFile( SvStream* pStream ); + static sal_Bool IsStorageFile( const String & rFileName ); + static sal_Bool IsStorageFile( SvStream* pStream ); virtual const String & GetName() const; - virtual BOOL Validate(); + virtual sal_Bool Validate(); void SetKey( const ByteString& rKey ); const ByteString & GetKey() const { return m_aKey; } @@ -175,37 +175,37 @@ public: return m_nVersion; } - ULONG GetErrorCode() const { return m_nError; } - ULONG GetError() const { return ERRCODE_TOERROR(m_nError); } - void SetError( ULONG nErrorCode ) + sal_uIntPtr GetErrorCode() const { return m_nError; } + sal_uIntPtr GetError() const { return ERRCODE_TOERROR(m_nError); } + void SetError( sal_uIntPtr nErrorCode ) { if( m_nError == SVSTREAM_OK ) m_nError = nErrorCode; } virtual void ResetError(); - BOOL IsRoot() const { return m_bIsRoot; } - void SignAsRoot( BOOL b = TRUE ) { m_bIsRoot = b; } - void SetDeleteStream( BOOL bDelete ) { m_bDelStm = bDelete; } + sal_Bool IsRoot() const { return m_bIsRoot; } + void SignAsRoot( sal_Bool b = sal_True ) { m_bIsRoot = b; } + void SetDeleteStream( sal_Bool bDelete ) { m_bDelStm = bDelete; } // eigener Datenbereich virtual void SetClass( const SvGlobalName & rClass, - ULONG bOriginalClipFormat, + sal_uIntPtr bOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG bOriginalClipFormat, + sal_uIntPtr bOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName();// Typ der Daten im Storage - virtual ULONG GetFormat(); + virtual sal_uIntPtr GetFormat(); virtual String GetUserName(); - virtual BOOL ShouldConvert(); + virtual sal_Bool ShouldConvert(); void SetName( const String& rName ); // Liste aller Elemente virtual void FillInfoList( SvStorageInfoList * ) const; - virtual BOOL CopyTo( SotStorage * pDestStg ); - virtual BOOL Commit(); - virtual BOOL Revert(); + virtual sal_Bool CopyTo( SotStorage * pDestStg ); + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); /* Element Methoden */ // Stream mit Verbindung zu Storage erzeugen, @@ -226,26 +226,26 @@ public: StreamMode = STREAM_STD_READWRITE, StorageMode = STORAGE_TRANSACTED ); // Abfrage auf Storage oder Stream - virtual BOOL IsStream( const String & rEleName ) const; - virtual BOOL IsStorage( const String & rEleName ) const; - virtual BOOL IsContained( const String & rEleName ) const; + virtual sal_Bool IsStream( const String & rEleName ) const; + virtual sal_Bool IsStorage( const String & rEleName ) const; + virtual sal_Bool IsContained( const String & rEleName ) const; // Element loeschen - virtual BOOL Remove( const String & rEleName ); + virtual sal_Bool Remove( const String & rEleName ); // Elementnamen aendern - virtual BOOL Rename( const String & rEleName, + virtual sal_Bool Rename( const String & rEleName, const String & rNewName ); - virtual BOOL CopyTo( const String & rEleName, SotStorage * pDest, + virtual sal_Bool CopyTo( const String & rEleName, SotStorage * pDest, const String & rNewName ); - virtual BOOL MoveTo( const String & rEleName, SotStorage * pDest, + virtual sal_Bool MoveTo( const String & rEleName, SotStorage * pDest, const String & rNewName ); SvStream* GetTargetSvStream() const; - BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ); - BOOL IsOLEStorage() const; - static BOOL IsOLEStorage( const String & rFileName ); - static BOOL IsOLEStorage( SvStream* pStream ); + sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ); + sal_Bool IsOLEStorage() const; + static sal_Bool IsOLEStorage( const String & rFileName ); + static sal_Bool IsOLEStorage( SvStream* pStream ); // this is temporary HACK, _MUST_ be removed before release ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > diff --git a/sot/inc/stg.hxx b/sot/inc/stg.hxx index 84373e26d596..b4f13b8d2660 100644 --- a/sot/inc/stg.hxx +++ b/sot/inc/stg.hxx @@ -65,30 +65,30 @@ class StgStrm; class SvGlobalName; struct ClsId { - INT32 n1; - INT16 n2, n3; - UINT8 n4, n5, n6, n7, n8, n9, n10, n11; + sal_Int32 n1; + sal_Int16 n2, n3; + sal_uInt8 n4, n5, n6, n7, n8, n9, n10, n11; }; class SOT_DLLPUBLIC StorageBase : public SvRefBase { protected: - ULONG m_nError; // error code + sal_uIntPtr m_nError; // error code StreamMode m_nMode; // open mode - BOOL m_bAutoCommit; + sal_Bool m_bAutoCommit; StorageBase(); virtual ~StorageBase(); public: TYPEINFO(); virtual const SvStream* GetSvStream() const = 0; - virtual BOOL Validate( BOOL=FALSE ) const = 0; - virtual BOOL ValidateMode( StreamMode ) const = 0; + virtual sal_Bool Validate( sal_Bool=sal_False ) const = 0; + virtual sal_Bool ValidateMode( StreamMode ) const = 0; void ResetError() const; - void SetError( ULONG ) const; - ULONG GetError() const; - BOOL Good() const { return BOOL( m_nError == SVSTREAM_OK ); } + void SetError( sal_uIntPtr ) const; + sal_uIntPtr GetError() const; + sal_Bool Good() const { return sal_Bool( m_nError == SVSTREAM_OK ); } StreamMode GetMode() const { return m_nMode; } - void SetAutoCommit( BOOL bSet ) + void SetAutoCommit( sal_Bool bSet ) { m_bAutoCommit = bSet; } }; @@ -96,16 +96,16 @@ class BaseStorageStream : public StorageBase { public: TYPEINFO(); - virtual ULONG Read( void * pData, ULONG nSize ) = 0; - virtual ULONG Write( const void* pData, ULONG nSize ) = 0; - virtual ULONG Seek( ULONG nPos ) = 0; - virtual ULONG Tell() = 0; + virtual sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ) = 0; + virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ) = 0; + virtual sal_uIntPtr Seek( sal_uIntPtr nPos ) = 0; + virtual sal_uIntPtr Tell() = 0; virtual void Flush() = 0; - virtual BOOL SetSize( ULONG nNewSize ) = 0; - virtual BOOL CopyTo( BaseStorageStream * pDestStm ) = 0; - virtual BOOL Commit() = 0; - virtual BOOL Revert() = 0; - virtual BOOL Equals( const BaseStorageStream& rStream ) const = 0; + virtual sal_Bool SetSize( sal_uIntPtr nNewSize ) = 0; + virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ) = 0; + virtual sal_Bool Commit() = 0; + virtual sal_Bool Revert() = 0; + virtual sal_Bool Equals( const BaseStorageStream& rStream ) const = 0; }; class SvStorageInfoList; @@ -114,45 +114,45 @@ class BaseStorage : public StorageBase public: TYPEINFO(); virtual const String& GetName() const = 0; - virtual BOOL IsRoot() const = 0; + virtual sal_Bool IsRoot() const = 0; virtual void SetClassId( const ClsId& ) = 0; virtual const ClsId& GetClassId() const = 0; virtual void SetDirty() = 0; virtual void SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual SvGlobalName GetClassName() = 0; - virtual ULONG GetFormat() = 0; + virtual sal_uIntPtr GetFormat() = 0; virtual String GetUserName() = 0; - virtual BOOL ShouldConvert() = 0; + virtual sal_Bool ShouldConvert() = 0; virtual void FillInfoList( SvStorageInfoList* ) const = 0; - virtual BOOL CopyTo( BaseStorage* pDestStg ) const = 0; - virtual BOOL Commit() = 0; - virtual BOOL Revert() = 0; + virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const = 0; + virtual sal_Bool Commit() = 0; + virtual sal_Bool Revert() = 0; virtual BaseStorageStream* OpenStream( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ) = 0; + sal_Bool bDirect = sal_True, const ByteString* pKey=0 ) = 0; virtual BaseStorage* OpenStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ) = 0; + sal_Bool bDirect = sal_False ) = 0; virtual BaseStorage* OpenUCBStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ) = 0; + sal_Bool bDirect = sal_False ) = 0; virtual BaseStorage* OpenOLEStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ) = 0; - virtual BOOL IsStream( const String& rEleName ) const = 0; - virtual BOOL IsStorage( const String& rEleName ) const = 0; - virtual BOOL IsContained( const String& rEleName ) const = 0; - virtual BOOL Remove( const String & rEleName ) = 0; - virtual BOOL Rename( const String & rEleName, const String & rNewName ) = 0; - virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0; - virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0; - virtual BOOL ValidateFAT() = 0; - virtual BOOL Equals( const BaseStorage& rStream ) const = 0; + sal_Bool bDirect = sal_False ) = 0; + virtual sal_Bool IsStream( const String& rEleName ) const = 0; + virtual sal_Bool IsStorage( const String& rEleName ) const = 0; + virtual sal_Bool IsContained( const String& rEleName ) const = 0; + virtual sal_Bool Remove( const String & rEleName ) = 0; + virtual sal_Bool Rename( const String & rEleName, const String & rNewName ) = 0; + virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0; + virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0; + virtual sal_Bool ValidateFAT() = 0; + virtual sal_Bool Equals( const BaseStorage& rStream ) const = 0; }; class OLEStorageBase @@ -163,8 +163,8 @@ protected: StgDirEntry* pEntry; // the dir entry OLEStorageBase( StgIo*, StgDirEntry*, StreamMode& ); ~OLEStorageBase(); - BOOL Validate_Impl( BOOL=FALSE ) const; - BOOL ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ; + sal_Bool Validate_Impl( sal_Bool=sal_False ) const; + sal_Bool ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ; const SvStream* GetSvStream_Impl() const; public: }; @@ -172,26 +172,26 @@ public: class StorageStream : public BaseStorageStream, public OLEStorageBase { //friend class Storage; - ULONG nPos; // current position + sal_uIntPtr nPos; // current position protected: ~StorageStream(); public: TYPEINFO(); StorageStream( StgIo*, StgDirEntry*, StreamMode ); - virtual ULONG Read( void * pData, ULONG nSize ); - virtual ULONG Write( const void* pData, ULONG nSize ); - virtual ULONG Seek( ULONG nPos ); - virtual ULONG Tell() { return nPos; } + virtual sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr Seek( sal_uIntPtr nPos ); + virtual sal_uIntPtr Tell() { return nPos; } virtual void Flush(); - virtual BOOL SetSize( ULONG nNewSize ); - virtual BOOL CopyTo( BaseStorageStream * pDestStm ); - virtual BOOL Commit(); - virtual BOOL Revert(); - virtual BOOL Validate( BOOL=FALSE ) const; - virtual BOOL ValidateMode( StreamMode ) const; - BOOL ValidateMode( StreamMode, StgDirEntry* p ) const; + virtual sal_Bool SetSize( sal_uIntPtr nNewSize ); + virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); + virtual sal_Bool Validate( sal_Bool=sal_False ) const; + virtual sal_Bool ValidateMode( StreamMode ) const; + sal_Bool ValidateMode( StreamMode, StgDirEntry* p ) const; const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorageStream& rStream ) const; + virtual sal_Bool Equals( const BaseStorageStream& rStream ) const; }; class UCBStorageStream; @@ -199,64 +199,64 @@ class UCBStorageStream; class SOT_DLLPUBLIC Storage : public BaseStorage, public OLEStorageBase { String aName; - BOOL bIsRoot; - void Init( BOOL bCreate ); + sal_Bool bIsRoot; + void Init( sal_Bool bCreate ); Storage( StgIo*, StgDirEntry*, StreamMode ); protected: ~Storage(); public: TYPEINFO(); - Storage( const String &, StreamMode = STREAM_STD_READWRITE, BOOL bDirect = TRUE ); - Storage( SvStream& rStrm, BOOL bDirect = TRUE ); - Storage( UCBStorageStream& rStrm, BOOL bDirect = TRUE ); + Storage( const String &, StreamMode = STREAM_STD_READWRITE, sal_Bool bDirect = sal_True ); + Storage( SvStream& rStrm, sal_Bool bDirect = sal_True ); + Storage( UCBStorageStream& rStrm, sal_Bool bDirect = sal_True ); - static BOOL IsStorageFile( const String & rFileName ); - static BOOL IsStorageFile( SvStream* ); + static sal_Bool IsStorageFile( const String & rFileName ); + static sal_Bool IsStorageFile( SvStream* ); virtual const String& GetName() const; - virtual BOOL IsRoot() const { return bIsRoot; } + virtual sal_Bool IsRoot() const { return bIsRoot; } virtual void SetClassId( const ClsId& ); virtual const ClsId& GetClassId() const; virtual void SetDirty(); virtual void SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual ULONG GetFormat(); + virtual sal_uIntPtr GetFormat(); virtual String GetUserName(); - virtual BOOL ShouldConvert(); + virtual sal_Bool ShouldConvert(); virtual void FillInfoList( SvStorageInfoList* ) const; - virtual BOOL CopyTo( BaseStorage* pDestStg ) const; - virtual BOOL Commit(); - virtual BOOL Revert(); + virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const; + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); virtual BaseStorageStream* OpenStream( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ); + sal_Bool bDirect = sal_True, const ByteString* pKey=0 ); virtual BaseStorage* OpenStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); + sal_Bool bDirect = sal_False ); virtual BaseStorage* OpenUCBStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); + sal_Bool bDirect = sal_False ); virtual BaseStorage* OpenOLEStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); - virtual BOOL IsStream( const String& rEleName ) const; - virtual BOOL IsStorage( const String& rEleName ) const; - virtual BOOL IsContained( const String& rEleName ) const; - virtual BOOL Remove( const String & rEleName ); - virtual BOOL Rename( const String & rEleName, const String & rNewName ); - virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); - virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); - virtual BOOL ValidateFAT(); - virtual BOOL Validate( BOOL=FALSE ) const; - virtual BOOL ValidateMode( StreamMode ) const; - BOOL ValidateMode( StreamMode, StgDirEntry* p ) const; + sal_Bool bDirect = sal_False ); + virtual sal_Bool IsStream( const String& rEleName ) const; + virtual sal_Bool IsStorage( const String& rEleName ) const; + virtual sal_Bool IsContained( const String& rEleName ) const; + virtual sal_Bool Remove( const String & rEleName ); + virtual sal_Bool Rename( const String & rEleName, const String & rNewName ); + virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); + virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); + virtual sal_Bool ValidateFAT(); + virtual sal_Bool Validate( sal_Bool=sal_False ) const; + virtual sal_Bool ValidateMode( StreamMode ) const; + sal_Bool ValidateMode( StreamMode, StgDirEntry* p ) const; virtual const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorage& rStream ) const; + virtual sal_Bool Equals( const BaseStorage& rStream ) const; }; class UCBStorageStream_Impl; @@ -270,25 +270,25 @@ protected: ~UCBStorageStream(); public: TYPEINFO(); - UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey=0 ); - UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey, BOOL bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress ); + UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey=0 ); + UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress ); UCBStorageStream( UCBStorageStream_Impl* ); - virtual ULONG Read( void * pData, ULONG nSize ); - virtual ULONG Write( const void* pData, ULONG nSize ); - virtual ULONG Seek( ULONG nPos ); - virtual ULONG Tell(); + virtual sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr Seek( sal_uIntPtr nPos ); + virtual sal_uIntPtr Tell(); virtual void Flush(); - virtual BOOL SetSize( ULONG nNewSize ); - virtual BOOL CopyTo( BaseStorageStream * pDestStm ); - virtual BOOL Commit(); - virtual BOOL Revert(); - virtual BOOL Validate( BOOL=FALSE ) const; - virtual BOOL ValidateMode( StreamMode ) const; + virtual sal_Bool SetSize( sal_uIntPtr nNewSize ); + virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); + virtual sal_Bool Validate( sal_Bool=sal_False ) const; + virtual sal_Bool ValidateMode( StreamMode ) const; const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorageStream& rStream ) const; - BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); + virtual sal_Bool Equals( const BaseStorageStream& rStream ) const; + sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); SvStream* GetModifySvStream(); @@ -309,76 +309,76 @@ class SOT_DLLPUBLIC UCBStorage : public BaseStorage protected: ~UCBStorage(); public: - static BOOL IsStorageFile( SvStream* ); - static BOOL IsStorageFile( const String& rName ); - static BOOL IsDiskSpannedFile( SvStream* ); + static sal_Bool IsStorageFile( SvStream* ); + static sal_Bool IsStorageFile( const String& rName ); + static sal_Bool IsDiskSpannedFile( SvStream* ); static String GetLinkedFile( SvStream& ); static String CreateLinkFile( const String& rName ); - UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, BOOL bDirect = TRUE, BOOL bIsRoot = TRUE ); + UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, sal_Bool bDirect = sal_True, sal_Bool bIsRoot = sal_True ); UCBStorage( const String& rName, StreamMode nMode, - BOOL bDirect = TRUE, - BOOL bIsRoot = TRUE ); + sal_Bool bDirect = sal_True, + sal_Bool bIsRoot = sal_True ); UCBStorage( const String& rName, StreamMode nMode, - BOOL bDirect, - BOOL bIsRoot, - BOOL bIsRepair, + sal_Bool bDirect, + sal_Bool bIsRoot, + sal_Bool bIsRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgressHandler ); UCBStorage( UCBStorage_Impl* ); - UCBStorage( SvStream& rStrm, BOOL bDirect = TRUE ); + UCBStorage( SvStream& rStrm, sal_Bool bDirect = sal_True ); TYPEINFO(); virtual const String& GetName() const; - virtual BOOL IsRoot() const; + virtual sal_Bool IsRoot() const; virtual void SetClassId( const ClsId& ); virtual const ClsId& GetClassId() const; virtual void SetDirty(); virtual void SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual ULONG GetFormat(); + virtual sal_uIntPtr GetFormat(); virtual String GetUserName(); - virtual BOOL ShouldConvert(); + virtual sal_Bool ShouldConvert(); virtual void FillInfoList( SvStorageInfoList* ) const; - virtual BOOL CopyTo( BaseStorage* pDestStg ) const; - virtual BOOL Commit(); - virtual BOOL Revert(); + virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const; + virtual sal_Bool Commit(); + virtual sal_Bool Revert(); virtual BaseStorageStream* OpenStream( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = TRUE, const ByteString* pKey=0 ); + sal_Bool bDirect = sal_True, const ByteString* pKey=0 ); virtual BaseStorage* OpenStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); + sal_Bool bDirect = sal_False ); virtual BaseStorage* OpenUCBStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); + sal_Bool bDirect = sal_False ); virtual BaseStorage* OpenOLEStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, - BOOL bDirect = FALSE ); - virtual BOOL IsStream( const String& rEleName ) const; - virtual BOOL IsStorage( const String& rEleName ) const; - virtual BOOL IsContained( const String& rEleName ) const; - virtual BOOL Remove( const String & rEleName ); - virtual BOOL Rename( const String & rEleName, const String & rNewName ); - virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); - virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); - virtual BOOL ValidateFAT(); - virtual BOOL Validate( BOOL=FALSE ) const; - virtual BOOL ValidateMode( StreamMode ) const; + sal_Bool bDirect = sal_False ); + virtual sal_Bool IsStream( const String& rEleName ) const; + virtual sal_Bool IsStorage( const String& rEleName ) const; + virtual sal_Bool IsContained( const String& rEleName ) const; + virtual sal_Bool Remove( const String & rEleName ); + virtual sal_Bool Rename( const String & rEleName, const String & rNewName ); + virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); + virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ); + virtual sal_Bool ValidateFAT(); + virtual sal_Bool Validate( sal_Bool=sal_False ) const; + virtual sal_Bool ValidateMode( StreamMode ) const; virtual const SvStream* GetSvStream() const; - virtual BOOL Equals( const BaseStorage& rStream ) const; - BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); - BOOL GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ); + virtual sal_Bool Equals( const BaseStorage& rStream ) const; + sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); + sal_Bool GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ); // HACK to avoid incompatible build, can be done since this feature is only for development // should be removed before release @@ -386,10 +386,10 @@ public: //#if _SOLAR__PRIVATE UCBStorageElement_Impl* FindElement_Impl( const String& rName ) const; - BOOL CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, + sal_Bool CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, BaseStorage* pDest, const String& rNew ) const; BaseStorage* OpenStorage_Impl( const String & rEleName, - StreamMode, BOOL bDirect, BOOL bForceUCBStorage ); + StreamMode, sal_Bool bDirect, sal_Bool bForceUCBStorage ); //#endif }; diff --git a/sot/inc/storinfo.hxx b/sot/inc/storinfo.hxx index dab1f6d4540e..5f225c26d0de 100644 --- a/sot/inc/storinfo.hxx +++ b/sot/inc/storinfo.hxx @@ -39,14 +39,14 @@ class SvStorageInfo friend class SvStorage; String aName; SvGlobalName aClassName; - ULONG nSize; - BOOL bStream:1, + sal_uIntPtr nSize; + sal_Bool bStream:1, bStorage:1; SvStorageInfo(){}; // Fuer SvStorage public: SvStorageInfo( const StgDirEntry& ); - SvStorageInfo( const String& rName, ULONG nSz, BOOL bIsStorage ) + SvStorageInfo( const String& rName, sal_uIntPtr nSz, sal_Bool bIsStorage ) : aName( rName ) , nSize( nSz ) , bStream( !bIsStorage ) @@ -55,9 +55,9 @@ public: const SvGlobalName & GetClassName() const { return aClassName; } const String & GetName() const { return aName; } - BOOL IsStream() const { return bStream; } - BOOL IsStorage() const { return bStorage; } - ULONG GetSize() const { return nSize; } + sal_Bool IsStream() const { return bStream; } + sal_Bool IsStorage() const { return bStorage; } + sal_uIntPtr GetSize() const { return nSize; } }; class SOT_DLLPUBLIC SvStorageInfoList @@ -66,7 +66,7 @@ class SOT_DLLPUBLIC SvStorageInfoList const SvStorageInfo * Get( const String & rName ); }; -SOT_DLLPUBLIC ULONG ReadClipboardFormat( SvStream & rStm ); -SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ); +SOT_DLLPUBLIC sal_uIntPtr ReadClipboardFormat( SvStream & rStm ); +SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uIntPtr nFormat ); #endif // _STORINFO_HXX diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index 67c2b64f105f..2b51162df3a0 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -237,11 +237,11 @@ static List& InitFormats_Impl() |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::RegisterFormatName( const String& rName ) +sal_uIntPtr SotExchange::RegisterFormatName( const String& rName ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); // teste zuerst die Standard - Name - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( COMPARE_EQUAL == rName.CompareToAscii( pFormatArray_Impl[ i ].pName ) ) return i; @@ -277,11 +277,11 @@ ULONG SotExchange::RegisterFormatName( const String& rName ) return nMax + SOT_FORMATSTR_ID_USER_END + 1; } -ULONG SotExchange::RegisterFormatMimeType( const String& rMimeType ) +sal_uIntPtr SotExchange::RegisterFormatMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); // teste zuerst die Standard - Name - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) return i; @@ -318,9 +318,9 @@ ULONG SotExchange::RegisterFormatMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::RegisterFormat( const DataFlavor& rFlavor ) +sal_uIntPtr SotExchange::RegisterFormat( const DataFlavor& rFlavor ) { - ULONG nRet = GetFormat( rFlavor ); + sal_uIntPtr nRet = GetFormat( rFlavor ); if( !nRet ) { @@ -338,7 +338,7 @@ ULONG SotExchange::RegisterFormat( const DataFlavor& rFlavor ) |* *************************************************************************/ -sal_Bool SotExchange::GetFormatDataFlavor( ULONG nFormat, DataFlavor& rFlavor ) +sal_Bool SotExchange::GetFormatDataFlavor( sal_uIntPtr nFormat, DataFlavor& rFlavor ) { sal_Bool bRet; @@ -376,11 +376,11 @@ sal_Bool SotExchange::GetFormatDataFlavor( ULONG nFormat, DataFlavor& rFlavor ) /************************************************************************* |* -|* SotExchange::GetFormatMimeType( ULONG nFormat ) +|* SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) |* *************************************************************************/ -String SotExchange::GetFormatMimeType( ULONG nFormat ) +String SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) { String sMimeType; if( SOT_FORMATSTR_ID_USER_END >= nFormat ) @@ -406,10 +406,10 @@ String SotExchange::GetFormatMimeType( ULONG nFormat ) |* *************************************************************************/ -ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) +sal_uIntPtr SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) return i; @@ -443,12 +443,12 @@ ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -ULONG SotExchange::GetFormat( const DataFlavor& rFlavor ) +sal_uIntPtr SotExchange::GetFormat( const DataFlavor& rFlavor ) { // teste zuerst die Standard - Name const ::rtl::OUString& rMimeType = rFlavor.MimeType; const String aMimeType( rMimeType ); - ULONG i, nMax = SOT_FORMAT_FILE_LIST; + sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( aMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) @@ -482,7 +482,7 @@ ULONG SotExchange::GetFormat( const DataFlavor& rFlavor ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -String SotExchange::GetFormatName( ULONG nFormat ) +String SotExchange::GetFormatName( sal_uIntPtr nFormat ) { DataFlavor aFlavor; String aRet; @@ -493,7 +493,7 @@ String SotExchange::GetFormatName( ULONG nFormat ) return aRet; } -BOOL SotExchange::IsInternal( const SvGlobalName& rName ) +sal_Bool SotExchange::IsInternal( const SvGlobalName& rName ) { if ( rName == SvGlobalName(SO3_SW_CLASSID_60) || rName == SvGlobalName(SO3_SC_CLASSID_60) || @@ -503,6 +503,6 @@ BOOL SotExchange::IsInternal( const SvGlobalName& rName ) rName == SvGlobalName(SO3_SM_CLASSID_60) || rName == SvGlobalName(SO3_SWWEB_CLASSID_60) || rName == SvGlobalName(SO3_SWGLOB_CLASSID_60) ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index 4934f99e78c6..5c4757188f38 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -96,10 +96,10 @@ void SotFactory::DeInit() aStr += " Count: "; aStr += p->GetRefCount(); DBG_TRACE( "\tReferences:" ); - p->TestObjRef( FALSE ); + p->TestObjRef( sal_False ); #ifdef TEST_INVARIANT DBG_TRACE( "\tInvariant:" ); - p->TestInvariant( TRUE ); + p->TestInvariant( sal_True ); #endif p = pObjList->Next(); } @@ -129,7 +129,7 @@ void SotFactory::DeInit() if( pSotData->pDataFlavorList ) { - for( ULONG i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ ) + for( sal_uIntPtr i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ ) delete (::com::sun::star::datatransfer::DataFlavor*) pSotData->pDataFlavorList->GetObject( i ); delete pSotData->pDataFlavorList; pSotData->pDataFlavorList = NULL; @@ -194,7 +194,7 @@ SotFactory::~SotFactory() |* |* Beschreibung Zugriffsmethoden auf SotData_Impl-Daten *************************************************************************/ -UINT32 SotFactory::GetSvObjectCount() +sal_uInt32 SotFactory::GetSvObjectCount() { return SOTDATA()->nSvObjCount; } @@ -295,10 +295,10 @@ void SotFactory::TestInvariant() SotData_Impl * pSotData = SOTDATA(); if( pSotData->pObjectList ) { - ULONG nCount = pSotData->pObjectList->Count(); - for( ULONG i = 0; i < nCount ; i++ ) + sal_uIntPtr nCount = pSotData->pObjectList->Count(); + for( sal_uIntPtr i = 0; i < nCount ; i++ ) { - pSotData->pObjectList->GetObject( i )->TestInvariant( FALSE ); + pSotData->pObjectList->GetObject( i )->TestInvariant( sal_False ); } } #endif @@ -388,17 +388,17 @@ void * SotFactory::AggCastAndAddRef |* |* Beschreibung *************************************************************************/ -BOOL SotFactory::Is( const SotFactory * pSuperCl ) const +sal_Bool SotFactory::Is( const SotFactory * pSuperCl ) const { if( this == pSuperCl ) - return TRUE; + return sal_True; - for( USHORT i = 0; i < nSuperCount; i++ ) + for( sal_uInt16 i = 0; i < nSuperCount; i++ ) { if( pSuperClasses[ i ]->Is( pSuperCl ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx index 4f854add304d..80828e596538 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -61,8 +61,8 @@ FileList::~FileList() void FileList::ClearAll( void ) { // Strings in der Liste loeschen - ULONG nCount = pStrList->Count(); - for( ULONG i = 0 ; i < nCount ; i++ ) + sal_uIntPtr nCount = pStrList->Count(); + for( sal_uIntPtr i = 0 ; i < nCount ; i++ ) delete pStrList->GetObject( i ); // Liste loeschen @@ -81,8 +81,8 @@ FileList& FileList::operator=( const FileList& rFileList ) *pStrList = *rFileList.pStrList; // Strings in der Liste kopieren - ULONG nCount = pStrList->Count(); - for( ULONG i = 0 ; i < nCount ; i++ ) + sal_uIntPtr nCount = pStrList->Count(); + for( sal_uIntPtr i = 0 ; i < nCount ; i++ ) pStrList->Replace( new String( *rFileList.pStrList->GetObject( i ) ), i ); return *this; @@ -94,7 +94,7 @@ FileList& FileList::operator=( const FileList& rFileList ) |* \*************************************************************************/ -ULONG FileList::GetFormat() +sal_uIntPtr FileList::GetFormat() { return FORMAT_FILE_LIST; } @@ -184,7 +184,7 @@ void FileList::AppendFile( const String& rStr ) pStrList->Insert( new String( rStr ) , pStrList->Count() ); } -String FileList::GetFile( ULONG i ) const +String FileList::GetFile( sal_uIntPtr i ) const { String aStr; if( i < pStrList->Count() ) @@ -192,7 +192,7 @@ String FileList::GetFile( ULONG i ) const return aStr; } -ULONG FileList::Count( void ) const +sal_uIntPtr FileList::Count( void ) const { return pStrList->Count(); } diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index baddde6e716f..10b6958ca4ac 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -46,9 +46,9 @@ using namespace::com::sun::star::datatransfer; struct SotAction_Impl { - ULONG nFormatId; // Clipboard Id - USHORT nAction; // Action Id - BYTE nContextCheckId; // additional check of content in clipboard + sal_uIntPtr nFormatId; // Clipboard Id + sal_uInt16 nAction; // Action Id + sal_uInt8 nContextCheckId; // additional check of content in clipboard }; @@ -68,7 +68,7 @@ struct SotAction_Impl struct SotDestinationEntry_Impl { - USHORT nDestination; + sal_uInt16 nDestination; const SotAction_Impl* aDefaultActions; const SotAction_Impl* aMoveActions; const SotAction_Impl* aCopyActions; @@ -1283,7 +1283,7 @@ static SotDestinationEntry_Impl __READONLY_DATA aDestinationArray[] = \ // - new style GetExchange methods - // --------------------------------- -sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, ULONG nId ) +sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_uIntPtr nId ) { DataFlavorExVector::iterator aIter( ( (DataFlavorExVector&) rDataFlavorExVector ).begin() ); DataFlavorExVector::iterator aEnd( ( (DataFlavorExVector&) rDataFlavorExVector ).end() ); @@ -1303,14 +1303,14 @@ sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, ULONG // ----------------------------------------------------------------------------- -static BOOL CheckTransferableContext_Impl( const Reference< XTransferable >* pxTransferable, const SotAction_Impl& +static sal_Bool CheckTransferableContext_Impl( const Reference< XTransferable >* pxTransferable, const SotAction_Impl& #ifdef WNT rEntry #endif ) { DataFlavor aFlavor; - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; try { @@ -1323,7 +1323,7 @@ rEntry { case FILEGRPDSC_ONLY_URL: { - bRet = FALSE; + bRet = sal_False; if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_FILECONTENT, aFlavor ) && (*pxTransferable)->isDataFlavorSupported( aFlavor ) && @@ -1367,11 +1367,11 @@ rEntry // ----------------------------------------------------------------------------- -static USHORT GetTransferableAction_Impl( +static sal_uInt16 GetTransferableAction_Impl( const DataFlavorExVector& rDataFlavorExVector, const SotAction_Impl* pArray, - ULONG& rFormat, - ULONG nOnlyTestFormat, + sal_uIntPtr& rFormat, + sal_uIntPtr nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { try @@ -1380,11 +1380,11 @@ static USHORT GetTransferableAction_Impl( { DataFlavor aFlavor; const SotAction_Impl* pArrayStart = pArray; - ULONG nId = pArray->nFormatId; + sal_uIntPtr nId = pArray->nFormatId; #if OSL_DEBUG_LEVEL > 1 // used for testing a specific format - change in the debugger the value - static ULONG nChkFormat = 0; + static sal_uIntPtr nChkFormat = 0; if( nChkFormat ) { for( ; 0xffff != pArray->nFormatId && @@ -1454,13 +1454,13 @@ static USHORT GetTransferableAction_Impl( // ----------------------------------------------------------------------------- -USHORT SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVector, - USHORT nDestination, - USHORT nSourceOptions, - USHORT nUserAction, - ULONG& rFormat, - USHORT& rDefaultAction, - ULONG nOnlyTestFormat, +sal_uInt16 SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVector, + sal_uInt16 nDestination, + sal_uInt16 nSourceOptions, + sal_uInt16 nUserAction, + sal_uIntPtr& rFormat, + sal_uInt16& rDefaultAction, + sal_uIntPtr nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { // hier wird jetzt die oben definierte Tabelle "implementiert" @@ -1568,11 +1568,11 @@ USHORT SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVe // ----------------------------------------------------------------------------- -USHORT SotExchange::GetExchangeAction( +sal_uInt16 SotExchange::GetExchangeAction( const Reference< XTransferable >& rxTransferable, - USHORT nDestination, USHORT nSourceOptions, - USHORT nUserAction, ULONG& rFormat, - USHORT& rDefaultAction, ULONG nOnlyTestFormat ) + sal_uInt16 nDestination, sal_uInt16 nSourceOptions, + sal_uInt16 nUserAction, sal_uIntPtr& rFormat, + sal_uInt16& rDefaultAction, sal_uIntPtr nOnlyTestFormat ) { DataFlavorExVector aVector; @@ -1625,9 +1625,9 @@ USHORT SotExchange::GetExchangeAction( nOnlyTestFormat, &rxTransferable ) ); } -USHORT SotExchange::IsChart( const SvGlobalName& rName ) +sal_uInt16 SotExchange::IsChart( const SvGlobalName& rName ) { - USHORT nRet=0; + sal_uInt16 nRet=0; // if ( rName == SvGlobalName( SO3_SCH_CLASSID_8 ) ) // nRet = SOFFICE_FILEFORMAT_8; // else @@ -1643,9 +1643,9 @@ USHORT SotExchange::IsChart( const SvGlobalName& rName ) return nRet; } -USHORT SotExchange::IsMath( const SvGlobalName& rName ) +sal_uInt16 SotExchange::IsMath( const SvGlobalName& rName ) { - USHORT nRet=0; + sal_uInt16 nRet=0; // if ( rName == SvGlobalName( SO3_SM_CLASSID_8 ) ) // nRet = SOFFICE_FILEFORMAT_8; // else diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 403a1c6bb61d..bdd3862d8d52 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -63,7 +63,7 @@ SO2_IMPL_INVARIANT(SotObject) |* |* Beschreibung: *************************************************************************/ -void SotObject::TestMemberObjRef( BOOL /*bFree*/ ) +void SotObject::TestMemberObjRef( sal_Bool /*bFree*/ ) { } @@ -73,7 +73,7 @@ void SotObject::TestMemberObjRef( BOOL /*bFree*/ ) |* Beschreibung: *************************************************************************/ #ifdef TEST_INVARIANT -void SotObject::TestMemberInvariant( BOOL /*bPrint*/ ) +void SotObject::TestMemberInvariant( sal_Bool /*bPrint*/ ) { } #endif @@ -87,9 +87,9 @@ SotObject::SotObject() : pAggList ( NULL ) , nStrongLockCount( 0 ) , nOwnerLockCount( 0 ) - , bOwner ( TRUE ) - , bSVObject ( FALSE ) - , bInClose ( FALSE ) + , bOwner ( sal_True ) + , bSVObject ( sal_False ) + , bInClose ( sal_False ) { SotFactory::IncSvObjectCount( this ); } @@ -123,7 +123,7 @@ IUnknown * SotObject::GetInterface( const SvGlobalName & ) |* |* Beschreibung *************************************************************************/ -BOOL SotObject::IsSvObject() const +sal_Bool SotObject::IsSvObject() const { return Owner() || bSVObject; } @@ -138,20 +138,20 @@ BOOL SotObject::IsSvObject() const |* Objekte um 1 erhoeht, muss dies bei der Berechnung |* des 0-RefCounts beruecksichtigt werden. *************************************************************************/ -BOOL SotObject::ShouldDelete() +sal_Bool SotObject::ShouldDelete() { if( !pAggList ) - return TRUE; + return sal_True; SvAggregate & rMO = pAggList->GetObject( 0 ); if( rMO.bMainObj ) { AddRef(); pAggList->GetObject( 0 ).pObj->ReleaseRef(); - return FALSE; + return sal_False; } - ULONG i; + sal_uIntPtr i; for( i = 1; i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); @@ -162,7 +162,7 @@ BOOL SotObject::ShouldDelete() AddRef(); // einen Aggregierten runterzaehlen rAgg.pObj->ReleaseRef(); - return FALSE; + return sal_False; } } AddNextRef(); // rekursion stoppen @@ -175,7 +175,7 @@ BOOL SotObject::ShouldDelete() delete pAggList; pAggList = NULL; // und zerstoeren, dies ist unabhaengig vom RefCount - return TRUE; + return sal_True; } /************************************************************************* @@ -212,7 +212,7 @@ SvAggregateMemberList & SotObject::GetAggList() |* |* Beschreibung *************************************************************************/ -void SotObject::RemoveInterface( ULONG nPos ) +void SotObject::RemoveInterface( sal_uIntPtr nPos ) { SvAggregate & rAgg = pAggList->GetObject( nPos ); if( !rAgg.bFactory ) @@ -238,7 +238,7 @@ void SotObject::RemoveInterface( SotObject * pObjP ) { DBG_ASSERT( pObjP, "null pointer" ); DBG_ASSERT( pAggList, "no aggregation list" ); - ULONG i; + sal_uIntPtr i; for( i = 0; i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); @@ -257,12 +257,12 @@ void SotObject::AddInterface( SotObject * pObjP ) { pObjP->AddRef(); // Objekt festhalten GetAggList(); - pAggList->Append( SvAggregate( pObjP, FALSE ) ); + pAggList->Append( SvAggregate( pObjP, sal_False ) ); // sich selbst als Typecast-Verwalter eintragen SvAggregateMemberList & rAList = pObjP->GetAggList(); DBG_ASSERT( !rAList.GetObject( 0 ).bMainObj, "try to aggregate twice" ); - rAList[ 0 ] = SvAggregate( this, TRUE ); + rAList[ 0 ] = SvAggregate( this, sal_True ); } /************************************************************************* @@ -298,7 +298,7 @@ void * SotObject::DownAggCast( const SotFactory * pFact ) // geht den Pfad nur Richtung aggregierte Objekte if( pAggList ) { - for( ULONG i = 1; !pCast || i < pAggList->Count(); i++ ) + for( sal_uIntPtr i = 1; !pCast || i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); if( rAgg.bFactory ) @@ -307,14 +307,14 @@ void * SotObject::DownAggCast( const SotFactory * pFact ) { // On-Demand erzeugen, wenn Typ gebraucht SotObjectRef aObj( CreateAggObj( rAgg.pFact ) ); - rAgg.bFactory = FALSE; + rAgg.bFactory = sal_False; rAgg.pObj = aObj; rAgg.pObj->AddRef(); // sich selbst als Typecast-Verwalter eintragen SvAggregateMemberList & rAList = rAgg.pObj->GetAggList(); DBG_ASSERT( !rAList.GetObject( 0 ).bMainObj, "try to aggregate twice" ); - rAList[ 0 ] = SvAggregate( this, TRUE ); + rAList[ 0 ] = SvAggregate( this, sal_True ); } } if( !rAgg.bFactory ) @@ -382,23 +382,23 @@ SotObject * SotObject::GetMainObj() const } //========================================================================= -USHORT SotObject::FuzzyLock +sal_uInt16 SotObject::FuzzyLock ( - BOOL bLock, /* TRUE, lock. FALSE, unlock. */ - BOOL /*bIntern*/, /* TRUE, es handelt sich um einen internen Lock. - FALSE, der Lock kam von aussen (Ole2, Ipc2) */ - BOOL bClose /* TRUE, Close aufrufen wenn letzte Lock */ + sal_Bool bLock, /* sal_True, lock. sal_False, unlock. */ + sal_Bool /*bIntern*/, /* sal_True, es handelt sich um einen internen Lock. + sal_False, der Lock kam von aussen (Ole2, Ipc2) */ + sal_Bool bClose /* sal_True, Close aufrufen wenn letzte Lock */ ) /* [Beschreibung] Erlaubte Parameterkombinationen: - ( TRUE, TRUE, * ) -> interner Lock. - ( FALSE, TRUE, TRUE ) -> interner Unlock mit Close, + ( sal_True, sal_True, * ) -> interner Lock. + ( sal_False, sal_True, sal_True ) -> interner Unlock mit Close, wenn LockCount() == 0 - ( TRUE, FALSE, * ) -> externer Lock. - ( FALSE, FALSE, TRUE ) -> externer Unlock mit Close, + ( sal_True, sal_False, * ) -> externer Lock. + ( sal_False, sal_False, sal_True ) -> externer Unlock mit Close, wenn LockCount() == 0 - ( FALSE, FALSE, FALSE ) -> externer Unlock + ( sal_False, sal_False, sal_False ) -> externer Unlock F"ur !Owner() wird der Aufruf an das externe Objekt weitergeleitet. F"ur diese muss das -Interface zur Vef"ugung stehen. @@ -411,7 +411,7 @@ USHORT SotObject::FuzzyLock */ { SotObjectRef xHoldAlive( this ); - USHORT nRet; + sal_uInt16 nRet; if( bLock ) { AddRef(); @@ -431,7 +431,7 @@ USHORT SotObject::FuzzyLock //========================================================================= void SotObject::OwnerLock ( - BOOL bLock /* TRUE, lock. FALSE, unlock. */ + sal_Bool bLock /* sal_True, lock. sal_False, unlock. */ ) /* [Beschreibung] @@ -467,23 +467,23 @@ void SotObject::RemoveOwnerLock() } //========================================================================= -BOOL SotObject::DoClose() +sal_Bool SotObject::DoClose() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !bInClose ) { SotObjectRef xHoldAlive( this ); - bInClose = TRUE; + bInClose = sal_True; bRet = Close(); - bInClose = FALSE; + bInClose = sal_False; } return bRet; } //========================================================================= -BOOL SotObject::Close() +sal_Bool SotObject::Close() { - return TRUE; + return sal_True; } diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 1c749aa05cb8..5adfb735d47b 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -66,7 +66,7 @@ TYPEINIT1( BaseStorageStream, StorageBase ); TYPEINIT1( BaseStorage, StorageBase ); StorageBase::StorageBase() - : m_bAutoCommit( FALSE ) + : m_bAutoCommit( sal_False ) { m_nMode = STREAM_READ; m_nError = SVSTREAM_OK; @@ -79,14 +79,14 @@ StorageBase::~StorageBase() // The following three methods are declared as const, since they // may be called from within a const method. -ULONG StorageBase::GetError() const +sal_uIntPtr StorageBase::GetError() const { - ULONG n = m_nError; + sal_uIntPtr n = m_nError; ((StorageBase*) this)->m_nError = SVSTREAM_OK; return n; } -void StorageBase::SetError( ULONG n ) const +void StorageBase::SetError( sal_uIntPtr n ) const { if( !m_nError ) ((StorageBase*) this)->m_nError = n; @@ -133,20 +133,20 @@ OLEStorageBase::~OLEStorageBase() // Validate the instance for I/O -BOOL OLEStorageBase::Validate_Impl( BOOL bWrite ) const +sal_Bool OLEStorageBase::Validate_Impl( sal_Bool bWrite ) const { if( pEntry && !pEntry->bInvalid && ( !bWrite || !pEntry->bDirect || ( nStreamMode & STREAM_WRITE ) ) ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } -BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const +sal_Bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const { if( m == INTERNAL_MODE ) - return TRUE; - USHORT nCurMode = ( p && p->nRefCnt ) ? p->nMode : 0xFFFF; + return sal_True; + sal_uInt16 nCurMode = ( p && p->nRefCnt ) ? p->nMode : 0xFFFF; if( ( m & 3 ) == STREAM_READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed @@ -154,7 +154,7 @@ BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) || ( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) - return TRUE; + return sal_True; } else { @@ -163,9 +163,9 @@ BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const // the commit may fail if( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -199,18 +199,18 @@ StorageStream::~StorageStream() pEntry->Commit(); } -BOOL StorageStream::Equals( const BaseStorageStream& rStream ) const +sal_Bool StorageStream::Equals( const BaseStorageStream& rStream ) const { const StorageStream* pOther = PTR_CAST( StorageStream, &rStream ); return pOther && ( pOther->pEntry == pEntry ); } -ULONG StorageStream::Read( void* pData, ULONG nSize ) +sal_uIntPtr StorageStream::Read( void* pData, sal_uIntPtr nSize ) { if( Validate() ) { pEntry->Seek( nPos ); - nSize = pEntry->Read( pData, (INT32) nSize ); + nSize = pEntry->Read( pData, (sal_Int32) nSize ); pIo->MoveError( *this ); nPos += nSize; } @@ -219,12 +219,12 @@ ULONG StorageStream::Read( void* pData, ULONG nSize ) return nSize; } -ULONG StorageStream::Write( const void* pData, ULONG nSize ) +sal_uIntPtr StorageStream::Write( const void* pData, sal_uIntPtr nSize ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { pEntry->Seek( nPos ); - nSize = pEntry->Write( pData, (INT32) nSize ); + nSize = pEntry->Write( pData, (sal_Int32) nSize ); pIo->MoveError( *this ); nPos += nSize; } @@ -233,7 +233,7 @@ ULONG StorageStream::Write( const void* pData, ULONG nSize ) return nSize; } -ULONG StorageStream::Seek( ULONG n ) +sal_uIntPtr StorageStream::Seek( sal_uIntPtr n ) { if( Validate() ) return nPos = pEntry->Seek( n ); @@ -247,26 +247,26 @@ void StorageStream::Flush() Commit(); } -BOOL StorageStream::SetSize( ULONG nNewSize ) +sal_Bool StorageStream::SetSize( sal_uIntPtr nNewSize ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { - BOOL b = pEntry->SetSize( (INT32) nNewSize ); + sal_Bool b = pEntry->SetSize( (sal_Int32) nNewSize ); pIo->MoveError( *this ); return b; } else - return FALSE; + return sal_False; } -BOOL StorageStream::Commit() +sal_Bool StorageStream::Commit() { if( !Validate() ) - return FALSE; + return sal_False; if( !( m_nMode & STREAM_WRITE ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } else { @@ -276,22 +276,22 @@ BOOL StorageStream::Commit() } } -BOOL StorageStream::Revert() +sal_Bool StorageStream::Revert() { pEntry->Revert(); pIo->MoveError( *this ); return Good(); } -BOOL StorageStream::CopyTo( BaseStorageStream* pDest ) +sal_Bool StorageStream::CopyTo( BaseStorageStream* pDest ) { - if( !Validate() || !pDest->Validate( TRUE ) || Equals( *pDest ) ) - return FALSE; + if( !Validate() || !pDest->Validate( sal_True ) || Equals( *pDest ) ) + return sal_False; pEntry->Copy( *pDest ); pDest->Commit(); pIo->MoveError( *this ); SetError( pDest->GetError() ); - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } const SvStream* StorageStream::GetSvStream() const @@ -299,25 +299,25 @@ const SvStream* StorageStream::GetSvStream() const return GetSvStream_Impl(); } -BOOL StorageStream::Validate( BOOL bValidate ) const +sal_Bool StorageStream::Validate( sal_Bool bValidate ) const { - BOOL bRet = Validate_Impl( bValidate ); + sal_Bool bRet = Validate_Impl( bValidate ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL StorageStream::ValidateMode( StreamMode nMode ) const +sal_Bool StorageStream::ValidateMode( StreamMode nMode ) const { - BOOL bRet = ValidateMode_Impl( nMode, NULL ); + sal_Bool bRet = ValidateMode_Impl( nMode, NULL ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const +sal_Bool StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const { - BOOL bRet = ValidateMode_Impl( nMode, p ); + sal_Bool bRet = ValidateMode_Impl( nMode, p ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; @@ -328,26 +328,26 @@ BOOL StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const SvStorageInfo::SvStorageInfo( const StgDirEntry& rE ) { rE.aEntry.GetName( aName ); - bStorage = BOOL( rE.aEntry.GetType() == STG_STORAGE ); - bStream = BOOL( rE.aEntry.GetType() == STG_STREAM ); + bStorage = sal_Bool( rE.aEntry.GetType() == STG_STORAGE ); + bStream = sal_Bool( rE.aEntry.GetType() == STG_STREAM ); nSize = bStorage ? 0 : rE.aEntry.GetSize(); } /////////////////////////// class Storage //////////////////////////////// -BOOL Storage::IsStorageFile( const String & rFileName ) +sal_Bool Storage::IsStorageFile( const String & rFileName ) { StgIo aIo; if( aIo.Open( rFileName, STREAM_STD_READ ) ) return aIo.Load(); - return FALSE; + return sal_False; } -BOOL Storage::IsStorageFile( SvStream* pStream ) +sal_Bool Storage::IsStorageFile( SvStream* pStream ) { StgHeader aHdr; - ULONG nPos = pStream->Tell(); - BOOL bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); + sal_uIntPtr nPos = pStream->Tell(); + sal_Bool bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); // It's not a stream error if it is too small for a OLE storage header if ( pStream->GetErrorCode() == ERRCODE_IO_CANTSEEK ) @@ -361,21 +361,21 @@ BOOL Storage::IsStorageFile( SvStream* pStream ) TYPEINIT1( Storage, BaseStorage ); -Storage::Storage( const String& rFile, StreamMode m, BOOL bDirect ) - : OLEStorageBase( new StgIo, NULL, m_nMode ), aName( rFile ), bIsRoot( FALSE ) +Storage::Storage( const String& rFile, StreamMode m, sal_Bool bDirect ) + : OLEStorageBase( new StgIo, NULL, m_nMode ), aName( rFile ), bIsRoot( sal_False ) { - BOOL bTemp = FALSE; + sal_Bool bTemp = sal_False; if( !aName.Len() ) { // no name = temporary name! aName = TempFile::CreateTempName(); - bTemp = TRUE; + bTemp = sal_True; } // the root storage creates the I/O system m_nMode = m; if( pIo->Open( aName, m ) ) { - Init( BOOL( ( m & ( STREAM_TRUNC | STREAM_NOCREATE ) ) == STREAM_TRUNC ) ); + Init( sal_Bool( ( m & ( STREAM_TRUNC | STREAM_NOCREATE ) ) == STREAM_TRUNC ) ); if( pEntry ) { pEntry->bDirect = bDirect; @@ -392,19 +392,19 @@ Storage::Storage( const String& rFile, StreamMode m, BOOL bDirect ) // Create a storage on a given stream. -Storage::Storage( SvStream& r, BOOL bDirect ) - : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( FALSE ) +Storage::Storage( SvStream& r, sal_Bool bDirect ) + : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( sal_False ) { m_nMode = STREAM_READ; if( r.IsWritable() ) m_nMode = STREAM_READ | STREAM_WRITE; if( r.GetError() == SVSTREAM_OK ) { - pIo->SetStrm( &r, FALSE ); - ULONG nSize = r.Seek( STREAM_SEEK_TO_END ); + pIo->SetStrm( &r, sal_False ); + sal_uIntPtr nSize = r.Seek( STREAM_SEEK_TO_END ); r.Seek( 0L ); // Initializing is OK if the stream is empty - Init( BOOL( nSize == 0 ) ); + Init( sal_Bool( nSize == 0 ) ); if( pEntry ) { pEntry->bDirect = bDirect; @@ -420,8 +420,8 @@ Storage::Storage( SvStream& r, BOOL bDirect ) } -Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) - : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( FALSE ) +Storage::Storage( UCBStorageStream& rStrm, sal_Bool bDirect ) + : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( sal_False ) { m_nMode = STREAM_READ; @@ -435,7 +435,7 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) SvStream* pStream = rStrm.GetModifySvStream(); if ( !pStream ) { - OSL_ENSURE( FALSE, "UCBStorageStream can not provide SvStream implementation!\n" ); + OSL_ENSURE( sal_False, "UCBStorageStream can not provide SvStream implementation!\n" ); SetError( SVSTREAM_GENERALERROR ); pEntry = NULL; return; @@ -446,10 +446,10 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) pIo->SetStrm( &rStrm ); - ULONG nSize = pStream->Seek( STREAM_SEEK_TO_END ); + sal_uIntPtr nSize = pStream->Seek( STREAM_SEEK_TO_END ); pStream->Seek( 0L ); // Initializing is OK if the stream is empty - Init( BOOL( nSize == 0 ) ); + Init( sal_Bool( nSize == 0 ) ); if( pEntry ) { pEntry->bDirect = bDirect; @@ -462,14 +462,14 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect ) // Perform common code for both ctors above. -void Storage::Init( BOOL bCreate ) +void Storage::Init( sal_Bool bCreate ) { pEntry = NULL; - BOOL bHdrLoaded = FALSE; - bIsRoot = TRUE; + sal_Bool bHdrLoaded = sal_False; + bIsRoot = sal_True; if( pIo->Good() ) { - ULONG nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); + sal_uIntPtr nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); pIo->GetStrm()->Seek( 0L ); if( nSize ) { @@ -498,7 +498,7 @@ void Storage::Init( BOOL bCreate ) // Internal ctor Storage::Storage( StgIo* p, StgDirEntry* q, StreamMode m ) - : OLEStorageBase( p, q, m_nMode ), bIsRoot( FALSE ) + : OLEStorageBase( p, q, m_nMode ), bIsRoot( sal_False ) { if( q ) q->aEntry.GetName( aName ); @@ -561,7 +561,7 @@ void Storage::FillInfoList( SvStorageInfoList* pList ) const // Open or create a substorage -BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, BOOL bDirect ) +BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, sal_Bool bDirect ) { DBG_ERROR("Not supported!"); /* @@ -572,20 +572,20 @@ BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, BOOL bD return OpenStorage( rName, m, bDirect ); } -BaseStorage* Storage::OpenOLEStorage( const String& rName, StreamMode m, BOOL bDirect ) +BaseStorage* Storage::OpenOLEStorage( const String& rName, StreamMode m, sal_Bool bDirect ) { return OpenStorage( rName, m, bDirect ); } -BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, BOOL bDirect ) +BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, sal_Bool bDirect ) { if( !Validate() || !ValidateMode( m ) ) return new Storage( pIo, NULL, m ); - BOOL bSetAutoCommit = FALSE; + sal_Bool bSetAutoCommit = sal_False; if( bDirect && !pEntry->bDirect ) { - bSetAutoCommit = TRUE; - bDirect = FALSE; + bSetAutoCommit = sal_True; + bDirect = sal_False; } StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); @@ -593,14 +593,14 @@ BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, BOOL bDire { if( !( m & STREAM_NOCREATE ) ) { - BOOL bTemp = FALSE; + sal_Bool bTemp = sal_False; // create a new storage String aNewName = rName; if( !aNewName.Len() ) { aNewName.AssignAscii( "Temp Stg " ); aNewName.Append( String::CreateFromInt32( ++nTmpCount ) ); - bTemp = TRUE; + bTemp = sal_True; } p = pIo->pTOC->Create( *pEntry, aNewName, STG_STORAGE ); if( p ) @@ -630,13 +630,13 @@ BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, BOOL bDire } Storage* pStg = new Storage( pIo, p, m ); pIo->MoveError( *pStg ); - if( m & STREAM_WRITE ) pStg->m_bAutoCommit = TRUE; + if( m & STREAM_WRITE ) pStg->m_bAutoCommit = sal_True; return pStg; } // Open a stream -BaseStorageStream* Storage::OpenStream( const String& rName, StreamMode m, BOOL, +BaseStorageStream* Storage::OpenStream( const String& rName, StreamMode m, sal_Bool, const ByteString* #ifdef DBG_UTIL pB @@ -648,7 +648,7 @@ pB if( !Validate() || !ValidateMode( m ) ) return new StorageStream( pIo, NULL, m ); StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); - BOOL bTemp = FALSE; + sal_Bool bTemp = sal_False; if( !p ) { if( !( m & STREAM_NOCREATE ) ) @@ -660,7 +660,7 @@ pB { aNewName.AssignAscii( "Temp Strm " ); aNewName.Append( String::CreateFromInt32( ++nTmpCount ) ); - bTemp = TRUE; + bTemp = sal_True; } p = pIo->pTOC->Create( *pEntry, aNewName, STG_STREAM ); } @@ -682,50 +682,50 @@ pB } StorageStream* pStm = new StorageStream( pIo, p, m ); if( p && !p->bDirect ) - pStm->SetAutoCommit( TRUE ); + pStm->SetAutoCommit( sal_True ); pIo->MoveError( *pStm ); return pStm; } // Delete a stream or substorage by setting the temp bit. -BOOL Storage::Remove( const String& rName ) +sal_Bool Storage::Remove( const String& rName ) { - if( !Validate( TRUE ) ) - return FALSE; + if( !Validate( sal_True ) ) + return sal_False; StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( p ) { - p->Invalidate( TRUE ); - return TRUE; + p->Invalidate( sal_True ); + return sal_True; } else { SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } } // Rename a storage element -BOOL Storage::Rename( const String& rOld, const String& rNew ) +sal_Bool Storage::Rename( const String& rOld, const String& rNew ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { - BOOL b = pIo->pTOC->Rename( *pEntry, rOld, rNew ); + sal_Bool b = pIo->pTOC->Rename( *pEntry, rOld, rNew ); pIo->MoveError( *this ); return b; } else - return FALSE; + return sal_False; } // Copy one element -BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNew ) +sal_Bool Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNew ) { - if( !Validate() || !pDest || !pDest->Validate( TRUE ) ) - return FALSE; + if( !Validate() || !pDest || !pDest->Validate( sal_True ) ) + return sal_False; StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem ); if( pElem ) { @@ -734,7 +734,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe if( !pElem->IsContained( pDest->pEntry ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } */ if( pElem->aEntry.GetType() == STG_STORAGE ) @@ -743,7 +743,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe BaseStorage* p1 = OpenStorage( rElem, INTERNAL_MODE ); BaseStorage* p2 = pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); - ULONG nTmpErr = p2->GetError(); + sal_uIntPtr nTmpErr = p2->GetError(); if( !nTmpErr ) { p2->SetClassId( p1->GetClassId() ); @@ -761,7 +761,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe delete p1; delete p2; - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } else { @@ -769,7 +769,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe BaseStorageStream* p1 = OpenStream( rElem, INTERNAL_MODE ); BaseStorageStream* p2 = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); - ULONG nTmpErr = p2->GetError(); + sal_uIntPtr nTmpErr = p2->GetError(); if( !nTmpErr ) { p1->CopyTo( p2 ); @@ -786,58 +786,58 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe delete p1; delete p2; - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } } SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } -BOOL Storage::CopyTo( BaseStorage* pDest ) const +sal_Bool Storage::CopyTo( BaseStorage* pDest ) const { - if( !Validate() || !pDest || !pDest->Validate( TRUE ) || Equals( *pDest ) ) + if( !Validate() || !pDest || !pDest->Validate( sal_True ) || Equals( *pDest ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } Storage* pThis = (Storage*) this; /* if( !pThis->pEntry->IsContained( pDest->pEntry ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } */ pDest->SetClassId( GetClassId() ); pDest->SetDirty(); SvStorageInfoList aList; FillInfoList( &aList ); - BOOL bRes = TRUE; - for( USHORT i = 0; i < aList.Count() && bRes; i++ ) + sal_Bool bRes = sal_True; + for( sal_uInt16 i = 0; i < aList.Count() && bRes; i++ ) { SvStorageInfo& rInfo = aList.GetObject( i ); bRes = pThis->CopyTo( rInfo.GetName(), pDest, rInfo.GetName() ); } if( !bRes ) SetError( pDest->GetError() ); - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } // Move one element -BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rNew ) +sal_Bool Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rNew ) { - if( !Validate() || !pODest || !pODest->Validate( TRUE ) || Equals( *pODest ) ) + if( !Validate() || !pODest || !pODest->Validate( sal_True ) || Equals( *pODest ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem ); if( pElem ) { // Simplest case: both storages share the same file - BOOL bRes; + sal_Bool bRes; Storage *pOther = PTR_CAST( Storage, pODest ); if( pOther && pIo == pOther->pIo && rElem == rNew ) { @@ -848,14 +848,14 @@ BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rN { // cyclic move SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } bRes = pIo->pTOC->Move( *pEntry, *pDest->pEntry, rNew ); if( !bRes ) { pIo->MoveError( *this ); pDest->pIo->MoveError( *pDest ); - ULONG nErr = GetError(); + sal_uIntPtr nErr = GetError(); if( !nErr ) nErr = pDest->GetError(); SetError( nErr ); @@ -873,51 +873,51 @@ BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rN return bRes; } SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } -BOOL Storage::IsStorage( const String& rName ) const +sal_Bool Storage::IsStorage( const String& rName ) const { if( Validate() ) { StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( p ) - return BOOL( p->aEntry.GetType() == STG_STORAGE ); + return sal_Bool( p->aEntry.GetType() == STG_STORAGE ); } - return FALSE; + return sal_False; } -BOOL Storage::IsStream( const String& rName ) const +sal_Bool Storage::IsStream( const String& rName ) const { if( Validate() ) { StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( p ) - return BOOL( p->aEntry.GetType() == STG_STREAM ); + return sal_Bool( p->aEntry.GetType() == STG_STREAM ); } - return FALSE; + return sal_False; } -BOOL Storage::IsContained( const String& rName ) const +sal_Bool Storage::IsContained( const String& rName ) const { if( Validate() ) - return BOOL( pIo->pTOC->Find( *pEntry, rName ) != NULL ); + return sal_Bool( pIo->pTOC->Find( *pEntry, rName ) != NULL ); else - return FALSE; + return sal_False; } // Commit all sub-elements within this storage. If this is // the root, commit the FAT, the TOC and the header as well. -BOOL Storage::Commit() +sal_Bool Storage::Commit() { - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; if( !Validate() ) - return FALSE; + return sal_False; if( !( m_nMode & STREAM_WRITE ) ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; + return sal_False; } else { @@ -936,9 +936,9 @@ BOOL Storage::Commit() return bRes; } -BOOL Storage::Revert() +sal_Bool Storage::Revert() { - return TRUE; + return sal_True; } ///////////////////////////// OLE Support //////////////////////////////// @@ -946,16 +946,16 @@ BOOL Storage::Revert() // Set the storage type void Storage::SetClass( const SvGlobalName & rClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { // set the class name in the root entry pEntry->aEntry.SetClassId( (const ClsId&) rClass.GetCLSID() ); pEntry->SetDirty(); // then create the streams - StgCompObjStream aCompObj( *this, TRUE ); + StgCompObjStream aCompObj( *this, sal_True ); aCompObj.GetClsId() = (const ClsId&) rClass.GetCLSID(); aCompObj.GetCbFormat() = nOriginalClipFormat; aCompObj.GetUserName() = rUserTypeName; @@ -973,14 +973,14 @@ void Storage::SetClass( const SvGlobalName & rClass, } void Storage::SetConvertClass( const SvGlobalName & rConvertClass, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) { - if( Validate( TRUE ) ) + if( Validate( sal_True ) ) { SetClass( rConvertClass, nOriginalClipFormat, rUserTypeName ); // plus the convert flag: - StgOleStream aOle( *this, TRUE ); + StgOleStream aOle( *this, sal_True ); aOle.GetFlags() |= 4; if( !aOle.Store() ) SetError( aOle.GetError() ); @@ -989,7 +989,7 @@ void Storage::SetConvertClass( const SvGlobalName & rConvertClass, SvGlobalName Storage::GetClassName() { - StgCompObjStream aCompObj( *this, FALSE ); + StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) return SvGlobalName( (const CLSID&) aCompObj.GetClsId() ); pIo->ResetError(); @@ -1000,9 +1000,9 @@ SvGlobalName Storage::GetClassName() return SvGlobalName(); } -ULONG Storage::GetFormat() +sal_uIntPtr Storage::GetFormat() { - StgCompObjStream aCompObj( *this, FALSE ); + StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) return aCompObj.GetCbFormat(); pIo->ResetError(); @@ -1011,26 +1011,26 @@ ULONG Storage::GetFormat() String Storage::GetUserName() { - StgCompObjStream aCompObj( *this, FALSE ); + StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) return aCompObj.GetUserName(); pIo->ResetError(); return String(); } -BOOL Storage::ShouldConvert() +sal_Bool Storage::ShouldConvert() { - StgOleStream aOle( *this, FALSE ); + StgOleStream aOle( *this, sal_False ); if( aOle.Load() ) - return BOOL( ( aOle.GetFlags() & 4 ) != 0 ); + return sal_Bool( ( aOle.GetFlags() & 4 ) != 0 ); else { pIo->ResetError(); - return FALSE; + return sal_False; } } -BOOL Storage::ValidateFAT() +sal_Bool Storage::ValidateFAT() { Link aLink = StgIo::GetErrorLink(); ErrCode nErr = pIo->ValidateFATs(); @@ -1058,31 +1058,31 @@ const SvStream* Storage::GetSvStream() const return GetSvStream_Impl(); } -BOOL Storage::Validate( BOOL bValidate ) const +sal_Bool Storage::Validate( sal_Bool bValidate ) const { - BOOL bRet = Validate_Impl( bValidate ); + sal_Bool bRet = Validate_Impl( bValidate ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL Storage::ValidateMode( StreamMode nMode ) const +sal_Bool Storage::ValidateMode( StreamMode nMode ) const { - BOOL bRet = ValidateMode_Impl( nMode ); + sal_Bool bRet = ValidateMode_Impl( nMode ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL Storage::ValidateMode( StreamMode nMode, StgDirEntry* p ) const +sal_Bool Storage::ValidateMode( StreamMode nMode, StgDirEntry* p ) const { - BOOL bRet = ValidateMode_Impl( nMode, p ); + sal_Bool bRet = ValidateMode_Impl( nMode, p ); if ( !bRet ) SetError( SVSTREAM_ACCESS_DENIED ); return bRet; } -BOOL Storage::Equals( const BaseStorage& rStorage ) const +sal_Bool Storage::Equals( const BaseStorage& rStorage ) const { const Storage* pOther = PTR_CAST( Storage, &rStorage ); return pOther && ( pOther->pEntry == pEntry ); diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx index 3542a965da33..ad400f85dee5 100644 --- a/sot/source/sdstor/stgavl.cxx +++ b/sot/source/sdstor/stgavl.cxx @@ -212,7 +212,7 @@ StgAvlNode* StgAvlNode::RotRL() // Remove a tree element. Return the removed element or NULL. -StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, BOOL bPtrs ) +StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, sal_Bool bPtrs ) { if( *p ) { @@ -279,21 +279,21 @@ void StgAvlNode::StgEnum( short& n ) } // Add node to AVL tree. -// Return FALSE if the element already exists. +// Return sal_False if the element already exists. -BOOL StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns ) +sal_Bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns ) { StgAvlNode* pPivot, *pHeavy, *pNewRoot, *pParent, *pPrev; // special case - empty tree if( *pRoot == NULL ) { *pRoot = pIns; - return TRUE; + return sal_True; } // find insertion point and return if already present short nRes = (*pRoot)->Locate( pIns, &pPivot, &pParent, &pPrev ); if( !nRes ) - return FALSE; + return sal_False; // add new node if( nRes < 0 ) pPrev->pLeft = pIns; @@ -323,19 +323,19 @@ BOOL StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns ) else if( pPivot == pParent->pRight ) pParent->pRight = pNewRoot; } - return TRUE; + return sal_True; } -// Remove node from tree. Returns TRUE is found and removed. +// Remove node from tree. Returns sal_True is found and removed. // Actually delete if bDel -BOOL StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, BOOL bDel ) +sal_Bool StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, sal_Bool bDel ) { // special case - empty tree if( *pRoot == NULL ) - return FALSE; + return sal_False; // delete the element - pDel = Rem( pRoot, pDel, FALSE ); + pDel = Rem( pRoot, pDel, sal_False ); if( pDel ) { if( bDel ) @@ -345,30 +345,30 @@ BOOL StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, BOOL bDel ) /* StgAvlNode* pNew = NULL; while( *pRoot ) { - StgAvlNode* p = Rem( pRoot, *pRoot, FALSE ); + StgAvlNode* p = Rem( pRoot, *pRoot, sal_False ); Insert( &pNew, p ); } *pRoot = pNew;*/ - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } -// Move node to a different tree. Returns TRUE is found and moved. This routine +// Move node to a different tree. Returns sal_True is found and moved. This routine // may be called when the key has changed. -BOOL StgAvlNode::Move +sal_Bool StgAvlNode::Move ( StgAvlNode** pRoot1, StgAvlNode** pRoot2, StgAvlNode* pMove ) { // special case - empty tree if( *pRoot1 == NULL ) - return FALSE; - pMove = Rem( pRoot1, pMove, FALSE ); + return sal_False; + pMove = Rem( pRoot1, pMove, sal_False ); if( pMove ) return Insert( pRoot2, pMove ); else - return FALSE; + return sal_False; } ////////////////////////// class AvlIterator ///////////////////////// diff --git a/sot/source/sdstor/stgavl.hxx b/sot/source/sdstor/stgavl.hxx index 66f424888e6d..29b33ae81109 100644 --- a/sot/source/sdstor/stgavl.hxx +++ b/sot/source/sdstor/stgavl.hxx @@ -46,7 +46,7 @@ private: StgAvlNode* RotRR(); StgAvlNode* RotRL(); void StgEnum( short& ); - static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, BOOL ); + static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, sal_Bool ); protected: short nId; // iterator ID short nBalance; // indicates tree balance @@ -55,9 +55,9 @@ protected: public: virtual ~StgAvlNode(); StgAvlNode* Find( StgAvlNode* ); - static BOOL Insert( StgAvlNode**, StgAvlNode* ); - static BOOL Remove( StgAvlNode**, StgAvlNode*, BOOL bDel = TRUE ); - static BOOL Move( StgAvlNode**, StgAvlNode**, StgAvlNode* ); + static sal_Bool Insert( StgAvlNode**, StgAvlNode* ); + static sal_Bool Remove( StgAvlNode**, StgAvlNode*, sal_Bool bDel = sal_True ); + static sal_Bool Move( StgAvlNode**, StgAvlNode**, StgAvlNode* ); virtual short Compare( const StgAvlNode* ) const = 0; }; diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index 88a8187ee9dd..6a0d1117f934 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -52,10 +52,10 @@ //----------------------------------------------------------------------------- typedef std::hash_map < - INT32, + sal_Int32, StgPage *, - std::hash< INT32 >, - NAMESPACE_STD(equal_to)< INT32 > + std::hash< sal_Int32 >, + NAMESPACE_STD(equal_to)< sal_Int32 > > UsrStgPagePtr_Impl; #ifdef _MSC_VER #pragma warning( disable: 4786 ) @@ -73,9 +73,9 @@ StgPage::StgPage( StgCache* p, short n ) { pCache = p; nData = n; - bDirty = FALSE; + bDirty = sal_False; nPage = 0; - pData = new BYTE[ nData ]; + pData = new sal_uInt8[ nData ]; pNext1 = pNext2 = pLast1 = @@ -88,15 +88,15 @@ StgPage::~StgPage() delete [] pData; } -void StgPage::SetPage( short nOff, INT32 nVal ) +void StgPage::SetPage( short nOff, sal_Int32 nVal ) { - if( ( nOff < (short) ( nData / sizeof( INT32 ) ) ) && nOff >= 0 ) + if( ( nOff < (short) ( nData / sizeof( sal_Int32 ) ) ) && nOff >= 0 ) { #ifdef OSL_BIGENDIAN nVal = SWAPLONG(nVal); #endif - ((INT32*) pData )[ nOff ] = nVal; - bDirty = TRUE; + ((sal_Int32*) pData )[ nOff ] = nVal; + bDirty = sal_True; } } @@ -105,7 +105,7 @@ void StgPage::SetPage( short nOff, INT32 nVal ) // The disk cache holds the cached sectors. The sector type differ according // to their purpose. -INT32 lcl_GetPageCount( ULONG nFileSize, short nPageSize ) +sal_Int32 lcl_GetPageCount( sal_uIntPtr nFileSize, short nPageSize ) { // return (nFileSize >= 512) ? (nFileSize - 512) / nPageSize : 0; // #i61980# reallife: last page may be incomplete, return number of *started* pages @@ -119,8 +119,8 @@ StgCache::StgCache() pCur = pElem1 = NULL; nPageSize = 512; nError = SVSTREAM_OK; - bMyStream = FALSE; - bFile = FALSE; + bMyStream = sal_False; + bFile = sal_False; pLRUCache = NULL; pStorageStream = NULL; } @@ -128,15 +128,15 @@ StgCache::StgCache() StgCache::~StgCache() { Clear(); - SetStrm( NULL, FALSE ); + SetStrm( NULL, sal_False ); delete (UsrStgPagePtr_Impl*)pLRUCache; } void StgCache::SetPhysPageSize( short n ) { nPageSize = n; - ULONG nPos = pStrm->Tell(); - ULONG nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); + sal_uIntPtr nPos = pStrm->Tell(); + sal_uIntPtr nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); nPages = lcl_GetPageCount( nFileSize, nPageSize ); pStrm->Seek( nPos ); } @@ -144,7 +144,7 @@ void StgCache::SetPhysPageSize( short n ) // Create a new cache element // pCur points to this element -StgPage* StgCache::Create( INT32 nPg ) +StgPage* StgCache::Create( sal_Int32 nPg ) { StgPage* pElem = new StgPage( this, nPageSize ); pElem->nPage = nPg; @@ -227,7 +227,7 @@ void StgCache::Clear() // Look for a cached page -StgPage* StgCache::Find( INT32 nPage ) +StgPage* StgCache::Find( sal_Int32 nPage ) { if( !pLRUCache ) return NULL; @@ -255,7 +255,7 @@ StgPage* StgCache::Find( INT32 nPage ) // Load a page into the cache -StgPage* StgCache::Get( INT32 nPage, BOOL bForce ) +StgPage* StgCache::Get( sal_Int32 nPage, sal_Bool bForce ) { StgPage* p = Find( nPage ); if( !p ) @@ -275,7 +275,7 @@ StgPage* StgCache::Get( INT32 nPage, BOOL bForce ) // to duplicate an existing stream or to create new entries. // The new page is initially marked dirty. No owner is copied. -StgPage* StgCache::Copy( INT32 nNew, INT32 nOld ) +StgPage* StgCache::Copy( sal_Int32 nNew, sal_Int32 nOld ) { StgPage* p = Find( nNew ); if( !p ) @@ -283,7 +283,7 @@ StgPage* StgCache::Copy( INT32 nNew, INT32 nOld ) if( nOld >= 0 ) { // old page: we must have this data! - StgPage* q = Get( nOld, TRUE ); + StgPage* q = Get( nOld, sal_True ); if( q ) memcpy( p->pData, q->pData, p->nData ); } @@ -293,17 +293,17 @@ StgPage* StgCache::Copy( INT32 nNew, INT32 nOld ) // Flush the cache whose owner is given. NULL flushes all. -BOOL StgCache::Commit( StgDirEntry* ) +sal_Bool StgCache::Commit( StgDirEntry* ) { StgPage* p = pElem1; if( p ) do { if( p->bDirty ) { - BOOL b = Write( p->nPage, p->pData, 1 ); + sal_Bool b = Write( p->nPage, p->pData, 1 ); if( !b ) - return FALSE; - p->bDirty = FALSE; + return sal_False; + p->bDirty = sal_False; } p = p->pNext2; } while( p != pElem1 ); @@ -316,10 +316,10 @@ BOOL StgCache::Commit( StgDirEntry* ) if( p->bDirty ) { ErrorBox( NULL, WB_OK, String("SO2: Dirty Block in Ordered List") ).Execute(); - BOOL b = Write( p->nPage, p->pData, 1 ); + sal_Bool b = Write( p->nPage, p->pData, 1 ); if( !b ) - return FALSE; - p->bDirty = FALSE; + return sal_False; + p->bDirty = sal_False; } p = p->pNext2; } while( p != pElem1 ); @@ -329,15 +329,15 @@ BOOL StgCache::Commit( StgDirEntry* ) if( p->bDirty ) { ErrorBox( NULL, WB_OK, String("SO2: Dirty Block in LRU List") ).Execute(); - BOOL b = Write( p->nPage, p->pData, 1 ); + sal_Bool b = Write( p->nPage, p->pData, 1 ); if( !b ) - return FALSE; - p->bDirty = FALSE; + return sal_False; + p->bDirty = sal_False; } p = p->pNext1; } while( p != pElem1 ); #endif - return TRUE; + return sal_True; } void StgCache::Revert( StgDirEntry* ) @@ -345,7 +345,7 @@ void StgCache::Revert( StgDirEntry* ) // Set a stream -void StgCache::SetStrm( SvStream* p, BOOL bMy ) +void StgCache::SetStrm( SvStream* p, sal_Bool bMy ) { if( pStorageStream ) { @@ -376,34 +376,34 @@ void StgCache::SetStrm( UCBStorageStream* pStgStream ) pStrm = pStorageStream->GetModifySvStream(); } - bMyStream = FALSE; + bMyStream = sal_False; } // Open/close the disk file -BOOL StgCache::Open( const String& rName, StreamMode nMode ) +sal_Bool StgCache::Open( const String& rName, StreamMode nMode ) { // do not open in exclusive mode! if( nMode & STREAM_SHARE_DENYALL ) nMode = ( ( nMode & ~STREAM_SHARE_DENYALL ) | STREAM_SHARE_DENYWRITE ); SvFileStream* pFileStrm = new SvFileStream( rName, nMode ); // SvStream "Feature" Write Open auch erfolgreich, wenns nicht klappt - BOOL bAccessDenied = FALSE; + sal_Bool bAccessDenied = sal_False; if( ( nMode & STREAM_WRITE ) && !pFileStrm->IsWritable() ) { pFileStrm->Close(); - bAccessDenied = TRUE; + bAccessDenied = sal_True; } - SetStrm( pFileStrm, TRUE ); + SetStrm( pFileStrm, sal_True ); if( pFileStrm->IsOpen() ) { - ULONG nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); + sal_uIntPtr nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); nPages = lcl_GetPageCount( nFileSize, nPageSize ); pStrm->Seek( 0L ); } else nPages = 0; - bFile = TRUE; + bFile = sal_True; SetError( bAccessDenied ? ERRCODE_IO_ACCESSDENIED : pStrm->GetError() ); return Good(); } @@ -419,7 +419,7 @@ void StgCache::Close() // low level I/O -BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg ) +sal_Bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) { if( Good() ) { @@ -431,9 +431,9 @@ BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg ) SetError( SVSTREAM_READ_ERROR ); else if ( nPage < nPages ) { - ULONG nPos = Page2Pos( nPage ); - INT32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; - ULONG nBytes = nPg2 * nPageSize; + sal_uIntPtr nPos = Page2Pos( nPage ); + sal_Int32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; + sal_uIntPtr nBytes = nPg2 * nPageSize; // fixed address and size for the header if( nPage == -1 ) { @@ -458,12 +458,12 @@ BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg ) return Good(); } -BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg ) +sal_Bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) { if( Good() ) { - ULONG nPos = Page2Pos( nPage ); - ULONG nBytes = nPg * nPageSize; + sal_uIntPtr nPos = Page2Pos( nPage ); + sal_uIntPtr nBytes = nPg * nPageSize; // fixed address and size for the header if( nPage == -1 ) nPos = 0L, nBytes = 512; @@ -475,16 +475,16 @@ BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg ) #endif } } - ULONG nRes = pStrm->Write( pBuf, nBytes ); + sal_uIntPtr nRes = pStrm->Write( pBuf, nBytes ); if( nRes != nBytes ) SetError( SVSTREAM_WRITE_ERROR ); else SetError( pStrm->GetError() ); #ifdef READ_AFTER_WRITE - BYTE cBuf[ 512 ]; + sal_uInt8 cBuf[ 512 ]; pStrm->Flush(); pStrm->Seek( nPos ); - BOOL bRes = ( pStrm->Read( cBuf, 512 ) == 512 ); + sal_Bool bRes = ( pStrm->Read( cBuf, 512 ) == 512 ); if( bRes ) bRes = !memcmp( cBuf, pBuf, 512 ); if( !bRes ) @@ -499,10 +499,10 @@ BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg ) // set the file size in pages -BOOL StgCache::SetSize( INT32 n ) +sal_Bool StgCache::SetSize( sal_Int32 n ) { // Add the file header - INT32 nSize = n * nPageSize + 512; + sal_Int32 nSize = n * nPageSize + 512; pStrm->SetStreamSize( nSize ); SetError( pStrm->GetError() ); if( !nError ) @@ -510,7 +510,7 @@ BOOL StgCache::SetSize( INT32 n ) return Good(); } -void StgCache::SetError( ULONG n ) +void StgCache::SetError( sal_uIntPtr n ) { if( n && !nError ) nError = n; @@ -533,13 +533,13 @@ void StgCache::MoveError( StorageBase& r ) // Utility functions -INT32 StgCache::Page2Pos( INT32 nPage ) +sal_Int32 StgCache::Page2Pos( sal_Int32 nPage ) { if( nPage < 0 ) nPage = 0; return( nPage * nPageSize ) + nPageSize; } -INT32 StgCache::Pos2Page( INT32 nPos ) +sal_Int32 StgCache::Pos2Page( sal_Int32 nPos ) { return ( ( nPos + nPageSize - 1 ) / nPageSize ) * nPageSize - 1; } diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx index 5379f837b8b1..0c1fc3eab1ff 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -47,9 +47,9 @@ class StorageBase; class StgCache { StgPage* pCur; // top of LRU list StgPage* pElem1; // top of ordered list - ULONG nError; // error code - INT32 nPages; // size of data area in pages - USHORT nRef; // reference count + sal_uIntPtr nError; // error code + sal_Int32 nPages; // size of data area in pages + sal_uInt16 nRef; // reference count void * pLRUCache; // hash table of cached objects short nPageSize; // page size of the file UCBStorageStream* pStorageStream; // holds reference to UCB storage stream @@ -57,40 +57,40 @@ class StgCache { void Erase( StgPage* ); // delete a cache element void InsertToLRU( StgPage* ); // insert into LRU list void InsertToOrdered( StgPage* ); // insert into ordered list - StgPage* Create( INT32 ); // create a cached page + StgPage* Create( sal_Int32 ); // create a cached page protected: SvStream* pStrm; // physical stream - BOOL bMyStream; // TRUE: delete stream in dtor - BOOL bFile; // TRUE: file stream - INT32 Page2Pos( INT32 ); // page address --> file position - INT32 Pos2Page( INT32 ); // file position --> page address + sal_Bool bMyStream; // sal_True: delete stream in dtor + sal_Bool bFile; // sal_True: file stream + sal_Int32 Page2Pos( sal_Int32 ); // page address --> file position + sal_Int32 Pos2Page( sal_Int32 ); // file position --> page address public: StgCache(); ~StgCache(); void IncRef() { nRef++; } - USHORT DecRef() { return --nRef; } + sal_uInt16 DecRef() { return --nRef; } void SetPhysPageSize( short ); - INT32 GetPhysPages() { return nPages; } + sal_Int32 GetPhysPages() { return nPages; } short GetPhysPageSize() { return nPageSize; } SvStream* GetStrm() { return pStrm; } - void SetStrm( SvStream*, BOOL ); + void SetStrm( SvStream*, sal_Bool ); void SetStrm( UCBStorageStream* ); - BOOL IsWritable() { return pStrm->IsWritable(); } - BOOL Good() { return BOOL( nError == SVSTREAM_OK ); } - BOOL Bad() { return BOOL( nError != SVSTREAM_OK ); } - ULONG GetError() { return nError; } + sal_Bool IsWritable() { return pStrm->IsWritable(); } + sal_Bool Good() { return sal_Bool( nError == SVSTREAM_OK ); } + sal_Bool Bad() { return sal_Bool( nError != SVSTREAM_OK ); } + sal_uIntPtr GetError() { return nError; } void MoveError( StorageBase& ); - void SetError( ULONG ); + void SetError( sal_uIntPtr ); void ResetError(); - BOOL Open( const String& rName, StreamMode ); + sal_Bool Open( const String& rName, StreamMode ); void Close(); - BOOL Read( INT32 nPage, void* pBuf, INT32 nPages ); - BOOL Write( INT32 nPage, void* pBuf, INT32 nPages ); - BOOL SetSize( INT32 nPages ); - StgPage* Find( INT32 ); // find a cached page - StgPage* Get( INT32, BOOL ); // get a cached page - StgPage* Copy( INT32, INT32=STG_FREE ); // copy a page - BOOL Commit( StgDirEntry* = NULL ); // flush all pages + sal_Bool Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPages ); + sal_Bool Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPages ); + sal_Bool SetSize( sal_Int32 nPages ); + StgPage* Find( sal_Int32 ); // find a cached page + StgPage* Get( sal_Int32, sal_Bool ); // get a cached page + StgPage* Copy( sal_Int32, sal_Int32=STG_FREE ); // copy a page + sal_Bool Commit( StgDirEntry* = NULL ); // flush all pages void Revert( StgDirEntry* = NULL ); // revert dirty pages void Clear(); // clear the cache }; @@ -101,32 +101,32 @@ class StgPage { StgPage *pNext1, *pLast1; // LRU chain StgPage *pNext2, *pLast2; // ordered chain StgDirEntry* pOwner; // owner - INT32 nPage; // page # - BYTE* pData; // nPageSize characters + sal_Int32 nPage; // page # + sal_uInt8* pData; // nPageSize characters short nData; // size of this page - BOOL bDirty; // dirty flag + sal_Bool bDirty; // dirty flag StgPage( StgCache*, short ); ~StgPage(); public: - void SetDirty() { bDirty = TRUE; } - INT32 GetPage() { return nPage; } + void SetDirty() { bDirty = sal_True; } + sal_Int32 GetPage() { return nPage; } void* GetData() { return pData; } short GetSize() { return nData; } void SetOwner( StgDirEntry* p ) { pOwner = p; } // routines for accessing FAT pages // Assume that the data is a FAT page and get/put FAT data. - INT32 GetPage( short nOff ) + sal_Int32 GetPage( short nOff ) { - if( ( nOff >= (short) ( nData / sizeof( INT32 ) ) ) || nOff < 0 ) + if( ( nOff >= (short) ( nData / sizeof( sal_Int32 ) ) ) || nOff < 0 ) return -1; - INT32 n = ((INT32*) pData )[ nOff ]; + sal_Int32 n = ((sal_Int32*) pData )[ nOff ]; #ifdef OSL_BIGENDIAN return SWAPLONG(n); #else return n; #endif } - void SetPage( short, INT32 ); // put an element + void SetPage( short, sal_Int32 ); // put an element }; #endif diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index f093dc60cbe7..0b1cf2582501 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -54,7 +54,7 @@ // Problem der Implementation: Keine Hierarchischen commits. Daher nur // insgesamt transaktionsorientert oder direkt. -StgDirEntry::StgDirEntry( const void* pFrom, BOOL * pbOk ) : StgAvlNode() +StgDirEntry::StgDirEntry( const void* pFrom, sal_Bool * pbOk ) : StgAvlNode() { *pbOk = aEntry.Load( pFrom ); @@ -81,14 +81,14 @@ void StgDirEntry::InitMembers() nEntry = nRefCnt = 0; nMode = STREAM_READ; - bDirect = TRUE; + bDirect = sal_True; bInvalid = bCreated = bRenamed = bRemoved = bTemp = bDirty = - bZombie = FALSE; + bZombie = sal_False; } StgDirEntry::~StgDirEntry() @@ -113,9 +113,9 @@ short StgDirEntry::Compare( const StgAvlNode* p ) const // the TOC tree into the TOC stream. Remember that aSave is // stored, not aEntry. -void StgDirEntry::Enum( INT32& n ) +void StgDirEntry::Enum( sal_Int32& n ) { - INT32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE; + sal_Int32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE; nEntry = n++; if( pLeft ) { @@ -137,17 +137,17 @@ void StgDirEntry::Enum( INT32& n ) // Delete all temporary entries before writing the TOC stream. // Until now Deltem is never called with bForce True -void StgDirEntry::DelTemp( BOOL bForce ) +void StgDirEntry::DelTemp( sal_Bool bForce ) { if( pLeft ) - ((StgDirEntry*) pLeft)->DelTemp( FALSE ); + ((StgDirEntry*) pLeft)->DelTemp( sal_False ); if( pRight ) - ((StgDirEntry*) pRight)->DelTemp( FALSE ); + ((StgDirEntry*) pRight)->DelTemp( sal_False ); if( pDown ) { // If the storage is dead, of course all elements are dead, too if( bInvalid && aEntry.GetType() == STG_STORAGE ) - bForce = TRUE; + bForce = sal_True; pDown->DelTemp( bForce ); } if( ( bForce || bInvalid ) @@ -157,12 +157,12 @@ void StgDirEntry::DelTemp( BOOL bForce ) if( pUp ) { // this deletes the element if refcnt == 0! - BOOL bDel = nRefCnt == 0; + sal_Bool bDel = nRefCnt == 0; StgAvlNode::Remove( (StgAvlNode**) &pUp->pDown, this, bDel ); if( !bDel ) { pLeft = pRight = pDown = 0; - bInvalid = bZombie = TRUE; + bInvalid = bZombie = sal_True; } } } @@ -170,26 +170,26 @@ void StgDirEntry::DelTemp( BOOL bForce ) // Save the tree into the given dir stream -BOOL StgDirEntry::Store( StgDirStrm& rStrm ) +sal_Bool StgDirEntry::Store( StgDirStrm& rStrm ) { - void* pEntry = rStrm.GetEntry( nEntry, TRUE ); + void* pEntry = rStrm.GetEntry( nEntry, sal_True ); if( !pEntry ) - return FALSE; + return sal_False; // Do not store the current (maybe not commited) entry aSave.Store( pEntry ); if( pLeft ) if( !((StgDirEntry*) pLeft)->Store( rStrm ) ) - return FALSE; + return sal_False; if( pRight ) if( !((StgDirEntry*) pRight)->Store( rStrm ) ) - return FALSE; + return sal_False; if( pDown ) if( !pDown->Store( rStrm ) ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL StgDirEntry::StoreStream( StgIo& rIo ) +sal_Bool StgDirEntry::StoreStream( StgIo& rIo ) { if( aEntry.GetType() == STG_STREAM || aEntry.GetType() == STG_ROOT ) { @@ -206,27 +206,27 @@ BOOL StgDirEntry::StoreStream( StgIo& rIo ) } // or write the data stream else if( !Tmp2Strm() ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } // Save all dirty streams -BOOL StgDirEntry::StoreStreams( StgIo& rIo ) +sal_Bool StgDirEntry::StoreStreams( StgIo& rIo ) { if( !StoreStream( rIo ) ) - return FALSE; + return sal_False; if( pLeft ) if( !((StgDirEntry*) pLeft)->StoreStreams( rIo ) ) - return FALSE; + return sal_False; if( pRight ) if( !((StgDirEntry*) pRight)->StoreStreams( rIo ) ) - return FALSE; + return sal_False; if( pDown ) if( !pDown->StoreStreams( rIo ) ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } // Revert all directory entries after failure to write the TOC stream @@ -244,24 +244,24 @@ void StgDirEntry::RevertAll() // Look if any element of the tree is dirty -BOOL StgDirEntry::IsDirty() +sal_Bool StgDirEntry::IsDirty() { if( bDirty || bInvalid ) - return TRUE; + return sal_True; if( pLeft && ((StgDirEntry*) pLeft)->IsDirty() ) - return TRUE; + return sal_True; if( pRight && ((StgDirEntry*) pRight)->IsDirty() ) - return TRUE; + return sal_True; if( pDown && pDown->IsDirty() ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } // Set up a stream. -void StgDirEntry::OpenStream( StgIo& rIo, BOOL bForceBig ) +void StgDirEntry::OpenStream( StgIo& rIo, sal_Bool bForceBig ) { - INT32 nThreshold = (USHORT) rIo.aHdr.GetThreshold(); + sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold(); delete pStgStrm; if( !bForceBig && aEntry.GetSize() < nThreshold ) pStgStrm = new StgSmallStrm( rIo, this ); @@ -271,7 +271,7 @@ void StgDirEntry::OpenStream( StgIo& rIo, BOOL bForceBig ) { // This entry has invalid data, so delete that data SetSize( 0L ); -// bRemoved = bInvalid = FALSE; +// bRemoved = bInvalid = sal_False; } nPos = 0; } @@ -291,9 +291,9 @@ void StgDirEntry::Close() // Get the current stream size -INT32 StgDirEntry::GetSize() +sal_Int32 StgDirEntry::GetSize() { - INT32 n; + sal_Int32 n; if( pTmpStrm ) n = pTmpStrm->GetSize(); else if( pCurStrm ) @@ -304,14 +304,14 @@ INT32 StgDirEntry::GetSize() // Set the stream size. This means also creating a temp stream. -BOOL StgDirEntry::SetSize( INT32 nNewSize ) +sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize ) { if ( !( nMode & STREAM_WRITE ) || (!bDirect && !pTmpStrm && !Strm2Tmp()) ) { - return FALSE; + return sal_False; } if( nNewSize < nPos ) @@ -320,26 +320,26 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) { pTmpStrm->SetSize( nNewSize ); pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); - return BOOL( pTmpStrm->GetError() == SVSTREAM_OK ); + return sal_Bool( pTmpStrm->GetError() == SVSTREAM_OK ); } else { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; StgIo& rIo = pStgStrm->GetIo(); - INT32 nThreshold = rIo.aHdr.GetThreshold(); + sal_Int32 nThreshold = rIo.aHdr.GetThreshold(); // ensure the correct storage stream! StgStrm* pOld = NULL; - USHORT nOldSize = 0; + sal_uInt16 nOldSize = 0; if( nNewSize >= nThreshold && pStgStrm->IsSmallStrm() ) { pOld = pStgStrm; - nOldSize = (USHORT) pOld->GetSize(); + nOldSize = (sal_uInt16) pOld->GetSize(); pStgStrm = new StgDataStrm( rIo, STG_EOF, 0 ); } else if( nNewSize < nThreshold && !pStgStrm->IsSmallStrm() ) { pOld = pStgStrm; - nOldSize = (USHORT) nNewSize; + nOldSize = (sal_uInt16) nNewSize; pStgStrm = new StgSmallStrm( rIo, STG_EOF, 0 ); } // now set the new size @@ -351,16 +351,16 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) // if so, we probably need to copy the old data if( nOldSize ) { - void* pBuf = new BYTE[ nOldSize ]; + void* pBuf = new sal_uInt8[ nOldSize ]; pOld->Pos2Page( 0L ); pStgStrm->Pos2Page( 0L ); if( pOld->Read( pBuf, nOldSize ) && pStgStrm->Write( pBuf, nOldSize ) ) - bRes = TRUE; - delete[] static_cast(pBuf); + bRes = sal_True; + delete[] static_cast(pBuf); } else - bRes = TRUE; + bRes = sal_True; if( bRes ) { pOld->SetSize( 0 ); @@ -378,7 +378,7 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) else { pStgStrm->Pos2Page( nPos ); - bRes = TRUE; + bRes = sal_True; } } return bRes; @@ -387,7 +387,7 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize ) // Seek. On negative values, seek to EOF. -INT32 StgDirEntry::Seek( INT32 nNew ) +sal_Int32 StgDirEntry::Seek( sal_Int32 nNew ) { if( pTmpStrm ) { @@ -403,7 +403,7 @@ INT32 StgDirEntry::Seek( INT32 nNew ) } else { - INT32 nSize = aEntry.GetSize(); + sal_Int32 nSize = aEntry.GetSize(); if( nNew < 0 ) nNew = nSize; @@ -427,7 +427,7 @@ INT32 StgDirEntry::Seek( INT32 nNew ) // Read -INT32 StgDirEntry::Read( void* p, INT32 nLen ) +sal_Int32 StgDirEntry::Read( void* p, sal_Int32 nLen ) { if( nLen <= 0 ) return 0; @@ -443,7 +443,7 @@ INT32 StgDirEntry::Read( void* p, INT32 nLen ) // Write -INT32 StgDirEntry::Write( const void* p, INT32 nLen ) +sal_Int32 StgDirEntry::Write( const void* p, sal_Int32 nLen ) { if( nLen <= 0 || !( nMode & STREAM_WRITE ) ) return 0; @@ -461,7 +461,7 @@ INT32 StgDirEntry::Write( const void* p, INT32 nLen ) } else { - INT32 nNew = nPos + nLen; + sal_Int32 nNew = nPos + nLen; if( nNew > pStgStrm->GetSize() ) { if( !SetSize( nNew ) ) @@ -478,16 +478,16 @@ INT32 StgDirEntry::Write( const void* p, INT32 nLen ) void StgDirEntry::Copy( StgDirEntry& rDest ) { - INT32 n = GetSize(); + sal_Int32 n = GetSize(); if( rDest.SetSize( n ) && n ) { - BYTE aTempBytes[ 4096 ]; + sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast( aTempBytes ); Seek( 0L ); rDest.Seek( 0L ); while( n ) { - INT32 nn = n; + sal_Int32 nn = n; if( nn > 4096 ) nn = 4096; if( Read( p, nn ) != nn ) @@ -501,22 +501,22 @@ void StgDirEntry::Copy( StgDirEntry& rDest ) void StgDirEntry::Copy( BaseStorageStream& rDest ) { - INT32 n = GetSize(); + sal_Int32 n = GetSize(); if( rDest.SetSize( n ) && n ) { - ULONG Pos = rDest.Tell(); - BYTE aTempBytes[ 4096 ]; + sal_uIntPtr Pos = rDest.Tell(); + sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast( aTempBytes ); Seek( 0L ); rDest.Seek( 0L ); while( n ) { - INT32 nn = n; + sal_Int32 nn = n; if( nn > 4096 ) nn = 4096; if( Read( p, nn ) != nn ) break; - if( sal::static_int_cast(rDest.Write( p, nn )) != nn ) + if( sal::static_int_cast(rDest.Write( p, nn )) != nn ) break; n -= nn; } @@ -526,12 +526,12 @@ void StgDirEntry::Copy( BaseStorageStream& rDest ) // Commit this entry -BOOL StgDirEntry::Commit() +sal_Bool StgDirEntry::Commit() { // OSL_ENSURE( nMode & STREAM_WRITE, "Trying to commit readonly stream!" ); aSave = aEntry; - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; if( aEntry.GetType() == STG_STREAM ) { if( pTmpStrm ) @@ -552,7 +552,7 @@ BOOL StgDirEntry::Commit() // Revert the entry -BOOL StgDirEntry::Revert() +sal_Bool StgDirEntry::Revert() { aEntry = aSave; switch( aEntry.GetType() ) @@ -563,24 +563,24 @@ BOOL StgDirEntry::Revert() break; case STG_STORAGE: { - BOOL bSomeRenamed = FALSE; + sal_Bool bSomeRenamed = sal_False; StgIterator aOIter( *this ); StgDirEntry* op = aOIter.First(); while( op ) { op->aEntry = op->aSave; - op->bDirty = FALSE; - bSomeRenamed = BOOL( bSomeRenamed | op->bRenamed ); + op->bDirty = sal_False; + bSomeRenamed = sal_Bool( bSomeRenamed | op->bRenamed ); // Remove any new entries if( op->bCreated ) { - op->bCreated = FALSE; + op->bCreated = sal_False; op->Close(); - op->bInvalid = TRUE; + op->bInvalid = sal_True; } // Reactivate any removed entries else if( op->bRemoved ) - op->bRemoved = op->bInvalid = op->bTemp = FALSE; + op->bRemoved = op->bInvalid = op->bTemp = sal_False; op = aOIter.Next(); } // Resort all renamed entries @@ -595,12 +595,12 @@ BOOL StgDirEntry::Revert() StgAvlNode::Move ( (StgAvlNode**) &p->pUp->pDown, (StgAvlNode**) &p->pUp->pDown, p ); - p->bRenamed = FALSE; + p->bRenamed = sal_False; } p = aIter.Next(); } } - DelTemp( FALSE ); + DelTemp( sal_False ); break; } case STG_EMPTY: @@ -609,22 +609,22 @@ BOOL StgDirEntry::Revert() case STG_ROOT: break; } - return TRUE; + return sal_True; } // Copy the stg stream to the temp stream -BOOL StgDirEntry::Strm2Tmp() +sal_Bool StgDirEntry::Strm2Tmp() { if( !pTmpStrm ) { - ULONG n = 0; + sal_uIntPtr n = 0; if( pCurStrm ) { // It was already commited once pTmpStrm = new StgTmpStrm; if( pTmpStrm->GetError() == SVSTREAM_OK && pTmpStrm->Copy( *pCurStrm ) ) - return TRUE; + return sal_True; n = 1; // indicates error } else @@ -635,15 +635,15 @@ BOOL StgDirEntry::Strm2Tmp() { if( n ) { - BYTE aTempBytes[ 4096 ]; + sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast( aTempBytes ); pStgStrm->Pos2Page( 0L ); while( n ) { - ULONG nn = n; + sal_uIntPtr nn = n; if( nn > 4096 ) nn = 4096; - if( (ULONG) pStgStrm->Read( p, nn ) != nn ) + if( (sal_uIntPtr) pStgStrm->Read( p, nn ) != nn ) break; if( pTmpStrm->Write( p, nn ) != nn ) break; @@ -661,41 +661,41 @@ BOOL StgDirEntry::Strm2Tmp() pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); delete pTmpStrm; pTmpStrm = NULL; - return FALSE; + return sal_False; } } - return TRUE; + return sal_True; } // Copy the temp stream to the stg stream during the final commit -BOOL StgDirEntry::Tmp2Strm() +sal_Bool StgDirEntry::Tmp2Strm() { // We did commit once, but have not written since then if( !pTmpStrm ) pTmpStrm = pCurStrm, pCurStrm = NULL; if( pTmpStrm ) { - ULONG n = pTmpStrm->GetSize(); + sal_uIntPtr n = pTmpStrm->GetSize(); StgStrm* pNewStrm; StgIo& rIo = pStgStrm->GetIo(); - ULONG nThreshold = (ULONG) rIo.aHdr.GetThreshold(); + sal_uIntPtr nThreshold = (sal_uIntPtr) rIo.aHdr.GetThreshold(); if( n < nThreshold ) pNewStrm = new StgSmallStrm( rIo, STG_EOF, 0 ); else pNewStrm = new StgDataStrm( rIo, STG_EOF, 0 ); if( pNewStrm->SetSize( n ) ) { - BYTE p[ 4096 ]; + sal_uInt8 p[ 4096 ]; pTmpStrm->Seek( 0L ); while( n ) { - ULONG nn = n; + sal_uIntPtr nn = n; if( nn > 4096 ) nn = 4096; if( pTmpStrm->Read( p, nn ) != nn ) break; - if( (ULONG) pNewStrm->Write( p, nn ) != nn ) + if( (sal_uIntPtr) pNewStrm->Write( p, nn ) != nn ) break; n -= nn; } @@ -704,7 +704,7 @@ BOOL StgDirEntry::Tmp2Strm() pTmpStrm->Seek( nPos ); pStgStrm->GetIo().SetError( pTmpStrm->GetError() ); delete pNewStrm; - return FALSE; + return sal_False; } else { @@ -720,12 +720,12 @@ BOOL StgDirEntry::Tmp2Strm() } } } - return TRUE; + return sal_True; } // Check if the given entry is contained in this entry -BOOL StgDirEntry::IsContained( StgDirEntry* pStg ) +sal_Bool StgDirEntry::IsContained( StgDirEntry* pStg ) { if( aEntry.GetType() == STG_STORAGE ) { @@ -734,25 +734,25 @@ BOOL StgDirEntry::IsContained( StgDirEntry* pStg ) while( p ) { if( !p->aEntry.Compare( pStg->aEntry ) ) - return FALSE; + return sal_False; if( p->aEntry.GetType() == STG_STORAGE ) if( !p->IsContained( pStg ) ) - return FALSE; + return sal_False; p = aIter.Next(); } } - return TRUE; + return sal_True; } // Invalidate all open entries by setting the RefCount to 0. If the bDel // flag is set, also set the invalid flag to indicate deletion during the // next dir stream flush. -void StgDirEntry::Invalidate( BOOL bDel ) +void StgDirEntry::Invalidate( sal_Bool bDel ) { // nRefCnt = 0; if( bDel ) - bRemoved = bInvalid = TRUE; + bRemoved = bInvalid = sal_True; switch( aEntry.GetType() ) { case STG_STORAGE: @@ -807,12 +807,12 @@ StgDirStrm::~StgDirStrm() // Recursively parse the directory tree during reading the TOC stream -void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper ) +void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper ) { void* p = ( n == STG_FREE ) ? NULL : GetEntry( n ); if( p ) { - BOOL bOk(FALSE); + sal_Bool bOk(sal_False); StgDirEntry* pCur = new StgDirEntry( p, &bOk ); if( !bOk ) @@ -827,10 +827,10 @@ void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper ) if( !pUpper ) pCur->aEntry.SetType( STG_ROOT ); - INT32 nLeft = pCur->aEntry.GetLeaf( STG_LEFT ); - INT32 nRight = pCur->aEntry.GetLeaf( STG_RIGHT ); + sal_Int32 nLeft = pCur->aEntry.GetLeaf( STG_LEFT ); + sal_Int32 nRight = pCur->aEntry.GetLeaf( STG_RIGHT ); // substorage? - INT32 nLeaf = STG_FREE; + sal_Int32 nLeaf = STG_FREE; if( pCur->aEntry.GetType() == STG_STORAGE || pCur->aEntry.GetType() == STG_ROOT ) { nLeaf = pCur->aEntry.GetLeaf( STG_CHILD ); @@ -865,7 +865,7 @@ void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper ) // Extend or shrink the directory stream. -BOOL StgDirStrm::SetSize( INT32 nBytes ) +sal_Bool StgDirStrm::SetSize( sal_Int32 nBytes ) { // Always allocate full pages nBytes = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize; @@ -874,72 +874,72 @@ BOOL StgDirStrm::SetSize( INT32 nBytes ) // Save the TOC stream into a new substream after saving all data streams -BOOL StgDirStrm::Store() +sal_Bool StgDirStrm::Store() { if( !pRoot->IsDirty() ) - return TRUE; + return sal_True; if( !pRoot->StoreStreams( rIo ) ) - return FALSE; + return sal_False; // After writing all streams, the data FAT stream has changed, // so we have to commit the root again pRoot->Commit(); // We want a completely new stream, so fake an empty stream - INT32 nOldStart = nStart; // save for later deletion - INT32 nOldSize = nSize; + sal_Int32 nOldStart = nStart; // save for later deletion + sal_Int32 nOldSize = nSize; nStart = nPage = STG_EOF; nSize = nPos = 0; nOffset = 0; // Delete all temporary entries - pRoot->DelTemp( FALSE ); + pRoot->DelTemp( sal_False ); // set the entry numbers - INT32 n = 0; + sal_Int32 n = 0; pRoot->Enum( n ); if( !SetSize( n * STGENTRY_SIZE ) ) { nStart = nOldStart; nSize = nOldSize; pRoot->RevertAll(); - return FALSE; + return sal_False; } // set up the cache elements for the new stream if( !Copy( STG_FREE, nSize ) ) { pRoot->RevertAll(); - return FALSE; + return sal_False; } // Write the data to the new stream if( !pRoot->Store( *this ) ) { pRoot->RevertAll(); - return FALSE; + return sal_False; } // fill any remaining entries with empty data - INT32 ne = nSize / STGENTRY_SIZE; + sal_Int32 ne = nSize / STGENTRY_SIZE; StgEntry aEmpty; aEmpty.Init(); while( n < ne ) { - void* p = GetEntry( n++, TRUE ); + void* p = GetEntry( n++, sal_True ); if( !p ) { pRoot->RevertAll(); - return FALSE; + return sal_False; } aEmpty.Store( p ); } // Now we can release the old stream - pFat->FreePages( nOldStart, TRUE ); + pFat->FreePages( nOldStart, sal_True ); rIo.aHdr.SetTOCStart( nStart ); - return TRUE; + return sal_True; } // Get a dir entry. -void* StgDirStrm::GetEntry( INT32 n, BOOL bDirty ) +void* StgDirStrm::GetEntry( sal_Int32 n, sal_Bool bDirty ) { n *= STGENTRY_SIZE; if( n >= nSize ) return NULL; - return GetPtr( n, TRUE, bDirty ); + return GetPtr( n, sal_True, bDirty ); } // Find a dir entry. @@ -986,9 +986,9 @@ StgDirEntry* StgDirStrm::Create } pRes->bInvalid = pRes->bRemoved = - pRes->bTemp = FALSE; + pRes->bTemp = sal_False; pRes->bCreated = - pRes->bDirty = TRUE; + pRes->bDirty = sal_True; } else { @@ -998,7 +998,7 @@ StgDirEntry* StgDirStrm::Create pRes->pUp = &rStg; pRes->ppRoot = &pRoot; pRes->bCreated = - pRes->bDirty = TRUE; + pRes->bDirty = sal_True; } else { @@ -1011,44 +1011,44 @@ StgDirEntry* StgDirStrm::Create // Rename the given entry. -BOOL StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew ) +sal_Bool StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew ) { StgDirEntry* p = Find( rStg, rOld ); if( p ) { - if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, FALSE ) ) - return FALSE; + if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, sal_False ) ) + return sal_False; p->aEntry.SetName( rNew ); if( !StgAvlNode::Insert( (StgAvlNode**) &rStg.pDown, p ) ) - return FALSE; - p->bRenamed = p->bDirty = TRUE; - return TRUE; + return sal_False; + p->bRenamed = p->bDirty = sal_True; + return sal_True; } else { rIo.SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } } // Move the given entry to a different storage. -BOOL StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName ) +sal_Bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName ) { StgDirEntry* p = Find( rStg1, rName ); if( p ) { if( !StgAvlNode::Move ( (StgAvlNode**) &rStg1.pDown, (StgAvlNode**) &rStg2.pDown, p ) ) - return FALSE; - p->bDirty = TRUE; - return TRUE; + return sal_False; + p->bDirty = sal_True; + return sal_True; } else { rIo.SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } } diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx index 3ef510a12e50..e3cf2cb78072 100644 --- a/sot/source/sdstor/stgdir.hxx +++ b/sot/source/sdstor/stgdir.hxx @@ -49,52 +49,52 @@ class StgDirEntry : public StgAvlNode StgStrm* pStgStrm; // storage stream StgTmpStrm* pTmpStrm; // temporary stream StgTmpStrm* pCurStrm; // temp stream after commit - INT32 nEntry; // entry # in TOC stream (temp) - INT32 nPos; // current position - BOOL bDirty; // dirty directory entry - BOOL bCreated; // newly created entry - BOOL bRemoved; // removed per Invalidate() - BOOL bRenamed; // renamed + sal_Int32 nEntry; // entry # in TOC stream (temp) + sal_Int32 nPos; // current position + sal_Bool bDirty; // dirty directory entry + sal_Bool bCreated; // newly created entry + sal_Bool bRemoved; // removed per Invalidate() + sal_Bool bRenamed; // renamed void InitMembers(); // ctor helper virtual short Compare( const StgAvlNode* ) const; - BOOL StoreStream( StgIo& ); // store the stream - BOOL StoreStreams( StgIo& ); // store all streams + sal_Bool StoreStream( StgIo& ); // store the stream + sal_Bool StoreStreams( StgIo& ); // store all streams void RevertAll(); // revert the whole tree - BOOL Strm2Tmp(); // copy stgstream to temp file - BOOL Tmp2Strm(); // copy temp file to stgstream + sal_Bool Strm2Tmp(); // copy stgstream to temp file + sal_Bool Tmp2Strm(); // copy temp file to stgstream public: StgEntry aEntry; // entry data - INT32 nRefCnt; // reference count + sal_Int32 nRefCnt; // reference count StreamMode nMode; // open mode - BOOL bTemp; // TRUE: delete on dir flush - BOOL bDirect; // TRUE: direct mode - BOOL bZombie; // TRUE: Removed From StgIo - BOOL bInvalid; // TRUE: invalid entry - StgDirEntry( const void*, BOOL * pbOk ); + sal_Bool bTemp; // sal_True: delete on dir flush + sal_Bool bDirect; // sal_True: direct mode + sal_Bool bZombie; // sal_True: Removed From StgIo + sal_Bool bInvalid; // sal_True: invalid entry + StgDirEntry( const void*, sal_Bool * pbOk ); StgDirEntry( const StgEntry& ); ~StgDirEntry(); - void Invalidate( BOOL=FALSE ); // invalidate all open entries - void Enum( INT32& ); // enumerate entries for iteration - void DelTemp( BOOL ); // delete temporary entries - BOOL Store( StgDirStrm& ); // save entry into dir strm - BOOL IsContained( StgDirEntry* ); // check if subentry + void Invalidate( sal_Bool=sal_False ); // invalidate all open entries + void Enum( sal_Int32& ); // enumerate entries for iteration + void DelTemp( sal_Bool ); // delete temporary entries + sal_Bool Store( StgDirStrm& ); // save entry into dir strm + sal_Bool IsContained( StgDirEntry* ); // check if subentry - void SetDirty() { bDirty = TRUE; } - BOOL IsDirty(); + void SetDirty() { bDirty = sal_True; } + sal_Bool IsDirty(); void ClearDirty(); - BOOL Commit(); - BOOL Revert(); + sal_Bool Commit(); + sal_Bool Revert(); - void OpenStream( StgIo&, BOOL=FALSE ); // set up an approbiate stream + void OpenStream( StgIo&, sal_Bool=sal_False ); // set up an approbiate stream void Close(); - INT32 GetSize(); - BOOL SetSize( INT32 ); - INT32 Seek( INT32 ); - INT32 Tell() { return nPos; } - INT32 Read( void*, INT32 ); - INT32 Write( const void*, INT32 ); + sal_Int32 GetSize(); + sal_Bool SetSize( sal_Int32 ); + sal_Int32 Seek( sal_Int32 ); + sal_Int32 Tell() { return nPos; } + sal_Int32 Read( void*, sal_Int32 ); + sal_Int32 Write( const void*, sal_Int32 ); void Copy( StgDirEntry& ); void Copy( BaseStorageStream& ); }; @@ -104,19 +104,19 @@ class StgDirStrm : public StgDataStrm friend class StgIterator; StgDirEntry* pRoot; // root of dir tree short nEntries; // entries per page - void SetupEntry( INT32, StgDirEntry* ); + void SetupEntry( sal_Int32, StgDirEntry* ); public: StgDirStrm( StgIo& ); ~StgDirStrm(); - virtual BOOL SetSize( INT32 ); // change the size - BOOL Store(); - void* GetEntry( INT32 n, BOOL=FALSE );// get an entry + virtual sal_Bool SetSize( sal_Int32 ); // change the size + sal_Bool Store(); + void* GetEntry( sal_Int32 n, sal_Bool=sal_False );// get an entry StgDirEntry* GetRoot() { return pRoot; } StgDirEntry* Find( StgDirEntry&, const String& ); StgDirEntry* Create( StgDirEntry&, const String&, StgEntryType ); - BOOL Remove( StgDirEntry&, const String& ); - BOOL Rename( StgDirEntry&, const String&, const String& ); - BOOL Move( StgDirEntry&, StgDirEntry&, const String& ); + sal_Bool Remove( StgDirEntry&, const String& ); + sal_Bool Rename( StgDirEntry&, const String&, const String& ); + sal_Bool Move( StgDirEntry&, StgDirEntry&, const String& ); }; class StgIterator : public StgAvlIterator diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index 46d7f1803140..917a4c2adb61 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -39,7 +39,7 @@ #include "stgdir.hxx" #include "stgio.hxx" -static BYTE cStgSignature[ 8 ] = { 0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A,0xE1 }; +static sal_uInt8 cStgSignature[ 8 ] = { 0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A,0xE1 }; ////////////////////////////// struct ClsId ///////////////////////////// @@ -62,17 +62,17 @@ SvStream& operator >>( SvStream& r, ClsId& rId ) SvStream& operator <<( SvStream& r, const ClsId& rId ) { return - r << (INT32) rId.n1 - << (INT16) rId.n2 - << (INT16) rId.n3 - << (UINT8) rId.n4 - << (UINT8) rId.n5 - << (UINT8) rId.n6 - << (UINT8) rId.n7 - << (UINT8) rId.n8 - << (UINT8) rId.n9 - << (UINT8) rId.n10 - << (UINT8) rId.n11; + r << (sal_Int32) rId.n1 + << (sal_Int16) rId.n2 + << (sal_Int16) rId.n3 + << (sal_uInt8) rId.n4 + << (sal_uInt8) rId.n5 + << (sal_uInt8) rId.n6 + << (sal_uInt8) rId.n7 + << (sal_uInt8) rId.n8 + << (sal_uInt8) rId.n9 + << (sal_uInt8) rId.n10 + << (sal_uInt8) rId.n11; } ///////////////////////////// class StgHeader //////////////////////////// @@ -99,14 +99,14 @@ void StgHeader::Init() SetFATPage( i, STG_FREE ); } -BOOL StgHeader::Load( StgIo& rIo ) +sal_Bool StgHeader::Load( StgIo& rIo ) { SvStream& r = *rIo.GetStrm(); Load( r ); return rIo.Good(); } -BOOL StgHeader::Load( SvStream& r ) +sal_Bool StgHeader::Load( SvStream& r ) { r.Seek( 0L ); r.Read( cSignature, 8 ); @@ -129,10 +129,10 @@ BOOL StgHeader::Load( SvStream& r ) return r.GetErrorCode() == ERRCODE_NONE; } -BOOL StgHeader::Store( StgIo& rIo ) +sal_Bool StgHeader::Store( StgIo& rIo ) { if( !bDirty ) - return TRUE; + return sal_True; SvStream& r = *rIo.GetStrm(); r.Seek( 0L ); r.Write( cSignature, 8 + 16 ); @@ -140,7 +140,7 @@ BOOL StgHeader::Store( StgIo& rIo ) << nByteOrder // 1C Unicode byte order indicator << nPageSize // 1E 1 << nPageSize = block size << nDataPageSize // 20 1 << this size == data block size - << (INT32) 0 << (INT32) 0 << (INT16) 0 + << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int16) 0 << nFATSize // 2C total number of FAT pages << nTOCstrm // 30 starting page for the TOC stream << nReserved // 34 @@ -152,7 +152,7 @@ BOOL StgHeader::Store( StgIo& rIo ) for( short i = 0; i < 109; i++ ) r << nMasterFAT[ i ]; bDirty = !rIo.Good(); - return BOOL( !bDirty ); + return sal_Bool( !bDirty ); } static bool lcl_wontoverflow(short shift) @@ -161,15 +161,15 @@ static bool lcl_wontoverflow(short shift) } // Perform thorough checks also on unknown variables -BOOL StgHeader::Check() +sal_Bool StgHeader::Check() { - return BOOL( memcmp( cSignature, cStgSignature, 8 ) == 0 + return sal_Bool( memcmp( cSignature, cStgSignature, 8 ) == 0 && (short) ( nVersion >> 16 ) == 3 ) && lcl_wontoverflow(nPageSize) && lcl_wontoverflow(nDataPageSize); } -INT32 StgHeader::GetFATPage( short n ) const +sal_Int32 StgHeader::GetFATPage( short n ) const { if( n >= 0 && n < 109 ) return nMasterFAT[ n ]; @@ -177,50 +177,50 @@ INT32 StgHeader::GetFATPage( short n ) const return STG_EOF; } -void StgHeader::SetFATPage( short n, INT32 nb ) +void StgHeader::SetFATPage( short n, sal_Int32 nb ) { if( n >= 0 && n < 109 ) { if( nMasterFAT[ n ] != nb ) - bDirty = TRUE, nMasterFAT[ n ] = nb; + bDirty = sal_True, nMasterFAT[ n ] = nb; } } void StgHeader::SetClassId( const ClsId& r ) { if( memcmp( &aClsId, &r, sizeof( ClsId ) ) ) - bDirty = TRUE, memcpy( &aClsId, &r, sizeof( ClsId ) ); + bDirty = sal_True, memcpy( &aClsId, &r, sizeof( ClsId ) ); } -void StgHeader::SetTOCStart( INT32 n ) +void StgHeader::SetTOCStart( sal_Int32 n ) { - if( n != nTOCstrm ) bDirty = TRUE, nTOCstrm = n; + if( n != nTOCstrm ) bDirty = sal_True, nTOCstrm = n; } -void StgHeader::SetDataFATStart( INT32 n ) +void StgHeader::SetDataFATStart( sal_Int32 n ) { - if( n != nDataFAT ) bDirty = TRUE, nDataFAT = n; + if( n != nDataFAT ) bDirty = sal_True, nDataFAT = n; } -void StgHeader::SetDataFATSize( INT32 n ) +void StgHeader::SetDataFATSize( sal_Int32 n ) { - if( n != nDataFATSize ) bDirty = TRUE, nDataFATSize = n; + if( n != nDataFATSize ) bDirty = sal_True, nDataFATSize = n; } -void StgHeader::SetFATSize( INT32 n ) +void StgHeader::SetFATSize( sal_Int32 n ) { - if( n != nFATSize ) bDirty = TRUE, nFATSize = n; + if( n != nFATSize ) bDirty = sal_True, nFATSize = n; } -void StgHeader::SetFATChain( INT32 n ) +void StgHeader::SetFATChain( sal_Int32 n ) { if( n != nMasterChain ) - bDirty = TRUE, nMasterChain = n; + bDirty = sal_True, nMasterChain = n; } -void StgHeader::SetMasters( INT32 n ) +void StgHeader::SetMasters( sal_Int32 n ) { - if( n != nMaster ) bDirty = TRUE, nMaster = n; + if( n != nMaster ) bDirty = sal_True, nMaster = n; } ///////////////////////////// class StgEntry ///////////////////////////// @@ -237,11 +237,11 @@ void ToUnicode_Impl( String& rName ) rName.Erase( 32 ); rName.Convert( ::GetSystemCharSet(), CHARSET_ANSI ); // brute force is OK - BYTE* p = (BYTE*) rName.GetCharStr(); - for( USHORT i = 0; i < rName.Len(); i++, p++ ) + sal_uInt8* p = (sal_uInt8*) rName.GetCharStr(); + for( sal_uInt16 i = 0; i < rName.Len(); i++, p++ ) { // check each character and substitute blanks for illegal ones - BYTE cChar = *p; + sal_uInt8 cChar = *p; if( cChar == '!' || cChar == ':' || cChar == '\\' || cChar == '/' ) *p = ' '; } @@ -253,14 +253,14 @@ static void FromUnicode( String& rName ) rName.Convert( CHARSET_ANSI, ::GetSystemCharSet() ); } */ -BOOL StgEntry::Init() +sal_Bool StgEntry::Init() { memset( this, 0, sizeof (StgEntry) - sizeof( String ) ); SetLeaf( STG_LEFT, STG_FREE ); SetLeaf( STG_RIGHT, STG_FREE ); SetLeaf( STG_CHILD, STG_FREE ); SetLeaf( STG_DATA, STG_EOF ); - return TRUE; + return sal_True; } static String ToUpperUnicode( const String & rStr ) @@ -278,7 +278,7 @@ static String ToUpperUnicode( const String & rStr ) } -BOOL StgEntry::SetName( const String& rName ) +sal_Bool StgEntry::SetName( const String& rName ) { // I don't know the locale, so en_US is hopefully fine aName = ToUpperUnicode( rName ); @@ -290,12 +290,12 @@ BOOL StgEntry::SetName( const String& rName ) while( i < 32 ) nName[ i++ ] = 0; nNameLen = ( aName.Len() + 1 ) << 1; - return TRUE; + return sal_True; } -INT32 StgEntry::GetLeaf( StgEntryRef eRef ) const +sal_Int32 StgEntry::GetLeaf( StgEntryRef eRef ) const { - INT32 n = -1; + sal_Int32 n = -1; switch( eRef ) { case STG_LEFT: n = nLeft; break; @@ -306,7 +306,7 @@ INT32 StgEntry::GetLeaf( StgEntryRef eRef ) const return n; } -void StgEntry::SetLeaf( StgEntryRef eRef, INT32 nPage ) +void StgEntry::SetLeaf( StgEntryRef eRef, sal_Int32 nPage ) { switch( eRef ) { @@ -317,12 +317,12 @@ void StgEntry::SetLeaf( StgEntryRef eRef, INT32 nPage ) } } -const INT32* StgEntry::GetTime( StgEntryTime eTime ) const +const sal_Int32* StgEntry::GetTime( StgEntryTime eTime ) const { return( eTime == STG_MODIFIED ) ? nMtime : nAtime; } -void StgEntry::SetTime( StgEntryTime eTime, INT32* pTime ) +void StgEntry::SetTime( StgEntryTime eTime, sal_Int32* pTime ) { if( eTime == STG_MODIFIED ) nMtime[ 0 ] = *pTime++, nMtime[ 1 ] = *pTime; @@ -337,7 +337,7 @@ void StgEntry::SetClassId( const ClsId& r ) void StgEntry::GetName( String& rName ) const { - UINT16 n = nNameLen; + sal_uInt16 n = nNameLen; if( n ) n = ( n >> 1 ) - 1; rName = String( nName, n ); @@ -362,7 +362,7 @@ short StgEntry::Compare( const StgEntry& r ) const // These load/store operations are a bit more complicated, // since they have to copy their contents into a packed structure. -BOOL StgEntry::Load( const void* pFrom ) +sal_Bool StgEntry::Load( const void* pFrom ) { SvMemoryStream r( (sal_Char*) pFrom, 128, STREAM_READ ); for( short i = 0; i < 32; i++ ) @@ -383,14 +383,14 @@ BOOL StgEntry::Load( const void* pFrom ) >> nSize // 78 file size >> nUnknown; // 7C unknown - UINT16 n = nNameLen; + sal_uInt16 n = nNameLen; if( n ) n = ( n >> 1 ) - 1; if( n > 31 || (nSize < 0 && cType != STG_STORAGE) ) { // the size makes no sence for the substorage // TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb - return FALSE; + return sal_False; } aName = String( nName, n ); @@ -398,7 +398,7 @@ BOOL StgEntry::Load( const void* pFrom ) aName = ToUpperUnicode( aName ); aName.Erase( 31 ); - return TRUE; + return sal_True; } void StgEntry::Store( void* pTo ) diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx index 7a5b7bc52b26..8b7d547ca416 100644 --- a/sot/source/sdstor/stgelem.hxx +++ b/sot/source/sdstor/stgelem.hxx @@ -46,51 +46,51 @@ SvStream& operator<<( SvStream&, const ClsId& ); class StgHeader { - BYTE cSignature[ 8 ]; // 00 signature (see below) + sal_uInt8 cSignature[ 8 ]; // 00 signature (see below) ClsId aClsId; // 08 Class ID - INT32 nVersion; // 18 version number - UINT16 nByteOrder; // 1C Unicode byte order indicator - INT16 nPageSize; // 1E 1 << nPageSize = block size - INT16 nDataPageSize; // 20 1 << this size == data block size - BYTE bDirty; // 22 internal dirty flag - BYTE cReserved[ 9 ]; // 23 - INT32 nFATSize; // 2C total number of FAT pages - INT32 nTOCstrm; // 30 starting page for the TOC stream - INT32 nReserved; // 34 - INT32 nThreshold; // 38 minimum file size for big data - INT32 nDataFAT; // 3C page # of 1st data FAT block - INT32 nDataFATSize; // 40 # of data fat blocks - INT32 nMasterChain; // 44 chain to the next master block - INT32 nMaster; // 48 # of additional master blocks - INT32 nMasterFAT[ 109 ]; // 4C first 109 master FAT pages + sal_Int32 nVersion; // 18 version number + sal_uInt16 nByteOrder; // 1C Unicode byte order indicator + sal_Int16 nPageSize; // 1E 1 << nPageSize = block size + sal_Int16 nDataPageSize; // 20 1 << this size == data block size + sal_uInt8 bDirty; // 22 internal dirty flag + sal_uInt8 cReserved[ 9 ]; // 23 + sal_Int32 nFATSize; // 2C total number of FAT pages + sal_Int32 nTOCstrm; // 30 starting page for the TOC stream + sal_Int32 nReserved; // 34 + sal_Int32 nThreshold; // 38 minimum file size for big data + sal_Int32 nDataFAT; // 3C page # of 1st data FAT block + sal_Int32 nDataFATSize; // 40 # of data fat blocks + sal_Int32 nMasterChain; // 44 chain to the next master block + sal_Int32 nMaster; // 48 # of additional master blocks + sal_Int32 nMasterFAT[ 109 ]; // 4C first 109 master FAT pages public: StgHeader(); void Init(); // initialize the header - BOOL Load( StgIo& ); - BOOL Load( SvStream& ); - BOOL Store( StgIo& ); - BOOL Check(); // check the signature and version + sal_Bool Load( StgIo& ); + sal_Bool Load( SvStream& ); + sal_Bool Store( StgIo& ); + sal_Bool Check(); // check the signature and version short GetByteOrder() const { return nByteOrder; } - INT32 GetTOCStart() const { return nTOCstrm; } - void SetTOCStart( INT32 n ); - INT32 GetDataFATStart() const { return nDataFAT; } - void SetDataFATStart( INT32 n ); - INT32 GetDataFATSize() const { return nDataFATSize; } - void SetDataFATSize( INT32 n ); - INT32 GetThreshold() const { return nThreshold; } + sal_Int32 GetTOCStart() const { return nTOCstrm; } + void SetTOCStart( sal_Int32 n ); + sal_Int32 GetDataFATStart() const { return nDataFAT; } + void SetDataFATStart( sal_Int32 n ); + sal_Int32 GetDataFATSize() const { return nDataFATSize; } + void SetDataFATSize( sal_Int32 n ); + sal_Int32 GetThreshold() const { return nThreshold; } short GetPageSize() const { return nPageSize; } short GetDataPageSize() const { return nDataPageSize; } - INT32 GetFATSize() const { return nFATSize; } - void SetFATSize( INT32 n ); - INT32 GetFATChain() const { return nMasterChain; } - void SetFATChain( INT32 n ); - INT32 GetMasters() const { return nMaster; } - void SetMasters( INT32 n ); + sal_Int32 GetFATSize() const { return nFATSize; } + void SetFATSize( sal_Int32 n ); + sal_Int32 GetFATChain() const { return nMasterChain; } + void SetFATChain( sal_Int32 n ); + sal_Int32 GetMasters() const { return nMaster; } + void SetMasters( sal_Int32 n ); short GetFAT1Size() const { return 109; } const ClsId& GetClassId() const { return aClsId; } void SetClassId( const ClsId& ); - INT32 GetFATPage( short ) const; - void SetFATPage( short, INT32 ); + sal_Int32 GetFATPage( short ) const; + void SetFATPage( short, sal_Int32 ); }; enum StgEntryType { // dir entry types: @@ -119,42 +119,42 @@ class StgStream; #define STGENTRY_SIZE 128 class StgEntry { // directory enty - UINT16 nName[ 32 ]; // 00 name as WCHAR - INT16 nNameLen; // 40 size of name in bytes including 00H - BYTE cType; // 42 entry type - BYTE cFlags; // 43 0 or 1 (tree balance?) - INT32 nLeft; // 44 left node entry - INT32 nRight; // 48 right node entry - INT32 nChild; // 4C 1st child entry if storage + sal_uInt16 nName[ 32 ]; // 00 name as WCHAR + sal_Int16 nNameLen; // 40 size of name in bytes including 00H + sal_uInt8 cType; // 42 entry type + sal_uInt8 cFlags; // 43 0 or 1 (tree balance?) + sal_Int32 nLeft; // 44 left node entry + sal_Int32 nRight; // 48 right node entry + sal_Int32 nChild; // 4C 1st child entry if storage ClsId aClsId; // 50 class ID (optional) - INT32 nFlags; // 60 state flags(?) - INT32 nMtime[ 2 ]; // 64 modification time - INT32 nAtime[ 2 ]; // 6C creation and access time - INT32 nPage1; // 74 starting block (either direct or translated) - INT32 nSize; // 78 file size - INT32 nUnknown; // 7C unknown + sal_Int32 nFlags; // 60 state flags(?) + sal_Int32 nMtime[ 2 ]; // 64 modification time + sal_Int32 nAtime[ 2 ]; // 6C creation and access time + sal_Int32 nPage1; // 74 starting block (either direct or translated) + sal_Int32 nSize; // 78 file size + sal_Int32 nUnknown; // 7C unknown String aName; // Name as Compare String (ascii, upper) public: - BOOL Init(); // initialize the data - BOOL SetName( const String& ); // store a name (ASCII, up to 32 chars) + sal_Bool Init(); // initialize the data + sal_Bool SetName( const String& ); // store a name (ASCII, up to 32 chars) void GetName( String& rName ) const; // fill in the name short Compare( const StgEntry& ) const; // compare two entries - BOOL Load( const void* ); + sal_Bool Load( const void* ); void Store( void* ); StgEntryType GetType() const { return (StgEntryType) cType; } - INT32 GetStartPage() const { return nPage1; } - void SetType( StgEntryType t ) { cType = (BYTE) t; } - BYTE GetFlags() const { return cFlags; } - void SetFlags( BYTE c ) { cFlags = c; } - INT32 GetSize() const { return nSize; } - void SetSize( INT32 n ) { nSize = n; } + sal_Int32 GetStartPage() const { return nPage1; } + void SetType( StgEntryType t ) { cType = (sal_uInt8) t; } + sal_uInt8 GetFlags() const { return cFlags; } + void SetFlags( sal_uInt8 c ) { cFlags = c; } + sal_Int32 GetSize() const { return nSize; } + void SetSize( sal_Int32 n ) { nSize = n; } const ClsId& GetClassId() const { return aClsId; } void SetClassId( const ClsId& ); - INT32 GetLeaf( StgEntryRef ) const; - void SetLeaf( StgEntryRef, INT32 ); - const INT32* GetTime( StgEntryTime ) const; - void SetTime( StgEntryTime, INT32* ); + sal_Int32 GetLeaf( StgEntryRef ) const; + void SetLeaf( StgEntryRef, sal_Int32 ); + const sal_Int32* GetTime( StgEntryTime ) const; + void SetTime( StgEntryTime, sal_Int32* ); }; diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 00dd454233e2..580a3ddad4a6 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -46,7 +46,7 @@ StgIo::StgIo() : StgCache() pDataFAT = NULL; pDataStrm = NULL; pFAT = NULL; - bCopied = FALSE; + bCopied = sal_False; } StgIo::~StgIo() @@ -59,7 +59,7 @@ StgIo::~StgIo() // Load the header. Do not set an error code if the header is invalid. -BOOL StgIo::Load() +sal_Bool StgIo::Load() { if( pStrm ) { @@ -68,7 +68,7 @@ BOOL StgIo::Load() if( aHdr.Check() ) SetupStreams(); else - return FALSE; + return sal_False; } } return Good(); @@ -76,7 +76,7 @@ BOOL StgIo::Load() // Set up an initial, empty storage -BOOL StgIo::Init() +sal_Bool StgIo::Init() { aHdr.Init(); SetupStreams(); @@ -122,7 +122,7 @@ short StgIo::GetDataPageSize() // Commit everything -BOOL StgIo::CommitAll() +sal_Bool StgIo::CommitAll() { // Store the data (all streams and the TOC) if( pTOC->Store() ) @@ -135,81 +135,81 @@ BOOL StgIo::CommitAll() if( aHdr.Store( *this ) ) { pStrm->Flush(); - ULONG n = pStrm->GetError(); + sal_uIntPtr n = pStrm->GetError(); SetError( n ); #ifdef DBG_UTIL if( n==0 ) ValidateFATs(); #endif - return BOOL( n == 0 ); + return sal_Bool( n == 0 ); } } } SetError( SVSTREAM_WRITE_ERROR ); - return FALSE; + return sal_False; } class EasyFat { - INT32 *pFat; - BOOL *pFree; - INT32 nPages; - INT32 nPageSize; + sal_Int32 *pFat; + sal_Bool *pFree; + sal_Int32 nPages; + sal_Int32 nPageSize; public: - EasyFat( StgIo & rIo, StgStrm *pFatStream, INT32 nPSize ); + EasyFat( StgIo & rIo, StgStrm *pFatStream, sal_Int32 nPSize ); ~EasyFat() { delete pFat; delete pFree; } - INT32 GetPageSize() { return nPageSize; } - INT32 Count() { return nPages; } - INT32 operator[]( INT32 nOffset ) { return pFat[ nOffset ]; } + sal_Int32 GetPageSize() { return nPageSize; } + sal_Int32 Count() { return nPages; } + sal_Int32 operator[]( sal_Int32 nOffset ) { return pFat[ nOffset ]; } - ULONG Mark( INT32 nPage, INT32 nCount, INT32 nExpect ); - BOOL HasUnrefChains(); + sal_uIntPtr Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ); + sal_Bool HasUnrefChains(); }; -EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, INT32 nPSize ) +EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, sal_Int32 nPSize ) { nPages = pFatStream->GetSize() >> 2; nPageSize = nPSize; - pFat = new INT32[ nPages ]; - pFree = new BOOL[ nPages ]; + pFat = new sal_Int32[ nPages ]; + pFree = new sal_Bool[ nPages ]; StgPage *pPage = NULL; - INT32 nFatPageSize = (1 << rIo.aHdr.GetPageSize()) - 2; + sal_Int32 nFatPageSize = (1 << rIo.aHdr.GetPageSize()) - 2; - for( INT32 nPage = 0; nPage < nPages; nPage++ ) + for( sal_Int32 nPage = 0; nPage < nPages; nPage++ ) { if( ! (nPage % nFatPageSize) ) { pFatStream->Pos2Page( nPage << 2 ); - INT32 nPhysPage = pFatStream->GetPage(); - pPage = rIo.Get( nPhysPage, TRUE ); + sal_Int32 nPhysPage = pFatStream->GetPage(); + pPage = rIo.Get( nPhysPage, sal_True ); } pFat[ nPage ] = pPage->GetPage( short( nPage % nFatPageSize ) ); - pFree[ nPage ] = TRUE; + pFree[ nPage ] = sal_True; } } -BOOL EasyFat::HasUnrefChains() +sal_Bool EasyFat::HasUnrefChains() { - for( INT32 nPage = 0; nPage < nPages; nPage++ ) + for( sal_Int32 nPage = 0; nPage < nPages; nPage++ ) { if( pFree[ nPage ] && pFat[ nPage ] != -1 ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -ULONG EasyFat::Mark( INT32 nPage, INT32 nCount, INT32 nExpect ) +sal_uIntPtr EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ) { if( nCount > 0 ) --nCount /= GetPageSize(), nCount++; - INT32 nCurPage = nPage; + sal_Int32 nCurPage = nPage; while( nCount != 0 ) { - pFree[ nCurPage ] = FALSE; + pFree[ nCurPage ] = sal_False; nCurPage = pFat[ nCurPage ]; //Stream zu lang if( nCurPage != nExpect && nCount == 1 ) @@ -231,22 +231,22 @@ ULONG EasyFat::Mark( INT32 nPage, INT32 nCount, INT32 nExpect ) class Validator { - ULONG nError; + sal_uIntPtr nError; EasyFat aSmallFat; EasyFat aFat; StgIo &rIo; - ULONG ValidateMasterFATs(); - ULONG ValidateDirectoryEntries(); - ULONG FindUnrefedChains(); - ULONG MarkAll( StgDirEntry *pEntry ); + sal_uIntPtr ValidateMasterFATs(); + sal_uIntPtr ValidateDirectoryEntries(); + sal_uIntPtr FindUnrefedChains(); + sal_uIntPtr MarkAll( StgDirEntry *pEntry ); public: Validator( StgIo &rIo ); - BOOL IsError() { return nError != 0; } + sal_Bool IsError() { return nError != 0; } }; Validator::Validator( StgIo &rIoP ) @@ -254,7 +254,7 @@ Validator::Validator( StgIo &rIoP ) aFat( rIoP, rIoP.pFAT, 1 << rIoP.aHdr.GetPageSize() ), rIo( rIoP ) { - ULONG nErr = nError = FAT_OK; + sal_uIntPtr nErr = nError = FAT_OK; if( ( nErr = ValidateMasterFATs() ) != FAT_OK ) nError = nErr; @@ -264,13 +264,13 @@ Validator::Validator( StgIo &rIoP ) nError = nErr; } -ULONG Validator::ValidateMasterFATs() +sal_uIntPtr Validator::ValidateMasterFATs() { - INT32 nCount = rIo.aHdr.GetFATSize(); - ULONG nErr; - for( INT32 i = 0; i < nCount; i++ ) + sal_Int32 nCount = rIo.aHdr.GetFATSize(); + sal_uIntPtr nErr; + for( sal_Int32 i = 0; i < nCount; i++ ) { - if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), FALSE ), aFat.GetPageSize(), -3 )) != FAT_OK ) + if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), sal_False ), aFat.GetPageSize(), -3 )) != FAT_OK ) return nErr; } if( rIo.aHdr.GetMasters() ) @@ -279,10 +279,10 @@ ULONG Validator::ValidateMasterFATs() return FAT_OK; } -ULONG Validator::MarkAll( StgDirEntry *pEntry ) +sal_uIntPtr Validator::MarkAll( StgDirEntry *pEntry ) { StgIterator aIter( *pEntry ); - ULONG nErr = FAT_OK; + sal_uIntPtr nErr = FAT_OK; for( StgDirEntry* p = aIter.First(); p ; p = aIter.Next() ) { if( p->aEntry.GetType() == STG_STORAGE ) @@ -293,7 +293,7 @@ ULONG Validator::MarkAll( StgDirEntry *pEntry ) } else { - INT32 nSize = p->aEntry.GetSize(); + sal_Int32 nSize = p->aEntry.GetSize(); if( nSize < rIo.aHdr.GetThreshold() ) nErr = aSmallFat.Mark( p->aEntry.GetStartPage(),nSize, -2 ); else @@ -305,10 +305,10 @@ ULONG Validator::MarkAll( StgDirEntry *pEntry ) return FAT_OK; } -ULONG Validator::ValidateDirectoryEntries() +sal_uIntPtr Validator::ValidateDirectoryEntries() { // Normale DirEntries - ULONG nErr = MarkAll( rIo.pTOC->GetRoot() ); + sal_uIntPtr nErr = MarkAll( rIo.pTOC->GetRoot() ); if( nErr != FAT_OK ) return nErr; // Small Data @@ -328,7 +328,7 @@ ULONG Validator::ValidateDirectoryEntries() return nErr; } -ULONG Validator::FindUnrefedChains() +sal_uIntPtr Validator::FindUnrefedChains() { if( aSmallFat.HasUnrefChains() || aFat.HasUnrefChains() ) @@ -349,12 +349,12 @@ const Link& StgIo::GetErrorLink() return ErrorLink::get(); } -ULONG StgIo::ValidateFATs() +sal_uIntPtr StgIo::ValidateFATs() { if( bFile ) { Validator *pV = new Validator( *this ); - BOOL bRet1 = !pV->IsError(), bRet2 = TRUE ; + sal_Bool bRet1 = !pV->IsError(), bRet2 = sal_True ; delete pV; SvFileStream *pFileStrm = ( SvFileStream *) GetStrm(); StgIo aIo; @@ -367,7 +367,7 @@ ULONG StgIo::ValidateFATs() delete pV; } - ULONG nErr; + sal_uIntPtr nErr; if( bRet1 != bRet2 ) nErr = bRet1 ? FAT_ONFILEERROR : FAT_INMEMORYERROR; else nErr = bRet1 ? FAT_OK : FAT_BOTHERROR; @@ -377,7 +377,7 @@ ULONG StgIo::ValidateFATs() aArg.aFile = pFileStrm->GetFileName(); aArg.nErr = nErr; ErrorLink::get().Call( &aArg ); - bCopied = TRUE; + bCopied = sal_True; } // DBG_ASSERT( nErr == FAT_OK ,"Storage kaputt"); return nErr; diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx index db1c00b8d521..43f72ebefd59 100644 --- a/sot/source/sdstor/stgio.hxx +++ b/sot/source/sdstor/stgio.hxx @@ -53,12 +53,12 @@ enum FAT_ERROR struct StgLinkArg { String aFile; - ULONG nErr; + sal_uIntPtr nErr; }; class StgIo : public StgCache { void SetupStreams(); // load all internal streams - BOOL bCopied; + sal_Bool bCopied; public: StgIo(); ~StgIo(); @@ -68,13 +68,13 @@ public: StgDataStrm* pDataFAT; // small data FAT stream StgDataStrm* pDataStrm; // small data stream short GetDataPageSize(); // get the logical data page size - BOOL Load(); // load a storage file - BOOL Init(); // set up an empty file - BOOL CommitAll(); // commit everything (root commit) + sal_Bool Load(); // load a storage file + sal_Bool Init(); // set up an empty file + sal_Bool CommitAll(); // commit everything (root commit) static void SetErrorLink( const Link& ); static const Link& GetErrorLink(); - ULONG ValidateFATs( ); + sal_uIntPtr ValidateFATs( ); }; #endif diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 148f1e87585c..e3d02bc597ab 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -40,10 +40,10 @@ ///////////////////////// class StgInternalStream //////////////////////// StgInternalStream::StgInternalStream - ( BaseStorage& rStg, const String& rName, BOOL bWr ) + ( BaseStorage& rStg, const String& rName, sal_Bool bWr ) { - bIsWritable = TRUE; - USHORT nMode = bWr + bIsWritable = sal_True; + sal_uInt16 nMode = bWr ? STREAM_WRITE | STREAM_SHARE_DENYALL : STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE; pStrm = rStg.OpenStream( rName, nMode ); @@ -58,7 +58,7 @@ StgInternalStream::~StgInternalStream() delete pStrm; } -ULONG StgInternalStream::GetData( void* pData, ULONG nSize ) +sal_uIntPtr StgInternalStream::GetData( void* pData, sal_uIntPtr nSize ) { if( pStrm ) { @@ -70,7 +70,7 @@ ULONG StgInternalStream::GetData( void* pData, ULONG nSize ) return 0; } -ULONG StgInternalStream::PutData( const void* pData, ULONG nSize ) +sal_uIntPtr StgInternalStream::PutData( const void* pData, sal_uIntPtr nSize ) { if( pStrm ) { @@ -82,7 +82,7 @@ ULONG StgInternalStream::PutData( const void* pData, ULONG nSize ) return 0; } -ULONG StgInternalStream::SeekPos( ULONG nPos ) +sal_uIntPtr StgInternalStream::SeekPos( sal_uIntPtr nPos ) { return pStrm ? pStrm->Seek( nPos ) : 0; } @@ -104,43 +104,43 @@ void StgInternalStream::Commit() ///////////////////////// class StgCompObjStream ///////////////////////// -StgCompObjStream::StgCompObjStream( BaseStorage& rStg, BOOL bWr ) +StgCompObjStream::StgCompObjStream( BaseStorage& rStg, sal_Bool bWr ) : StgInternalStream( rStg, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1CompObj" ) ), bWr ) { memset( &aClsId, 0, sizeof( ClsId ) ); nCbFormat = 0; } -BOOL StgCompObjStream::Load() +sal_Bool StgCompObjStream::Load() { memset( &aClsId, 0, sizeof( ClsId ) ); nCbFormat = 0; aUserName.Erase(); if( GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; Seek( 8L ); // skip the first part - INT32 nMarker = 0; + sal_Int32 nMarker = 0; *this >> nMarker; if( nMarker == -1L ) { *this >> aClsId; - INT32 nLen1 = 0; + sal_Int32 nLen1 = 0; *this >> nLen1; // higher bits are ignored nLen1 &= 0xFFFF; - sal_Char* p = new sal_Char[ (USHORT) nLen1 ]; - if( Read( p, nLen1 ) == (ULONG) nLen1 ) + sal_Char* p = new sal_Char[ (sal_uInt16) nLen1 ]; + if( Read( p, nLen1 ) == (sal_uIntPtr) nLen1 ) { aUserName = nLen1 ? String( p, gsl_getSystemTextEncoding() ) : String(); /* // Now we can read the CB format - INT32 nLen2 = 0; + sal_Int32 nLen2 = 0; *this >> nLen2; if( nLen2 > 0 ) { // get a string name if( nLen2 > nLen1 ) delete p, p = new char[ nLen2 ]; - if( Read( p, nLen2 ) == (ULONG) nLen2 && nLen2 ) + if( Read( p, nLen2 ) == (sal_uIntPtr) nLen2 && nLen2 ) nCbFormat = Exchange::RegisterFormatName( String( p ) ); else SetError( SVSTREAM_GENERALERROR ); @@ -158,73 +158,73 @@ BOOL StgCompObjStream::Load() SetError( SVSTREAM_GENERALERROR ); delete [] p; } - return BOOL( GetError() == SVSTREAM_OK ); + return sal_Bool( GetError() == SVSTREAM_OK ); } -BOOL StgCompObjStream::Store() +sal_Bool StgCompObjStream::Store() { if( GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; Seek( 0L ); ByteString aAsciiUserName( aUserName, RTL_TEXTENCODING_ASCII_US ); - *this << (INT16) 1 // Version? - << (INT16) -2 // 0xFFFE = Byte Order Indicator - << (INT32) 0x0A03 // Windows 3.10 - << (INT32) -1L + *this << (sal_Int16) 1 // Version? + << (sal_Int16) -2 // 0xFFFE = Byte Order Indicator + << (sal_Int32) 0x0A03 // Windows 3.10 + << (sal_Int32) -1L << aClsId // Class ID - << (INT32) (aAsciiUserName.Len() + 1) + << (sal_Int32) (aAsciiUserName.Len() + 1) << (const char *)aAsciiUserName.GetBuffer() - << (UINT8) 0; // string terminator + << (sal_uInt8) 0; // string terminator /* // determine the clipboard format string String aCbFmt; if( nCbFormat > FORMAT_GDIMETAFILE ) aCbFmt = Exchange::GetFormatName( nCbFormat ); if( aCbFmt.Len() ) - *this << (INT32) aCbFmt.Len() + 1 + *this << (sal_Int32) aCbFmt.Len() + 1 << (const char*) aCbFmt - << (UINT8) 0; + << (sal_uInt8) 0; else if( nCbFormat ) - *this << (INT32) -1 // for Windows - << (INT32) nCbFormat; + *this << (sal_Int32) -1 // for Windows + << (sal_Int32) nCbFormat; else - *this << (INT32) 0; // no clipboard format + *this << (sal_Int32) 0; // no clipboard format */ WriteClipboardFormat( *this, nCbFormat ); - *this << (INT32) 0; // terminator + *this << (sal_Int32) 0; // terminator Commit(); - return BOOL( GetError() == SVSTREAM_OK ); + return sal_Bool( GetError() == SVSTREAM_OK ); } /////////////////////////// class StgOleStream /////////////////////////// -StgOleStream::StgOleStream( BaseStorage& rStg, BOOL bWr ) +StgOleStream::StgOleStream( BaseStorage& rStg, sal_Bool bWr ) : StgInternalStream( rStg, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole" ) ), bWr ) { nFlags = 0; } -BOOL StgOleStream::Load() +sal_Bool StgOleStream::Load() { nFlags = 0; if( GetError() != SVSTREAM_OK ) - return FALSE; - INT32 version = 0; + return sal_False; + sal_Int32 version = 0; Seek( 0L ); *this >> version >> nFlags; - return BOOL( GetError() == SVSTREAM_OK ); + return sal_Bool( GetError() == SVSTREAM_OK ); } -BOOL StgOleStream::Store() +sal_Bool StgOleStream::Store() { if( GetError() != SVSTREAM_OK ) - return FALSE; + return sal_False; Seek( 0L ); - *this << (INT32) 0x02000001 // OLE version, format - << (INT32) nFlags // Object flags - << (INT32) 0 // Update Options - << (INT32) 0 // reserved - << (INT32) 0; // Moniker 1 + *this << (sal_Int32) 0x02000001 // OLE version, format + << (sal_Int32) nFlags // Object flags + << (sal_Int32) 0 // Update Options + << (sal_Int32) 0 // reserved + << (sal_Int32) 0; // Moniker 1 Commit(); - return BOOL( GetError() == SVSTREAM_OK ); + return sal_Bool( GetError() == SVSTREAM_OK ); } diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 346f21035f06..b8c569c81ded 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -36,12 +36,12 @@ class StgInternalStream : public SvStream { BaseStorageStream* pStrm; - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); + virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); virtual void FlushData(); public: - StgInternalStream( BaseStorage&, const String&, BOOL ); + StgInternalStream( BaseStorage&, const String&, sal_Bool ); ~StgInternalStream(); void Commit(); }; @@ -52,14 +52,14 @@ class StgCompObjStream : public StgInternalStream { ClsId aClsId; String aUserName; - ULONG nCbFormat; + sal_uIntPtr nCbFormat; public: - StgCompObjStream( BaseStorage&, BOOL ); + StgCompObjStream( BaseStorage&, sal_Bool ); ClsId& GetClsId() { return aClsId; } String& GetUserName() { return aUserName; } - ULONG& GetCbFormat() { return nCbFormat; } - BOOL Load(); - BOOL Store(); + sal_uIntPtr& GetCbFormat() { return nCbFormat; } + sal_Bool Load(); + sal_Bool Store(); }; // standard stream "\1Ole" @@ -68,10 +68,10 @@ class StgOleStream : public StgInternalStream { sal_uInt32 nFlags; public: - StgOleStream( BaseStorage&, BOOL ); + StgOleStream( BaseStorage&, sal_Bool ); sal_uInt32& GetFlags() { return nFlags; } - BOOL Load(); - BOOL Store(); + sal_Bool Load(); + sal_Bool Store(); }; #endif diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 07711133bf4b..74e21903f087 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -52,10 +52,10 @@ ///////////////////////////// class StgFAT /////////////////////////////// // The FAT class performs FAT operations on an underlying storage stream. -// This stream is either the master FAT stream (m == TRUE ) or a normal +// This stream is either the master FAT stream (m == sal_True ) or a normal // storage stream, which then holds the FAT for small data allocations. -StgFAT::StgFAT( StgStrm& r, BOOL m ) : rStrm( r ) +StgFAT::StgFAT( StgStrm& r, sal_Bool m ) : rStrm( r ) { bPhys = m; nPageSize = rStrm.GetIo().GetPhysPageSize(); @@ -67,7 +67,7 @@ StgFAT::StgFAT( StgStrm& r, BOOL m ) : rStrm( r ) // Retrieve the physical page for a given byte offset. -StgPage* StgFAT::GetPhysPage( INT32 nByteOff ) +StgPage* StgFAT::GetPhysPage( sal_Int32 nByteOff ) { StgPage* pPg = NULL; // Position within the underlying stream @@ -75,16 +75,16 @@ StgPage* StgFAT::GetPhysPage( INT32 nByteOff ) if( rStrm.Pos2Page( nByteOff ) ) { nOffset = rStrm.GetOffset(); - INT32 nPhysPage = rStrm.GetPage(); + sal_Int32 nPhysPage = rStrm.GetPage(); // get the physical page (must be present) - pPg = rStrm.GetIo().Get( nPhysPage, TRUE ); + pPg = rStrm.GetIo().Get( nPhysPage, sal_True ); } return pPg; } // Get the follow page for a certain FAT page. -INT32 StgFAT::GetNextPage( INT32 nPg ) +sal_Int32 StgFAT::GetNextPage( sal_Int32 nPg ) { if( nPg >= 0 ) { @@ -100,16 +100,16 @@ INT32 StgFAT::GetNextPage( INT32 nPg ) // underlying stream size. It is treated as a recommendation // to abort the search to inhibit excessive file growth. -INT32 StgFAT::FindBlock( INT32& nPgs ) +sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs ) { - INT32 nMinStart = STG_EOF, nMinLen = 0; - INT32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL; - INT32 nTmpStart = STG_EOF, nTmpLen = 0; - INT32 nPages = rStrm.GetSize() >> 2; - BOOL bFound = FALSE; + sal_Int32 nMinStart = STG_EOF, nMinLen = 0; + sal_Int32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL; + sal_Int32 nTmpStart = STG_EOF, nTmpLen = 0; + sal_Int32 nPages = rStrm.GetSize() >> 2; + sal_Bool bFound = sal_False; StgPage* pPg = NULL; short nEntry = 0; - for( INT32 i = 0; i < nPages; i++, nEntry++ ) + for( sal_Int32 i = 0; i < nPages; i++, nEntry++ ) { if( !( nEntry % nEntries ) ) { @@ -119,7 +119,7 @@ INT32 StgFAT::FindBlock( INT32& nPgs ) if( !pPg ) return STG_EOF; } - INT32 nCur = pPg->GetPage( nEntry ); + sal_Int32 nCur = pPg->GetPage( nEntry ); if( nCur == STG_FREE ) { // count the size of this area @@ -137,12 +137,12 @@ INT32 StgFAT::FindBlock( INT32& nPgs ) { if( nTmpLen > nPgs && nTmpLen < nMaxLen ) // block > requested size - nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = TRUE; + nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = sal_True; else if( nTmpLen >= nMinLen ) { // block < requested size nMinLen = nTmpLen, nMinStart = nTmpStart; - bFound = TRUE; + bFound = sal_True; if( nTmpLen == nPgs ) break; } @@ -163,8 +163,8 @@ INT32 StgFAT::FindBlock( INT32& nPgs ) if( nMinStart != STG_EOF && nMaxStart != STG_EOF ) { // two areas found; return the best fit area - INT32 nMinDiff = nPgs - nMinLen; - INT32 nMaxDiff = nMaxLen - nPgs; + sal_Int32 nMinDiff = nPgs - nMinLen; + sal_Int32 nMaxDiff = nMaxLen - nPgs; if( nMinDiff > nMaxDiff ) nMinStart = STG_EOF; } @@ -180,19 +180,19 @@ INT32 StgFAT::FindBlock( INT32& nPgs ) // Set up the consecutive chain for a given block. -BOOL StgFAT::MakeChain( INT32 nStart, INT32 nPgs ) +sal_Bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs ) { - INT32 nPos = nStart << 2; + sal_Int32 nPos = nStart << 2; StgPage* pPg = GetPhysPage( nPos ); if( !pPg || !nPgs ) - return FALSE; + return sal_False; while( --nPgs ) { if( nOffset >= nPageSize ) { pPg = GetPhysPage( nPos ); if( !pPg ) - return FALSE; + return sal_False; } pPg->SetPage( nOffset >> 2, ++nStart ); nOffset += 4; @@ -202,22 +202,22 @@ BOOL StgFAT::MakeChain( INT32 nStart, INT32 nPgs ) { pPg = GetPhysPage( nPos ); if( !pPg ) - return FALSE; + return sal_False; } pPg->SetPage( nOffset >> 2, STG_EOF ); - return TRUE; + return sal_True; } // Allocate a block of data from the given page number on. // It the page number is != STG_EOF, chain the block. -INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs ) +sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs ) { - INT32 nOrig = nBgn; - INT32 nLast = nBgn; - INT32 nBegin = STG_EOF; - INT32 nAlloc; - INT32 nPages = rStrm.GetSize() >> 2; + sal_Int32 nOrig = nBgn; + sal_Int32 nLast = nBgn; + sal_Int32 nBegin = STG_EOF; + sal_Int32 nAlloc; + sal_Int32 nPages = rStrm.GetSize() >> 2; short nPasses = 0; // allow for two passes while( nPasses < 2 ) @@ -253,7 +253,7 @@ INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs ) if( !rStrm.SetSize( ( nPages + nPgs ) << 2 ) ) return STG_EOF; if( !bPhys && !InitNew( nPages ) ) - return FALSE; + return sal_False; nPages = rStrm.GetSize() >> 2; nPasses++; } @@ -273,9 +273,9 @@ INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs ) // It can be assumed that the stream size is always on // a page boundary -BOOL StgFAT::InitNew( INT32 nPage1 ) +sal_Bool StgFAT::InitNew( sal_Int32 nPage1 ) { - INT32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries; + sal_Int32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries; while( n-- ) { StgPage* pPg = NULL; @@ -285,29 +285,29 @@ BOOL StgFAT::InitNew( INT32 nPage1 ) // Initialize the page pPg = rStrm.GetIo().Copy( rStrm.GetPage(), STG_FREE ); if ( !pPg ) - return FALSE; + return sal_False; for( short i = 0; i < nEntries; i++ ) pPg->SetPage( i, STG_FREE ); nPage1++; } - return TRUE; + return sal_True; } // Release a chain -BOOL StgFAT::FreePages( INT32 nStart, BOOL bAll ) +sal_Bool StgFAT::FreePages( sal_Int32 nStart, sal_Bool bAll ) { while( nStart >= 0 ) { StgPage* pPg = GetPhysPage( nStart << 2 ); if( !pPg ) - return FALSE; + return sal_False; nStart = pPg->GetPage( nOffset >> 2 ); // The first released page is either set to EOF or FREE pPg->SetPage( nOffset >> 2, bAll ? STG_FREE : STG_EOF ); - bAll = TRUE; + bAll = sal_True; } - return TRUE; + return sal_True; } ///////////////////////////// class StgStrm //////////////////////////////// @@ -345,21 +345,21 @@ void StgStrm::SetEntry( StgDirEntry& r ) // If the position is behind the size, set the stream right // behind the EOF. -BOOL StgStrm::Pos2Page( INT32 nBytePos ) +sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos ) { - INT32 nRel, nBgn; + sal_Int32 nRel, nBgn; // Values < 0 seek to the end if( nBytePos < 0 || nBytePos >= nSize ) nBytePos = nSize; // Adjust the position back to offset 0 nPos -= nOffset; - INT32 nMask = ~( nPageSize - 1 ); - INT32 nOld = nPos & nMask; - INT32 nNew = nBytePos & nMask; + sal_Int32 nMask = ~( nPageSize - 1 ); + sal_Int32 nOld = nPos & nMask; + sal_Int32 nNew = nBytePos & nMask; nOffset = (short) ( nBytePos & ~nMask ); nPos = nBytePos; if( nOld == nNew ) - return TRUE; + return sal_True; if( nNew > nOld ) { // the new position is behind the current, so an incremental @@ -376,7 +376,7 @@ BOOL StgStrm::Pos2Page( INT32 nBytePos ) } // now, traverse the FAT chain. nRel /= nPageSize; - INT32 nLast = STG_EOF; + sal_Int32 nLast = STG_EOF; while( nRel && nBgn >= 0 ) { nLast = nBgn; @@ -394,12 +394,12 @@ BOOL StgStrm::Pos2Page( INT32 nBytePos ) nOffset = nPageSize; } nPage = nBgn; - return BOOL( nRel == 0 && nPage >= 0 ); + return sal_Bool( nRel == 0 && nPage >= 0 ); } // Retrieve the physical page for a given byte offset. -StgPage* StgStrm::GetPhysPage( INT32 nBytePos, BOOL bForce ) +StgPage* StgStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce ) { if( !Pos2Page( nBytePos ) ) return NULL; @@ -409,16 +409,16 @@ StgPage* StgStrm::GetPhysPage( INT32 nBytePos, BOOL bForce ) // Copy an entire stream. Both streams are allocated in the FAT. // The target stream is this stream. -BOOL StgStrm::Copy( INT32 nFrom, INT32 nBytes ) +sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes ) { - INT32 nTo = nStart; - INT32 nPgs = ( nBytes + nPageSize - 1 ) / nPageSize; + sal_Int32 nTo = nStart; + sal_Int32 nPgs = ( nBytes + nPageSize - 1 ) / nPageSize; while( nPgs-- ) { if( nTo < 0 ) { rIo.SetError( SVSTREAM_FILEFORMAT_ERROR ); - return FALSE; + return sal_False; } rIo.Copy( nTo, nFrom ); if( nFrom >= 0 ) @@ -427,34 +427,34 @@ BOOL StgStrm::Copy( INT32 nFrom, INT32 nBytes ) if( nFrom < 0 ) { rIo.SetError( SVSTREAM_FILEFORMAT_ERROR ); - return FALSE; + return sal_False; } } nTo = pFat->GetNextPage( nTo ); } - return TRUE; + return sal_True; } -BOOL StgStrm::SetSize( INT32 nBytes ) +sal_Bool StgStrm::SetSize( sal_Int32 nBytes ) { // round up to page size - INT32 nOld = ( ( nSize + nPageSize - 1 ) / nPageSize ) * nPageSize; - INT32 nNew = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize; + sal_Int32 nOld = ( ( nSize + nPageSize - 1 ) / nPageSize ) * nPageSize; + sal_Int32 nNew = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize; if( nNew > nOld ) { if( !Pos2Page( nSize ) ) - return FALSE; - INT32 nBgn = pFat->AllocPages( nPage, ( nNew - nOld ) / nPageSize ); + return sal_False; + sal_Int32 nBgn = pFat->AllocPages( nPage, ( nNew - nOld ) / nPageSize ); if( nBgn == STG_EOF ) - return FALSE; + return sal_False; if( nStart == STG_EOF ) nStart = nPage = nBgn; } else if( nNew < nOld ) { - BOOL bAll = BOOL( nBytes == 0 ); + sal_Bool bAll = sal_Bool( nBytes == 0 ); if( !Pos2Page( nBytes ) || !pFat->FreePages( nPage, bAll ) ) - return FALSE; + return sal_False; if( bAll ) nStart = nPage = STG_EOF; } @@ -468,12 +468,12 @@ BOOL StgStrm::SetSize( INT32 nBytes ) } nSize = nBytes; pFat->SetLimit( GetPages() ); - return TRUE; + return sal_True; } // Return the # of allocated pages -INT32 StgStrm::GetPages() +sal_Int32 StgStrm::GetPages() { return ( nSize + nPageSize - 1 ) / nPageSize; } @@ -486,11 +486,11 @@ INT32 StgStrm::GetPages() StgFATStrm::StgFATStrm( StgIo& r ) : StgStrm( r ) { - pFat = new StgFAT( *this, TRUE ); + pFat = new StgFAT( *this, sal_True ); nSize = rIo.aHdr.GetFATSize() * nPageSize; } -BOOL StgFATStrm::Pos2Page( INT32 nBytePos ) +sal_Bool StgFATStrm::Pos2Page( sal_Int32 nBytePos ) { // Values < 0 seek to the end if( nBytePos < 0 || nBytePos >= nSize ) @@ -498,38 +498,38 @@ BOOL StgFATStrm::Pos2Page( INT32 nBytePos ) nPage = nBytePos / nPageSize; nOffset = (short) ( nBytePos % nPageSize ); nPos = nBytePos; - nPage = GetPage( (short) nPage, FALSE ); - return BOOL( nPage >= 0 ); + nPage = GetPage( (short) nPage, sal_False ); + return sal_Bool( nPage >= 0 ); } // Retrieve the physical page for a given byte offset. // Since Pos2Page() already has computed the physical offset, // use the byte offset directly. -StgPage* StgFATStrm::GetPhysPage( INT32 nBytePos, BOOL bForce ) +StgPage* StgFATStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce ) { return rIo.Get( nBytePos / ( nPageSize >> 2 ), bForce ); } // Get the page number entry for the given page offset. -INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc ) +sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterAlloc ) { if( pnMasterAlloc ) *pnMasterAlloc = 0; if( nOff < rIo.aHdr.GetFAT1Size() ) return rIo.aHdr.GetFATPage( nOff ); - INT32 nMaxPage = nSize >> 2; + sal_Int32 nMaxPage = nSize >> 2; nOff = nOff - rIo.aHdr.GetFAT1Size(); // Anzahl der Masterpages, durch die wir iterieren muessen - USHORT nMasterCount = ( nPageSize >> 2 ) - 1; - USHORT nBlocks = nOff / nMasterCount; + sal_uInt16 nMasterCount = ( nPageSize >> 2 ) - 1; + sal_uInt16 nBlocks = nOff / nMasterCount; // Offset in letzter Masterpage nOff = nOff % nMasterCount; StgPage* pOldPage = 0; StgPage* pMaster = 0; - INT32 nFAT = rIo.aHdr.GetFATChain(); - for( USHORT nCount = 0; nCount <= nBlocks; nCount++ ) + sal_Int32 nFAT = rIo.aHdr.GetFATChain(); + for( sal_uInt16 nCount = 0; nCount <= nBlocks; nCount++ ) { if( nFAT == STG_EOF || nFAT == STG_FREE ) { @@ -556,7 +556,7 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc ) { if( !Pos2Page( nFAT << 2 ) ) return STG_EOF; - StgPage* pPg = rIo.Get( nPage, TRUE ); + StgPage* pPg = rIo.Get( nPage, sal_True ); if( !pPg ) return STG_EOF; pPg->SetPage( nOffset >> 2, STG_MASTER ); @@ -570,7 +570,7 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc ) } else { - pMaster = rIo.Get( nFAT, TRUE ); + pMaster = rIo.Get( nFAT, sal_True ); if ( pMaster ) { nFAT = pMaster->GetPage( nMasterCount ); @@ -587,30 +587,30 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc ) // Set the page number entry for the given page offset. -BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage ) +sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage ) { - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; if( nOff < rIo.aHdr.GetFAT1Size() ) rIo.aHdr.SetFATPage( nOff, nNewPage ); else { nOff = nOff - rIo.aHdr.GetFAT1Size(); // Anzahl der Masterpages, durch die wir iterieren muessen - USHORT nMasterCount = ( nPageSize >> 2 ) - 1; - USHORT nBlocks = nOff / nMasterCount; + sal_uInt16 nMasterCount = ( nPageSize >> 2 ) - 1; + sal_uInt16 nBlocks = nOff / nMasterCount; // Offset in letzter Masterpage nOff = nOff % nMasterCount; StgPage* pMaster = 0; - INT32 nFAT = rIo.aHdr.GetFATChain(); - for( USHORT nCount = 0; nCount <= nBlocks; nCount++ ) + sal_Int32 nFAT = rIo.aHdr.GetFATChain(); + for( sal_uInt16 nCount = 0; nCount <= nBlocks; nCount++ ) { if( nFAT == STG_EOF || nFAT == STG_FREE ) { pMaster = 0; break; } - pMaster = rIo.Get( nFAT, TRUE ); + pMaster = rIo.Get( nFAT, sal_True ); if ( pMaster ) nFAT = pMaster->GetPage( nMasterCount ); } @@ -619,7 +619,7 @@ BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage ) else { rIo.SetError( SVSTREAM_GENERALERROR ); - bRes = FALSE; + bRes = sal_False; } } @@ -627,16 +627,16 @@ BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage ) if( bRes ) { Pos2Page( nNewPage << 2 ); - StgPage* pPg = rIo.Get( nPage, TRUE ); + StgPage* pPg = rIo.Get( nPage, sal_True ); if( pPg ) pPg->SetPage( nOffset >> 2, STG_FAT ); else - bRes = FALSE; + bRes = sal_False; } return bRes; } -BOOL StgFATStrm::SetSize( INT32 nBytes ) +sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes ) { // Set the number of entries to a multiple of the page size short nOld = (short) ( ( nSize + ( nPageSize - 1 ) ) / nPageSize ); @@ -654,17 +654,17 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) { // allocate master pages // find a free master page slot - INT32 nPg = 0; - USHORT nMasterAlloc = 0; - nPg = GetPage( nOld, TRUE, &nMasterAlloc ); + sal_Int32 nPg = 0; + sal_uInt16 nMasterAlloc = 0; + nPg = GetPage( nOld, sal_True, &nMasterAlloc ); if( nPg == STG_EOF ) - return FALSE; + return sal_False; // 4 Bytes have been used for Allocation of each MegaMasterPage nBytes += nMasterAlloc << 2; // find a free page using the FAT allocator - INT32 n = 1; - INT32 nNewPage = pFat->FindBlock( n ); + sal_Int32 n = 1; + sal_Int32 nNewPage = pFat->FindBlock( n ); if( nNewPage == STG_EOF ) { // no free pages found; create a new page @@ -677,12 +677,12 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) // adjust the file size if necessary if( nNewPage >= rIo.GetPhysPages() ) if( !rIo.SetSize( nNewPage + 1 ) ) - return FALSE; + return sal_False; } // Set up the page with empty entries StgPage* pPg = rIo.Copy( nNewPage, STG_FREE ); if ( !pPg ) - return FALSE; + return sal_False; for( short j = 0; j < ( nPageSize >> 2 ); j++ ) pPg->SetPage( j, STG_FREE ); @@ -693,22 +693,22 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) // MegaMasterPages were created, mark it them as used - UINT32 nMax = rIo.aHdr.GetMasters( ); - UINT32 nFAT = rIo.aHdr.GetFATChain(); + sal_uInt32 nMax = rIo.aHdr.GetMasters( ); + sal_uInt32 nFAT = rIo.aHdr.GetFATChain(); if( nMasterAlloc ) - for( USHORT nCount = 0; nCount < nMax; nCount++ ) + for( sal_uInt16 nCount = 0; nCount < nMax; nCount++ ) { if( !Pos2Page( nFAT << 2 ) ) - return FALSE; + return sal_False; if( nMax - nCount <= nMasterAlloc ) { - StgPage* piPg = rIo.Get( nPage, TRUE ); + StgPage* piPg = rIo.Get( nPage, sal_True ); if( !piPg ) - return FALSE; + return sal_False; piPg->SetPage( nOffset >> 2, STG_MASTER ); } - StgPage* pPage = rIo.Get( nFAT, TRUE ); - if( !pPage ) return FALSE; + StgPage* pPage = rIo.Get( nFAT, sal_True ); + if( !pPage ) return sal_False; nFAT = pPage->GetPage( (nPageSize >> 2 ) - 1 ); } @@ -721,7 +721,7 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) } nSize = nNew * nPageSize; rIo.aHdr.SetFATSize( nNew ); - return TRUE; + return sal_True; } /////////////////////////// class StgDataStrm ////////////////////////////// @@ -731,7 +731,7 @@ BOOL StgFATStrm::SetSize( INT32 nBytes ) // The stream has a size increment which normally is 1, but which can be // set to any value is you want the size to be incremented by certain values. -StgDataStrm::StgDataStrm( StgIo& r, INT32 nBgn, INT32 nLen ) : StgStrm( r ) +StgDataStrm::StgDataStrm( StgIo& r, sal_Int32 nBgn, sal_Int32 nLen ) : StgStrm( r ) { Init( nBgn, nLen ); } @@ -743,9 +743,9 @@ StgDataStrm::StgDataStrm( StgIo& r, StgDirEntry* p ) : StgStrm( r ) p->aEntry.GetSize() ); } -void StgDataStrm::Init( INT32 nBgn, INT32 nLen ) +void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen ) { - pFat = new StgFAT( *rIo.pFAT, TRUE ); + pFat = new StgFAT( *rIo.pFAT, sal_True ); nStart = nPage = nBgn; nSize = nLen; nIncr = 1; @@ -755,7 +755,7 @@ void StgDataStrm::Init( INT32 nBgn, INT32 nLen ) // determine the actual size of the stream by scanning // the FAT chain and counting the # of pages allocated nSize = 0; - INT32 nOldBgn = -1; + sal_Int32 nOldBgn = -1; while( nBgn >= 0 && nBgn != nOldBgn ) { nOldBgn = nBgn; @@ -769,18 +769,18 @@ void StgDataStrm::Init( INT32 nBgn, INT32 nLen ) // Set the size of a physical stream. -BOOL StgDataStrm::SetSize( INT32 nBytes ) +sal_Bool StgDataStrm::SetSize( sal_Int32 nBytes ) { nBytes = ( ( nBytes + nIncr - 1 ) / nIncr ) * nIncr; - INT32 nOldSz = nSize; + sal_Int32 nOldSz = nSize; if( ( nOldSz != nBytes ) ) { if( !StgStrm::SetSize( nBytes ) ) - return FALSE; - INT32 nMaxPage = pFat->GetMaxPage(); + return sal_False; + sal_Int32 nMaxPage = pFat->GetMaxPage(); if( nMaxPage > rIo.GetPhysPages() ) if( !rIo.SetSize( nMaxPage ) ) - return FALSE; + return sal_False; // If we only allocated one page or less, create this // page in the cache for faster throughput. The current // position is the former EOF point. @@ -791,14 +791,14 @@ BOOL StgDataStrm::SetSize( INT32 nBytes ) rIo.Copy( nPage, STG_FREE ); } } - return TRUE; + return sal_True; } // Get the address of the data byte at a specified offset. -// If bForce = TRUE, a read of non-existent data causes +// If bForce = sal_True, a read of non-existent data causes // a read fault. -void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty ) +void* StgDataStrm::GetPtr( sal_Int32 Pos, sal_Bool bForce, sal_Bool bDirty ) { if( Pos2Page( Pos ) ) { @@ -808,7 +808,7 @@ void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty ) pPg->SetOwner( pEntry ); if( bDirty ) pPg->SetDirty(); - return ((BYTE *)pPg->GetData()) + nOffset; + return ((sal_uInt8 *)pPg->GetData()) + nOffset; } } return NULL; @@ -818,24 +818,24 @@ void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty ) // the amount of consecutable blocks before doing a read. The result // is the number of bytes read. No error is generated on EOF. -INT32 StgDataStrm::Read( void* pBuf, INT32 n ) +sal_Int32 StgDataStrm::Read( void* pBuf, sal_Int32 n ) { if ( n < 0 ) return 0; if( ( nPos + n ) > nSize ) n = nSize - nPos; - INT32 nDone = 0; + sal_Int32 nDone = 0; while( n ) { short nBytes = nPageSize - nOffset; short nRes; StgPage* pPg; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { - void *p = (BYTE *) pBuf + nDone; + void *p = (sal_uInt8 *) pBuf + nDone; if( nBytes == nPageSize ) { pPg = rIo.Find( nPage ); @@ -853,11 +853,11 @@ INT32 StgDataStrm::Read( void* pBuf, INT32 n ) else { // partial block read thru the cache. - pPg = rIo.Get( nPage, FALSE ); + pPg = rIo.Get( nPage, sal_False ); if( !pPg ) break; pPg->SetOwner( pEntry ); - memcpy( p, (BYTE*)pPg->GetData() + nOffset, nBytes ); + memcpy( p, (sal_uInt8*)pPg->GetData() + nOffset, nBytes ); nRes = nBytes; } nDone += nRes; @@ -874,14 +874,14 @@ INT32 StgDataStrm::Read( void* pBuf, INT32 n ) return nDone; } -INT32 StgDataStrm::Write( const void* pBuf, INT32 n ) +sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n ) { - INT32 nDone = 0; + sal_Int32 nDone = 0; if( ( nPos + n ) > nSize ) { - INT32 nOld = nPos; + sal_Int32 nOld = nPos; if( !SetSize( nPos + n ) ) - return FALSE; + return sal_False; Pos2Page( nOld ); } while( n ) @@ -889,11 +889,11 @@ INT32 StgDataStrm::Write( const void* pBuf, INT32 n ) short nBytes = nPageSize - nOffset; short nRes; StgPage* pPg; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { - const void *p = (const BYTE *) pBuf + nDone; + const void *p = (const sal_uInt8 *) pBuf + nDone; if( nBytes == nPageSize ) { pPg = rIo.Find( nPage ); @@ -912,11 +912,11 @@ INT32 StgDataStrm::Write( const void* pBuf, INT32 n ) else { // partial block read thru the cache. - pPg = rIo.Get( nPage, FALSE ); + pPg = rIo.Get( nPage, sal_False ); if( !pPg ) break; pPg->SetOwner( pEntry ); - memcpy( (BYTE*)pPg->GetData() + nOffset, p, nBytes ); + memcpy( (sal_uInt8*)pPg->GetData() + nOffset, p, nBytes ); pPg->SetDirty(); nRes = nBytes; } @@ -941,7 +941,7 @@ INT32 StgDataStrm::Write( const void* pBuf, INT32 n ) // is also a StgStream. The start of the FAT is in the header at DataRootPage, // the stream itself is pointed to by the root entry (it holds start & size). -StgSmallStrm::StgSmallStrm( StgIo& r, INT32 nBgn, INT32 nLen ) : StgStrm( r ) +StgSmallStrm::StgSmallStrm( StgIo& r, sal_Int32 nBgn, sal_Int32 nLen ) : StgStrm( r ) { Init( nBgn, nLen ); } @@ -953,9 +953,9 @@ StgSmallStrm::StgSmallStrm( StgIo& r, StgDirEntry* p ) : StgStrm( r ) p->aEntry.GetSize() ); } -void StgSmallStrm::Init( INT32 nBgn, INT32 nLen ) +void StgSmallStrm::Init( sal_Int32 nBgn, sal_Int32 nLen ) { - pFat = new StgFAT( *rIo.pDataFAT, FALSE ); + pFat = new StgFAT( *rIo.pDataFAT, sal_False ); pData = rIo.pDataStrm; nPageSize = rIo.GetDataPageSize(); nStart = @@ -967,7 +967,7 @@ void StgSmallStrm::Init( INT32 nBgn, INT32 nLen ) // the amount of consecutable blocks before doing a read. The result // is the number of bytes read. No error is generated on EOF. -INT32 StgSmallStrm::Read( void* pBuf, INT32 n ) +sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n ) { // We can safely assume that reads are not huge, since the // small stream is likely to be < 64 KBytes. @@ -977,14 +977,14 @@ INT32 StgSmallStrm::Read( void* pBuf, INT32 n ) while( n ) { short nBytes = nPageSize - nOffset; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { if( !pData->Pos2Page( nPage * nPageSize + nOffset ) ) break; // all reading thru the stream - short nRes = (short) pData->Read( (BYTE*)pBuf + nDone, nBytes ); + short nRes = (short) pData->Read( (sal_uInt8*)pBuf + nDone, nBytes ); nDone = nDone + nRes; nPos += nRes; n -= nRes; @@ -1000,33 +1000,33 @@ INT32 StgSmallStrm::Read( void* pBuf, INT32 n ) return nDone; } -INT32 StgSmallStrm::Write( const void* pBuf, INT32 n ) +sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) { // you can safely assume that reads are not huge, since the // small stream is likely to be < 64 KBytes. short nDone = 0; if( ( nPos + n ) > nSize ) { - INT32 nOld = nPos; + sal_Int32 nOld = nPos; if( !SetSize( nPos + n ) ) - return FALSE; + return sal_False; Pos2Page( nOld ); } while( n ) { short nBytes = nPageSize - nOffset; - if( (INT32) nBytes > n ) + if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { // all writing goes thru the stream - INT32 nDataPos = nPage * nPageSize + nOffset; + sal_Int32 nDataPos = nPage * nPageSize + nOffset; if( pData->GetSize() < ( nDataPos + nBytes ) ) if( !pData->SetSize( nDataPos + nBytes ) ) break; if( !pData->Pos2Page( nDataPos ) ) break; - short nRes = (short) pData->Write( (BYTE*)pBuf + nDone, nBytes ); + short nRes = (short) pData->Write( (sal_uInt8*)pBuf + nDone, nBytes ); nDone = nDone + nRes; nPos += nRes; n -= nRes; @@ -1049,7 +1049,7 @@ INT32 StgSmallStrm::Write( const void* pBuf, INT32 n ) #define THRESHOLD 32768L -StgTmpStrm::StgTmpStrm( ULONG nInitSize ) +StgTmpStrm::StgTmpStrm( sal_uIntPtr nInitSize ) : SvMemoryStream( nInitSize > THRESHOLD ? 16 : ( nInitSize ? nInitSize : 16 ), 4096 ) @@ -1061,19 +1061,19 @@ StgTmpStrm::StgTmpStrm( ULONG nInitSize ) SetSize( nInitSize ); } -BOOL StgTmpStrm::Copy( StgTmpStrm& rSrc ) +sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) { - ULONG n = rSrc.GetSize(); - ULONG nCur = rSrc.Tell(); + sal_uIntPtr n = rSrc.GetSize(); + sal_uIntPtr nCur = rSrc.Tell(); SetSize( n ); if( GetError() == SVSTREAM_OK ) { - BYTE* p = new BYTE[ 4096 ]; + sal_uInt8* p = new sal_uInt8[ 4096 ]; rSrc.Seek( 0L ); Seek( 0L ); while( n ) { - ULONG nn = n; + sal_uIntPtr nn = n; if( nn > 4096 ) nn = 4096; if( rSrc.Read( p, nn ) != nn ) @@ -1085,10 +1085,10 @@ BOOL StgTmpStrm::Copy( StgTmpStrm& rSrc ) delete [] p; rSrc.Seek( nCur ); Seek( nCur ); - return BOOL( n == 0 ); + return sal_Bool( n == 0 ); } else - return FALSE; + return sal_False; } StgTmpStrm::~StgTmpStrm() @@ -1101,12 +1101,12 @@ StgTmpStrm::~StgTmpStrm() } } -ULONG StgTmpStrm::GetSize() const +sal_uIntPtr StgTmpStrm::GetSize() const { - ULONG n; + sal_uIntPtr n; if( pStrm ) { - ULONG old = pStrm->Tell(); + sal_uIntPtr old = pStrm->Tell(); n = pStrm->Seek( STREAM_SEEK_TO_END ); pStrm->Seek( old ); } @@ -1115,7 +1115,7 @@ ULONG StgTmpStrm::GetSize() const return n; } -void StgTmpStrm::SetSize( ULONG n ) +void StgTmpStrm::SetSize( sal_uIntPtr n ) { if( pStrm ) pStrm->SetStreamSize( n ); @@ -1125,15 +1125,15 @@ void StgTmpStrm::SetSize( ULONG n ) { aName = TempFile::CreateTempName(); SvFileStream* s = new SvFileStream( aName, STREAM_READWRITE ); - ULONG nCur = Tell(); - ULONG i = nEndOfData; + sal_uIntPtr nCur = Tell(); + sal_uIntPtr i = nEndOfData; if( i ) { - BYTE* p = new BYTE[ 4096 ]; + sal_uInt8* p = new sal_uInt8[ 4096 ]; Seek( 0L ); while( i ) { - ULONG nb = ( i > 4096 ) ? 4096 : i; + sal_uIntPtr nb = ( i > 4096 ) ? 4096 : i; if( Read( p, nb ) == nb && s->Write( p, nb ) == nb ) i -= nb; @@ -1169,9 +1169,9 @@ void StgTmpStrm::SetSize( ULONG n ) { if( n > nEndOfData ) { - ULONG nCur = Tell(); + sal_uIntPtr nCur = Tell(); Seek( nEndOfData - 1 ); - *this << (BYTE) 0; + *this << (sal_uInt8) 0; Seek( nCur ); } else @@ -1180,7 +1180,7 @@ void StgTmpStrm::SetSize( ULONG n ) } } -ULONG StgTmpStrm::GetData( void* pData, ULONG n ) +sal_uIntPtr StgTmpStrm::GetData( void* pData, sal_uIntPtr n ) { if( pStrm ) { @@ -1192,10 +1192,10 @@ ULONG StgTmpStrm::GetData( void* pData, ULONG n ) return SvMemoryStream::GetData( (sal_Char *)pData, n ); } -ULONG StgTmpStrm::PutData( const void* pData, ULONG n ) +sal_uIntPtr StgTmpStrm::PutData( const void* pData, sal_uIntPtr n ) { - UINT32 nCur = Tell(); - UINT32 nNew = nCur + n; + sal_uInt32 nCur = Tell(); + sal_uInt32 nNew = nCur + n; if( nNew > THRESHOLD && !pStrm ) { SetSize( nNew ); @@ -1212,7 +1212,7 @@ ULONG StgTmpStrm::PutData( const void* pData, ULONG n ) return nNew; } -ULONG StgTmpStrm::SeekPos( ULONG n ) +sal_uIntPtr StgTmpStrm::SeekPos( sal_uIntPtr n ) { if( n == STREAM_SEEK_TO_END ) n = GetSize(); diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 9b09f51db43f..1ececadae35e 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -38,29 +38,29 @@ class StgPage; class StgDirEntry; // The FAT class performs FAT operations on an underlying storage stream. -// This stream is either the physical FAT stream (bPhys == TRUE ) or a normal +// This stream is either the physical FAT stream (bPhys == sal_True ) or a normal // storage stream, which then holds the FAT for small data allocations. class StgFAT { // FAT allocator StgStrm& rStrm; // underlying stream - INT32 nMaxPage; // highest page allocated so far + sal_Int32 nMaxPage; // highest page allocated so far short nPageSize; // physical page size short nEntries; // FAT entries per page short nOffset; // current offset within page - INT32 nLimit; // search limit recommendation - BOOL bPhys; // TRUE: physical FAT - StgPage* GetPhysPage( INT32 nPage ); - BOOL MakeChain( INT32 nStart, INT32 nPages ); - BOOL InitNew( INT32 nPage1 ); + sal_Int32 nLimit; // search limit recommendation + sal_Bool bPhys; // sal_True: physical FAT + StgPage* GetPhysPage( sal_Int32 nPage ); + sal_Bool MakeChain( sal_Int32 nStart, sal_Int32 nPages ); + sal_Bool InitNew( sal_Int32 nPage1 ); public: - StgFAT( StgStrm& rStrm, BOOL bMark ); - INT32 FindBlock( INT32& nPages ); - INT32 GetNextPage( INT32 nPg ); - INT32 AllocPages( INT32 nStart, INT32 nPages ); - BOOL FreePages( INT32 nStart, BOOL bAll ); - INT32 GetMaxPage() { return nMaxPage; } - void SetLimit( INT32 n ) { nLimit = n; } + StgFAT( StgStrm& rStrm, sal_Bool bMark ); + sal_Int32 FindBlock( sal_Int32& nPages ); + sal_Int32 GetNextPage( sal_Int32 nPg ); + sal_Int32 AllocPages( sal_Int32 nStart, sal_Int32 nPages ); + sal_Bool FreePages( sal_Int32 nStart, sal_Bool bAll ); + sal_Int32 GetMaxPage() { return nMaxPage; } + void SetLimit( sal_Int32 n ) { nLimit = n; } }; // The base stream class provides basic functionality for seeking @@ -72,31 +72,31 @@ protected: StgIo& rIo; // I/O system StgFAT* pFat; // FAT stream for allocations StgDirEntry* pEntry; // dir entry (for ownership) - INT32 nStart; // 1st data page - INT32 nSize; // stream size in bytes - INT32 nPos; // current byte position - INT32 nPage; // current logical page + sal_Int32 nStart; // 1st data page + sal_Int32 nSize; // stream size in bytes + sal_Int32 nPos; // current byte position + sal_Int32 nPage; // current logical page short nOffset; // offset into current page short nPageSize; // logical page size - BOOL Copy( INT32 nFrom, INT32 nBytes ); + sal_Bool Copy( sal_Int32 nFrom, sal_Int32 nBytes ); StgStrm( StgIo& ); public: virtual ~StgStrm(); StgIo& GetIo() { return rIo; } - INT32 GetPos() { return nPos; } - INT32 GetStart() { return nStart; } - INT32 GetSize() { return nSize; } - INT32 GetPage() { return nPage; } + sal_Int32 GetPos() { return nPos; } + sal_Int32 GetStart() { return nStart; } + sal_Int32 GetSize() { return nSize; } + sal_Int32 GetPage() { return nPage; } short GetPageSize() { return nPageSize; } - INT32 GetPages(); + sal_Int32 GetPages(); short GetOffset() { return nOffset;} void SetEntry( StgDirEntry& ); - virtual BOOL SetSize( INT32 ); - virtual BOOL Pos2Page( INT32 nBytePos ); - virtual INT32 Read( void*, INT32 ) { return 0; } - virtual INT32 Write( const void*, INT32 ) { return 0; } - virtual StgPage* GetPhysPage( INT32 nBytePos, BOOL bForce = FALSE ); - virtual BOOL IsSmallStrm() { return FALSE; } + virtual sal_Bool SetSize( sal_Int32 ); + virtual sal_Bool Pos2Page( sal_Int32 nBytePos ); + virtual sal_Int32 Read( void*, sal_Int32 ) { return 0; } + virtual sal_Int32 Write( const void*, sal_Int32 ) { return 0; } + virtual StgPage* GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False ); + virtual sal_Bool IsSmallStrm() { return sal_False; } }; // The FAT stream class provides physical access to the master FAT. @@ -104,15 +104,15 @@ public: // FAT allocator. class StgFATStrm : public StgStrm { // the master FAT stream - virtual BOOL Pos2Page( INT32 nBytePos ); - BOOL SetPage( short, INT32 ); + virtual sal_Bool Pos2Page( sal_Int32 nBytePos ); + sal_Bool SetPage( short, sal_Int32 ); public: StgFATStrm( StgIo& ); virtual ~StgFATStrm() {} using StgStrm::GetPage; - INT32 GetPage( short, BOOL, USHORT *pnMasterAlloc = 0); - virtual BOOL SetSize( INT32 ); - virtual StgPage* GetPhysPage( INT32 nBytePos, BOOL bForce = FALSE ); + sal_Int32 GetPage( short, sal_Bool, sal_uInt16 *pnMasterAlloc = 0); + virtual sal_Bool SetSize( sal_Int32 ); + virtual StgPage* GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False ); }; // The stream has a size increment which normally is 1, but which can be @@ -121,15 +121,15 @@ public: class StgDataStrm : public StgStrm // a physical data stream { short nIncr; // size adjust increment - void Init( INT32 nBgn, INT32 nLen ); + void Init( sal_Int32 nBgn, sal_Int32 nLen ); public: - StgDataStrm( StgIo&, INT32 nBgn, INT32 nLen=-1 ); + StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 ); StgDataStrm( StgIo&, StgDirEntry* ); - void* GetPtr( INT32 nPos, BOOL bForce, BOOL bDirty ); + void* GetPtr( sal_Int32 nPos, sal_Bool bForce, sal_Bool bDirty ); void SetIncrement( short n ) { nIncr = n ; } - virtual BOOL SetSize( INT32 ); - virtual INT32 Read( void*, INT32 ); - virtual INT32 Write( const void*, INT32 ); + virtual sal_Bool SetSize( sal_Int32 ); + virtual sal_Int32 Read( void*, sal_Int32 ); + virtual sal_Int32 Write( const void*, sal_Int32 ); }; // The small stream class provides access to streams with a size < 4096 bytes. @@ -140,13 +140,13 @@ public: class StgSmallStrm : public StgStrm // a logical data stream { StgStrm* pData; // the data stream - void Init( INT32 nBgn, INT32 nLen ); + void Init( sal_Int32 nBgn, sal_Int32 nLen ); public: - StgSmallStrm( StgIo&, INT32 nBgn, INT32 nLen ); + StgSmallStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen ); StgSmallStrm( StgIo&, StgDirEntry* ); - virtual INT32 Read( void*, INT32 ); - virtual INT32 Write( const void*, INT32 ); - virtual BOOL IsSmallStrm() { return TRUE; } + virtual sal_Int32 Read( void*, sal_Int32 ); + virtual sal_Int32 Write( const void*, sal_Int32 ); + virtual sal_Bool IsSmallStrm() { return sal_True; } }; class StgTmpStrm : public SvMemoryStream @@ -154,17 +154,17 @@ class StgTmpStrm : public SvMemoryStream String aName; SvFileStream* pStrm; using SvMemoryStream::GetData; - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); + virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); virtual void FlushData(); public: - StgTmpStrm( ULONG=16 ); + StgTmpStrm( sal_uIntPtr=16 ); ~StgTmpStrm(); - BOOL Copy( StgTmpStrm& ); - void SetSize( ULONG ); - ULONG GetSize() const; + sal_Bool Copy( StgTmpStrm& ); + void SetSize( sal_uIntPtr ); + sal_uIntPtr GetSize() const; }; #endif diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 136abb29a98e..9b5d3a95b92f 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -75,12 +75,12 @@ SO2_IMPL_BASIC_CLASS1_DLL(SotStorageStream,SotStorageStreamFactory,SotObject, SO2_IMPL_INVARIANT(SotStorageStream) -void SotStorageStream::TestMemberObjRef( BOOL /*bFree*/ ) +void SotStorageStream::TestMemberObjRef( sal_Bool /*bFree*/ ) { } #ifdef TEST_INVARIANT -void SotStorageStream::TestMemberInvariant( BOOL /*bPrint*/ ) +void SotStorageStream::TestMemberInvariant( sal_Bool /*bPrint*/ ) { } #endif @@ -96,12 +96,12 @@ SvLockBytesRef MakeLockBytes_Impl( const String & rName, StreamMode nMode ) if( rName.Len() ) { SvStream * pFileStm = new SvFileStream( rName, nMode ); - xLB = new SvLockBytes( pFileStm, TRUE ); + xLB = new SvLockBytes( pFileStm, sal_True ); } else { SvStream * pCacheStm = new SvCacheStream(); - xLB = new SvLockBytes( pCacheStm, TRUE ); + xLB = new SvLockBytes( pCacheStm, sal_True ); } return xLB; } @@ -116,9 +116,9 @@ SotStorageStream::SotStorageStream( const String & rName, StreamMode nMode, , pOwnStm( NULL ) { if( nMode & STREAM_WRITE ) - bIsWritable = TRUE; + bIsWritable = sal_True; else - bIsWritable = FALSE; + bIsWritable = sal_False; DBG_ASSERT( !nStorageMode,"StorageModes ignored" ); } @@ -128,9 +128,9 @@ SotStorageStream::SotStorageStream( BaseStorageStream * pStm ) if( pStm ) { if( STREAM_WRITE & pStm->GetMode() ) - bIsWritable = TRUE; + bIsWritable = sal_True; else - bIsWritable = FALSE; + bIsWritable = sal_False; pOwnStm = pStm; SetError( pStm->GetError() ); @@ -139,7 +139,7 @@ SotStorageStream::SotStorageStream( BaseStorageStream * pStm ) else { pOwnStm = NULL; - bIsWritable = TRUE; + bIsWritable = sal_True; SetError( SVSTREAM_INVALID_PARAMETER ); } } @@ -148,7 +148,7 @@ SotStorageStream::SotStorageStream() : pOwnStm( NULL ) { // ??? wenn Init virtuell ist, entsprechen setzen - bIsWritable = TRUE; + bIsWritable = sal_True; } /************************************************************************ @@ -170,7 +170,7 @@ SotStorageStream::~SotStorageStream() *************************************************************************/ void SotStorageStream::SyncSvStream() { - ULONG nPos = 0; + sal_uIntPtr nPos = 0; if( pOwnStm ) { pOwnStm->Flush(); @@ -197,9 +197,9 @@ void SotStorageStream::ResetError() |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::GetData( void* pData, ULONG nSize ) +sal_uIntPtr SotStorageStream::GetData( void* pData, sal_uIntPtr nSize ) { - ULONG nRet = 0; + sal_uIntPtr nRet = 0; if( pOwnStm ) { @@ -216,9 +216,9 @@ ULONG SotStorageStream::GetData( void* pData, ULONG nSize ) |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::PutData( const void* pData, ULONG nSize ) +sal_uIntPtr SotStorageStream::PutData( const void* pData, sal_uIntPtr nSize ) { - ULONG nRet = 0; + sal_uIntPtr nRet = 0; if( pOwnStm ) { @@ -235,9 +235,9 @@ ULONG SotStorageStream::PutData( const void* pData, ULONG nSize ) |* |* Beschreibung *************************************************************************/ -ULONG SotStorageStream::SeekPos( ULONG nPos ) +sal_uIntPtr SotStorageStream::SeekPos( sal_uIntPtr nPos ) { - ULONG nRet = 0; + sal_uIntPtr nRet = 0; if( pOwnStm ) { @@ -270,9 +270,9 @@ void SotStorageStream::FlushData() |* |* Beschreibung *************************************************************************/ -void SotStorageStream::SetSize( ULONG nNewSize ) +void SotStorageStream::SetSize( sal_uIntPtr nNewSize ) { - ULONG nPos = Tell(); + sal_uIntPtr nPos = Tell(); if( pOwnStm ) { pOwnStm->SetSize( nNewSize ); @@ -295,11 +295,11 @@ void SotStorageStream::SetSize( ULONG nNewSize ) |* Beschreibung |* *************************************************************************/ -UINT32 SotStorageStream::GetSize() const +sal_uInt32 SotStorageStream::GetSize() const { - ULONG nPos = Tell(); + sal_uIntPtr nPos = Tell(); ((SotStorageStream *)this)->Seek( STREAM_SEEK_TO_END ); - ULONG nSize = Tell(); + sal_uIntPtr nSize = Tell(); ((SotStorageStream *)this)->Seek( nPos ); return nSize; } @@ -309,19 +309,19 @@ UINT32 SotStorageStream::GetSize() const |* |* Beschreibung *************************************************************************/ -BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm ) +sal_Bool SotStorageStream::CopyTo( SotStorageStream * pDestStm ) { Flush(); // alle Daten schreiben pDestStm->ClearBuffer(); if( !pOwnStm || !pDestStm->pOwnStm ) { // Wenn Ole2 oder nicht nur eigene StorageStreams - ULONG nPos = Tell(); // Position merken + sal_uIntPtr nPos = Tell(); // Position merken Seek( 0L ); pDestStm->SetSize( 0 ); // Ziel-Stream leeren - void * pMem = new BYTE[ 8192 ]; - ULONG nRead; + void * pMem = new sal_uInt8[ 8192 ]; + sal_uIntPtr nRead; while( 0 != (nRead = Read( pMem, 8192 )) ) { if( nRead != pDestStm->Write( pMem, nRead ) ) @@ -330,7 +330,7 @@ BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm ) break; } } - delete [] static_cast(pMem); + delete [] static_cast(pMem); // Position setzen pDestStm->Seek( nPos ); Seek( nPos ); @@ -361,7 +361,7 @@ BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorageStream::Commit() +sal_Bool SotStorageStream::Commit() { if( pOwnStm ) { @@ -373,7 +373,7 @@ BOOL SotStorageStream::Commit() return GetError() == SVSTREAM_OK; } -BOOL SotStorageStream::Revert() +sal_Bool SotStorageStream::Revert() { if( !pOwnStm ) { @@ -383,7 +383,7 @@ BOOL SotStorageStream::Revert() return GetError() == SVSTREAM_OK; } -BOOL SotStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) { UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm ); if ( pStg ) @@ -393,11 +393,11 @@ BOOL SotStorageStream::SetProperty( const String& rName, const ::com::sun::star: else { DBG_ERROR("Not implemented!"); - return FALSE; + return sal_False; } } -BOOL SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) { UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm ); if ( pStg ) @@ -407,7 +407,7 @@ BOOL SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno:: else { DBG_ERROR("Not implemented!"); - return FALSE; + return sal_False; } } @@ -454,12 +454,12 @@ SO2_IMPL_INVARIANT(SotStorage) |* |* Beschreibung *************************************************************************/ -void SotStorage::TestMemberObjRef( BOOL /*bFree*/ ) +void SotStorage::TestMemberObjRef( sal_Bool /*bFree*/ ) { } #ifdef TEST_INVARIANT -void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ ) +void SotStorage::TestMemberInvariant( sal_Bool /*bPrint*/ ) { } #endif @@ -471,7 +471,7 @@ void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ ) |* Beschreibung Es muss ein I... Objekt an SvObject uebergeben |* werden, da es sonst selbst ein IUnknown anlegt und |* festlegt, dass alle weiteren I... Objekte mit -|* delete zerstoert werden (Owner() == TRUE). +|* delete zerstoert werden (Owner() == sal_True). |* Es werden aber nur IStorage Objekte benutzt und nicht |* selbst implementiert, deshalb wird so getan, als ob |* das IStorage Objekt von aussen kam und es wird mit @@ -491,8 +491,8 @@ void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ ) : m_pOwnStg( NULL ) \ , m_pStorStm( NULL ) \ , m_nError( SVSTREAM_OK ) \ - , m_bIsRoot( FALSE ) \ - , m_bDelStm( FALSE ) \ + , m_bIsRoot( sal_False ) \ + , m_bDelStm( sal_False ) \ , m_nVersion( SOFFICE_FILEFORMAT_CURRENT ) SotStorage::SotStorage() @@ -510,7 +510,7 @@ SotStorage::SotStorage( const ::ucbhelper::Content& rContent, const String & rNa INIT_SotStorage() { m_aName = rName; // Namen merken - m_pOwnStg = new UCBStorage( rContent, m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new UCBStorage( rContent, m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); SetError( m_pOwnStg->GetError() ); @@ -524,12 +524,12 @@ SotStorage::SotStorage( const String & rName, StreamMode nMode, StorageMode nSto INIT_SotStorage() { m_aName = rName; // Namen merken - CreateStorage( TRUE, nMode, nStorageMode ); + CreateStorage( sal_True, nMode, nStorageMode ); if ( IsOLEStorage() ) m_nVersion = SOFFICE_FILEFORMAT_50; } -void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, StorageMode nStorageMode ) +void SotStorage::CreateStorage( sal_Bool bForceUCBStorage, StreamMode nMode, StorageMode nStorageMode ) { DBG_ASSERT( !m_pStorStm && !m_pOwnStg, "Use only in ctor!" ); if( m_aName.Len() ) @@ -555,11 +555,11 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage if ( aURL.Len() ) { ::ucbhelper::Content aContent( aURL, ::com::sun::star::uno::Reference < ::com::sun::star::ucb::XCommandEnvironment >() ); - m_pOwnStg = new UCBStorage( aContent, aURL, nMode, FALSE ); + m_pOwnStg = new UCBStorage( aContent, aURL, nMode, sal_False ); } else { - m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); SetError( ERRCODE_IO_NOTSUPPORTED ); } } @@ -573,7 +573,7 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage if ( m_pStorStm ) { // try as UCBStorage, next try as OLEStorage - BOOL bIsUCBStorage = UCBStorage::IsStorageFile( m_pStorStm ); + sal_Bool bIsUCBStorage = UCBStorage::IsStorageFile( m_pStorStm ); if ( !bIsUCBStorage && bForceUCBStorage ) // if UCBStorage has priority, it should not be used only if it is really an OLEStorage bIsUCBStorage = !Storage::IsStorageFile( m_pStorStm ); @@ -583,8 +583,8 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage if ( UCBStorage::GetLinkedFile( *m_pStorStm ).Len() ) { // detect special unpacked storages - m_pOwnStg = new UCBStorage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); - m_bDelStm = TRUE; + m_pOwnStg = new UCBStorage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); + m_bDelStm = sal_True; } else { @@ -594,24 +594,24 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage // UCBStorage always works directly on the UCB content, so discard the stream first DELETEZ( m_pStorStm ); - m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); } } else { // OLEStorage can be opened with a stream - m_pOwnStg = new Storage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); - m_bDelStm = TRUE; + m_pOwnStg = new Storage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); + m_bDelStm = sal_True; } } else if ( bForceUCBStorage ) { - m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); SetError( ERRCODE_IO_NOTSUPPORTED ); } else { - m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); SetError( ERRCODE_IO_NOTSUPPORTED ); } } @@ -620,9 +620,9 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage { // temporary storage if ( bForceUCBStorage ) - m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); else - m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); m_aName = m_pOwnStg->GetName(); } @@ -631,7 +631,7 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage SignAsRoot( m_pOwnStg->IsRoot() ); } -SotStorage::SotStorage( BOOL bUCBStorage, const String & rName, StreamMode nMode, StorageMode nStorageMode ) +SotStorage::SotStorage( sal_Bool bUCBStorage, const String & rName, StreamMode nMode, StorageMode nStorageMode ) INIT_SotStorage() { m_aName = rName; @@ -651,22 +651,22 @@ SotStorage::SotStorage( BaseStorage * pStor ) } m_pOwnStg = pStor; - ULONG nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE; + sal_uIntPtr nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE; SetError( nErr ); if ( IsOLEStorage() ) m_nVersion = SOFFICE_FILEFORMAT_50; } -SotStorage::SotStorage( BOOL bUCBStorage, SvStream & rStm ) +SotStorage::SotStorage( sal_Bool bUCBStorage, SvStream & rStm ) INIT_SotStorage() { SetError( rStm.GetError() ); // try as UCBStorage, next try as OLEStorage if ( UCBStorage::IsStorageFile( &rStm ) || bUCBStorage ) - m_pOwnStg = new UCBStorage( rStm, FALSE ); + m_pOwnStg = new UCBStorage( rStm, sal_False ); else - m_pOwnStg = new Storage( rStm, FALSE ); + m_pOwnStg = new Storage( rStm, sal_False ); SetError( m_pOwnStg->GetError() ); @@ -683,9 +683,9 @@ SotStorage::SotStorage( SvStream & rStm ) // try as UCBStorage, next try as OLEStorage if ( UCBStorage::IsStorageFile( &rStm ) ) - m_pOwnStg = new UCBStorage( rStm, FALSE ); + m_pOwnStg = new UCBStorage( rStm, sal_False ); else - m_pOwnStg = new Storage( rStm, FALSE ); + m_pOwnStg = new Storage( rStm, sal_False ); SetError( m_pOwnStg->GetError() ); @@ -695,16 +695,16 @@ SotStorage::SotStorage( SvStream & rStm ) SignAsRoot( m_pOwnStg->IsRoot() ); } -SotStorage::SotStorage( SvStream * pStm, BOOL bDelete ) +SotStorage::SotStorage( SvStream * pStm, sal_Bool bDelete ) INIT_SotStorage() { SetError( pStm->GetError() ); // try as UCBStorage, next try as OLEStorage if ( UCBStorage::IsStorageFile( pStm ) ) - m_pOwnStg = new UCBStorage( *pStm, FALSE ); + m_pOwnStg = new UCBStorage( *pStm, sal_False ); else - m_pOwnStg = new Storage( *pStm, FALSE ); + m_pOwnStg = new Storage( *pStm, sal_False ); SetError( m_pOwnStg->GetError() ); @@ -798,7 +798,7 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String& UCBStorage* pChildUCBStg = PTR_CAST( UCBStorage, pChildStorage->m_pOwnStg ); if ( pChildUCBStg ) { - UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, FALSE, TRUE ); + UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, sal_False, sal_True ); if ( pTempStorage ) { pChildUCBStg->CopyTo( pTempStorage ); @@ -896,7 +896,7 @@ SvMemoryStream * SotStorage::CreateMemoryStream() |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::IsStorageFile( const String & rFileName ) +sal_Bool SotStorage::IsStorageFile( const String & rFileName ) { String aName( rFileName ); INetURLObject aObj( aName ); @@ -909,25 +909,25 @@ BOOL SotStorage::IsStorageFile( const String & rFileName ) } SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READ ); - BOOL bRet = SotStorage::IsStorageFile( pStm ); + sal_Bool bRet = SotStorage::IsStorageFile( pStm ); delete pStm; return bRet; } -BOOL SotStorage::IsStorageFile( SvStream* pStream ) +sal_Bool SotStorage::IsStorageFile( SvStream* pStream ) { /** code for new storages must come first! **/ if ( pStream ) { long nPos = pStream->Tell(); - BOOL bRet = UCBStorage::IsStorageFile( pStream ); + sal_Bool bRet = UCBStorage::IsStorageFile( pStream ); if ( !bRet ) bRet = Storage::IsStorageFile( pStream ); pStream->Seek( nPos ); return bRet; } else - return FALSE; + return sal_False; } /************************************************************************* |* SotStorage::GetStorage() @@ -973,7 +973,7 @@ void SotStorage::ResetError() |* Beschreibung *************************************************************************/ void SotStorage::SetClass( const SvGlobalName & rName, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -984,7 +984,7 @@ void SotStorage::SetClass( const SvGlobalName & rName, } void SotStorage::SetConvertClass( const SvGlobalName & rName, - ULONG nOriginalClipFormat, + sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1013,9 +1013,9 @@ SvGlobalName SotStorage::GetClassName() return aGN; } -ULONG SotStorage::GetFormat() +sal_uIntPtr SotStorage::GetFormat() { - ULONG nFormat = 0; + sal_uIntPtr nFormat = 0; DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) nFormat = m_pOwnStg->GetFormat(); @@ -1035,14 +1035,14 @@ String SotStorage::GetUserName() return aName; } -BOOL SotStorage::ShouldConvert() +sal_Bool SotStorage::ShouldConvert() { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) return m_pOwnStg->ShouldConvert(); else SetError( SVSTREAM_GENERALERROR ); - return FALSE; + return sal_False; } /************************************************************************* @@ -1062,7 +1062,7 @@ void SotStorage::FillInfoList( SvStorageInfoList * pFillList ) const |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::CopyTo( SotStorage * pDestStg ) +sal_Bool SotStorage::CopyTo( SotStorage * pDestStg ) { DBG_ASSERT( Owner(), "must be owner" ); DBG_ASSERT( pDestStg->Owner(), "must be owner" ); @@ -1083,7 +1083,7 @@ BOOL SotStorage::CopyTo( SotStorage * pDestStg ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Commit() +sal_Bool SotStorage::Commit() { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1101,7 +1101,7 @@ BOOL SotStorage::Commit() |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Revert() +sal_Bool SotStorage::Revert() { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1133,7 +1133,7 @@ SotStorageStream * SotStorage::OpenEncryptedSotStream( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorageStream* p = m_pOwnStg->OpenStream( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE, &rKey ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True, &rKey ); pStm = new SotStorageStream( p ); if( !nE ) @@ -1160,7 +1160,7 @@ SotStorageStream * SotStorage::OpenSotStream( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorageStream * p = m_pOwnStg->OpenStream( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); pStm = new SotStorageStream( p ); if( !nE ) @@ -1189,7 +1189,7 @@ SotStorage * SotStorage::OpenSotStorage( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorage * p = m_pOwnStg->OpenStorage( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); if( p ) { pStor = new SotStorage( p ); @@ -1216,7 +1216,7 @@ SotStorage * SotStorage::OpenUCBStorage( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorage * p = m_pOwnStg->OpenUCBStorage( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); pStor = new SotStorage( p ); if( !nE ) m_pOwnStg->ResetError(); // kein Fehler setzen @@ -1237,7 +1237,7 @@ SotStorage * SotStorage::OpenOLEStorage( const String & rEleName, nMode |= STREAM_SHARE_DENYALL; ErrCode nE = m_pOwnStg->GetError(); BaseStorage * p = m_pOwnStg->OpenOLEStorage( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE ); + (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); pStor = new SotStorage( p ); if( !nE ) m_pOwnStg->ResetError(); // kein Fehler setzen @@ -1254,31 +1254,31 @@ SotStorage * SotStorage::OpenOLEStorage( const String & rEleName, |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::IsStorage( const String & rEleName ) const +sal_Bool SotStorage::IsStorage( const String & rEleName ) const { DBG_ASSERT( Owner(), "must be owner" ); // ein bisschen schneller if( m_pOwnStg ) return m_pOwnStg->IsStorage( rEleName ); - return FALSE; + return sal_False; } -BOOL SotStorage::IsStream( const String & rEleName ) const +sal_Bool SotStorage::IsStream( const String & rEleName ) const { DBG_ASSERT( Owner(), "must be owner" ); // ein bisschen schneller if( m_pOwnStg ) return m_pOwnStg->IsStream( rEleName ); - return FALSE; + return sal_False; } -BOOL SotStorage::IsContained( const String & rEleName ) const +sal_Bool SotStorage::IsContained( const String & rEleName ) const { DBG_ASSERT( Owner(), "must be owner" ); // ein bisschen schneller if( m_pOwnStg ) return m_pOwnStg->IsContained( rEleName ); - return FALSE; + return sal_False; } /************************************************************************* @@ -1286,7 +1286,7 @@ BOOL SotStorage::IsContained( const String & rEleName ) const |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Remove( const String & rEleName ) +sal_Bool SotStorage::Remove( const String & rEleName ) { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1304,7 +1304,7 @@ BOOL SotStorage::Remove( const String & rEleName ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::Rename( const String & rEleName, const String & rNewName ) +sal_Bool SotStorage::Rename( const String & rEleName, const String & rNewName ) { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) @@ -1322,7 +1322,7 @@ BOOL SotStorage::Rename( const String & rEleName, const String & rNewName ) |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::CopyTo( const String & rEleName, +sal_Bool SotStorage::CopyTo( const String & rEleName, SotStorage * pNewSt, const String & rNewName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1343,7 +1343,7 @@ BOOL SotStorage::CopyTo( const String & rEleName, |* |* Beschreibung *************************************************************************/ -BOOL SotStorage::MoveTo( const String & rEleName, +sal_Bool SotStorage::MoveTo( const String & rEleName, SotStorage * pNewSt, const String & rNewName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1378,16 +1378,16 @@ SvStream* SotStorage::GetTargetSvStream() const } -BOOL SotStorage::Validate() +sal_Bool SotStorage::Validate() { DBG_ASSERT( m_bIsRoot, "Validate nur an Rootstorage" ); if( m_pOwnStg ) return m_pOwnStg->ValidateFAT(); else - return TRUE; + return sal_True; } -BOOL SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); if ( pStg ) @@ -1397,11 +1397,11 @@ BOOL SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno:: else { DBG_WARNING("W1:Not implemented!"); - return FALSE; + return sal_False; } } -BOOL SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); if ( pStg ) @@ -1411,20 +1411,20 @@ BOOL SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& r else if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL ) { String aStr = SotExchange::GetFormatMimeType( GetFormat() ); - USHORT nPos = aStr.Search(';'); + sal_uInt16 nPos = aStr.Search(';'); if ( nPos != STRING_NOTFOUND ) aStr = aStr.Copy( 0, nPos ); rValue <<= (::rtl::OUString) aStr; - return TRUE; + return sal_True; } else { DBG_WARNING("W1:Not implemented!"); - return FALSE; + return sal_False; } } -BOOL SotStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool SotStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ) { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); if ( pStg ) @@ -1434,22 +1434,22 @@ BOOL SotStorage::GetProperty( const String& rEleName, const String& rName, ::com else { DBG_WARNING("W1:Not implemented!"); - return FALSE; + return sal_False; } } -BOOL SotStorage::IsOLEStorage() const +sal_Bool SotStorage::IsOLEStorage() const { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); return !pStg; } -BOOL SotStorage::IsOLEStorage( const String & rFileName ) +sal_Bool SotStorage::IsOLEStorage( const String & rFileName ) { return Storage::IsStorageFile( rFileName ); } -BOOL SotStorage::IsOLEStorage( SvStream* pStream ) +sal_Bool SotStorage::IsOLEStorage( SvStream* pStream ) { return Storage::IsStorageFile( pStream ); } @@ -1506,7 +1506,7 @@ SotStorage* SotStorage::OpenOLEStorage( const com::sun::star::uno::Reference < c pStream->SetError( ERRCODE_IO_GENERAL ); } - return new SotStorage( pStream, TRUE ); + return new SotStorage( pStream, sal_True ); } sal_Int32 SotStorage::GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ) diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 2aaaadd5a151..f326025fd0ac 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -39,7 +39,7 @@ PRV_SV_IMPL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) { - for( ULONG i = 0; i < Count(); i++ ) + for( sal_uIntPtr i = 0; i < Count(); i++ ) { const SvStorageInfo & rType = GetObject( i ); if( rType.GetName() == rEleName ) @@ -50,10 +50,10 @@ const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) /************** class SvStorageInfo ************************************** *************************************************************************/ -ULONG ReadClipboardFormat( SvStream & rStm ) +sal_uIntPtr ReadClipboardFormat( SvStream & rStm ) { sal_uInt32 nFormat = 0; - INT32 nLen = 0; + sal_Int32 nLen = 0; rStm >> nLen; if( rStm.IsEof() ) rStm.SetError( SVSTREAM_GENERALERROR ); @@ -61,7 +61,7 @@ ULONG ReadClipboardFormat( SvStream & rStm ) { // get a string name sal_Char * p = new sal_Char[ nLen ]; - if( rStm.Read( p, nLen ) == (ULONG) nLen ) + if( rStm.Read( p, nLen ) == (sal_uIntPtr) nLen ) { nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( p, short(nLen-1) ) ); } @@ -88,7 +88,7 @@ ULONG ReadClipboardFormat( SvStream & rStm ) return nFormat; } -void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ) +void WriteClipboardFormat( SvStream & rStm, sal_uIntPtr nFormat ) { // determine the clipboard format string String aCbFmt; @@ -97,15 +97,15 @@ void WriteClipboardFormat( SvStream & rStm, ULONG nFormat ) if( aCbFmt.Len() ) { ByteString aAsciiCbFmt( aCbFmt, RTL_TEXTENCODING_ASCII_US ); - rStm << (INT32) (aAsciiCbFmt.Len() + 1); + rStm << (sal_Int32) (aAsciiCbFmt.Len() + 1); rStm << (const char *)aAsciiCbFmt.GetBuffer(); - rStm << (UINT8) 0; + rStm << (sal_uInt8) 0; } else if( nFormat ) - rStm << (INT32) -1 // for Windows - << (INT32) nFormat; + rStm << (sal_Int32) -1 // for Windows + << (sal_Int32) nFormat; else - rStm << (INT32) 0; // no clipboard format + rStm << (sal_Int32) 0; // no clipboard format } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index ea3b656272db..ede41ec3aec9 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -443,10 +443,10 @@ class UCBStorageStream_Impl : public SvRefBase, public SvStream ~UCBStorageStream_Impl(); public: - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); - virtual void SetSize( ULONG nSize ); + virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); + virtual void SetSize( sal_uIntPtr nSize ); virtual void FlushData(); virtual void ResetError(); @@ -466,35 +466,35 @@ public: RepresentModes m_nRepresentMode; // should it be used as XInputStream or as SvStream long m_nError; StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing ) - BOOL m_bSourceRead; // Source still contains useful information - BOOL m_bModified; // only modified streams will be sent to the original content - BOOL m_bCommited; // sending the streams is coordinated by the root storage of the package - BOOL m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages + sal_Bool m_bSourceRead; // Source still contains useful information + sal_Bool m_bModified; // only modified streams will be sent to the original content + sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package + sal_Bool m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages // this means that the root storage does an autocommit when its external // reference is destroyed - BOOL m_bIsOLEStorage;// an OLEStorage on a UCBStorageStream makes this an Autocommit-stream + sal_Bool m_bIsOLEStorage;// an OLEStorage on a UCBStorageStream makes this an Autocommit-stream - UCBStorageStream_Impl( const String&, StreamMode, UCBStorageStream*, BOOL, const ByteString* pKey=0, BOOL bRepair = FALSE, Reference< XProgressHandler > xProgress = Reference< XProgressHandler >() ); + UCBStorageStream_Impl( const String&, StreamMode, UCBStorageStream*, sal_Bool, const ByteString* pKey=0, sal_Bool bRepair = sal_False, Reference< XProgressHandler > xProgress = Reference< XProgressHandler >() ); void Free(); - BOOL Init(); - BOOL Clear(); + sal_Bool Init(); + sal_Bool Clear(); sal_Int16 Commit(); // if modified and commited: transfer an XInputStream to the content - BOOL Revert(); // discard all changes + sal_Bool Revert(); // discard all changes BaseStorage* CreateStorage();// create an OLE Storage on the UCBStorageStream - ULONG GetSize(); + sal_uIntPtr GetSize(); - ULONG ReadSourceWriteTemporary( ULONG aLength ); // read aLength from source and copy to temporary, + sal_uIntPtr ReadSourceWriteTemporary( sal_uIntPtr aLength ); // read aLength from source and copy to temporary, // no seeking is produced - ULONG ReadSourceWriteTemporary(); // read source till the end and copy to temporary, + sal_uIntPtr ReadSourceWriteTemporary(); // read source till the end and copy to temporary, // no seeking is produced #if 0 - ULONG CopySourceToTemporary( ULONG aLength ); // same as ReadSourceWriteToTemporary( aLength ) + sal_uIntPtr CopySourceToTemporary( sal_uIntPtr aLength ); // same as ReadSourceWriteToTemporary( aLength ) // but the writing is done at the end of temporary // pointer position is not changed #endif - ULONG CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() + sal_uIntPtr CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() // but the writing is done at the end of temporary // pointer position is not changed Reference GetXInputStream(); // return XInputStream, after that @@ -527,34 +527,34 @@ public: //SvStream* m_pStream; // the corresponding editable stream, only for storage on a stream long m_nError; StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing ) - BOOL m_bModified; // only modified elements will be sent to the original content - BOOL m_bCommited; // sending the streams is coordinated by the root storage of the package - BOOL m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages + sal_Bool m_bModified; // only modified elements will be sent to the original content + sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package + sal_Bool m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages // this means that the root storage does an autocommit when its external // reference is destroyed - BOOL m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts - BOOL m_bDirty; // ??? - BOOL m_bIsLinked; - BOOL m_bListCreated; - ULONG m_nFormat; + sal_Bool m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts + sal_Bool m_bDirty; // ??? + sal_Bool m_bIsLinked; + sal_Bool m_bListCreated; + sal_uIntPtr m_nFormat; String m_aUserTypeName; SvGlobalName m_aClassId; UCBStorageElementList_Impl m_aChildrenList; - BOOL m_bRepairPackage; + sal_Bool m_bRepairPackage; Reference< XProgressHandler > m_xProgressHandler; UNOStorageHolderList* m_pUNOStorageHolderList; - UCBStorage_Impl( const ::ucbhelper::Content&, const String&, StreamMode, UCBStorage*, BOOL, BOOL, BOOL = FALSE, Reference< XProgressHandler > = Reference< XProgressHandler >() ); - UCBStorage_Impl( const String&, StreamMode, UCBStorage*, BOOL, BOOL, BOOL = FALSE, Reference< XProgressHandler > = Reference< XProgressHandler >() ); - UCBStorage_Impl( SvStream&, UCBStorage*, BOOL ); + UCBStorage_Impl( const ::ucbhelper::Content&, const String&, StreamMode, UCBStorage*, sal_Bool, sal_Bool, sal_Bool = sal_False, Reference< XProgressHandler > = Reference< XProgressHandler >() ); + UCBStorage_Impl( const String&, StreamMode, UCBStorage*, sal_Bool, sal_Bool, sal_Bool = sal_False, Reference< XProgressHandler > = Reference< XProgressHandler >() ); + UCBStorage_Impl( SvStream&, UCBStorage*, sal_Bool ); void Init(); sal_Int16 Commit(); - BOOL Revert(); - BOOL Insert( ::ucbhelper::Content *pContent ); - UCBStorage_Impl* OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect ); - UCBStorageStream_Impl* OpenStream( UCBStorageElement_Impl*, StreamMode, BOOL, const ByteString* pKey=0 ); + sal_Bool Revert(); + sal_Bool Insert( ::ucbhelper::Content *pContent ); + UCBStorage_Impl* OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect ); + UCBStorageStream_Impl* OpenStream( UCBStorageElement_Impl*, StreamMode, sal_Bool, const ByteString* pKey=0 ); void SetProps( const Sequence < Sequence < PropertyValue > >& rSequence, const String& ); void GetProps( sal_Int32&, Sequence < Sequence < PropertyValue > >& rSequence, const String& ); sal_Int32 GetObjectCount(); @@ -589,32 +589,32 @@ struct UCBStorageElement_Impl { String m_aName; // the actual URL relative to the root "folder" String m_aOriginalName;// the original name in the content - ULONG m_nSize; - BOOL m_bIsFolder; // Only TRUE when it is a UCBStorage ! - BOOL m_bIsStorage; // Also TRUE when it is an OLEStorage ! - BOOL m_bIsRemoved; // element will be removed on commit - BOOL m_bIsInserted; // element will be removed on revert + sal_uIntPtr m_nSize; + sal_Bool m_bIsFolder; // Only sal_True when it is a UCBStorage ! + sal_Bool m_bIsStorage; // Also sal_True when it is an OLEStorage ! + sal_Bool m_bIsRemoved; // element will be removed on commit + sal_Bool m_bIsInserted; // element will be removed on revert UCBStorage_ImplRef m_xStorage; // reference to the "real" storage UCBStorageStream_ImplRef m_xStream; // reference to the "real" stream UCBStorageElement_Impl( const ::rtl::OUString& rName, - BOOL bIsFolder = FALSE, ULONG nSize = 0 ) + sal_Bool bIsFolder = sal_False, sal_uIntPtr nSize = 0 ) : m_aName( rName ) , m_aOriginalName( rName ) , m_nSize( nSize ) , m_bIsFolder( bIsFolder ) , m_bIsStorage( bIsFolder ) - , m_bIsRemoved( FALSE ) - , m_bIsInserted( FALSE ) + , m_bIsRemoved( sal_False ) + , m_bIsInserted( sal_False ) { } ::ucbhelper::Content* GetContent(); - BOOL IsModified(); + sal_Bool IsModified(); String GetContentType(); void SetContentType( const String& ); String GetOriginalContentType(); - BOOL IsLoaded() + sal_Bool IsLoaded() { return m_xStream.Is() || m_xStorage.Is(); } }; @@ -664,9 +664,9 @@ String UCBStorageElement_Impl::GetOriginalContentType() return String(); } -BOOL UCBStorageElement_Impl::IsModified() +sal_Bool UCBStorageElement_Impl::IsModified() { - BOOL bModified = m_bIsRemoved || m_bIsInserted || m_aName != m_aOriginalName; + sal_Bool bModified = m_bIsRemoved || m_bIsInserted || m_aName != m_aOriginalName; if ( bModified ) { if ( m_xStream.Is() ) @@ -678,7 +678,7 @@ BOOL UCBStorageElement_Impl::IsModified() return bModified; } -UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nMode, UCBStorageStream* pStream, BOOL bDirect, const ByteString* pKey, BOOL bRepair, Reference< XProgressHandler > xProgress ) +UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nMode, UCBStorageStream* pStream, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress ) : m_pAntiImpl( pStream ) , m_aURL( rName ) , m_pContent( NULL ) @@ -687,10 +687,10 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM , m_nError( 0 ) , m_nMode( nMode ) , m_bSourceRead( !( nMode & STREAM_TRUNC ) ) - , m_bModified( FALSE ) - , m_bCommited( FALSE ) + , m_bModified( sal_False ) + , m_bCommited( sal_False ) , m_bDirect( bDirect ) - , m_bIsOLEStorage( FALSE ) + , m_bIsOLEStorage( sal_False ) { // name is last segment in URL INetURLObject aObj( rName ); @@ -775,7 +775,7 @@ Reference UCBStorageStream_Impl::GetXInputStream() CopySourceToTemporary(); // owner transfer of stream to wrapper - aResult = new ::utl::OInputStreamWrapper( m_pStream, TRUE ); + aResult = new ::utl::OInputStreamWrapper( m_pStream, sal_True ); m_pStream->Seek(0); if( aResult.is() ) @@ -812,13 +812,13 @@ Reference UCBStorageStream_Impl::GetXInputStream() return aResult; } -BOOL UCBStorageStream_Impl::Init() +sal_Bool UCBStorageStream_Impl::Init() { if( m_nRepresentMode == xinputstream ) { DBG_ERROR( "XInputStream misuse!" ); SetError( ERRCODE_IO_ACCESSDENIED ); - return FALSE; + return sal_False; } if( !m_pStream ) @@ -840,7 +840,7 @@ BOOL UCBStorageStream_Impl::Init() { DBG_ERROR( "Suspicious temporary stream creation!" ); SetError( SVSTREAM_CANNOT_MAKE ); - return FALSE; + return sal_False; } SetError( m_pStream->GetError() ); @@ -871,12 +871,12 @@ BOOL UCBStorageStream_Impl::Init() catch( BufferSizeExceededException& ) { // the temporary stream already contain all the data - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } catch( Exception& ) { // something is really wrong - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; DBG_ERROR( "Can not operate original stream!" ); SetError( SVSTREAM_CANNOT_MAKE ); } @@ -886,7 +886,7 @@ BOOL UCBStorageStream_Impl::Init() else { // if the new file is edited than no source exist - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; //SetError( SVSTREAM_CANNOT_MAKE ); } } @@ -896,12 +896,12 @@ BOOL UCBStorageStream_Impl::Init() return sal_True; } -ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() +sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary() { // read source stream till the end and copy all the data to // the current position of the temporary stream - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( m_bSourceRead ) { @@ -909,7 +909,7 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() try { - ULONG aReaded; + sal_uIntPtr aReaded; do { aReaded = m_rSource->readBytes( aData, 32000 ); @@ -919,7 +919,7 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -927,18 +927,18 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary() } } - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; return aResult; } -ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) +sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uIntPtr aLength ) { // read aLength bite from the source stream and copy them to the current // position of the temporary stream - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( m_bSourceRead ) { @@ -947,22 +947,22 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) try { - ULONG aReaded = 32000; + sal_uIntPtr aReaded = 32000; - for( ULONG pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) + for( sal_uIntPtr pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) { - ULONG aToCopy = min( aLength - pInd, 32000 ); + sal_uIntPtr aToCopy = min( aLength - pInd, 32000 ); aReaded = m_rSource->readBytes( aData, aToCopy ); aResult += m_pStream->Write( aData.getArray(), aReaded ); } if( aResult < aLength ) - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -973,14 +973,14 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength ) return aResult; } -ULONG UCBStorageStream_Impl::CopySourceToTemporary() +sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary() { // current position of the temporary stream is not changed - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( m_bSourceRead ) { - ULONG aPos = m_pStream->Tell(); + sal_uIntPtr aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary(); m_pStream->Seek( aPos ); @@ -991,14 +991,14 @@ ULONG UCBStorageStream_Impl::CopySourceToTemporary() } #if 0 -ULONG UCBStorageStream_Impl::CopySourceToTemporary( ULONG aLength ) +sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary( sal_uIntPtr aLength ) { // current position of the temporary stream is not changed - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( m_bSourceRead ) { - ULONG aPos = m_pStream->Tell(); + sal_uIntPtr aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary( aLength ); m_pStream->Seek( aPos ); @@ -1011,9 +1011,9 @@ ULONG UCBStorageStream_Impl::CopySourceToTemporary( ULONG aLength ) // UCBStorageStream_Impl must have a SvStream interface, because it then can be used as underlying stream // of an OLEStorage; so every write access caused by storage operations marks the UCBStorageStream as modified -ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize ) +sal_uIntPtr UCBStorageStream_Impl::GetData( void* pData, sal_uIntPtr nSize ) { - ULONG aResult = 0; + sal_uIntPtr aResult = 0; if( !Init() ) return 0; @@ -1026,20 +1026,20 @@ ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize ) // read the tail of the data from original stream // copy this tail to the temporary stream - ULONG aToRead = nSize - aResult; + sal_uIntPtr aToRead = nSize - aResult; pData = (void*)( (char*)pData + aResult ); try { Sequence aData( aToRead ); - ULONG aReaded = m_rSource->readBytes( aData, aToRead ); + sal_uIntPtr aReaded = m_rSource->readBytes( aData, aToRead ); aResult += m_pStream->Write( (void*)aData.getArray(), aReaded ); memcpy( pData, aData.getArray(), aReaded ); } #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -1047,13 +1047,13 @@ ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize ) } if( aResult < nSize ) - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } return aResult; } -ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize ) +sal_uIntPtr UCBStorageStream_Impl::PutData( const void* pData, sal_uIntPtr nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1064,7 +1064,7 @@ ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize ) if( !nSize || !Init() ) return 0; - ULONG aResult = m_pStream->Write( pData, nSize ); + sal_uIntPtr aResult = m_pStream->Write( pData, nSize ); m_bModified = aResult > 0; @@ -1072,12 +1072,12 @@ ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize ) } -ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) +sal_uIntPtr UCBStorageStream_Impl::SeekPos( sal_uIntPtr nPos ) { if( !Init() ) return 0; - ULONG aResult; + sal_uIntPtr aResult; if( nPos == STREAM_SEEK_TO_END ) { @@ -1108,7 +1108,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) { aResult += ReadSourceWriteTemporary( nPos - aResult ); if( aResult < nPos ) - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; DBG_ASSERT( aResult == m_pStream->Tell(), "Error in stream arithmetic!\n" ); } @@ -1129,7 +1129,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) return aResult; } -void UCBStorageStream_Impl::SetSize( ULONG nSize ) +void UCBStorageStream_Impl::SetSize( sal_uIntPtr nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1140,11 +1140,11 @@ void UCBStorageStream_Impl::SetSize( ULONG nSize ) if( !Init() ) return; - m_bModified = TRUE; + m_bModified = sal_True; if( m_bSourceRead ) { - ULONG aPos = m_pStream->Tell(); + sal_uIntPtr aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); if( m_pStream->Tell() < nSize ) ReadSourceWriteTemporary( nSize - m_pStream->Tell() ); @@ -1152,7 +1152,7 @@ void UCBStorageStream_Impl::SetSize( ULONG nSize ) } m_pStream->SetStreamSize( nSize ); - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; } void UCBStorageStream_Impl::FlushData() @@ -1163,7 +1163,7 @@ void UCBStorageStream_Impl::FlushData() m_pStream->Flush(); } - m_bCommited = TRUE; + m_bCommited = sal_True; } void UCBStorageStream_Impl::SetError( sal_uInt32 nErr ) @@ -1184,15 +1184,15 @@ void UCBStorageStream_Impl::ResetError() m_pAntiImpl->ResetError(); } -ULONG UCBStorageStream_Impl::GetSize() +sal_uIntPtr UCBStorageStream_Impl::GetSize() { if( !Init() ) return 0; - ULONG nPos = m_pStream->Tell(); + sal_uIntPtr nPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); ReadSourceWriteTemporary(); - ULONG nRet = m_pStream->Tell(); + sal_uIntPtr nRet = m_pStream->Tell(); m_pStream->Seek( nPos ); return nRet; @@ -1252,8 +1252,8 @@ sal_Int16 UCBStorageStream_Impl::Commit() INetURLObject aObj( m_aURL ); aObj.SetName( m_aName ); m_aURL = aObj.GetMainURL( INetURLObject::NO_DECODE ); - m_bModified = FALSE; - m_bSourceRead = TRUE; + m_bModified = sal_False; + m_bSourceRead = sal_True; } catch ( CommandAbortedException& ) { @@ -1274,7 +1274,7 @@ sal_Int16 UCBStorageStream_Impl::Commit() return COMMIT_RESULT_FAILURE; } - m_bCommited = FALSE; + m_bCommited = sal_False; return COMMIT_RESULT_SUCCESS; } } @@ -1282,13 +1282,13 @@ sal_Int16 UCBStorageStream_Impl::Commit() return COMMIT_RESULT_NOTHING_TO_DO; } -BOOL UCBStorageStream_Impl::Revert() +sal_Bool UCBStorageStream_Impl::Revert() { // if an OLEStorage is created on this stream, no "revert" is neccessary because OLEStorages do nothing on "Revert" ! if ( m_bCommited ) { DBG_ERROR("Revert while commit is in progress!" ); - return FALSE; // ??? + return sal_False; // ??? } Free(); @@ -1298,7 +1298,7 @@ BOOL UCBStorageStream_Impl::Revert() m_aTempURL.Erase(); } - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; try { m_rSource = m_pContent->openStream(); @@ -1306,11 +1306,11 @@ BOOL UCBStorageStream_Impl::Revert() { if ( m_pAntiImpl && ( m_nMode & STREAM_TRUNC ) ) // stream is in use and should be truncated - m_bSourceRead = FALSE; + m_bSourceRead = sal_False; else { m_nMode &= ~STREAM_TRUNC; - m_bSourceRead = TRUE; + m_bSourceRead = sal_True; } } else @@ -1328,15 +1328,15 @@ BOOL UCBStorageStream_Impl::Revert() { } - m_bModified = FALSE; + m_bModified = sal_False; m_aName = m_aOriginalName; m_aContentType = m_aOriginalContentType; return ( GetError() == ERRCODE_NONE ); } -BOOL UCBStorageStream_Impl::Clear() +sal_Bool UCBStorageStream_Impl::Clear() { - BOOL bRet = ( m_pAntiImpl == NULL ); + sal_Bool bRet = ( m_pAntiImpl == NULL ); DBG_ASSERT( bRet, "Removing used stream!" ); if( bRet ) { @@ -1387,7 +1387,7 @@ void UCBStorageStream_Impl::PrepareCachedForReopen( StreamMode nMode ) } } -UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey ) +UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorageStream ! @@ -1396,7 +1396,7 @@ UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL StorageBase::m_nMode = pImp->m_nMode; } -UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey, BOOL bRepair, Reference< XProgressHandler > xProgress ) +UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorageStream ! @@ -1423,13 +1423,13 @@ UCBStorageStream::~UCBStorageStream() pImp->ReleaseRef(); } -ULONG UCBStorageStream::Read( void * pData, ULONG nSize ) +sal_uIntPtr UCBStorageStream::Read( void * pData, sal_uIntPtr nSize ) { //return pImp->m_pStream->Read( pData, nSize ); return pImp->GetData( pData, nSize ); } -ULONG UCBStorageStream::Write( const void* pData, ULONG nSize ) +sal_uIntPtr UCBStorageStream::Write( const void* pData, sal_uIntPtr nSize ) { /* // mba: does occur in writer ! @@ -1439,18 +1439,18 @@ ULONG UCBStorageStream::Write( const void* pData, ULONG nSize ) return 0; } */ - // pImp->m_bModified = TRUE; + // pImp->m_bModified = sal_True; //return pImp->m_pStream->Write( pData, nSize ); return pImp->PutData( pData, nSize ); } -ULONG UCBStorageStream::Seek( ULONG nPos ) +sal_uIntPtr UCBStorageStream::Seek( sal_uIntPtr nPos ) { //return pImp->m_pStream->Seek( nPos ); return pImp->Seek( nPos ); } -ULONG UCBStorageStream::Tell() +sal_uIntPtr UCBStorageStream::Tell() { if( !pImp->Init() ) return 0; @@ -1463,32 +1463,32 @@ void UCBStorageStream::Flush() Commit(); } -BOOL UCBStorageStream::SetSize( ULONG nNewSize ) +sal_Bool UCBStorageStream::SetSize( sal_uIntPtr nNewSize ) { /* if ( pImp->m_bCommited ) { DBG_ERROR("Changing stream size while commit is in progress!" ); - return FALSE; + return sal_False; } */ - // pImp->m_bModified = TRUE; + // pImp->m_bModified = sal_True; //return pImp->m_pStream->SetStreamSize( nNewSize ); pImp->SetSize( nNewSize ); return !pImp->GetError(); } -BOOL UCBStorageStream::Validate( BOOL bWrite ) const +sal_Bool UCBStorageStream::Validate( sal_Bool bWrite ) const { return ( !bWrite || ( pImp->m_nMode & STREAM_WRITE ) ); } -BOOL UCBStorageStream::ValidateMode( StreamMode m ) const +sal_Bool UCBStorageStream::ValidateMode( StreamMode m ) const { // ??? if( m == ( STREAM_READ | STREAM_TRUNC ) ) // from stg.cxx - return TRUE; - USHORT nCurMode = 0xFFFF; + return sal_True; + sal_uInt16 nCurMode = 0xFFFF; if( ( m & 3 ) == STREAM_READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed @@ -1496,7 +1496,7 @@ BOOL UCBStorageStream::ValidateMode( StreamMode m ) const && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) || ( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) - return TRUE; + return sal_True; } else { @@ -1505,10 +1505,10 @@ BOOL UCBStorageStream::ValidateMode( StreamMode m ) const // the commit may fail if( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) - return TRUE; + return sal_True; } - return TRUE; + return sal_True; } const SvStream* UCBStorageStream::GetSvStream() const @@ -1530,28 +1530,28 @@ Reference< XInputStream > UCBStorageStream::GetXInputStream() const return pImp->GetXInputStream(); } -BOOL UCBStorageStream::Equals( const BaseStorageStream& rStream ) const +sal_Bool UCBStorageStream::Equals( const BaseStorageStream& rStream ) const { // ??? return ((BaseStorageStream*) this ) == &rStream; } -BOOL UCBStorageStream::Commit() +sal_Bool UCBStorageStream::Commit() { // mark this stream for sending it on root commit pImp->FlushData(); - return TRUE; + return sal_True; } -BOOL UCBStorageStream::Revert() +sal_Bool UCBStorageStream::Revert() { return pImp->Revert(); } -BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm ) +sal_Bool UCBStorageStream::CopyTo( BaseStorageStream* pDestStm ) { if( !pImp->Init() ) - return FALSE; + return sal_False; UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pDestStm ); if ( pStg ) @@ -1559,18 +1559,18 @@ BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm ) pDestStm->SetSize( 0 ); Seek( STREAM_SEEK_TO_END ); - INT32 n = Tell(); + sal_Int32 n = Tell(); if( n < 0 ) - return FALSE; + return sal_False; if( pDestStm->SetSize( n ) && n ) { - BYTE* p = new BYTE[ 4096 ]; + sal_uInt8* p = new sal_uInt8[ 4096 ]; Seek( 0L ); pDestStm->Seek( 0L ); while( n ) { - UINT32 nn = n; + sal_uInt32 nn = n; if( nn > 4096 ) nn = 4096; if( Read( p, nn ) != nn ) @@ -1583,13 +1583,13 @@ BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm ) delete[] p; } - return TRUE; + return sal_True; } -BOOL UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) { if ( rName.CompareToAscii("Title") == COMPARE_EQUAL ) - return FALSE; + return sal_False; if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL ) { @@ -1603,34 +1603,34 @@ BOOL UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star: if ( pImp->m_pContent ) { pImp->m_pContent->setPropertyValue( rName, rValue ); - return TRUE; + return sal_True; } } catch ( Exception& ) { } - return FALSE; + return sal_False; } -BOOL UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) { try { if ( pImp->m_pContent ) { rValue = pImp->m_pContent->getPropertyValue( rName ); - return TRUE; + return sal_True; } } catch ( Exception& ) { } - return FALSE; + return sal_False; } -UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect ) +UCBStorage::UCBStorage( SvStream& rStrm, sal_Bool bDirect ) { String aURL = GetLinkedFile( rStrm ); if ( aURL.Len() ) @@ -1640,7 +1640,7 @@ UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect ) nMode = STREAM_READ | STREAM_WRITE; ::ucbhelper::Content aContent( aURL, Reference < XCommandEnvironment >() ); - pImp = new UCBStorage_Impl( aContent, aURL, nMode, this, bDirect, TRUE ); + pImp = new UCBStorage_Impl( aContent, aURL, nMode, this, bDirect, sal_True ); } else { @@ -1654,7 +1654,7 @@ UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect ) StorageBase::m_nMode = pImp->m_nMode; } -UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot ) +UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorage ! @@ -1664,7 +1664,7 @@ UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rNam StorageBase::m_nMode = pImp->m_nMode; } -UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler ) +UCBStorage::UCBStorage( const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorage ! @@ -1674,7 +1674,7 @@ UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOO StorageBase::m_nMode = pImp->m_nMode; } -UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot ) +UCBStorage::UCBStorage( const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized // to class UCBStorage ! @@ -1703,7 +1703,7 @@ UCBStorage::~UCBStorage() pImp->ReleaseRef(); } -UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, UCBStorage* pStorage, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler ) +UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, UCBStorage* pStorage, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler ) : m_pAntiImpl( pStorage ) , m_pContent( new ::ucbhelper::Content( rContent ) ) , m_pTempFile( NULL ) @@ -1711,13 +1711,13 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const St //, m_pStream( NULL ) , m_nError( 0 ) , m_nMode( nMode ) - , m_bModified( FALSE ) - , m_bCommited( FALSE ) + , m_bModified( sal_False ) + , m_bCommited( sal_False ) , m_bDirect( bDirect ) , m_bIsRoot( bIsRoot ) - , m_bDirty( FALSE ) - , m_bIsLinked( TRUE ) - , m_bListCreated( FALSE ) + , m_bDirty( sal_False ) + , m_bIsLinked( sal_True ) + , m_bListCreated( sal_False ) , m_nFormat( 0 ) , m_aClassId( SvGlobalName() ) , m_bRepairPackage( bIsRepair ) @@ -1731,14 +1731,14 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const St // no name given = use temporary name! DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); m_pTempFile = new ::utl::TempFile; - m_pTempFile->EnableKillingFile( TRUE ); + m_pTempFile->EnableKillingFile( sal_True ); m_aName = m_aOriginalName = aName = m_pTempFile->GetURL(); } m_aURL = rName; } -UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStorage* pStorage, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler ) +UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStorage* pStorage, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler ) : m_pAntiImpl( pStorage ) , m_pContent( NULL ) , m_pTempFile( NULL ) @@ -1746,13 +1746,13 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor //, m_pStream( NULL ) , m_nError( 0 ) , m_nMode( nMode ) - , m_bModified( FALSE ) - , m_bCommited( FALSE ) + , m_bModified( sal_False ) + , m_bCommited( sal_False ) , m_bDirect( bDirect ) , m_bIsRoot( bIsRoot ) - , m_bDirty( FALSE ) - , m_bIsLinked( FALSE ) - , m_bListCreated( FALSE ) + , m_bDirty( sal_False ) + , m_bIsLinked( sal_False ) + , m_bListCreated( sal_False ) , m_nFormat( 0 ) , m_aClassId( SvGlobalName() ) , m_bRepairPackage( bIsRepair ) @@ -1765,7 +1765,7 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor // no name given = use temporary name! DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); m_pTempFile = new ::utl::TempFile; - m_pTempFile->EnableKillingFile( TRUE ); + m_pTempFile->EnableKillingFile( sal_True ); m_aName = m_aOriginalName = aName = m_pTempFile->GetURL(); } @@ -1788,31 +1788,31 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor // substorages are opened like streams: the URL is a "child URL" of the root package URL m_aURL = rName; if ( m_aURL.CompareToAscii( "vnd.sun.star.pkg://", 19 ) != 0 ) - m_bIsLinked = TRUE; + m_bIsLinked = sal_True; } } -UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, BOOL bDirect ) +UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, sal_Bool bDirect ) : m_pAntiImpl( pStorage ) , m_pContent( NULL ) , m_pTempFile( new ::utl::TempFile ) , m_pSource( &rStream ) , m_nError( 0 ) - , m_bModified( FALSE ) - , m_bCommited( FALSE ) + , m_bModified( sal_False ) + , m_bCommited( sal_False ) , m_bDirect( bDirect ) - , m_bIsRoot( TRUE ) - , m_bDirty( FALSE ) - , m_bIsLinked( FALSE ) - , m_bListCreated( FALSE ) + , m_bIsRoot( sal_True ) + , m_bDirty( sal_False ) + , m_bIsLinked( sal_False ) + , m_bListCreated( sal_False ) , m_nFormat( 0 ) , m_aClassId( SvGlobalName() ) - , m_bRepairPackage( FALSE ) + , m_bRepairPackage( sal_False ) , m_pUNOStorageHolderList( NULL ) { // opening in direct mode is too fuzzy because the data is transferred to the stream in the Commit() call, // which will be called in the storages' dtor - m_pTempFile->EnableKillingFile( TRUE ); + m_pTempFile->EnableKillingFile( sal_True ); DBG_ASSERT( !bDirect, "Storage on a stream must not be opened in direct mode!" ); // UCBStorages work on a content, so a temporary file for a content must be created, even if the stream is only @@ -1973,7 +1973,7 @@ void UCBStorage_Impl::ReadContent() if ( m_bListCreated ) return; - m_bListCreated = TRUE; + m_bListCreated = sal_True; // create cursor for access to children Sequence< ::rtl::OUString > aProps(4); @@ -2011,9 +2011,9 @@ void UCBStorage_Impl::ReadContent() aContentType = xRow->getString(3); } - BOOL bIsFolder( xRow->getBoolean(2) ); + sal_Bool bIsFolder( xRow->getBoolean(2) ); sal_Int64 nSize = xRow->getLong(4); - UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (ULONG) nSize ); + UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (sal_uIntPtr) nSize ); m_aChildrenList.Insert( pElement, LIST_APPEND ); sal_Bool bIsOfficeDocument = m_bIsLinked || ( m_aClassId != SvGlobalName() ); @@ -2044,13 +2044,13 @@ void UCBStorage_Impl::ReadContent() ::rtl::OUString aMediaType; Any aAny = aContent.getPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ) ); if ( ( aAny >>= aMediaType ) && ( aMediaType.compareToAscii("application/vnd.sun.star.oleobject") == 0 ) ) - pElement->m_bIsStorage = TRUE; + pElement->m_bIsStorage = sal_True; else if ( !aMediaType.getLength() ) { // older files didn't have that special content type, so they must be detected OpenStream( pElement, STREAM_STD_READ, m_bDirect ); if ( Storage::IsStorageFile( pElement->m_xStream ) ) - pElement->m_bIsStorage = TRUE; + pElement->m_bIsStorage = sal_True; else pElement->m_xStream->Free(); } @@ -2118,7 +2118,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount() ::rtl::OUString Find_Impl( const Sequence < Sequence < PropertyValue > >& rSequence, const ::rtl::OUString& rPath ) { - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; for ( sal_Int32 nSeqs=0; nSeqs& rMyProps = rSequence[nSeqs]; @@ -2131,7 +2131,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount() { rtl::OUString aTmp; if ( ( rAny.Value >>= aTmp ) && aTmp == rPath ) - bFound = TRUE; + bFound = sal_True; if ( aType.getLength() ) break; } @@ -2269,11 +2269,11 @@ UCBStorage_Impl::~UCBStorage_Impl() delete m_pTempFile; } -BOOL UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent ) +sal_Bool UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent ) { // a new substorage is inserted into a UCBStorage ( given by the parameter pContent ) // it must be inserted with a title and a type - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; try { @@ -2310,7 +2310,7 @@ BOOL UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent ) // remove old content, create an "empty" new one and initialize it with the new inserted DELETEZ( m_pContent ); m_pContent = new ::ucbhelper::Content( aNewFolder ); - bRet = TRUE; + bRet = sal_True; } } } @@ -2349,11 +2349,11 @@ sal_Int16 UCBStorage_Impl::Commit() while ( pElement && nRet ) { ::ucbhelper::Content* pContent = pElement->GetContent(); - BOOL bDeleteContent = FALSE; + sal_Bool bDeleteContent = sal_False; if ( !pContent && pElement->IsModified() ) { // if the element has never been opened, no content has been created until now - bDeleteContent = TRUE; // remember to delete it later + bDeleteContent = sal_True; // remember to delete it later String aName( m_aURL ); aName += '/'; aName += pElement->m_aOriginalName; @@ -2401,7 +2401,7 @@ sal_Int16 UCBStorage_Impl::Commit() // OLE storage should be stored encrytped, if the storage uses encryption pElement->m_xStream->m_aContentType = String::CreateFromAscii("application/vnd.sun.star.oleobject"); Any aValue; - aValue <<= (BOOL) TRUE; + aValue <<= (sal_Bool) sal_True; pElement->m_xStream->m_pContent->setPropertyValue(String::CreateFromAscii("Encrypted"), aValue ); } @@ -2483,7 +2483,7 @@ sal_Int16 UCBStorage_Impl::Commit() // write a manifest file // first create a subfolder "META-inf" Content aNewSubFolder; - BOOL bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, String::CreateFromAscii("META-INF"), aNewSubFolder ); + sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, String::CreateFromAscii("META-INF"), aNewSubFolder ); if ( bRet ) { // create a stream to write the manifest file - use a temp file @@ -2584,7 +2584,7 @@ sal_Int16 UCBStorage_Impl::Commit() // after successfull root commit all elements names and types are adjusted and all removed elements // are also removed from the lists UCBStorageElement_Impl* pInnerElement = m_aChildrenList.First(); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; while ( pInnerElement && bRet ) { UCBStorageElement_Impl* pNext = m_aChildrenList.Next(); @@ -2596,26 +2596,26 @@ sal_Int16 UCBStorage_Impl::Commit() else { pInnerElement->m_aOriginalName = pInnerElement->m_aName; - pInnerElement->m_bIsInserted = FALSE; + pInnerElement->m_bIsInserted = sal_False; } pInnerElement = pNext; } } - m_bCommited = FALSE; + m_bCommited = sal_False; } return nRet; } -BOOL UCBStorage_Impl::Revert() +sal_Bool UCBStorage_Impl::Revert() { UCBStorageElement_Impl* pElement = m_aChildrenList.First(); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; while ( pElement && bRet ) { - pElement->m_bIsRemoved = FALSE; + pElement->m_bIsRemoved = sal_False; if ( pElement->m_bIsInserted ) { m_aChildrenList.Remove( pElement ); // correct usage of list ??? @@ -2634,7 +2634,7 @@ BOOL UCBStorage_Impl::Revert() } pElement->m_aName = pElement->m_aOriginalName; - pElement->m_bIsRemoved = FALSE; + pElement->m_bIsRemoved = sal_False; } pElement = m_aChildrenList.Next(); @@ -2648,17 +2648,17 @@ const String& UCBStorage::GetName() const return pImp->m_aName; // pImp->m_aURL ?! } -BOOL UCBStorage::IsRoot() const +sal_Bool UCBStorage::IsRoot() const { return pImp->m_bIsRoot; } void UCBStorage::SetDirty() { - pImp->m_bDirty = TRUE; + pImp->m_bDirty = sal_True; } -void UCBStorage::SetClass( const SvGlobalName & rClass, ULONG nOriginalClipFormat, const String & rUserTypeName ) +void UCBStorage::SetClass( const SvGlobalName & rClass, sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) { pImp->m_aClassId = rClass; pImp->m_nFormat = nOriginalClipFormat; @@ -2697,15 +2697,15 @@ const ClsId& UCBStorage::GetClassId() const return ( const ClsId& ) pImp->m_aClassId.GetCLSID(); } -void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, ULONG /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) +void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, sal_uIntPtr /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) { // ??? } -BOOL UCBStorage::ShouldConvert() +sal_Bool UCBStorage::ShouldConvert() { // ??? - return FALSE; + return sal_False; } SvGlobalName UCBStorage::GetClassName() @@ -2713,7 +2713,7 @@ SvGlobalName UCBStorage::GetClassName() return pImp->m_aClassId; } -ULONG UCBStorage::GetFormat() +sal_uIntPtr UCBStorage::GetFormat() { return pImp->m_nFormat; } @@ -2733,7 +2733,7 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const if ( !pElement->m_bIsRemoved ) { // problem: what about the size of a substorage ?! - ULONG nSize = pElement->m_nSize; + sal_uIntPtr nSize = pElement->m_nSize; if ( pElement->m_xStream.Is() ) nSize = pElement->m_xStream->GetSize(); SvStorageInfo aInfo( pElement->m_aName, nSize, pElement->m_bIsStorage ); @@ -2744,7 +2744,7 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const } } -BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, BaseStorage* pDest, const String& rNew ) const +sal_Bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, BaseStorage* pDest, const String& rNew ) const { // insert stream or storage into the list or stream of the destination storage // not into the content, this will be done on commit ! @@ -2755,7 +2755,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base // the destination stream must not be open BaseStorageStream* pOtherStream = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect ); BaseStorageStream* pStream = NULL; - BOOL bDeleteStream = FALSE; + sal_Bool bDeleteStream = sal_False; // if stream is already open, it is allowed to copy it, so be aware of this if ( rElement.m_xStream.Is() ) @@ -2763,7 +2763,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base if ( !pStream ) { pStream = ( const_cast < UCBStorage* > (this) )->OpenStream( rElement.m_aName, STREAM_STD_READ, pImp->m_bDirect ); - bDeleteStream = TRUE; + bDeleteStream = sal_True; } pStream->CopyTo( pOtherStream ); @@ -2784,19 +2784,19 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base BaseStorage* pStorage = NULL; // if stream is already open, it is allowed to copy it, so be aware of this - BOOL bDeleteStorage = FALSE; + sal_Bool bDeleteStorage = sal_False; if ( rElement.m_xStorage.Is() ) pStorage = rElement.m_xStorage->m_pAntiImpl; if ( !pStorage ) { pStorage = ( const_cast < UCBStorage* > (this) )->OpenStorage( rElement.m_aName, pImp->m_nMode, pImp->m_bDirect ); - bDeleteStorage = TRUE; + bDeleteStorage = sal_True; } UCBStorage* pUCBDest = PTR_CAST( UCBStorage, pDest ); UCBStorage* pUCBCopy = PTR_CAST( UCBStorage, pStorage ); - BOOL bOpenUCBStorage = pUCBDest && pUCBCopy; + sal_Bool bOpenUCBStorage = pUCBDest && pUCBCopy; BaseStorage* pOtherStorage = bOpenUCBStorage ? pDest->OpenUCBStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect ) : pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect ); @@ -2821,7 +2821,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base delete pOtherStorage; } - return BOOL( Good() && pDest->Good() ); + return sal_Bool( Good() && pDest->Good() ); } UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const String& rName ) const @@ -2838,11 +2838,11 @@ UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const String& rName ) cons return pElement; } -BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const +sal_Bool UCBStorage::CopyTo( BaseStorage* pDestStg ) const { DBG_ASSERT( pDestStg != ((BaseStorage*)this), "Self-Copying is not possible!" ); if ( pDestStg == ((BaseStorage*)this) ) - return FALSE; + return sal_False; // perhaps it's also a problem if one storage is a parent of the other ?! // or if not: could be optimized ?! @@ -2856,7 +2856,7 @@ BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const pDestStg->SetClassId( GetClassId() ); pDestStg->SetDirty(); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; UCBStorageElement_Impl* pElement = pImp->GetChildrenList().First(); while ( pElement && bRet ) { @@ -2867,18 +2867,18 @@ BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const if( !bRet ) SetError( pDestStg->GetError() ); - return BOOL( Good() && pDestStg->Good() ); + return sal_Bool( Good() && pDestStg->Good() ); } -BOOL UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const String& rNew ) +sal_Bool UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const String& rNew ) { if( !rElemName.Len() ) - return FALSE; + return sal_False; if ( pDest == ((BaseStorage*) this) ) { // can't double an element - return FALSE; + return sal_False; } else { @@ -2889,28 +2889,28 @@ BOOL UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const Stri else { SetError( SVSTREAM_FILE_NOT_FOUND ); - return FALSE; + return sal_False; } } } -BOOL UCBStorage::Commit() +sal_Bool UCBStorage::Commit() { // mark this storage for sending it on root commit - pImp->m_bCommited = TRUE; + pImp->m_bCommited = sal_True; if ( pImp->m_bIsRoot ) // the root storage coordinates commiting by sending a Commit command to its content return ( pImp->Commit() != COMMIT_RESULT_FAILURE ); else - return TRUE; + return sal_True; } -BOOL UCBStorage::Revert() +sal_Bool UCBStorage::Revert() { return pImp->Revert(); } -BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nMode, BOOL bDirect, const ByteString* pKey ) +BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey ) { if( !rEleName.Len() ) return NULL; @@ -2935,7 +2935,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM { // create a new UCBStorageElement and insert it into the list pElement = new UCBStorageElement_Impl( rEleName ); - pElement->m_bIsInserted = TRUE; + pElement->m_bIsInserted = sal_True; pImp->m_aChildrenList.Insert( pElement, LIST_APPEND ); } } @@ -2980,7 +2980,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM return NULL; } -UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect, const ByteString* pKey ) +UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey ) { String aName( m_aURL ); aName += '/'; @@ -2989,31 +2989,31 @@ UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pEle return pElement->m_xStream; } -BaseStorage* UCBStorage::OpenUCBStorage( const String& rEleName, StreamMode nMode, BOOL bDirect ) +BaseStorage* UCBStorage::OpenUCBStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect ) { if( !rEleName.Len() ) return NULL; - return OpenStorage_Impl( rEleName, nMode, bDirect, TRUE ); + return OpenStorage_Impl( rEleName, nMode, bDirect, sal_True ); } -BaseStorage* UCBStorage::OpenOLEStorage( const String& rEleName, StreamMode nMode, BOOL bDirect ) +BaseStorage* UCBStorage::OpenOLEStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect ) { if( !rEleName.Len() ) return NULL; - return OpenStorage_Impl( rEleName, nMode, bDirect, FALSE ); + return OpenStorage_Impl( rEleName, nMode, bDirect, sal_False ); } -BaseStorage* UCBStorage::OpenStorage( const String& rEleName, StreamMode nMode, BOOL bDirect ) +BaseStorage* UCBStorage::OpenStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect ) { if( !rEleName.Len() ) return NULL; - return OpenStorage_Impl( rEleName, nMode, bDirect, TRUE ); + return OpenStorage_Impl( rEleName, nMode, bDirect, sal_True ); } -BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nMode, BOOL bDirect, BOOL bForceUCBStorage ) +BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nMode, sal_Bool bDirect, sal_Bool bForceUCBStorage ) { // try to find the storage element UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); @@ -3026,8 +3026,8 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM String aName( pImp->m_aURL ); aName += '/'; aName += rEleName; // ??? - UCBStorage *pStorage = new UCBStorage( aName, nMode, bDirect, FALSE, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); - pStorage->pImp->m_bIsRoot = FALSE; + UCBStorage *pStorage = new UCBStorage( aName, nMode, bDirect, sal_False, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); + pStorage->pImp->m_bIsRoot = sal_False; pStorage->pImp->m_bListCreated = sal_True; // the storage is pretty new, nothing to read pStorage->SetError( GetError() ); return pStorage; @@ -3037,7 +3037,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM // problem: perhaps an OLEStorage should be created ?! // Because nothing is known about the element that should be created, an external parameter is needed ! pElement = new UCBStorageElement_Impl( rEleName ); - pElement->m_bIsInserted = TRUE; + pElement->m_bIsInserted = sal_True; pImp->m_aChildrenList.Insert( pElement, LIST_APPEND ); } @@ -3064,7 +3064,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM pElement->m_xStream->PrepareCachedForReopen( nMode ); pElement->m_xStream->Init(); - pElement->m_bIsStorage = TRUE; + pElement->m_bIsStorage = sal_True; return pElement->m_xStream->CreateStorage(); // can only be created in transacted mode } else if ( pElement->m_xStorage.Is() ) @@ -3077,13 +3077,13 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM } else { - BOOL bIsWritable = (( pElement->m_xStorage->m_nMode & STREAM_WRITE ) != 0); + sal_Bool bIsWritable = (( pElement->m_xStorage->m_nMode & STREAM_WRITE ) != 0); if ( !bIsWritable && (( nMode & STREAM_WRITE ) != 0 )) { String aName( pImp->m_aURL ); aName += '/'; aName += pElement->m_aOriginalName; - UCBStorage* pStorage = new UCBStorage( aName, nMode, bDirect, FALSE, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); + UCBStorage* pStorage = new UCBStorage( aName, nMode, bDirect, sal_False, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); pElement->m_xStorage = pStorage->pImp; return pStorage; } @@ -3097,7 +3097,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM else if ( !pElement->m_xStream.Is() ) { // storage is opened the first time - BOOL bIsWritable = (( pImp->m_nMode & STREAM_WRITE ) != 0 ); + sal_Bool bIsWritable = (( pImp->m_nMode & STREAM_WRITE ) != 0 ); if ( pImp->m_bIsLinked && pImp->m_bIsRoot && bIsWritable ) { // make sure that the root storage object has been created before substorages will be created @@ -3107,7 +3107,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM Content aFolder( aFolderObj.GetMainURL( INetURLObject::NO_DECODE ), Reference < XCommandEnvironment >() ); pImp->m_pContent = new Content; - BOOL bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, pImp->m_aName, *pImp->m_pContent ); + sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, pImp->m_aName, *pImp->m_pContent ); if ( !bRet ) { SetError( SVSTREAM_CANNOT_MAKE ); @@ -3128,31 +3128,31 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM return NULL; } -UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect ) +UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect ) { UCBStorage_Impl* pRet = NULL; String aName( m_aURL ); aName += '/'; aName += pElement->m_aOriginalName; // ??? - pElement->m_bIsStorage = pElement->m_bIsFolder = TRUE; + pElement->m_bIsStorage = pElement->m_bIsFolder = sal_True; if ( m_bIsLinked && !::utl::UCBContentHelper::Exists( aName ) ) { Content aNewFolder; - BOOL bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, pElement->m_aOriginalName, aNewFolder ); + sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, pElement->m_aOriginalName, aNewFolder ); if ( bRet ) - pRet = new UCBStorage_Impl( aNewFolder, aName, nMode, NULL, bDirect, FALSE, m_bRepairPackage, m_xProgressHandler ); + pRet = new UCBStorage_Impl( aNewFolder, aName, nMode, NULL, bDirect, sal_False, m_bRepairPackage, m_xProgressHandler ); } else { - pRet = new UCBStorage_Impl( aName, nMode, NULL, bDirect, FALSE, m_bRepairPackage, m_xProgressHandler ); + pRet = new UCBStorage_Impl( aName, nMode, NULL, bDirect, sal_False, m_bRepairPackage, m_xProgressHandler ); } if ( pRet ) { pRet->m_bIsLinked = m_bIsLinked; - pRet->m_bIsRoot = FALSE; + pRet->m_bIsRoot = sal_False; // if name has been changed before creating the stream: set name! pRet->m_aName = pElement->m_aOriginalName; @@ -3165,41 +3165,41 @@ UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement, return pRet; } -BOOL UCBStorage::IsStorage( const String& rEleName ) const +sal_Bool UCBStorage::IsStorage( const String& rEleName ) const { if( !rEleName.Len() ) - return FALSE; + return sal_False; const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); return ( pElement && pElement->m_bIsStorage ); } -BOOL UCBStorage::IsStream( const String& rEleName ) const +sal_Bool UCBStorage::IsStream( const String& rEleName ) const { if( !rEleName.Len() ) - return FALSE; + return sal_False; const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); return ( pElement && !pElement->m_bIsStorage ); } -BOOL UCBStorage::IsContained( const String & rEleName ) const +sal_Bool UCBStorage::IsContained( const String & rEleName ) const { if( !rEleName.Len() ) - return FALSE; + return sal_False; const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); return ( pElement != NULL ); } -BOOL UCBStorage::Remove( const String& rEleName ) +sal_Bool UCBStorage::Remove( const String& rEleName ) { if( !rEleName.Len() ) - return FALSE; + return sal_False; UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); if ( pElement ) { - pElement->m_bIsRemoved = TRUE; + pElement->m_bIsRemoved = sal_True; } else SetError( SVSTREAM_FILE_NOT_FOUND ); @@ -3207,16 +3207,16 @@ BOOL UCBStorage::Remove( const String& rEleName ) return ( pElement != NULL ); } -BOOL UCBStorage::Rename( const String& rEleName, const String& rNewName ) +sal_Bool UCBStorage::Rename( const String& rEleName, const String& rNewName ) { if( !rEleName.Len()|| !rNewName.Len() ) - return FALSE; + return sal_False; UCBStorageElement_Impl *pAlreadyExisting = FindElement_Impl( rNewName ); if ( pAlreadyExisting ) { SetError( SVSTREAM_ACCESS_DENIED ); - return FALSE; // can't change to a name that is already used + return sal_False; // can't change to a name that is already used } UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); @@ -3230,10 +3230,10 @@ BOOL UCBStorage::Rename( const String& rEleName, const String& rNewName ) return pElement != NULL; } -BOOL UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const String& rNewName ) +sal_Bool UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const String& rNewName ) { if( !rEleName.Len() || !rNewName.Len() ) - return FALSE; + return sal_False; if ( pNewSt == ((BaseStorage*) this) && !FindElement_Impl( rNewName ) ) { @@ -3257,31 +3257,31 @@ BOOL UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const Stri } */ // MoveTo is done by first copying to the new destination and then removing the old element - BOOL bRet = CopyTo( rEleName, pNewSt, rNewName ); + sal_Bool bRet = CopyTo( rEleName, pNewSt, rNewName ); if ( bRet ) bRet = Remove( rEleName ); return bRet; } } -BOOL UCBStorage::ValidateFAT() +sal_Bool UCBStorage::ValidateFAT() { // ??? - return TRUE; + return sal_True; } -BOOL UCBStorage::Validate( BOOL bWrite ) const +sal_Bool UCBStorage::Validate( sal_Bool bWrite ) const { // ??? return ( !bWrite || ( pImp->m_nMode & STREAM_WRITE ) ); } -BOOL UCBStorage::ValidateMode( StreamMode m ) const +sal_Bool UCBStorage::ValidateMode( StreamMode m ) const { // ??? if( m == ( STREAM_READ | STREAM_TRUNC ) ) // from stg.cxx - return TRUE; - USHORT nCurMode = 0xFFFF; + return sal_True; + sal_uInt16 nCurMode = 0xFFFF; if( ( m & 3 ) == STREAM_READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed @@ -3289,7 +3289,7 @@ BOOL UCBStorage::ValidateMode( StreamMode m ) const && ( nCurMode & STREAM_SHARE_DENYWRITE ) ) || ( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) ) - return TRUE; + return sal_True; } else { @@ -3298,10 +3298,10 @@ BOOL UCBStorage::ValidateMode( StreamMode m ) const // the commit may fail if( ( m & STREAM_SHARE_DENYALL ) && ( nCurMode & STREAM_SHARE_DENYALL ) ) - return TRUE; + return sal_True; } - return TRUE; + return sal_True; } const SvStream* UCBStorage::GetSvStream() const @@ -3311,13 +3311,13 @@ const SvStream* UCBStorage::GetSvStream() const return pImp->m_pSource; } -BOOL UCBStorage::Equals( const BaseStorage& rStorage ) const +sal_Bool UCBStorage::Equals( const BaseStorage& rStorage ) const { // ??? return ((BaseStorage*)this) == &rStorage; } -BOOL UCBStorage::IsStorageFile( const String& rFileName ) +sal_Bool UCBStorage::IsStorageFile( const String& rFileName ) { String aFileURL = rFileName; INetURLObject aObj( aFileURL ); @@ -3329,27 +3329,27 @@ BOOL UCBStorage::IsStorageFile( const String& rFileName ) } SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aFileURL, STREAM_STD_READ ); - BOOL bRet = UCBStorage::IsStorageFile( pStm ); + sal_Bool bRet = UCBStorage::IsStorageFile( pStm ); delete pStm; return bRet; } -BOOL UCBStorage::IsStorageFile( SvStream* pFile ) +sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) { if ( !pFile ) - return FALSE; + return sal_False; - ULONG nPos = pFile->Tell(); + sal_uIntPtr nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); if ( pFile->Tell() < 4 ) - return FALSE; + return sal_False; pFile->Seek(0); - UINT32 nBytes; + sal_uInt32 nBytes; *pFile >> nBytes; // search for the magic bytes - BOOL bRet = ( nBytes == 0x04034b50 ); + sal_Bool bRet = ( nBytes == 0x04034b50 ); if ( !bRet ) { // disk spanned file have an additional header in front of the usual one @@ -3365,22 +3365,22 @@ BOOL UCBStorage::IsStorageFile( SvStream* pFile ) return bRet; } -BOOL UCBStorage::IsDiskSpannedFile( SvStream* pFile ) +sal_Bool UCBStorage::IsDiskSpannedFile( SvStream* pFile ) { if ( !pFile ) - return FALSE; + return sal_False; - ULONG nPos = pFile->Tell(); + sal_uIntPtr nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); if ( !pFile->Tell() ) - return FALSE; + return sal_False; pFile->Seek(0); - UINT32 nBytes; + sal_uInt32 nBytes; *pFile >> nBytes; // disk spanned file have an additional header in front of the usual one - BOOL bRet = ( nBytes == 0x08074b50 ); + sal_Bool bRet = ( nBytes == 0x08074b50 ); if ( bRet ) { *pFile >> nBytes; @@ -3394,13 +3394,13 @@ BOOL UCBStorage::IsDiskSpannedFile( SvStream* pFile ) String UCBStorage::GetLinkedFile( SvStream &rStream ) { String aString; - ULONG nPos = rStream.Tell(); + sal_uIntPtr nPos = rStream.Tell(); rStream.Seek( STREAM_SEEK_TO_END ); if ( !rStream.Tell() ) return aString; rStream.Seek(0); - UINT32 nBytes; + sal_uInt32 nBytes; rStream >> nBytes; if( nBytes == 0x04034b50 ) { @@ -3430,7 +3430,7 @@ String UCBStorage::CreateLinkFile( const String& rName ) SvStream* pStream = pTempFile->GetStream( STREAM_STD_READWRITE | STREAM_TRUNC ); // write header - *pStream << ( UINT32 ) 0x04034b50; + *pStream << ( sal_uInt32 ) 0x04034b50; // assemble a new folder name in the destination folder INetURLObject aObj( rName ); @@ -3441,7 +3441,7 @@ String UCBStorage::CreateLinkFile( const String& rName ) // create a folder and store its URL Content aFolder( aFolderURL, Reference < XCommandEnvironment >() ); Content aNewFolder; - BOOL bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, aTitle, aNewFolder ); + sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, aTitle, aNewFolder ); if ( !bRet ) { aFolderObj.insertName( aTitle ); @@ -3487,15 +3487,15 @@ String UCBStorage::CreateLinkFile( const String& rName ) return aURL; } - pTempFile->EnableKillingFile( TRUE ); + pTempFile->EnableKillingFile( sal_True ); delete pTempFile; return String(); } -BOOL UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ) { if ( rName.CompareToAscii("Title") == COMPARE_EQUAL ) - return FALSE; + return sal_False; if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL ) { @@ -3509,38 +3509,38 @@ BOOL UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno:: if ( pImp->GetContent() ) { pImp->m_pContent->setPropertyValue( rName, rValue ); - return TRUE; + return sal_True; } } catch ( Exception& ) { } - return FALSE; + return sal_False; } -BOOL UCBStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) { try { if ( pImp->GetContent() ) { rValue = pImp->m_pContent->getPropertyValue( rName ); - return TRUE; + return sal_True; } } catch ( Exception& ) { } - return FALSE; + return sal_False; } -BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ) +sal_Bool UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue ) { UCBStorageElement_Impl *pEle = FindElement_Impl( rEleName ); if ( !pEle ) - return FALSE; + return sal_False; if ( !pEle->m_bIsFolder ) { @@ -3549,7 +3549,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com if ( pEle->m_xStream->m_nError ) { pEle->m_xStream.Clear(); - return FALSE; + return sal_False; } try @@ -3557,7 +3557,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com if ( pEle->m_xStream->m_pContent ) { rValue = pEle->m_xStream->m_pContent->getPropertyValue( rName ); - return TRUE; + return sal_True; } } catch ( Exception& ) @@ -3571,7 +3571,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com if ( pEle->m_xStorage->m_nError ) { pEle->m_xStorage.Clear(); - return FALSE; + return sal_False; } try @@ -3579,7 +3579,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com if ( pEle->m_xStorage->GetContent() ) { rValue = pEle->m_xStorage->m_pContent->getPropertyValue( rName ); - return TRUE; + return sal_True; } } catch ( Exception& ) @@ -3587,7 +3587,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com } } - return FALSE; + return sal_False; } UNOStorageHolderList* UCBStorage::GetUNOStorageHolderList() diff --git a/sot/source/sdstor/unostorageholder.cxx b/sot/source/sdstor/unostorageholder.cxx index 55c205557648..aa84ed0cf87c 100644 --- a/sot/source/sdstor/unostorageholder.cxx +++ b/sot/source/sdstor/unostorageholder.cxx @@ -133,7 +133,7 @@ void SAL_CALL UNOStorageHolder::commited( const lang::EventObject& /*aEvent*/ ) xComp->dispose(); - SotStorageRef rTempStorage = new SotStorage( TRUE, aTmpStorFile.GetURL(), STREAM_WRITE, STORAGE_TRANSACTED ); + SotStorageRef rTempStorage = new SotStorage( sal_True, aTmpStorFile.GetURL(), STREAM_WRITE, STORAGE_TRANSACTED ); if ( !rTempStorage.Is() || rTempStorage->GetError() != ERRCODE_NONE ) throw uno::RuntimeException(); -- cgit From a3c8a0ed0c5c6be1cb5c940750222f6381608bd7 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 13:10:07 +0200 Subject: sb129: #i113189# change UNO components to use passive registration --- sot/prj/d.lst | 1 + sot/source/unoolestorage/register.cxx | 28 ---------------------------- sot/util/makefile.mk | 8 ++++++++ sot/util/sot.component | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 sot/util/sot.component (limited to 'sot') diff --git a/sot/prj/d.lst b/sot/prj/d.lst index 528b6863ef3c..10bed8c9fe5e 100644 --- a/sot/prj/d.lst +++ b/sot/prj/d.lst @@ -25,3 +25,4 @@ mkdir: %_DEST%\inc%_EXT%\sot ..\%__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 +..\%__SRC%\misc\sot.component %_DEST%\xml%_EXT%\sot.component diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 00326333546d..083a4d585ca1 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -69,33 +69,5 @@ 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" diff --git a/sot/util/makefile.mk b/sot/util/makefile.mk index 60b34c356217..72d17db189be 100644 --- a/sot/util/makefile.mk +++ b/sot/util/makefile.mk @@ -79,3 +79,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk @echo Making: $@ $(TYPE) sot.flt > $@ + +ALLTAR : $(MISC)/sot.component + +$(MISC)/sot.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + sot.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt sot.component 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 @@ + + + + + + + + -- cgit From 622f4846bb6e48873cbb00dc8a167a650b880f31 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 28 Sep 2010 16:11:29 +0200 Subject: fwk149: #i105142# avoid the crash in case of broken file --- sot/source/sdstor/stgdir.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sot') diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index f093dc60cbe7..039a29fd2683 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -936,8 +936,11 @@ BOOL StgDirStrm::Store() void* StgDirStrm::GetEntry( INT32 n, 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 ); } -- cgit From 955e88c80e9abce3f15aa55d434dae6ae17d7d43 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 22 Oct 2010 10:37:46 +0200 Subject: sb131: #i115124# $(XSLTPROC) implies LIBXSLT:libxslt --- sot/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sot') diff --git a/sot/prj/build.lst b/sot/prj/build.lst index a5ebff311e9c..9d6e785898a5 100644 --- a/sot/prj/build.lst +++ b/sot/prj/build.lst @@ -1,4 +1,4 @@ -to sot : tools ucbhelper unotools NULL +to sot : LIBXSLT:libxslt 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 -- cgit From 79f23856aa5f8a9c28d1650d5f02559e6a5fbddb Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 3 Jan 2011 13:40:23 +0100 Subject: fwk162: #i115902# review usage of SfxObjectShellRef, SfxObjecShellLock; remove unused some methods --- sot/inc/sot/factory.hxx | 1 - sot/inc/sot/object.hxx | 40 +----- sot/inc/sot/sotref.hxx | 8 +- sot/source/base/factory.cxx | 39 ------ sot/source/base/object.cxx | 290 +------------------------------------------- 5 files changed, 10 insertions(+), 368 deletions(-) (limited to 'sot') diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx index 08dd21a88aa5..7b7feb0e9ebe 100644 --- a/sot/inc/sot/factory.hxx +++ b/sot/inc/sot/factory.hxx @@ -73,7 +73,6 @@ 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 diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx index db2ac3b30ffc..563c90d89a54 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -381,22 +381,17 @@ 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, 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 @@ -414,25 +409,10 @@ public: 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 ); - } + + void* CastAndAddRef( const SotFactory * pFact ); + + USHORT Lock( BOOL bLock ); // affects nStrongLockCount USHORT GetOwnerLockCount() const { return nOwnerLockCount; } USHORT GetStrongLockCount() const { return nStrongLockCount; } @@ -450,18 +430,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/sotref.hxx b/sot/inc/sot/sotref.hxx index ae03032e286e..a6728627ef2c 100644 --- a/sot/inc/sot/sotref.hxx +++ b/sot/inc/sot/sotref.hxx @@ -33,14 +33,12 @@ #endif //======================================================================== -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 @@ -52,7 +50,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) \ @@ -64,12 +61,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/source/base/factory.cxx b/sot/source/base/factory.cxx index 4934f99e78c6..e0605b5f0063 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -344,45 +344,6 @@ 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] - - -*/ -{ - void * pRet = NULL; - if( pObj ) - { - pRet = pObj->AggCast( this ); - if( pRet ) - pObj->AddRef(); - } - return pRet; -} - /************************************************************************* |* SotFactory::Is() |* diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 403a1c6bb61d..0db2e45a5f83 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -35,10 +35,6 @@ #include #include -/************** class SvAggregateMemberList *****************************/ -/************************************************************************/ -PRV_SV_IMPL_OWNER_LIST(SvAggregateMemberList,SvAggregate); - /************** class SotObject ******************************************/ class SotObjectFactory : public SotFactory { @@ -84,8 +80,7 @@ void SotObject::TestMemberInvariant( BOOL /*bPrint*/ ) |* Beschreibung *************************************************************************/ SotObject::SotObject() - : pAggList ( NULL ) - , nStrongLockCount( 0 ) + : nStrongLockCount( 0 ) , nOwnerLockCount( 0 ) , bOwner ( TRUE ) , bSVObject ( FALSE ) @@ -118,247 +113,12 @@ IUnknown * SotObject::GetInterface( const SvGlobalName & ) return NULL; } -/************************************************************************* -|* 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 ) @@ -366,49 +126,8 @@ 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 -Interface zur Vef"ugung stehen. - bIntern und bClose werden dann ignoriert. - Wenn der LockCount auf 0 wechselt, wird - gerufen, wenn kein OwnerLock besteht. - - [Anmerkung] - -*/ +USHORT SotObject::Lock( BOOL bLock ) { SotObjectRef xHoldAlive( this ); USHORT nRet; @@ -423,8 +142,9 @@ USHORT SotObject::FuzzyLock ReleaseRef(); } - if( !nRet && bClose && !nOwnerLockCount ) + if( !nRet && !nOwnerLockCount ) DoClose(); + return nRet; } -- cgit From caa3d247d2ff8d34881e5fdb2edd4d153c2725c0 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 12 Jan 2011 16:31:19 +0100 Subject: removetooltypes01: #i112600# Exchange misleading sal_uIntPtr with sal_uLong in sot --- sot/inc/sot/exchange.hxx | 38 +++--- sot/inc/sot/filelist.hxx | 6 +- sot/inc/sot/formats.hxx | 276 +++++++++++++++++++-------------------- sot/inc/sot/object.hxx | 2 +- sot/inc/sot/stg.hxx | 56 ++++---- sot/inc/sot/storage.hxx | 22 ++-- sot/inc/sot/storinfo.hxx | 10 +- sot/source/base/exchange.cxx | 28 ++-- sot/source/base/factory.cxx | 6 +- sot/source/base/filelist.cxx | 14 +- sot/source/base/formats.cxx | 20 +-- sot/source/base/object.cxx | 8 +- sot/source/sdstor/stg.cxx | 34 ++--- sot/source/sdstor/stgcache.cxx | 20 +-- sot/source/sdstor/stgcache.hxx | 6 +- sot/source/sdstor/stgdir.cxx | 16 +-- sot/source/sdstor/stgio.cxx | 36 ++--- sot/source/sdstor/stgio.hxx | 4 +- sot/source/sdstor/stgole.cxx | 10 +- sot/source/sdstor/stgole.hxx | 10 +- sot/source/sdstor/stgstrms.cxx | 30 ++--- sot/source/sdstor/stgstrms.hxx | 12 +- sot/source/sdstor/storage.cxx | 36 ++--- sot/source/sdstor/storinfo.cxx | 8 +- sot/source/sdstor/ucbstorage.cxx | 104 +++++++-------- 25 files changed, 406 insertions(+), 406 deletions(-) (limited to 'sot') diff --git a/sot/inc/sot/exchange.hxx b/sot/inc/sot/exchange.hxx index d079d9bfec2c..da5d5854f056 100644 --- a/sot/inc/sot/exchange.hxx +++ b/sot/inc/sot/exchange.hxx @@ -52,7 +52,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer { // - SotFormatStringId - // --------------------- -typedef sal_uIntPtr SotFormatStringId; +typedef sal_uLong SotFormatStringId; // ---------------- // - DataFlavorEx - @@ -77,14 +77,14 @@ typedef ::std::list< ::com::sun::star::datatransfer::DataFlavor > DataFlavorLi typedef ::std::list< DataFlavorEx > DataFlavorExList; SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, - sal_uIntPtr nId ); + sal_uLong nId ); // ------------------------- // - Vordefinierte Formate - // ------------------------- -// Die Reihenfolge und die Werte dürfen nicht geändert werden, -// da die Implementation sich darauf verläßt. +// Die Reihenfolge und die Werte d�rfen nicht ge�ndert werden, +// da die Implementation sich darauf verl��t. // Standard-Formate fuer die es auch Copy/Paste-Methoden gibt #define FORMAT_STRING 1 #define FORMAT_BITMAP 2 @@ -188,26 +188,26 @@ class SvGlobalName; class SOT_DLLPUBLIC SotExchange { public: - static sal_uIntPtr RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static sal_uIntPtr RegisterFormatName( const String& rName ); - static sal_uIntPtr RegisterFormatMimeType( const String& rMimeType ); - - static sal_uIntPtr GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static String GetFormatName( sal_uIntPtr nFormat ); - static sal_Bool GetFormatDataFlavor( sal_uIntPtr nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - static String GetFormatMimeType( sal_uIntPtr nFormat ); + static sal_uLong RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static sal_uLong RegisterFormatName( const String& rName ); + static sal_uLong RegisterFormatMimeType( const String& rMimeType ); + + static sal_uLong GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static String GetFormatName( sal_uLong nFormat ); + static sal_Bool GetFormatDataFlavor( sal_uLong nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + static String GetFormatMimeType( sal_uLong nFormat ); static sal_Bool IsInternal( const SvGlobalName& ); - static sal_uIntPtr GetFormatIdFromMimeType( const String& rMimeType ); + static sal_uLong GetFormatIdFromMimeType( const String& rMimeType ); // bestimme die SotFormatStringId von dem registrierten Format //JP 12.11.98: diese 3 Methoden sind ab sofort ueberfluessig, da // die ClipboardIds statisch sind und aequivalent zur // SotFormatStringId ist! - static SotFormatStringId GetFormatStringId( sal_uIntPtr nFormat ) + static SotFormatStringId GetFormatStringId( sal_uLong nFormat ) { return nFormat; } static SotFormatStringId GetFormatStringId( const String& rName ) { return SotExchange::RegisterFormatMimeType( rName ); } - static sal_uIntPtr RegisterSotFormatName( SotFormatStringId nId ) + static sal_uLong RegisterSotFormatName( SotFormatStringId nId ) { return nId; } // same for XTransferable interface @@ -221,11 +221,11 @@ public: // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16 nUserAction, // In:- Out: Zu benutzendes Format - sal_uIntPtr& rFormat, + sal_uLong& rFormat, // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - sal_uIntPtr nOnlyTestFormat = 0, + sal_uLong nOnlyTestFormat = 0, // In:- optional - check the contents of Xtransferable const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >* pxTransferable = NULL ); @@ -240,11 +240,11 @@ public: // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16 nUserAction, // In:- Out: Zu benutzendes Format - sal_uIntPtr& rFormat, + sal_uLong& rFormat, // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*) sal_uInt16& rDefaultAction, // In:- optional - check only for this specific format - sal_uIntPtr nOnlyTestFormat = 0 ); + sal_uLong nOnlyTestFormat = 0 ); static sal_uInt16 IsChart( const SvGlobalName& rName ); static sal_uInt16 IsMath( const SvGlobalName& rName ); diff --git a/sot/inc/sot/filelist.hxx b/sot/inc/sot/filelist.hxx index fc04e92cb3d7..4db3e4866817 100644 --- a/sot/inc/sot/filelist.hxx +++ b/sot/inc/sot/filelist.hxx @@ -62,13 +62,13 @@ public: SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList ); // Clipboard, D&D usw. - static sal_uIntPtr GetFormat(); + static sal_uLong GetFormat(); // Liste fuellen/abfragen void AppendFile( const String& rStr ); - String GetFile( sal_uIntPtr i ) const; - sal_uIntPtr Count( void ) const; + String GetFile( sal_uLong i ) const; + sal_uLong Count( void ) const; }; diff --git a/sot/inc/sot/formats.hxx b/sot/inc/sot/formats.hxx index 8a61884c88e7..303afecb5a17 100644 --- a/sot/inc/sot/formats.hxx +++ b/sot/inc/sot/formats.hxx @@ -46,145 +46,145 @@ #endif #include -#define SOT_FORMAT_SYSTEM_START ((sal_uIntPtr)0) -#define SOT_FORMAT_STRING ((sal_uIntPtr)FORMAT_STRING) -#define SOT_FORMAT_BITMAP ((sal_uIntPtr)FORMAT_BITMAP) -#define SOT_FORMAT_GDIMETAFILE ((sal_uIntPtr)FORMAT_GDIMETAFILE) -#define SOT_FORMAT_PRIVATE ((sal_uIntPtr)FORMAT_PRIVATE) -#define SOT_FORMAT_FILE ((sal_uIntPtr)FORMAT_FILE) -#define SOT_FORMAT_FILE_LIST ((sal_uIntPtr)FORMAT_FILE_LIST) -#define SOT_FORMAT_RTF ((sal_uIntPtr)FORMAT_RTF) +#define SOT_FORMAT_SYSTEM_START ((sal_uLong)0) +#define SOT_FORMAT_STRING ((sal_uLong)FORMAT_STRING) +#define SOT_FORMAT_BITMAP ((sal_uLong)FORMAT_BITMAP) +#define SOT_FORMAT_GDIMETAFILE ((sal_uLong)FORMAT_GDIMETAFILE) +#define SOT_FORMAT_PRIVATE ((sal_uLong)FORMAT_PRIVATE) +#define SOT_FORMAT_FILE ((sal_uLong)FORMAT_FILE) +#define SOT_FORMAT_FILE_LIST ((sal_uLong)FORMAT_FILE_LIST) +#define SOT_FORMAT_RTF ((sal_uLong)FORMAT_RTF) -#define SOT_FORMATSTR_ID_DRAWING ((sal_uIntPtr)11) -#define SOT_FORMATSTR_ID_SVXB ((sal_uIntPtr)12) -#define SOT_FORMATSTR_ID_SVIM ((sal_uIntPtr)13) -#define SOT_FORMATSTR_ID_XFA ((sal_uIntPtr)14) -#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uIntPtr)15) -#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uIntPtr)16) -#define SOT_FORMATSTR_ID_SOLK ((sal_uIntPtr)17) -#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uIntPtr)18) -#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uIntPtr)19) -#define SOT_FORMATSTR_ID_NATIVE ((sal_uIntPtr)20) -#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uIntPtr)21) -#define SOT_FORMATSTR_ID_STARSERVER ((sal_uIntPtr)22) -#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uIntPtr)23) -#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uIntPtr)24) -#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uIntPtr)25) -#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uIntPtr)26) -#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uIntPtr)27) -#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uIntPtr)28) -#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uIntPtr)29) -#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uIntPtr)30) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uIntPtr)31) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uIntPtr)32) -#define SOT_FORMATSTR_ID_STARDRAW ((sal_uIntPtr)33) -#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uIntPtr)34) -#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uIntPtr)35) -#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uIntPtr)36) -#define SOT_FORMATSTR_ID_STARCALC ((sal_uIntPtr)37) -#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uIntPtr)38) -#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uIntPtr)39) -#define SOT_FORMATSTR_ID_STARCHART ((sal_uIntPtr)40) -#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uIntPtr)41) -#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uIntPtr)42) -#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uIntPtr)43) -#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uIntPtr)44) -#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uIntPtr)45) -#define SOT_FORMATSTR_ID_STARMATH ((sal_uIntPtr)46) -#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uIntPtr)47) -#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uIntPtr)48) -#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uIntPtr)49) -#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uIntPtr)50) -#define SOT_FORMATSTR_ID_HTML ((sal_uIntPtr)51) -#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uIntPtr)52) -#define SOT_FORMATSTR_ID_CHAOS ((sal_uIntPtr)53) -#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uIntPtr)54) -#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uIntPtr)55) -#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uIntPtr)56) -#define SOT_FORMATSTR_ID_SYLK ((sal_uIntPtr)57) -#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uIntPtr)58) -#define SOT_FORMATSTR_ID_LINK ((sal_uIntPtr)59) -#define SOT_FORMATSTR_ID_DIF ((sal_uIntPtr)60) -#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uIntPtr)61) -#define SOT_FORMATSTR_ID_SONLK ((sal_uIntPtr)62) -#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uIntPtr)63) -#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uIntPtr)64) -#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uIntPtr)65) -#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uIntPtr)66) -#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uIntPtr)67) -#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uIntPtr)68) -#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uIntPtr)69) -#define SOT_FORMATSTR_ID_EVDF ((sal_uIntPtr)70) -#define SOT_FORMATSTR_ID_ESDF ((sal_uIntPtr)71) -#define SOT_FORMATSTR_ID_IDF ((sal_uIntPtr)72) -#define SOT_FORMATSTR_ID_EFTP ((sal_uIntPtr)73) -#define SOT_FORMATSTR_ID_EFD ((sal_uIntPtr)74) -#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uIntPtr)75) -#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uIntPtr)76) -#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uIntPtr)77) -#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uIntPtr)78) -#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uIntPtr)79) -#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uIntPtr)80) -#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uIntPtr)81) -#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uIntPtr)82) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uIntPtr)83) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uIntPtr)84) -#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uIntPtr)85) -#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uIntPtr)86) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uIntPtr)87) -#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uIntPtr)88) -#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uIntPtr)89) -#define SOT_FORMATSTR_ID_FILENAME ((sal_uIntPtr)90) -#define SOT_FORMATSTR_ID_SD_OLE ((sal_uIntPtr)91) -#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uIntPtr)92) -#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uIntPtr)93) -#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uIntPtr)94) -#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uIntPtr)95) -#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uIntPtr)96) -#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uIntPtr)97) -#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uIntPtr)98) -#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uIntPtr)99) -#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uIntPtr)100) -#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uIntPtr)101) -#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uIntPtr)102) -#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uIntPtr)103) -#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uIntPtr)104) -#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uIntPtr)105) -#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uIntPtr)106) -#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uIntPtr)107) -#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uIntPtr)108) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uIntPtr)109) -#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uIntPtr)110) -#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uIntPtr)111) -#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uIntPtr)112) -#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uIntPtr)113) -#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uIntPtr)114) -#define SOT_FORMATSTR_ID_WMF ((sal_uIntPtr)115) -#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uIntPtr)116) -#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uIntPtr)117) -#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uIntPtr)118) -#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uIntPtr)119) -#define SOT_FORMATSTR_ID_EMF ((sal_uIntPtr)120) -#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uIntPtr)121) -#define SOT_FORMATSTR_ID_BMP ((sal_uIntPtr)122) -#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uIntPtr)123) -#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uIntPtr)124) -#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uIntPtr)125) -#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uIntPtr)126) -#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uIntPtr)127) -#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uIntPtr)128) -#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uIntPtr)129) -#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uIntPtr)130) -#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uIntPtr)131) -#define SOT_FORMATSTR_ID_XFORMS ((sal_uIntPtr)132) -#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uIntPtr)133) -#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uIntPtr)134) -#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uIntPtr)135) -#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uIntPtr)136) -#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uIntPtr)137) -#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uIntPtr)138) -#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uIntPtr)139) -#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uIntPtr)140) +#define SOT_FORMATSTR_ID_DRAWING ((sal_uLong)11) +#define SOT_FORMATSTR_ID_SVXB ((sal_uLong)12) +#define SOT_FORMATSTR_ID_SVIM ((sal_uLong)13) +#define SOT_FORMATSTR_ID_XFA ((sal_uLong)14) +#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uLong)15) +#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uLong)16) +#define SOT_FORMATSTR_ID_SOLK ((sal_uLong)17) +#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uLong)18) +#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uLong)19) +#define SOT_FORMATSTR_ID_NATIVE ((sal_uLong)20) +#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uLong)21) +#define SOT_FORMATSTR_ID_STARSERVER ((sal_uLong)22) +#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uLong)23) +#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uLong)24) +#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uLong)25) +#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uLong)26) +#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uLong)27) +#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uLong)28) +#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uLong)29) +#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uLong)30) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uLong)31) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uLong)32) +#define SOT_FORMATSTR_ID_STARDRAW ((sal_uLong)33) +#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uLong)34) +#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uLong)35) +#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uLong)36) +#define SOT_FORMATSTR_ID_STARCALC ((sal_uLong)37) +#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uLong)38) +#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uLong)39) +#define SOT_FORMATSTR_ID_STARCHART ((sal_uLong)40) +#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uLong)41) +#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uLong)42) +#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uLong)43) +#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uLong)44) +#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uLong)45) +#define SOT_FORMATSTR_ID_STARMATH ((sal_uLong)46) +#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uLong)47) +#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uLong)48) +#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uLong)49) +#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uLong)50) +#define SOT_FORMATSTR_ID_HTML ((sal_uLong)51) +#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uLong)52) +#define SOT_FORMATSTR_ID_CHAOS ((sal_uLong)53) +#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uLong)54) +#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uLong)55) +#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uLong)56) +#define SOT_FORMATSTR_ID_SYLK ((sal_uLong)57) +#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uLong)58) +#define SOT_FORMATSTR_ID_LINK ((sal_uLong)59) +#define SOT_FORMATSTR_ID_DIF ((sal_uLong)60) +#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uLong)61) +#define SOT_FORMATSTR_ID_SONLK ((sal_uLong)62) +#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uLong)63) +#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uLong)64) +#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uLong)65) +#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uLong)66) +#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uLong)67) +#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uLong)68) +#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uLong)69) +#define SOT_FORMATSTR_ID_EVDF ((sal_uLong)70) +#define SOT_FORMATSTR_ID_ESDF ((sal_uLong)71) +#define SOT_FORMATSTR_ID_IDF ((sal_uLong)72) +#define SOT_FORMATSTR_ID_EFTP ((sal_uLong)73) +#define SOT_FORMATSTR_ID_EFD ((sal_uLong)74) +#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uLong)75) +#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uLong)76) +#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uLong)77) +#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uLong)78) +#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uLong)79) +#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uLong)80) +#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uLong)81) +#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uLong)82) +#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uLong)83) +#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uLong)84) +#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uLong)85) +#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uLong)86) +#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uLong)87) +#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uLong)88) +#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uLong)89) +#define SOT_FORMATSTR_ID_FILENAME ((sal_uLong)90) +#define SOT_FORMATSTR_ID_SD_OLE ((sal_uLong)91) +#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uLong)92) +#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uLong)93) +#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uLong)94) +#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uLong)95) +#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uLong)96) +#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uLong)97) +#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uLong)98) +#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uLong)99) +#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uLong)100) +#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uLong)101) +#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uLong)102) +#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uLong)103) +#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uLong)104) +#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uLong)105) +#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uLong)106) +#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uLong)107) +#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uLong)108) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uLong)109) +#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uLong)110) +#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uLong)111) +#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uLong)112) +#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uLong)113) +#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uLong)114) +#define SOT_FORMATSTR_ID_WMF ((sal_uLong)115) +#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uLong)116) +#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uLong)117) +#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uLong)118) +#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uLong)119) +#define SOT_FORMATSTR_ID_EMF ((sal_uLong)120) +#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uLong)121) +#define SOT_FORMATSTR_ID_BMP ((sal_uLong)122) +#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uLong)123) +#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uLong)124) +#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uLong)125) +#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uLong)126) +#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uLong)127) +#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uLong)128) +#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uLong)129) +#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uLong)130) +#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uLong)131) +#define SOT_FORMATSTR_ID_XFORMS ((sal_uLong)132) +#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uLong)133) +#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uLong)134) +#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uLong)135) +#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uLong)136) +#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uLong)137) +#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uLong)138) +#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uLong)139) +#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uLong)140) #define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_HC_GDIMETAFILE #endif // _SOT_FORMATS_HXX diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx index 5b6cedfbf410..163f6932d66d 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -395,7 +395,7 @@ friend class SvObject; bInClose:1; // sal_True, im DoClose void * DownAggCast( const SotFactory * pFact ); - void RemoveInterface( sal_uIntPtr ); + void RemoveInterface( sal_uLong ); void RemoveInterface( SotObject * ); #if defined (GCC) && (defined (C281) || defined (C290) || defined (C291)) public: diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx index b4f13b8d2660..630c7d6a4a0f 100644 --- a/sot/inc/sot/stg.hxx +++ b/sot/inc/sot/stg.hxx @@ -73,7 +73,7 @@ struct ClsId class SOT_DLLPUBLIC StorageBase : public SvRefBase { protected: - sal_uIntPtr m_nError; // error code + sal_uLong m_nError; // error code StreamMode m_nMode; // open mode sal_Bool m_bAutoCommit; StorageBase(); @@ -84,8 +84,8 @@ public: virtual sal_Bool Validate( sal_Bool=sal_False ) const = 0; virtual sal_Bool ValidateMode( StreamMode ) const = 0; void ResetError() const; - void SetError( sal_uIntPtr ) const; - sal_uIntPtr GetError() const; + void SetError( sal_uLong ) const; + sal_uLong GetError() const; sal_Bool Good() const { return sal_Bool( m_nError == SVSTREAM_OK ); } StreamMode GetMode() const { return m_nMode; } void SetAutoCommit( sal_Bool bSet ) @@ -96,12 +96,12 @@ class BaseStorageStream : public StorageBase { public: TYPEINFO(); - virtual sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ) = 0; - virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ) = 0; - virtual sal_uIntPtr Seek( sal_uIntPtr nPos ) = 0; - virtual sal_uIntPtr Tell() = 0; + virtual sal_uLong Read( void * pData, sal_uLong nSize ) = 0; + virtual sal_uLong Write( const void* pData, sal_uLong nSize ) = 0; + virtual sal_uLong Seek( sal_uLong nPos ) = 0; + virtual sal_uLong Tell() = 0; virtual void Flush() = 0; - virtual sal_Bool SetSize( sal_uIntPtr nNewSize ) = 0; + virtual sal_Bool SetSize( sal_uLong nNewSize ) = 0; virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ) = 0; virtual sal_Bool Commit() = 0; virtual sal_Bool Revert() = 0; @@ -119,13 +119,13 @@ public: virtual const ClsId& GetClassId() const = 0; virtual void SetDirty() = 0; virtual void SetClass( const SvGlobalName & rClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) = 0; virtual SvGlobalName GetClassName() = 0; - virtual sal_uIntPtr GetFormat() = 0; + virtual sal_uLong GetFormat() = 0; virtual String GetUserName() = 0; virtual sal_Bool ShouldConvert() = 0; virtual void FillInfoList( SvStorageInfoList* ) const = 0; @@ -172,18 +172,18 @@ public: class StorageStream : public BaseStorageStream, public OLEStorageBase { //friend class Storage; - sal_uIntPtr nPos; // current position + sal_uLong nPos; // current position protected: ~StorageStream(); public: TYPEINFO(); StorageStream( StgIo*, StgDirEntry*, StreamMode ); - virtual sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr Seek( sal_uIntPtr nPos ); - virtual sal_uIntPtr Tell() { return nPos; } + virtual sal_uLong Read( void * pData, sal_uLong nSize ); + virtual sal_uLong Write( const void* pData, sal_uLong nSize ); + virtual sal_uLong Seek( sal_uLong nPos ); + virtual sal_uLong Tell() { return nPos; } virtual void Flush(); - virtual sal_Bool SetSize( sal_uIntPtr nNewSize ); + virtual sal_Bool SetSize( sal_uLong nNewSize ); virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); virtual sal_Bool Commit(); virtual sal_Bool Revert(); @@ -219,13 +219,13 @@ public: virtual const ClsId& GetClassId() const; virtual void SetDirty(); virtual void SetClass( const SvGlobalName & rClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual sal_uIntPtr GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); virtual sal_Bool ShouldConvert(); virtual void FillInfoList( SvStorageInfoList* ) const; @@ -274,12 +274,12 @@ public: UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress ); UCBStorageStream( UCBStorageStream_Impl* ); - virtual sal_uIntPtr Read( void * pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr Write( const void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr Seek( sal_uIntPtr nPos ); - virtual sal_uIntPtr Tell(); + virtual sal_uLong Read( void * pData, sal_uLong nSize ); + virtual sal_uLong Write( const void* pData, sal_uLong nSize ); + virtual sal_uLong Seek( sal_uLong nPos ); + virtual sal_uLong Tell(); virtual void Flush(); - virtual sal_Bool SetSize( sal_uIntPtr nNewSize ); + virtual sal_Bool SetSize( sal_uLong nNewSize ); virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); virtual sal_Bool Commit(); virtual sal_Bool Revert(); @@ -339,13 +339,13 @@ public: virtual const ClsId& GetClassId() const; virtual void SetDirty(); virtual void SetClass( const SvGlobalName & rClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName(); - virtual sal_uIntPtr GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); virtual sal_Bool ShouldConvert(); virtual void FillInfoList( SvStorageInfoList* ) const; diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index ccfeae4d9193..3c253fd80d1e 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -71,9 +71,9 @@ friend class SotStorage; friend class ImpStream; BaseStorageStream * pOwnStm;// Zeiger auf den eigenen Stream protected: - virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); + virtual sal_uLong GetData( void* pData, sal_uLong nSize ); + virtual sal_uLong PutData( const void* pData, sal_uLong nSize ); + virtual sal_uLong SeekPos( sal_uLong nPos ); virtual void FlushData(); ~SotStorageStream(); public: @@ -91,7 +91,7 @@ public: virtual void ResetError(); - virtual void SetSize( sal_uIntPtr nNewSize ); + virtual void SetSize( sal_uLong nNewSize ); sal_uInt32 GetSize() const; sal_Bool CopyTo( SotStorageStream * pDestStm ); virtual sal_Bool Commit(); @@ -125,7 +125,7 @@ friend class ::binfilter::SvStorage; BaseStorage * m_pTmpStg; // Temp-Storage fuer Transacted, nur auf diesem schreiben! ??? Useless ??? BaseStorage * m_pOwnStg; // Zielstorage SvStream * m_pStorStm; // nur fuer SDSTORAGES - sal_uIntPtr m_nError; + sal_uLong m_nError; String m_aName; // Name des Storage sal_Bool m_bIsRoot:1, // z.B.: File-Storage m_bDelStm:1; @@ -175,9 +175,9 @@ public: return m_nVersion; } - sal_uIntPtr GetErrorCode() const { return m_nError; } - sal_uIntPtr GetError() const { return ERRCODE_TOERROR(m_nError); } - void SetError( sal_uIntPtr nErrorCode ) + sal_uLong GetErrorCode() const { return m_nError; } + sal_uLong GetError() const { return ERRCODE_TOERROR(m_nError); } + void SetError( sal_uLong nErrorCode ) { if( m_nError == SVSTREAM_OK ) m_nError = nErrorCode; @@ -190,13 +190,13 @@ public: // eigener Datenbereich virtual void SetClass( const SvGlobalName & rClass, - sal_uIntPtr bOriginalClipFormat, + sal_uLong bOriginalClipFormat, const String & rUserTypeName ); virtual void SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr bOriginalClipFormat, + sal_uLong bOriginalClipFormat, const String & rUserTypeName ); virtual SvGlobalName GetClassName();// Typ der Daten im Storage - virtual sal_uIntPtr GetFormat(); + virtual sal_uLong GetFormat(); virtual String GetUserName(); virtual sal_Bool ShouldConvert(); void SetName( const String& rName ); diff --git a/sot/inc/sot/storinfo.hxx b/sot/inc/sot/storinfo.hxx index 5f225c26d0de..02db24529129 100644 --- a/sot/inc/sot/storinfo.hxx +++ b/sot/inc/sot/storinfo.hxx @@ -39,14 +39,14 @@ class SvStorageInfo friend class SvStorage; String aName; SvGlobalName aClassName; - sal_uIntPtr nSize; + sal_uLong nSize; sal_Bool bStream:1, bStorage:1; SvStorageInfo(){}; // Fuer SvStorage public: SvStorageInfo( const StgDirEntry& ); - SvStorageInfo( const String& rName, sal_uIntPtr nSz, sal_Bool bIsStorage ) + SvStorageInfo( const String& rName, sal_uLong nSz, sal_Bool bIsStorage ) : aName( rName ) , nSize( nSz ) , bStream( !bIsStorage ) @@ -57,7 +57,7 @@ public: const String & GetName() const { return aName; } sal_Bool IsStream() const { return bStream; } sal_Bool IsStorage() const { return bStorage; } - sal_uIntPtr GetSize() const { return nSize; } + sal_uLong GetSize() const { return nSize; } }; class SOT_DLLPUBLIC SvStorageInfoList @@ -66,7 +66,7 @@ class SOT_DLLPUBLIC SvStorageInfoList const SvStorageInfo * Get( const String & rName ); }; -SOT_DLLPUBLIC sal_uIntPtr ReadClipboardFormat( SvStream & rStm ); -SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uIntPtr nFormat ); +SOT_DLLPUBLIC sal_uLong ReadClipboardFormat( SvStream & rStm ); +SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ); #endif // _STORINFO_HXX diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index ec45c757c369..57e65862aea2 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -237,11 +237,11 @@ static List& InitFormats_Impl() |* |* Beschreibung CLIP.SDW *************************************************************************/ -sal_uIntPtr SotExchange::RegisterFormatName( const String& rName ) +sal_uLong SotExchange::RegisterFormatName( const String& rName ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); // teste zuerst die Standard - Name - sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; + sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( COMPARE_EQUAL == rName.CompareToAscii( pFormatArray_Impl[ i ].pName ) ) return i; @@ -277,11 +277,11 @@ sal_uIntPtr SotExchange::RegisterFormatName( const String& rName ) return nMax + SOT_FORMATSTR_ID_USER_END + 1; } -sal_uIntPtr SotExchange::RegisterFormatMimeType( const String& rMimeType ) +sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); // teste zuerst die Standard - Name - sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; + sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) return i; @@ -318,9 +318,9 @@ sal_uIntPtr SotExchange::RegisterFormatMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -sal_uIntPtr SotExchange::RegisterFormat( const DataFlavor& rFlavor ) +sal_uLong SotExchange::RegisterFormat( const DataFlavor& rFlavor ) { - sal_uIntPtr nRet = GetFormat( rFlavor ); + sal_uLong nRet = GetFormat( rFlavor ); if( !nRet ) { @@ -338,7 +338,7 @@ sal_uIntPtr SotExchange::RegisterFormat( const DataFlavor& rFlavor ) |* *************************************************************************/ -sal_Bool SotExchange::GetFormatDataFlavor( sal_uIntPtr nFormat, DataFlavor& rFlavor ) +sal_Bool SotExchange::GetFormatDataFlavor( sal_uLong nFormat, DataFlavor& rFlavor ) { sal_Bool bRet; @@ -376,11 +376,11 @@ sal_Bool SotExchange::GetFormatDataFlavor( sal_uIntPtr nFormat, DataFlavor& rFla /************************************************************************* |* -|* SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) +|* SotExchange::GetFormatMimeType( sal_uLong nFormat ) |* *************************************************************************/ -String SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) +String SotExchange::GetFormatMimeType( sal_uLong nFormat ) { String sMimeType; if( SOT_FORMATSTR_ID_USER_END >= nFormat ) @@ -406,10 +406,10 @@ String SotExchange::GetFormatMimeType( sal_uIntPtr nFormat ) |* *************************************************************************/ -sal_uIntPtr SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) +sal_uLong SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) { const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); - sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; + sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) return i; @@ -443,12 +443,12 @@ sal_uIntPtr SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -sal_uIntPtr SotExchange::GetFormat( const DataFlavor& rFlavor ) +sal_uLong SotExchange::GetFormat( const DataFlavor& rFlavor ) { // teste zuerst die Standard - Name const ::rtl::OUString& rMimeType = rFlavor.MimeType; const String aMimeType( rMimeType ); - sal_uIntPtr i, nMax = SOT_FORMAT_FILE_LIST; + sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) if( aMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) @@ -482,7 +482,7 @@ sal_uIntPtr SotExchange::GetFormat( const DataFlavor& rFlavor ) |* |* Beschreibung CLIP.SDW *************************************************************************/ -String SotExchange::GetFormatName( sal_uIntPtr nFormat ) +String SotExchange::GetFormatName( sal_uLong nFormat ) { DataFlavor aFlavor; String aRet; diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index 3b71382906ca..44e138f7aa1f 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -129,7 +129,7 @@ void SotFactory::DeInit() if( pSotData->pDataFlavorList ) { - for( sal_uIntPtr i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ ) + for( sal_uLong i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ ) delete (::com::sun::star::datatransfer::DataFlavor*) pSotData->pDataFlavorList->GetObject( i ); delete pSotData->pDataFlavorList; pSotData->pDataFlavorList = NULL; @@ -295,8 +295,8 @@ void SotFactory::TestInvariant() SotData_Impl * pSotData = SOTDATA(); if( pSotData->pObjectList ) { - sal_uIntPtr nCount = pSotData->pObjectList->Count(); - for( sal_uIntPtr i = 0; i < nCount ; i++ ) + sal_uLong nCount = pSotData->pObjectList->Count(); + for( sal_uLong i = 0; i < nCount ; i++ ) { pSotData->pObjectList->GetObject( i )->TestInvariant( sal_False ); } diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx index 5be0b01e8de6..345e6ddec84b 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -61,8 +61,8 @@ FileList::~FileList() void FileList::ClearAll( void ) { // Strings in der Liste loeschen - sal_uIntPtr nCount = pStrList->Count(); - for( sal_uIntPtr i = 0 ; i < nCount ; i++ ) + sal_uLong nCount = pStrList->Count(); + for( sal_uLong i = 0 ; i < nCount ; i++ ) delete pStrList->GetObject( i ); // Liste loeschen @@ -81,8 +81,8 @@ FileList& FileList::operator=( const FileList& rFileList ) *pStrList = *rFileList.pStrList; // Strings in der Liste kopieren - sal_uIntPtr nCount = pStrList->Count(); - for( sal_uIntPtr i = 0 ; i < nCount ; i++ ) + sal_uLong nCount = pStrList->Count(); + for( sal_uLong i = 0 ; i < nCount ; i++ ) pStrList->Replace( new String( *rFileList.pStrList->GetObject( i ) ), i ); return *this; @@ -94,7 +94,7 @@ FileList& FileList::operator=( const FileList& rFileList ) |* \*************************************************************************/ -sal_uIntPtr FileList::GetFormat() +sal_uLong FileList::GetFormat() { return FORMAT_FILE_LIST; } @@ -184,7 +184,7 @@ void FileList::AppendFile( const String& rStr ) pStrList->Insert( new String( rStr ) , pStrList->Count() ); } -String FileList::GetFile( sal_uIntPtr i ) const +String FileList::GetFile( sal_uLong i ) const { String aStr; if( i < pStrList->Count() ) @@ -192,7 +192,7 @@ String FileList::GetFile( sal_uIntPtr i ) const return aStr; } -sal_uIntPtr FileList::Count( void ) const +sal_uLong FileList::Count( void ) const { return pStrList->Count(); } diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index 81deb8e90112..f04d5d439bdc 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -46,7 +46,7 @@ using namespace::com::sun::star::datatransfer; struct SotAction_Impl { - sal_uIntPtr nFormatId; // Clipboard Id + sal_uLong nFormatId; // Clipboard Id sal_uInt16 nAction; // Action Id sal_uInt8 nContextCheckId; // additional check of content in clipboard }; @@ -1283,7 +1283,7 @@ static SotDestinationEntry_Impl __READONLY_DATA aDestinationArray[] = \ // - new style GetExchange methods - // --------------------------------- -sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_uIntPtr nId ) +sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_uLong nId ) { DataFlavorExVector::iterator aIter( ( (DataFlavorExVector&) rDataFlavorExVector ).begin() ); DataFlavorExVector::iterator aEnd( ( (DataFlavorExVector&) rDataFlavorExVector ).end() ); @@ -1370,8 +1370,8 @@ rEntry static sal_uInt16 GetTransferableAction_Impl( const DataFlavorExVector& rDataFlavorExVector, const SotAction_Impl* pArray, - sal_uIntPtr& rFormat, - sal_uIntPtr nOnlyTestFormat, + sal_uLong& rFormat, + sal_uLong nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { try @@ -1380,11 +1380,11 @@ static sal_uInt16 GetTransferableAction_Impl( { DataFlavor aFlavor; const SotAction_Impl* pArrayStart = pArray; - sal_uIntPtr nId = pArray->nFormatId; + sal_uLong nId = pArray->nFormatId; #if OSL_DEBUG_LEVEL > 1 // used for testing a specific format - change in the debugger the value - static sal_uIntPtr nChkFormat = 0; + static sal_uLong nChkFormat = 0; if( nChkFormat ) { for( ; 0xffff != pArray->nFormatId && @@ -1458,9 +1458,9 @@ sal_uInt16 SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavor sal_uInt16 nDestination, sal_uInt16 nSourceOptions, sal_uInt16 nUserAction, - sal_uIntPtr& rFormat, + sal_uLong& rFormat, sal_uInt16& rDefaultAction, - sal_uIntPtr nOnlyTestFormat, + sal_uLong nOnlyTestFormat, const Reference< XTransferable >* pxTransferable ) { // hier wird jetzt die oben definierte Tabelle "implementiert" @@ -1571,8 +1571,8 @@ sal_uInt16 SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavor sal_uInt16 SotExchange::GetExchangeAction( const Reference< XTransferable >& rxTransferable, sal_uInt16 nDestination, sal_uInt16 nSourceOptions, - sal_uInt16 nUserAction, sal_uIntPtr& rFormat, - sal_uInt16& rDefaultAction, sal_uIntPtr nOnlyTestFormat ) + sal_uInt16 nUserAction, sal_uLong& rFormat, + sal_uInt16& rDefaultAction, sal_uLong nOnlyTestFormat ) { DataFlavorExVector aVector; diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 5ac3f7f45d87..d7530163d0b5 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -151,7 +151,7 @@ sal_Bool SotObject::ShouldDelete() return sal_False; } - sal_uIntPtr i; + sal_uLong i; for( i = 1; i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); @@ -212,7 +212,7 @@ SvAggregateMemberList & SotObject::GetAggList() |* |* Beschreibung *************************************************************************/ -void SotObject::RemoveInterface( sal_uIntPtr nPos ) +void SotObject::RemoveInterface( sal_uLong nPos ) { SvAggregate & rAgg = pAggList->GetObject( nPos ); if( !rAgg.bFactory ) @@ -238,7 +238,7 @@ void SotObject::RemoveInterface( SotObject * pObjP ) { DBG_ASSERT( pObjP, "null pointer" ); DBG_ASSERT( pAggList, "no aggregation list" ); - sal_uIntPtr i; + sal_uLong i; for( i = 0; i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); @@ -298,7 +298,7 @@ void * SotObject::DownAggCast( const SotFactory * pFact ) // geht den Pfad nur Richtung aggregierte Objekte if( pAggList ) { - for( sal_uIntPtr i = 1; !pCast || i < pAggList->Count(); i++ ) + for( sal_uLong i = 1; !pCast || i < pAggList->Count(); i++ ) { SvAggregate & rAgg = pAggList->GetObject( i ); if( rAgg.bFactory ) diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index f1f51f20343b..bf1490447b08 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -79,14 +79,14 @@ StorageBase::~StorageBase() // The following three methods are declared as const, since they // may be called from within a const method. -sal_uIntPtr StorageBase::GetError() const +sal_uLong StorageBase::GetError() const { - sal_uIntPtr n = m_nError; + sal_uLong n = m_nError; ((StorageBase*) this)->m_nError = SVSTREAM_OK; return n; } -void StorageBase::SetError( sal_uIntPtr n ) const +void StorageBase::SetError( sal_uLong n ) const { if( !m_nError ) ((StorageBase*) this)->m_nError = n; @@ -205,7 +205,7 @@ sal_Bool StorageStream::Equals( const BaseStorageStream& rStream ) const return pOther && ( pOther->pEntry == pEntry ); } -sal_uIntPtr StorageStream::Read( void* pData, sal_uIntPtr nSize ) +sal_uLong StorageStream::Read( void* pData, sal_uLong nSize ) { if( Validate() ) { @@ -219,7 +219,7 @@ sal_uIntPtr StorageStream::Read( void* pData, sal_uIntPtr nSize ) return nSize; } -sal_uIntPtr StorageStream::Write( const void* pData, sal_uIntPtr nSize ) +sal_uLong StorageStream::Write( const void* pData, sal_uLong nSize ) { if( Validate( sal_True ) ) { @@ -233,7 +233,7 @@ sal_uIntPtr StorageStream::Write( const void* pData, sal_uIntPtr nSize ) return nSize; } -sal_uIntPtr StorageStream::Seek( sal_uIntPtr n ) +sal_uLong StorageStream::Seek( sal_uLong n ) { if( Validate() ) return nPos = pEntry->Seek( n ); @@ -247,7 +247,7 @@ void StorageStream::Flush() Commit(); } -sal_Bool StorageStream::SetSize( sal_uIntPtr nNewSize ) +sal_Bool StorageStream::SetSize( sal_uLong nNewSize ) { if( Validate( sal_True ) ) { @@ -346,7 +346,7 @@ sal_Bool Storage::IsStorageFile( const String & rFileName ) sal_Bool Storage::IsStorageFile( SvStream* pStream ) { StgHeader aHdr; - sal_uIntPtr nPos = pStream->Tell(); + sal_uLong nPos = pStream->Tell(); sal_Bool bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); // It's not a stream error if it is too small for a OLE storage header @@ -401,7 +401,7 @@ Storage::Storage( SvStream& r, sal_Bool bDirect ) if( r.GetError() == SVSTREAM_OK ) { pIo->SetStrm( &r, sal_False ); - sal_uIntPtr nSize = r.Seek( STREAM_SEEK_TO_END ); + sal_uLong nSize = r.Seek( STREAM_SEEK_TO_END ); r.Seek( 0L ); // Initializing is OK if the stream is empty Init( sal_Bool( nSize == 0 ) ); @@ -446,7 +446,7 @@ Storage::Storage( UCBStorageStream& rStrm, sal_Bool bDirect ) pIo->SetStrm( &rStrm ); - sal_uIntPtr nSize = pStream->Seek( STREAM_SEEK_TO_END ); + sal_uLong nSize = pStream->Seek( STREAM_SEEK_TO_END ); pStream->Seek( 0L ); // Initializing is OK if the stream is empty Init( sal_Bool( nSize == 0 ) ); @@ -469,7 +469,7 @@ void Storage::Init( sal_Bool bCreate ) bIsRoot = sal_True; if( pIo->Good() ) { - sal_uIntPtr nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); + sal_uLong nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END ); pIo->GetStrm()->Seek( 0L ); if( nSize ) { @@ -743,7 +743,7 @@ sal_Bool Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& BaseStorage* p1 = OpenStorage( rElem, INTERNAL_MODE ); BaseStorage* p2 = pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); - sal_uIntPtr nTmpErr = p2->GetError(); + sal_uLong nTmpErr = p2->GetError(); if( !nTmpErr ) { p2->SetClassId( p1->GetClassId() ); @@ -769,7 +769,7 @@ sal_Bool Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& BaseStorageStream* p1 = OpenStream( rElem, INTERNAL_MODE ); BaseStorageStream* p2 = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect ); - sal_uIntPtr nTmpErr = p2->GetError(); + sal_uLong nTmpErr = p2->GetError(); if( !nTmpErr ) { p1->CopyTo( p2 ); @@ -855,7 +855,7 @@ sal_Bool Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String { pIo->MoveError( *this ); pDest->pIo->MoveError( *pDest ); - sal_uIntPtr nErr = GetError(); + sal_uLong nErr = GetError(); if( !nErr ) nErr = pDest->GetError(); SetError( nErr ); @@ -946,7 +946,7 @@ sal_Bool Storage::Revert() // Set the storage type void Storage::SetClass( const SvGlobalName & rClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { if( Validate( sal_True ) ) @@ -973,7 +973,7 @@ void Storage::SetClass( const SvGlobalName & rClass, } void Storage::SetConvertClass( const SvGlobalName & rConvertClass, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { if( Validate( sal_True ) ) @@ -1000,7 +1000,7 @@ SvGlobalName Storage::GetClassName() return SvGlobalName(); } -sal_uIntPtr Storage::GetFormat() +sal_uLong Storage::GetFormat() { StgCompObjStream aCompObj( *this, sal_False ); if( aCompObj.Load() ) diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index d0f0b0332482..5a0fde8b9cf1 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -105,7 +105,7 @@ void StgPage::SetPage( short nOff, sal_Int32 nVal ) // The disk cache holds the cached sectors. The sector type differ according // to their purpose. -sal_Int32 lcl_GetPageCount( sal_uIntPtr nFileSize, short nPageSize ) +sal_Int32 lcl_GetPageCount( sal_uLong nFileSize, short nPageSize ) { // return (nFileSize >= 512) ? (nFileSize - 512) / nPageSize : 0; // #i61980# reallife: last page may be incomplete, return number of *started* pages @@ -135,8 +135,8 @@ StgCache::~StgCache() void StgCache::SetPhysPageSize( short n ) { nPageSize = n; - sal_uIntPtr nPos = pStrm->Tell(); - sal_uIntPtr nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); + sal_uLong nPos = pStrm->Tell(); + sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); nPages = lcl_GetPageCount( nFileSize, nPageSize ); pStrm->Seek( nPos ); } @@ -397,7 +397,7 @@ sal_Bool StgCache::Open( const String& rName, StreamMode nMode ) SetStrm( pFileStrm, sal_True ); if( pFileStrm->IsOpen() ) { - sal_uIntPtr nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); + sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END ); nPages = lcl_GetPageCount( nFileSize, nPageSize ); pStrm->Seek( 0L ); } @@ -431,9 +431,9 @@ sal_Bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) SetError( SVSTREAM_READ_ERROR ); else if ( nPage < nPages ) { - sal_uIntPtr nPos = Page2Pos( nPage ); + sal_uLong nPos = Page2Pos( nPage ); sal_Int32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; - sal_uIntPtr nBytes = nPg2 * nPageSize; + sal_uLong nBytes = nPg2 * nPageSize; // fixed address and size for the header if( nPage == -1 ) { @@ -462,8 +462,8 @@ sal_Bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) { if( Good() ) { - sal_uIntPtr nPos = Page2Pos( nPage ); - sal_uIntPtr nBytes = nPg * nPageSize; + sal_uLong nPos = Page2Pos( nPage ); + sal_uLong nBytes = nPg * nPageSize; // fixed address and size for the header if( nPage == -1 ) nPos = 0L, nBytes = 512; @@ -475,7 +475,7 @@ sal_Bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) #endif } } - sal_uIntPtr nRes = pStrm->Write( pBuf, nBytes ); + sal_uLong nRes = pStrm->Write( pBuf, nBytes ); if( nRes != nBytes ) SetError( SVSTREAM_WRITE_ERROR ); else @@ -510,7 +510,7 @@ sal_Bool StgCache::SetSize( sal_Int32 n ) return Good(); } -void StgCache::SetError( sal_uIntPtr n ) +void StgCache::SetError( sal_uLong n ) { if( n && !nError ) nError = n; diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx index 0c1fc3eab1ff..d6849bdd4b3d 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -47,7 +47,7 @@ class StorageBase; class StgCache { StgPage* pCur; // top of LRU list StgPage* pElem1; // top of ordered list - sal_uIntPtr nError; // error code + sal_uLong nError; // error code sal_Int32 nPages; // size of data area in pages sal_uInt16 nRef; // reference count void * pLRUCache; // hash table of cached objects @@ -78,9 +78,9 @@ public: sal_Bool IsWritable() { return pStrm->IsWritable(); } sal_Bool Good() { return sal_Bool( nError == SVSTREAM_OK ); } sal_Bool Bad() { return sal_Bool( nError != SVSTREAM_OK ); } - sal_uIntPtr GetError() { return nError; } + sal_uLong GetError() { return nError; } void MoveError( StorageBase& ); - void SetError( sal_uIntPtr ); + void SetError( sal_uLong ); void ResetError(); sal_Bool Open( const String& rName, StreamMode ); void Close(); diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index 080a4aba5268..42676a9dd222 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -504,7 +504,7 @@ void StgDirEntry::Copy( BaseStorageStream& rDest ) sal_Int32 n = GetSize(); if( rDest.SetSize( n ) && n ) { - sal_uIntPtr Pos = rDest.Tell(); + sal_uLong Pos = rDest.Tell(); sal_uInt8 aTempBytes[ 4096 ]; void* p = static_cast( aTempBytes ); Seek( 0L ); @@ -618,7 +618,7 @@ sal_Bool StgDirEntry::Strm2Tmp() { if( !pTmpStrm ) { - sal_uIntPtr n = 0; + sal_uLong n = 0; if( pCurStrm ) { // It was already commited once @@ -640,10 +640,10 @@ sal_Bool StgDirEntry::Strm2Tmp() pStgStrm->Pos2Page( 0L ); while( n ) { - sal_uIntPtr nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; - if( (sal_uIntPtr) pStgStrm->Read( p, nn ) != nn ) + if( (sal_uLong) pStgStrm->Read( p, nn ) != nn ) break; if( pTmpStrm->Write( p, nn ) != nn ) break; @@ -676,10 +676,10 @@ sal_Bool StgDirEntry::Tmp2Strm() pTmpStrm = pCurStrm, pCurStrm = NULL; if( pTmpStrm ) { - sal_uIntPtr n = pTmpStrm->GetSize(); + sal_uLong n = pTmpStrm->GetSize(); StgStrm* pNewStrm; StgIo& rIo = pStgStrm->GetIo(); - sal_uIntPtr nThreshold = (sal_uIntPtr) rIo.aHdr.GetThreshold(); + sal_uLong nThreshold = (sal_uLong) rIo.aHdr.GetThreshold(); if( n < nThreshold ) pNewStrm = new StgSmallStrm( rIo, STG_EOF, 0 ); else @@ -690,12 +690,12 @@ sal_Bool StgDirEntry::Tmp2Strm() pTmpStrm->Seek( 0L ); while( n ) { - sal_uIntPtr nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; if( pTmpStrm->Read( p, nn ) != nn ) break; - if( (sal_uIntPtr) pNewStrm->Write( p, nn ) != nn ) + if( (sal_uLong) pNewStrm->Write( p, nn ) != nn ) break; n -= nn; } diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 54dbe1d43366..0a10192528c1 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -135,7 +135,7 @@ sal_Bool StgIo::CommitAll() if( aHdr.Store( *this ) ) { pStrm->Flush(); - sal_uIntPtr n = pStrm->GetError(); + sal_uLong n = pStrm->GetError(); SetError( n ); #ifdef DBG_UTIL if( n==0 ) ValidateFATs(); @@ -163,7 +163,7 @@ public: sal_Int32 Count() { return nPages; } sal_Int32 operator[]( sal_Int32 nOffset ) { return pFat[ nOffset ]; } - sal_uIntPtr Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ); + sal_uLong Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ); sal_Bool HasUnrefChains(); }; @@ -201,7 +201,7 @@ sal_Bool EasyFat::HasUnrefChains() return sal_False; } -sal_uIntPtr EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ) +sal_uLong EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ) { if( nCount > 0 ) --nCount /= GetPageSize(), nCount++; @@ -231,17 +231,17 @@ sal_uIntPtr EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect class Validator { - sal_uIntPtr nError; + sal_uLong nError; EasyFat aSmallFat; EasyFat aFat; StgIo &rIo; - sal_uIntPtr ValidateMasterFATs(); - sal_uIntPtr ValidateDirectoryEntries(); - sal_uIntPtr FindUnrefedChains(); - sal_uIntPtr MarkAll( StgDirEntry *pEntry ); + sal_uLong ValidateMasterFATs(); + sal_uLong ValidateDirectoryEntries(); + sal_uLong FindUnrefedChains(); + sal_uLong MarkAll( StgDirEntry *pEntry ); public: @@ -254,7 +254,7 @@ Validator::Validator( StgIo &rIoP ) aFat( rIoP, rIoP.pFAT, 1 << rIoP.aHdr.GetPageSize() ), rIo( rIoP ) { - sal_uIntPtr nErr = nError = FAT_OK; + sal_uLong nErr = nError = FAT_OK; if( ( nErr = ValidateMasterFATs() ) != FAT_OK ) nError = nErr; @@ -264,10 +264,10 @@ Validator::Validator( StgIo &rIoP ) nError = nErr; } -sal_uIntPtr Validator::ValidateMasterFATs() +sal_uLong Validator::ValidateMasterFATs() { sal_Int32 nCount = rIo.aHdr.GetFATSize(); - sal_uIntPtr nErr; + sal_uLong nErr; for( sal_Int32 i = 0; i < nCount; i++ ) { if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), sal_False ), aFat.GetPageSize(), -3 )) != FAT_OK ) @@ -279,10 +279,10 @@ sal_uIntPtr Validator::ValidateMasterFATs() return FAT_OK; } -sal_uIntPtr Validator::MarkAll( StgDirEntry *pEntry ) +sal_uLong Validator::MarkAll( StgDirEntry *pEntry ) { StgIterator aIter( *pEntry ); - sal_uIntPtr nErr = FAT_OK; + sal_uLong nErr = FAT_OK; for( StgDirEntry* p = aIter.First(); p ; p = aIter.Next() ) { if( p->aEntry.GetType() == STG_STORAGE ) @@ -305,10 +305,10 @@ sal_uIntPtr Validator::MarkAll( StgDirEntry *pEntry ) return FAT_OK; } -sal_uIntPtr Validator::ValidateDirectoryEntries() +sal_uLong Validator::ValidateDirectoryEntries() { // Normale DirEntries - sal_uIntPtr nErr = MarkAll( rIo.pTOC->GetRoot() ); + sal_uLong nErr = MarkAll( rIo.pTOC->GetRoot() ); if( nErr != FAT_OK ) return nErr; // Small Data @@ -328,7 +328,7 @@ sal_uIntPtr Validator::ValidateDirectoryEntries() return nErr; } -sal_uIntPtr Validator::FindUnrefedChains() +sal_uLong Validator::FindUnrefedChains() { if( aSmallFat.HasUnrefChains() || aFat.HasUnrefChains() ) @@ -349,7 +349,7 @@ const Link& StgIo::GetErrorLink() return ErrorLink::get(); } -sal_uIntPtr StgIo::ValidateFATs() +sal_uLong StgIo::ValidateFATs() { if( bFile ) { @@ -367,7 +367,7 @@ sal_uIntPtr StgIo::ValidateFATs() delete pV; } - sal_uIntPtr nErr; + sal_uLong nErr; if( bRet1 != bRet2 ) nErr = bRet1 ? FAT_ONFILEERROR : FAT_INMEMORYERROR; else nErr = bRet1 ? FAT_OK : FAT_BOTHERROR; diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx index 43f72ebefd59..45b1985618f1 100644 --- a/sot/source/sdstor/stgio.hxx +++ b/sot/source/sdstor/stgio.hxx @@ -53,7 +53,7 @@ enum FAT_ERROR struct StgLinkArg { String aFile; - sal_uIntPtr nErr; + sal_uLong nErr; }; class StgIo : public StgCache { @@ -74,7 +74,7 @@ public: static void SetErrorLink( const Link& ); static const Link& GetErrorLink(); - sal_uIntPtr ValidateFATs( ); + sal_uLong ValidateFATs( ); }; #endif diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 250e0bc4d12b..80481957b3d0 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -58,7 +58,7 @@ StgInternalStream::~StgInternalStream() delete pStrm; } -sal_uIntPtr StgInternalStream::GetData( void* pData, sal_uIntPtr nSize ) +sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize ) { if( pStrm ) { @@ -70,7 +70,7 @@ sal_uIntPtr StgInternalStream::GetData( void* pData, sal_uIntPtr nSize ) return 0; } -sal_uIntPtr StgInternalStream::PutData( const void* pData, sal_uIntPtr nSize ) +sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize ) { if( pStrm ) { @@ -82,7 +82,7 @@ sal_uIntPtr StgInternalStream::PutData( const void* pData, sal_uIntPtr nSize ) return 0; } -sal_uIntPtr StgInternalStream::SeekPos( sal_uIntPtr nPos ) +sal_uLong StgInternalStream::SeekPos( sal_uLong nPos ) { return pStrm ? pStrm->Seek( nPos ) : 0; } @@ -129,7 +129,7 @@ sal_Bool StgCompObjStream::Load() // higher bits are ignored nLen1 &= 0xFFFF; sal_Char* p = new sal_Char[ (sal_uInt16) nLen1 ]; - if( Read( p, nLen1 ) == (sal_uIntPtr) nLen1 ) + if( Read( p, nLen1 ) == (sal_uLong) nLen1 ) { aUserName = nLen1 ? String( p, gsl_getSystemTextEncoding() ) : String(); /* // Now we can read the CB format @@ -140,7 +140,7 @@ sal_Bool StgCompObjStream::Load() // get a string name if( nLen2 > nLen1 ) delete p, p = new char[ nLen2 ]; - if( Read( p, nLen2 ) == (sal_uIntPtr) nLen2 && nLen2 ) + if( Read( p, nLen2 ) == (sal_uLong) nLen2 && nLen2 ) nCbFormat = Exchange::RegisterFormatName( String( p ) ); else SetError( SVSTREAM_GENERALERROR ); diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 5448bd3b6f9c..4f3901f5212b 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -36,9 +36,9 @@ class StgInternalStream : public SvStream { BaseStorageStream* pStrm; - virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); + virtual sal_uLong GetData( void* pData, sal_uLong nSize ); + virtual sal_uLong PutData( const void* pData, sal_uLong nSize ); + virtual sal_uLong SeekPos( sal_uLong nPos ); virtual void FlushData(); public: StgInternalStream( BaseStorage&, const String&, sal_Bool ); @@ -52,12 +52,12 @@ class StgCompObjStream : public StgInternalStream { ClsId aClsId; String aUserName; - sal_uIntPtr nCbFormat; + sal_uLong nCbFormat; public: StgCompObjStream( BaseStorage&, sal_Bool ); ClsId& GetClsId() { return aClsId; } String& GetUserName() { return aUserName; } - sal_uIntPtr& GetCbFormat() { return nCbFormat; } + sal_uLong& GetCbFormat() { return nCbFormat; } sal_Bool Load(); sal_Bool Store(); }; diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index a47695fc14d7..b3a775417817 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1043,7 +1043,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) #define THRESHOLD 32768L -StgTmpStrm::StgTmpStrm( sal_uIntPtr nInitSize ) +StgTmpStrm::StgTmpStrm( sal_uLong nInitSize ) : SvMemoryStream( nInitSize > THRESHOLD ? 16 : ( nInitSize ? nInitSize : 16 ), 4096 ) @@ -1057,8 +1057,8 @@ StgTmpStrm::StgTmpStrm( sal_uIntPtr nInitSize ) sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) { - sal_uIntPtr n = rSrc.GetSize(); - sal_uIntPtr nCur = rSrc.Tell(); + sal_uLong n = rSrc.GetSize(); + sal_uLong nCur = rSrc.Tell(); SetSize( n ); if( GetError() == SVSTREAM_OK ) { @@ -1067,7 +1067,7 @@ sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) Seek( 0L ); while( n ) { - sal_uIntPtr nn = n; + sal_uLong nn = n; if( nn > 4096 ) nn = 4096; if( rSrc.Read( p, nn ) != nn ) @@ -1095,12 +1095,12 @@ StgTmpStrm::~StgTmpStrm() } } -sal_uIntPtr StgTmpStrm::GetSize() const +sal_uLong StgTmpStrm::GetSize() const { - sal_uIntPtr n; + sal_uLong n; if( pStrm ) { - sal_uIntPtr old = pStrm->Tell(); + sal_uLong old = pStrm->Tell(); n = pStrm->Seek( STREAM_SEEK_TO_END ); pStrm->Seek( old ); } @@ -1109,7 +1109,7 @@ sal_uIntPtr StgTmpStrm::GetSize() const return n; } -void StgTmpStrm::SetSize( sal_uIntPtr n ) +void StgTmpStrm::SetSize( sal_uLong n ) { if( pStrm ) pStrm->SetStreamSize( n ); @@ -1119,15 +1119,15 @@ void StgTmpStrm::SetSize( sal_uIntPtr n ) { aName = TempFile::CreateTempName(); SvFileStream* s = new SvFileStream( aName, STREAM_READWRITE ); - sal_uIntPtr nCur = Tell(); - sal_uIntPtr i = nEndOfData; + sal_uLong nCur = Tell(); + sal_uLong i = nEndOfData; if( i ) { sal_uInt8* p = new sal_uInt8[ 4096 ]; Seek( 0L ); while( i ) { - sal_uIntPtr nb = ( i > 4096 ) ? 4096 : i; + sal_uLong nb = ( i > 4096 ) ? 4096 : i; if( Read( p, nb ) == nb && s->Write( p, nb ) == nb ) i -= nb; @@ -1163,7 +1163,7 @@ void StgTmpStrm::SetSize( sal_uIntPtr n ) { if( n > nEndOfData ) { - sal_uIntPtr nCur = Tell(); + sal_uLong nCur = Tell(); Seek( nEndOfData - 1 ); *this << (sal_uInt8) 0; Seek( nCur ); @@ -1174,7 +1174,7 @@ void StgTmpStrm::SetSize( sal_uIntPtr n ) } } -sal_uIntPtr StgTmpStrm::GetData( void* pData, sal_uIntPtr n ) +sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n ) { if( pStrm ) { @@ -1186,7 +1186,7 @@ sal_uIntPtr StgTmpStrm::GetData( void* pData, sal_uIntPtr n ) return SvMemoryStream::GetData( (sal_Char *)pData, n ); } -sal_uIntPtr StgTmpStrm::PutData( const void* pData, sal_uIntPtr n ) +sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n ) { sal_uInt32 nCur = Tell(); sal_uInt32 nNew = nCur + n; @@ -1206,7 +1206,7 @@ sal_uIntPtr StgTmpStrm::PutData( const void* pData, sal_uIntPtr n ) return nNew; } -sal_uIntPtr StgTmpStrm::SeekPos( sal_uIntPtr n ) +sal_uLong StgTmpStrm::SeekPos( sal_uLong n ) { if( n == STREAM_SEEK_TO_END ) n = GetSize(); diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 1ececadae35e..a1bb0707cdd7 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -154,17 +154,17 @@ class StgTmpStrm : public SvMemoryStream String aName; SvFileStream* pStrm; using SvMemoryStream::GetData; - virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); + virtual sal_uLong GetData( void* pData, sal_uLong nSize ); + virtual sal_uLong PutData( const void* pData, sal_uLong nSize ); + virtual sal_uLong SeekPos( sal_uLong nPos ); virtual void FlushData(); public: - StgTmpStrm( sal_uIntPtr=16 ); + StgTmpStrm( sal_uLong=16 ); ~StgTmpStrm(); sal_Bool Copy( StgTmpStrm& ); - void SetSize( sal_uIntPtr ); - sal_uIntPtr GetSize() const; + void SetSize( sal_uLong ); + sal_uLong GetSize() const; }; #endif diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index f912d76cdaf6..13c254e0cb4d 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -170,7 +170,7 @@ SotStorageStream::~SotStorageStream() *************************************************************************/ void SotStorageStream::SyncSvStream() { - sal_uIntPtr nPos = 0; + sal_uLong nPos = 0; if( pOwnStm ) { pOwnStm->Flush(); @@ -197,9 +197,9 @@ void SotStorageStream::ResetError() |* |* Beschreibung *************************************************************************/ -sal_uIntPtr SotStorageStream::GetData( void* pData, sal_uIntPtr nSize ) +sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize ) { - sal_uIntPtr nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -216,9 +216,9 @@ sal_uIntPtr SotStorageStream::GetData( void* pData, sal_uIntPtr nSize ) |* |* Beschreibung *************************************************************************/ -sal_uIntPtr SotStorageStream::PutData( const void* pData, sal_uIntPtr nSize ) +sal_uLong SotStorageStream::PutData( const void* pData, sal_uLong nSize ) { - sal_uIntPtr nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -235,9 +235,9 @@ sal_uIntPtr SotStorageStream::PutData( const void* pData, sal_uIntPtr nSize ) |* |* Beschreibung *************************************************************************/ -sal_uIntPtr SotStorageStream::SeekPos( sal_uIntPtr nPos ) +sal_uLong SotStorageStream::SeekPos( sal_uLong nPos ) { - sal_uIntPtr nRet = 0; + sal_uLong nRet = 0; if( pOwnStm ) { @@ -270,9 +270,9 @@ void SotStorageStream::FlushData() |* |* Beschreibung *************************************************************************/ -void SotStorageStream::SetSize( sal_uIntPtr nNewSize ) +void SotStorageStream::SetSize( sal_uLong nNewSize ) { - sal_uIntPtr nPos = Tell(); + sal_uLong nPos = Tell(); if( pOwnStm ) { pOwnStm->SetSize( nNewSize ); @@ -297,9 +297,9 @@ void SotStorageStream::SetSize( sal_uIntPtr nNewSize ) *************************************************************************/ sal_uInt32 SotStorageStream::GetSize() const { - sal_uIntPtr nPos = Tell(); + sal_uLong nPos = Tell(); ((SotStorageStream *)this)->Seek( STREAM_SEEK_TO_END ); - sal_uIntPtr nSize = Tell(); + sal_uLong nSize = Tell(); ((SotStorageStream *)this)->Seek( nPos ); return nSize; } @@ -316,12 +316,12 @@ sal_Bool SotStorageStream::CopyTo( SotStorageStream * pDestStm ) if( !pOwnStm || !pDestStm->pOwnStm ) { // Wenn Ole2 oder nicht nur eigene StorageStreams - sal_uIntPtr nPos = Tell(); // Position merken + sal_uLong nPos = Tell(); // Position merken Seek( 0L ); pDestStm->SetSize( 0 ); // Ziel-Stream leeren void * pMem = new sal_uInt8[ 8192 ]; - sal_uIntPtr nRead; + sal_uLong nRead; while( 0 != (nRead = Read( pMem, 8192 )) ) { if( nRead != pDestStm->Write( pMem, nRead ) ) @@ -651,7 +651,7 @@ SotStorage::SotStorage( BaseStorage * pStor ) } m_pOwnStg = pStor; - sal_uIntPtr nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE; + sal_uLong nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE; SetError( nErr ); if ( IsOLEStorage() ) m_nVersion = SOFFICE_FILEFORMAT_50; @@ -973,7 +973,7 @@ void SotStorage::ResetError() |* Beschreibung *************************************************************************/ void SotStorage::SetClass( const SvGlobalName & rName, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -984,7 +984,7 @@ void SotStorage::SetClass( const SvGlobalName & rName, } void SotStorage::SetConvertClass( const SvGlobalName & rName, - sal_uIntPtr nOriginalClipFormat, + sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { DBG_ASSERT( Owner(), "must be owner" ); @@ -1013,9 +1013,9 @@ SvGlobalName SotStorage::GetClassName() return aGN; } -sal_uIntPtr SotStorage::GetFormat() +sal_uLong SotStorage::GetFormat() { - sal_uIntPtr nFormat = 0; + sal_uLong nFormat = 0; DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) nFormat = m_pOwnStg->GetFormat(); diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 0958362f64a9..383d2f20d1c5 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -39,7 +39,7 @@ PRV_SV_IMPL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) { - for( sal_uIntPtr i = 0; i < Count(); i++ ) + for( sal_uLong i = 0; i < Count(); i++ ) { const SvStorageInfo & rType = GetObject( i ); if( rType.GetName() == rEleName ) @@ -50,7 +50,7 @@ const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) /************** class SvStorageInfo ************************************** *************************************************************************/ -sal_uIntPtr ReadClipboardFormat( SvStream & rStm ) +sal_uLong ReadClipboardFormat( SvStream & rStm ) { sal_uInt32 nFormat = 0; sal_Int32 nLen = 0; @@ -61,7 +61,7 @@ sal_uIntPtr ReadClipboardFormat( SvStream & rStm ) { // get a string name sal_Char * p = new sal_Char[ nLen ]; - if( rStm.Read( p, nLen ) == (sal_uIntPtr) nLen ) + if( rStm.Read( p, nLen ) == (sal_uLong) nLen ) { nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( p, short(nLen-1) ) ); } @@ -88,7 +88,7 @@ sal_uIntPtr ReadClipboardFormat( SvStream & rStm ) return nFormat; } -void WriteClipboardFormat( SvStream & rStm, sal_uIntPtr nFormat ) +void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ) { // determine the clipboard format string String aCbFmt; diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index ccdd42bb04bd..532877117329 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -443,10 +443,10 @@ class UCBStorageStream_Impl : public SvRefBase, public SvStream ~UCBStorageStream_Impl(); public: - virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); - virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); - virtual void SetSize( sal_uIntPtr nSize ); + virtual sal_uLong GetData( void* pData, sal_uLong nSize ); + virtual sal_uLong PutData( const void* pData, sal_uLong nSize ); + virtual sal_uLong SeekPos( sal_uLong nPos ); + virtual void SetSize( sal_uLong nSize ); virtual void FlushData(); virtual void ResetError(); @@ -482,19 +482,19 @@ public: sal_Int16 Commit(); // if modified and commited: transfer an XInputStream to the content sal_Bool Revert(); // discard all changes BaseStorage* CreateStorage();// create an OLE Storage on the UCBStorageStream - sal_uIntPtr GetSize(); + sal_uLong GetSize(); - sal_uIntPtr ReadSourceWriteTemporary( sal_uIntPtr aLength ); // read aLength from source and copy to temporary, + sal_uLong ReadSourceWriteTemporary( sal_uLong aLength ); // read aLength from source and copy to temporary, // no seeking is produced - sal_uIntPtr ReadSourceWriteTemporary(); // read source till the end and copy to temporary, + sal_uLong ReadSourceWriteTemporary(); // read source till the end and copy to temporary, // no seeking is produced #if 0 - sal_uIntPtr CopySourceToTemporary( sal_uIntPtr aLength ); // same as ReadSourceWriteToTemporary( aLength ) + sal_uLong CopySourceToTemporary( sal_uLong aLength ); // same as ReadSourceWriteToTemporary( aLength ) // but the writing is done at the end of temporary // pointer position is not changed #endif - sal_uIntPtr CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() + sal_uLong CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() // but the writing is done at the end of temporary // pointer position is not changed Reference GetXInputStream(); // return XInputStream, after that @@ -536,7 +536,7 @@ public: sal_Bool m_bDirty; // ??? sal_Bool m_bIsLinked; sal_Bool m_bListCreated; - sal_uIntPtr m_nFormat; + sal_uLong m_nFormat; String m_aUserTypeName; SvGlobalName m_aClassId; @@ -589,7 +589,7 @@ struct UCBStorageElement_Impl { String m_aName; // the actual URL relative to the root "folder" String m_aOriginalName;// the original name in the content - sal_uIntPtr m_nSize; + sal_uLong m_nSize; sal_Bool m_bIsFolder; // Only sal_True when it is a UCBStorage ! sal_Bool m_bIsStorage; // Also sal_True when it is an OLEStorage ! sal_Bool m_bIsRemoved; // element will be removed on commit @@ -598,7 +598,7 @@ struct UCBStorageElement_Impl UCBStorageStream_ImplRef m_xStream; // reference to the "real" stream UCBStorageElement_Impl( const ::rtl::OUString& rName, - sal_Bool bIsFolder = sal_False, sal_uIntPtr nSize = 0 ) + sal_Bool bIsFolder = sal_False, sal_uLong nSize = 0 ) : m_aName( rName ) , m_aOriginalName( rName ) , m_nSize( nSize ) @@ -896,12 +896,12 @@ sal_Bool UCBStorageStream_Impl::Init() return sal_True; } -sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary() +sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary() { // read source stream till the end and copy all the data to // the current position of the temporary stream - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { @@ -909,7 +909,7 @@ sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary() try { - sal_uIntPtr aReaded; + sal_uLong aReaded; do { aReaded = m_rSource->readBytes( aData, 32000 ); @@ -933,12 +933,12 @@ sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary() } -sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uIntPtr aLength ) +sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength ) { // read aLength bite from the source stream and copy them to the current // position of the temporary stream - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { @@ -947,11 +947,11 @@ sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uIntPtr aLength try { - sal_uIntPtr aReaded = 32000; + sal_uLong aReaded = 32000; - for( sal_uIntPtr pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) + for( sal_uLong pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 ) { - sal_uIntPtr aToCopy = min( aLength - pInd, 32000 ); + sal_uLong aToCopy = min( aLength - pInd, 32000 ); aReaded = m_rSource->readBytes( aData, aToCopy ); aResult += m_pStream->Write( aData.getArray(), aReaded ); } @@ -973,14 +973,14 @@ sal_uIntPtr UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uIntPtr aLength return aResult; } -sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary() +sal_uLong UCBStorageStream_Impl::CopySourceToTemporary() { // current position of the temporary stream is not changed - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { - sal_uIntPtr aPos = m_pStream->Tell(); + sal_uLong aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary(); m_pStream->Seek( aPos ); @@ -991,14 +991,14 @@ sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary() } #if 0 -sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary( sal_uIntPtr aLength ) +sal_uLong UCBStorageStream_Impl::CopySourceToTemporary( sal_uLong aLength ) { // current position of the temporary stream is not changed - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( m_bSourceRead ) { - sal_uIntPtr aPos = m_pStream->Tell(); + sal_uLong aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); aResult = ReadSourceWriteTemporary( aLength ); m_pStream->Seek( aPos ); @@ -1011,9 +1011,9 @@ sal_uIntPtr UCBStorageStream_Impl::CopySourceToTemporary( sal_uIntPtr aLength ) // UCBStorageStream_Impl must have a SvStream interface, because it then can be used as underlying stream // of an OLEStorage; so every write access caused by storage operations marks the UCBStorageStream as modified -sal_uIntPtr UCBStorageStream_Impl::GetData( void* pData, sal_uIntPtr nSize ) +sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) { - sal_uIntPtr aResult = 0; + sal_uLong aResult = 0; if( !Init() ) return 0; @@ -1026,13 +1026,13 @@ sal_uIntPtr UCBStorageStream_Impl::GetData( void* pData, sal_uIntPtr nSize ) // read the tail of the data from original stream // copy this tail to the temporary stream - sal_uIntPtr aToRead = nSize - aResult; + sal_uLong aToRead = nSize - aResult; pData = (void*)( (char*)pData + aResult ); try { Sequence aData( aToRead ); - sal_uIntPtr aReaded = m_rSource->readBytes( aData, aToRead ); + sal_uLong aReaded = m_rSource->readBytes( aData, aToRead ); aResult += m_pStream->Write( (void*)aData.getArray(), aReaded ); memcpy( pData, aData.getArray(), aReaded ); } @@ -1053,7 +1053,7 @@ sal_uIntPtr UCBStorageStream_Impl::GetData( void* pData, sal_uIntPtr nSize ) return aResult; } -sal_uIntPtr UCBStorageStream_Impl::PutData( const void* pData, sal_uIntPtr nSize ) +sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1064,7 +1064,7 @@ sal_uIntPtr UCBStorageStream_Impl::PutData( const void* pData, sal_uIntPtr nSize if( !nSize || !Init() ) return 0; - sal_uIntPtr aResult = m_pStream->Write( pData, nSize ); + sal_uLong aResult = m_pStream->Write( pData, nSize ); m_bModified = aResult > 0; @@ -1072,12 +1072,12 @@ sal_uIntPtr UCBStorageStream_Impl::PutData( const void* pData, sal_uIntPtr nSize } -sal_uIntPtr UCBStorageStream_Impl::SeekPos( sal_uIntPtr nPos ) +sal_uLong UCBStorageStream_Impl::SeekPos( sal_uLong nPos ) { if( !Init() ) return 0; - sal_uIntPtr aResult; + sal_uLong aResult; if( nPos == STREAM_SEEK_TO_END ) { @@ -1129,7 +1129,7 @@ sal_uIntPtr UCBStorageStream_Impl::SeekPos( sal_uIntPtr nPos ) return aResult; } -void UCBStorageStream_Impl::SetSize( sal_uIntPtr nSize ) +void UCBStorageStream_Impl::SetSize( sal_uLong nSize ) { if ( !(m_nMode & STREAM_WRITE) ) { @@ -1144,7 +1144,7 @@ void UCBStorageStream_Impl::SetSize( sal_uIntPtr nSize ) if( m_bSourceRead ) { - sal_uIntPtr aPos = m_pStream->Tell(); + sal_uLong aPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); if( m_pStream->Tell() < nSize ) ReadSourceWriteTemporary( nSize - m_pStream->Tell() ); @@ -1184,15 +1184,15 @@ void UCBStorageStream_Impl::ResetError() m_pAntiImpl->ResetError(); } -sal_uIntPtr UCBStorageStream_Impl::GetSize() +sal_uLong UCBStorageStream_Impl::GetSize() { if( !Init() ) return 0; - sal_uIntPtr nPos = m_pStream->Tell(); + sal_uLong nPos = m_pStream->Tell(); m_pStream->Seek( STREAM_SEEK_TO_END ); ReadSourceWriteTemporary(); - sal_uIntPtr nRet = m_pStream->Tell(); + sal_uLong nRet = m_pStream->Tell(); m_pStream->Seek( nPos ); return nRet; @@ -1423,13 +1423,13 @@ UCBStorageStream::~UCBStorageStream() pImp->ReleaseRef(); } -sal_uIntPtr UCBStorageStream::Read( void * pData, sal_uIntPtr nSize ) +sal_uLong UCBStorageStream::Read( void * pData, sal_uLong nSize ) { //return pImp->m_pStream->Read( pData, nSize ); return pImp->GetData( pData, nSize ); } -sal_uIntPtr UCBStorageStream::Write( const void* pData, sal_uIntPtr nSize ) +sal_uLong UCBStorageStream::Write( const void* pData, sal_uLong nSize ) { /* // mba: does occur in writer ! @@ -1444,13 +1444,13 @@ sal_uIntPtr UCBStorageStream::Write( const void* pData, sal_uIntPtr nSize ) return pImp->PutData( pData, nSize ); } -sal_uIntPtr UCBStorageStream::Seek( sal_uIntPtr nPos ) +sal_uLong UCBStorageStream::Seek( sal_uLong nPos ) { //return pImp->m_pStream->Seek( nPos ); return pImp->Seek( nPos ); } -sal_uIntPtr UCBStorageStream::Tell() +sal_uLong UCBStorageStream::Tell() { if( !pImp->Init() ) return 0; @@ -1463,7 +1463,7 @@ void UCBStorageStream::Flush() Commit(); } -sal_Bool UCBStorageStream::SetSize( sal_uIntPtr nNewSize ) +sal_Bool UCBStorageStream::SetSize( sal_uLong nNewSize ) { /* if ( pImp->m_bCommited ) @@ -2013,7 +2013,7 @@ void UCBStorage_Impl::ReadContent() sal_Bool bIsFolder( xRow->getBoolean(2) ); sal_Int64 nSize = xRow->getLong(4); - UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (sal_uIntPtr) nSize ); + UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (sal_uLong) nSize ); m_aChildrenList.Insert( pElement, LIST_APPEND ); sal_Bool bIsOfficeDocument = m_bIsLinked || ( m_aClassId != SvGlobalName() ); @@ -2658,7 +2658,7 @@ void UCBStorage::SetDirty() pImp->m_bDirty = sal_True; } -void UCBStorage::SetClass( const SvGlobalName & rClass, sal_uIntPtr nOriginalClipFormat, const String & rUserTypeName ) +void UCBStorage::SetClass( const SvGlobalName & rClass, sal_uLong nOriginalClipFormat, const String & rUserTypeName ) { pImp->m_aClassId = rClass; pImp->m_nFormat = nOriginalClipFormat; @@ -2697,7 +2697,7 @@ const ClsId& UCBStorage::GetClassId() const return ( const ClsId& ) pImp->m_aClassId.GetCLSID(); } -void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, sal_uIntPtr /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) +void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, sal_uLong /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ ) { // ??? } @@ -2713,7 +2713,7 @@ SvGlobalName UCBStorage::GetClassName() return pImp->m_aClassId; } -sal_uIntPtr UCBStorage::GetFormat() +sal_uLong UCBStorage::GetFormat() { return pImp->m_nFormat; } @@ -2733,7 +2733,7 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const if ( !pElement->m_bIsRemoved ) { // problem: what about the size of a substorage ?! - sal_uIntPtr nSize = pElement->m_nSize; + sal_uLong nSize = pElement->m_nSize; if ( pElement->m_xStream.Is() ) nSize = pElement->m_xStream->GetSize(); SvStorageInfo aInfo( pElement->m_aName, nSize, pElement->m_bIsStorage ); @@ -3339,7 +3339,7 @@ sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) if ( !pFile ) return sal_False; - sal_uIntPtr nPos = pFile->Tell(); + sal_uLong nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); if ( pFile->Tell() < 4 ) return sal_False; @@ -3370,7 +3370,7 @@ sal_Bool UCBStorage::IsDiskSpannedFile( SvStream* pFile ) if ( !pFile ) return sal_False; - sal_uIntPtr nPos = pFile->Tell(); + sal_uLong nPos = pFile->Tell(); pFile->Seek( STREAM_SEEK_TO_END ); if ( !pFile->Tell() ) return sal_False; @@ -3394,7 +3394,7 @@ sal_Bool UCBStorage::IsDiskSpannedFile( SvStream* pFile ) String UCBStorage::GetLinkedFile( SvStream &rStream ) { String aString; - sal_uIntPtr nPos = rStream.Tell(); + sal_uLong nPos = rStream.Tell(); rStream.Seek( STREAM_SEEK_TO_END ); if ( !rStream.Tell() ) return aString; -- cgit From 04034b8ca71a6d4e6823f71dd092aaac0270a028 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 25 Jan 2011 17:22:00 +0100 Subject: gnumake3: adjust sot project to the new build environment --- sot/Library_sot.mk | 105 +++++++++++++++++++++++++++++++++++ sot/Makefile | 38 +++++++++++++ sot/Module_sot.mk | 34 ++++++++++++ sot/Package_inc.mk | 42 ++++++++++++++ sot/inc/makefile.mk | 48 ---------------- sot/prj/build.lst | 10 ---- sot/prj/d.lst | 15 ----- sot/prj/makefile.mk | 40 +++++++++++++ sot/source/base/makefile.mk | 58 ------------------- sot/source/sdstor/makefile.mk | 64 --------------------- sot/source/unoolestorage/makefile.mk | 51 ----------------- sot/util/makefile.mk | 89 ----------------------------- sot/util/makefile.pmk | 31 ----------- 13 files changed, 259 insertions(+), 366 deletions(-) create mode 100644 sot/Library_sot.mk create mode 100644 sot/Makefile create mode 100644 sot/Module_sot.mk create mode 100644 sot/Package_inc.mk delete mode 100644 sot/inc/makefile.mk delete mode 100644 sot/prj/build.lst delete mode 100644 sot/prj/d.lst create mode 100644 sot/prj/makefile.mk delete mode 100644 sot/source/base/makefile.mk delete mode 100644 sot/source/sdstor/makefile.mk delete mode 100644 sot/source/unoolestorage/makefile.mk delete mode 100644 sot/util/makefile.mk delete mode 100644 sot/util/makefile.pmk (limited to 'sot') diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk new file mode 100644 index 000000000000..c5d8677bf2ca --- /dev/null +++ b/sot/Library_sot.mk @@ -0,0 +1,105 @@ +#************************************************************************* +# +# 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 +# +# 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$(SRCDIR)/sot/inc \ + -I$(SRCDIR)/sot/inc/pch \ + $$(INCLUDE) \ + -I$(OUTDIR)/inc/offuh \ + -I$(OUTDIR)/inc \ +)) + +$(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 \ +)) + +$(eval $(call gb_Library_add_exception_objects,sot,\ + sot/source/unoolestorage/xolesimplestorage \ + 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/stgio \ + sot/source/sdstor/stgavl \ + sot/source/sdstor/stgio \ + sot/source/sdstor/storage \ + sot/source/sdstor/stgavl \ + sot/source/sdstor/ucbstorage \ + sot/source/sdstor/storinfo \ + sot/source/sdstor/stg \ + sot/source/sdstor/stgcache \ + sot/source/sdstor/stgelem \ + sot/source/sdstor/stgstrms \ + sot/source/sdstor/stgstrms \ + sot/source/sdstor/stgelem \ + sot/source/sdstor/stgcache \ + sot/source/sdstor/stgole \ + sot/source/sdstor/unostorageholder \ + sot/source/sdstor/stgdir \ + sot/source/sdstor/stgole \ + sot/source/sdstor/stgdir \ + sot/source/sdstor/unostorageholder \ + )) + +ifeq ($(OS),LINUX) +$(eval $(call gb_Library_add_linked_libs,sot,\ + dl \ + m \ + pthread \ +)) +endif + +ifeq ($(OS),WNT) +$(eval $(call gb_Library_add_linked_libs,sot,\ + kernel32 \ + msvcrt \ + uwinapi \ +)) +endif +# vim: set noet sw=4 ts=4: diff --git a/sot/Makefile b/sot/Makefile new file mode 100644 index 000000000000..a79aff831024 --- /dev/null +++ b/sot/Makefile @@ -0,0 +1,38 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +ifeq ($(strip $(SOLARENV)),) +$(error No environment set!) +endif + +gb_PARTIALBUILD := T +GBUILDDIR := $(SOLARENV)/gbuild +include $(GBUILDDIR)/gbuild.mk + +$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk))) + +# vim: set noet sw=4 ts=4: diff --git a/sot/Module_sot.mk b/sot/Module_sot.mk new file mode 100644 index 000000000000..95e5d2898b28 --- /dev/null +++ b/sot/Module_sot.mk @@ -0,0 +1,34 @@ +#************************************************************************* +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_Module_Module,sot)) + +$(eval $(call gb_Module_add_targets,sot,\ + Package_inc \ + Library_sot \ +)) + 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_Package_Package,sot_inc,$(SRCDIR)/sot/inc)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/absdev.hxx,sot/absdev.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/agg.hxx,sot/agg.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/clsids.hxx,sot/clsids.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/exchange.hxx,sot/exchange.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/factory.hxx,sot/factory.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/filelist.hxx,sot/filelist.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/formats.hxx,sot/formats.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/object.hxx,sot/object.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotdata.hxx,sot/sotdata.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotdllapi.h,sot/sotdllapi.h)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotref.hxx,sot/sotref.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/stg.hxx,sot/stg.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/storage.hxx,sot/storage.hxx)) +$(eval $(call gb_Package_add_file,sot_inc,inc/sot/storinfo.hxx,sot/storinfo.hxx)) diff --git a/sot/inc/makefile.mk b/sot/inc/makefile.mk deleted file mode 100644 index bc31cd07e06b..000000000000 --- a/sot/inc/makefile.mk +++ /dev/null @@ -1,48 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=.. - -PRJNAME=sot -TARGET=inc - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - -.IF "$(ENABLE_PCH)"!="" -ALLTAR : \ - $(SLO)$/precompiled.pch \ - $(SLO)$/precompiled_ex.pch - -.ENDIF # "$(ENABLE_PCH)"!="" - diff --git a/sot/prj/build.lst b/sot/prj/build.lst deleted file mode 100644 index 9d6e785898a5..000000000000 --- a/sot/prj/build.lst +++ /dev/null @@ -1,10 +0,0 @@ -to sot : LIBXSLT:libxslt 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\qa\complex\olesimplestorage nmake - all sot_complex sot_ut NULL diff --git a/sot/prj/d.lst b/sot/prj/d.lst deleted file mode 100644 index ec3166bbea1a..000000000000 --- a/sot/prj/d.lst +++ /dev/null @@ -1,15 +0,0 @@ -mkdir: %_DEST%\inc%_EXT%\sot -..\inc\sot/*.hxx %_DEST%\inc%_EXT%\sot\*.hxx -..\inc\sot\*.h %_DEST%\inc%_EXT%\sot\*.h - -..\%__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 -..\%__SRC%\misc\sot.component %_DEST%\xml%_EXT%\sot.component diff --git a/sot/prj/makefile.mk b/sot/prj/makefile.mk new file mode 100644 index 000000000000..c73a3d944bbf --- /dev/null +++ b/sot/prj/makefile.mk @@ -0,0 +1,40 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=.. +TARGET=prj + +.INCLUDE : settings.mk + +.IF "$(VERBOSE)"!="" +VERBOSEFLAG := +.ELSE +VERBOSEFLAG := -s +.ENDIF + +all: + cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) diff --git a/sot/source/base/makefile.mk b/sot/source/base/makefile.mk deleted file mode 100644 index 861b7cc5969b..000000000000 --- a/sot/source/base/makefile.mk +++ /dev/null @@ -1,58 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=sot -TARGET=base - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -.IF "$(COM)"=="GCC" -NOOPTFILES= \ - $(SLO)$/exchange.obj -.ENDIF # GCC - -SLOFILES= \ - $(SLO)$/factory.obj \ - $(SLO)$/object.obj \ - $(SLO)$/exchange.obj \ - $(SLO)$/filelist.obj \ - $(SLO)$/formats.obj - -EXCEPTIONSFILES= \ - $(SLO)$/formats.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/sot/source/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 -# -# 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/unoolestorage/makefile.mk b/sot/source/unoolestorage/makefile.mk deleted file mode 100644 index d88f72f14e51..000000000000 --- a/sot/source/unoolestorage/makefile.mk +++ /dev/null @@ -1,51 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=sot -TARGET=unoolestorage - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/xolesimplestorage.obj \ - $(SLO)$/register.obj - -EXCEPTIONSFILES= \ - $(SLO)$/xolesimplestorage.obj \ - $(SLO)$/register.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/sot/util/makefile.mk b/sot/util/makefile.mk deleted file mode 100644 index 453dbddc5857..000000000000 --- a/sot/util/makefile.mk +++ /dev/null @@ -1,89 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# 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$/sot/absdev.hxx \ - $(PRJ)$/inc$/sot/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$/sot/stg.hxx \ - $(PRJ)$/inc$/sot$/storage.hxx \ - $(PRJ)$/inc$/sot/storinfo.hxx -DEFLIB1NAME =$(TARGET) -DEF1DES =StarObjectsTools - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - -$(MISC)$/$(SHL1TARGET).flt: makefile.mk - @echo ------------------------------ - @echo Making: $@ - $(TYPE) sot.flt > $@ - - -ALLTAR : $(MISC)/sot.component - -$(MISC)/sot.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ - sot.component - $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ - $(SOLARENV)/bin/createcomponent.xslt sot.component diff --git a/sot/util/makefile.pmk b/sot/util/makefile.pmk deleted file mode 100644 index 2d79b8068815..000000000000 --- a/sot/util/makefile.pmk +++ /dev/null @@ -1,31 +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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -# define SOT_DLLIMPLEMENTATION (see @ = sotdllapi.h) -CDEFS += -DSOT_DLLIMPLEMENTATION - -VISIBILITY_HIDDEN=TRUE -- cgit From 6c0d17b3e21d4c0d6f6a526a6261f5ca8eb42369 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 26 Jan 2011 10:30:19 +0100 Subject: CWS gnumake3: several clean ups and fixes in makefiles --- sot/Library_sot.mk | 28 +++++++++------------------- sot/prj/build.lst | 3 +++ 2 files changed, 12 insertions(+), 19 deletions(-) create mode 100755 sot/prj/build.lst (limited to 'sot') diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk index c5d8677bf2ca..5201312e05e1 100644 --- a/sot/Library_sot.mk +++ b/sot/Library_sot.mk @@ -34,11 +34,9 @@ $(eval $(call gb_Library_add_precompiled_header,sot,$(SRCDIR)/sot/inc/pch/precom $(eval $(call gb_Library_set_componentfile,sot,sot/util/sot)) $(eval $(call gb_Library_set_include,sot,\ - -I$(SRCDIR)/sot/inc \ -I$(SRCDIR)/sot/inc/pch \ $$(INCLUDE) \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc \ )) $(eval $(call gb_Library_set_defs,sot,\ @@ -53,11 +51,11 @@ $(eval $(call gb_Library_add_linked_libs,sot,\ sal \ tl \ ucbhelper \ + stl \ utl \ )) $(eval $(call gb_Library_add_exception_objects,sot,\ - sot/source/unoolestorage/xolesimplestorage \ sot/source/unoolestorage/xolesimplestorage \ sot/source/unoolestorage/register \ sot/source/base/formats \ @@ -65,27 +63,19 @@ $(eval $(call gb_Library_add_exception_objects,sot,\ sot/source/base/exchange \ sot/source/base/filelist \ sot/source/base/factory \ - sot/source/sdstor/stgio \ - sot/source/sdstor/stgavl \ - sot/source/sdstor/stgio \ - sot/source/sdstor/storage \ - sot/source/sdstor/stgavl \ - sot/source/sdstor/ucbstorage \ - sot/source/sdstor/storinfo \ sot/source/sdstor/stg \ + sot/source/sdstor/stgavl \ sot/source/sdstor/stgcache \ - sot/source/sdstor/stgelem \ - sot/source/sdstor/stgstrms \ - sot/source/sdstor/stgstrms \ - sot/source/sdstor/stgelem \ - sot/source/sdstor/stgcache \ - sot/source/sdstor/stgole \ - sot/source/sdstor/unostorageholder \ sot/source/sdstor/stgdir \ + sot/source/sdstor/stgelem \ + sot/source/sdstor/stgio \ sot/source/sdstor/stgole \ - sot/source/sdstor/stgdir \ + sot/source/sdstor/stgstrms \ + sot/source/sdstor/storage \ + sot/source/sdstor/storinfo \ + sot/source/sdstor/ucbstorage \ sot/source/sdstor/unostorageholder \ - )) +)) ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_linked_libs,sot,\ diff --git a/sot/prj/build.lst b/sot/prj/build.lst new file mode 100755 index 000000000000..30c66df950ed --- /dev/null +++ b/sot/prj/build.lst @@ -0,0 +1,3 @@ +to sot : tools ucbhelper unotools NULL +to sot usr1 - all sot_mkout NULL +to sot\prj nmake - all sot_prj NULL -- cgit From c4cf136270b00fb6f3188772feba3ccddea7391a Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 26 Jan 2011 13:41:35 +0100 Subject: CWS gnumake3: wrong license header in solenv, missing d.lst in sot and vbahelper --- sot/prj/d.lst | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sot/prj/d.lst (limited to 'sot') diff --git a/sot/prj/d.lst b/sot/prj/d.lst new file mode 100644 index 000000000000..e69de29bb2d1 -- cgit From 017970dc24d6b9e7b647a296a638e4c6892ab42e Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 31 Jan 2011 14:12:13 +0100 Subject: CWS gnumake3: workaround for cygwin coredump; don't create deliverlog in parallel --- sot/prj/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sot') diff --git a/sot/prj/makefile.mk b/sot/prj/makefile.mk index c73a3d944bbf..e312a7ccab65 100644 --- a/sot/prj/makefile.mk +++ b/sot/prj/makefile.mk @@ -37,4 +37,4 @@ VERBOSEFLAG := -s .ENDIF all: - cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) + cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog -- cgit From f7d5dd5f78289e1e0934d45262debd532432394f Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 1 Feb 2011 18:44:12 +0100 Subject: CWS gnumake3: use standard linked libs on Windows --- sot/Library_sot.mk | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'sot') diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk index 5201312e05e1..4a5c7ef4ce81 100644 --- a/sot/Library_sot.mk +++ b/sot/Library_sot.mk @@ -53,6 +53,7 @@ $(eval $(call gb_Library_add_linked_libs,sot,\ ucbhelper \ stl \ utl \ + $(gb_StdLibs) \ )) $(eval $(call gb_Library_add_exception_objects,sot,\ @@ -85,11 +86,4 @@ $(eval $(call gb_Library_add_linked_libs,sot,\ )) endif -ifeq ($(OS),WNT) -$(eval $(call gb_Library_add_linked_libs,sot,\ - kernel32 \ - msvcrt \ - uwinapi \ -)) -endif # vim: set noet sw=4 ts=4: -- cgit From 153a326981896a84523d3e6ff5340b2c3497136c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 1 Feb 2011 19:21:09 +0100 Subject: gnumake3: remove dmake files for tests in converted modules --- sot/prj/build.lst | 1 - 1 file changed, 1 deletion(-) (limited to 'sot') diff --git a/sot/prj/build.lst b/sot/prj/build.lst index 30c66df950ed..63f7a94cf054 100755 --- a/sot/prj/build.lst +++ b/sot/prj/build.lst @@ -1,3 +1,2 @@ to sot : tools ucbhelper unotools NULL -to sot usr1 - all sot_mkout NULL to sot\prj nmake - all sot_prj NULL -- cgit From 2b80af23f8142c9bb970a8de20040098ea8ed2b9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 1 Feb 2011 19:21:09 +0100 Subject: gnumake3: convert some dmake files for tests to gbuild --- sot/JunitTest_sot_complex.mk | 49 +++++++++++++++++++++++ sot/Module_sot.mk | 4 ++ sot/qa/complex/olesimplestorage/makefile.mk | 62 ----------------------------- 3 files changed, 53 insertions(+), 62 deletions(-) create mode 100644 sot/JunitTest_sot_complex.mk delete mode 100644 sot/qa/complex/olesimplestorage/makefile.mk (limited to 'sot') diff --git a/sot/JunitTest_sot_complex.mk b/sot/JunitTest_sot_complex.mk new file mode 100644 index 000000000000..e515ab539659 --- /dev/null +++ b/sot/JunitTest_sot_complex.mk @@ -0,0 +1,49 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_JunitTest_JunitTest,sot_complex)) + +$(eval $(call gb_JunitTest_add_sourcefiles,sot_complex,\ + sot/qa/complex/olesimplestorage/OLESimpleStorageTest \ + sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest \ + sot/qa/complex/olesimplestorage/Test01 \ + sot/qa/complex/olesimplestorage/TestHelper \ +)) + +$(eval $(call gb_JunitTest_add_jars,sot_complex,\ + $(OUTDIR)/bin/OOoRunner.jar \ + $(OUTDIR)/bin/ridl.jar \ + $(OUTDIR)/bin/test.jar \ + $(OUTDIR)/bin/unoil.jar \ + $(OUTDIR)/bin/jurt.jar \ +)) + +$(eval $(call gb_JunitTest_add_classes,sot_complex,\ + complex.olesimplestorage.OLESimpleStorageUnitTest \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sot/Module_sot.mk b/sot/Module_sot.mk index 95e5d2898b28..a9b72bf5f8d6 100644 --- a/sot/Module_sot.mk +++ b/sot/Module_sot.mk @@ -32,3 +32,7 @@ $(eval $(call gb_Module_add_targets,sot,\ Library_sot \ )) +$(eval $(call gb_Module_add_subsequentcheck_targets,sot,\ + JunitTest_sot_complex \ +)) + diff --git a/sot/qa/complex/olesimplestorage/makefile.mk b/sot/qa/complex/olesimplestorage/makefile.mk deleted file mode 100644 index cf3facf94d66..000000000000 --- a/sot/qa/complex/olesimplestorage/makefile.mk +++ /dev/null @@ -1,62 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE - -PRJ = ../../.. -PRJNAME = sot -TARGET = qa_complex_olesimplestorage - -.IF "$(OOO_JUNIT_JAR)" != "" -PACKAGE = complex/olesimplestorage -JAVATESTFILES = \ - OLESimpleStorageUnitTest.java - -JAVAFILES = $(JAVATESTFILES) \ - OLESimpleStorageTest.java \ - Test01.java \ - TestHelper.java - -JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar -EXTRAJARFILES = $(OOO_JUNIT_JAR) -.END - -.INCLUDE: settings.mk -.INCLUDE: target.mk -.INCLUDE: installationtest.mk - -ALLTAR : javatest - -.END - - - - - - -- cgit From 582eb5a368de1627164bc50e25f9eab8ae96e1a8 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 2 Feb 2011 17:05:04 +0100 Subject: CWS gnumake3: rename gb_StdLibs -> gb_STDLIBS; remove explicit linking of individual standard libs from makefiles; fix export problem in framework --- sot/Library_sot.mk | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'sot') diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk index 4a5c7ef4ce81..ef7d22c35081 100644 --- a/sot/Library_sot.mk +++ b/sot/Library_sot.mk @@ -53,7 +53,7 @@ $(eval $(call gb_Library_add_linked_libs,sot,\ ucbhelper \ stl \ utl \ - $(gb_StdLibs) \ + $(gb_STDLIBS) \ )) $(eval $(call gb_Library_add_exception_objects,sot,\ @@ -78,12 +78,4 @@ $(eval $(call gb_Library_add_exception_objects,sot,\ sot/source/sdstor/unostorageholder \ )) -ifeq ($(OS),LINUX) -$(eval $(call gb_Library_add_linked_libs,sot,\ - dl \ - m \ - pthread \ -)) -endif - # vim: set noet sw=4 ts=4: -- cgit