diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 12:47:44 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 12:47:44 +0200 |
commit | 941020379b1ea1ec7c564c21e68ea1674cda7683 (patch) | |
tree | 40fcaf109d6d585bcdc0faf7ea6c0812b3cc9a39 /sot | |
parent | fixing rebase errors (diff) | |
parent | enable exceptions here (diff) | |
download | core-941020379b1ea1ec7c564c21e68ea1674cda7683.tar.gz core-941020379b1ea1ec7c564c21e68ea1674cda7683.zip |
Merge branch 'master' into feature/gnumake4
Conflicts:
basebmp/prj/d.lst
basebmp/test/basictest.cxx
basebmp/test/makefile.mk
basegfx/inc/basegfx/basegfxdllapi.h
basegfx/inc/basegfx/tools/debugplotter.hxx
basegfx/inc/basegfx/tuple/b2ituple.hxx
basegfx/prj/d.lst
basegfx/source/numeric/makefile.mk
basegfx/source/polygon/makefile.mk
basegfx/source/range/makefile.mk
basegfx/source/raster/makefile.mk
basegfx/source/tuple/makefile.mk
basegfx/source/vector/makefile.mk
basegfx/test/basegfx1d.cxx
basegfx/test/makefile.mk
basegfx/util/makefile.mk
canvas/Library_canvasfactory.mk
canvas/Module_canvas.mk
canvas/prj/build.lst
canvas/prj/d.lst
canvas/source/cairo/cairo_canvashelper_texturefill.cxx
canvas/source/cairo/makefile.mk
canvas/source/tools/makefile.mk
comphelper/qa/string/makefile.mk
cppcanvas/Module_cppcanvas.mk
cppcanvas/inc/cppcanvas/cppcanvasdllapi.h
cppcanvas/prj/build.lst
cppcanvas/prj/d.lst
cppcanvas/source/mtfrenderer/makefile.mk
cppcanvas/util/makefile.mk
i18npool/source/search/makefile.mk
regexp/Library_regexp.mk
regexp/prj/d.lst
sax/CppunitTest_sax.mk
sax/Library_sax.mk
sax/prj/d.lst
sax/qa/cppunit/test_converter.cxx
sax/source/expatwrap/attrlistimpl.hxx
sax/util/makefile.mk
svtools/Library_svt.mk
tools/Executable_sspretty.mk
ucbhelper/prj/d.lst
ucbhelper/source/provider/configureucb.cxx
ucbhelper/source/provider/provconf.cxx
ucbhelper/util/makefile.mk
unotools/Library_utl.mk
unotools/Module_unotools.mk
unotools/Package_inc.mk
unotools/prj/build.lst
vcl/Library_desktop_detector.mk
vcl/Library_vcl.mk
vcl/Library_vclplug_gtk.mk
vcl/aqua/source/gdi/salprn.cxx
vcl/inc/aqua/saldata.hxx
vcl/unx/generic/gdi/salgdi3.cxx
Diffstat (limited to 'sot')
48 files changed, 428 insertions, 638 deletions
diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk index 2f851f13c89e..79f94858a688 100644 --- a/sot/Library_sot.mk +++ b/sot/Library_sot.mk @@ -34,7 +34,7 @@ $(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/pch \ + -I$(realpath $(SRCDIR)/sot/inc/pch) \ $$(INCLUDE) \ -I$(OUTDIR)/inc/offuh \ )) @@ -50,7 +50,6 @@ $(eval $(call gb_Library_add_linked_libs,sot,\ sal \ tl \ ucbhelper \ - stl \ utl \ $(gb_STDLIBS) \ )) diff --git a/sot/Package_inc.mk b/sot/Package_inc.mk index 1b664c263184..f1f71cf91b2a 100644 --- a/sot/Package_inc.mk +++ b/sot/Package_inc.mk @@ -27,7 +27,6 @@ $(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)) diff --git a/sot/inc/pch/precompiled_sot.cxx b/sot/inc/pch/precompiled_sot.cxx index fea8683f8074..1e18a81180e2 100644 --- a/sot/inc/pch/precompiled_sot.cxx +++ b/sot/inc/pch/precompiled_sot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,3 +28,4 @@ #include "precompiled_sot.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/pch/precompiled_sot.hxx b/sot/inc/pch/precompiled_sot.hxx index 4edee1275640..dc9d2de5a192 100644 --- a/sot/inc/pch/precompiled_sot.hxx +++ b/sot/inc/pch/precompiled_sot.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,3 +31,4 @@ #ifdef PRECOMPILED_HEADERS #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/absdev.hxx b/sot/inc/sot/absdev.hxx index d882e6fc6b14..b33954621c35 100644 --- a/sot/inc/sot/absdev.hxx +++ b/sot/inc/sot/absdev.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #ifndef _SOT_ABSDEV_HXX #define _SOT_ABSDEV_HXX -#ifndef _TOOLS_SOLAR_H #include <tools/solar.h> -#endif class JobSetup; class AbstractDeviceData @@ -46,3 +45,5 @@ public: }; #endif // _SOT_ABSDEV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/agg.hxx b/sot/inc/sot/agg.hxx deleted file mode 100644 index cf07f6a8faff..000000000000 --- a/sot/inc/sot/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 - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SOT_AGG_HXX -#define _SOT_AGG_HXX - -#include <tools/ownlist.hxx> - -/************** class SvAggregate ***************************************/ -/************************************************************************/ -class SotFactory; -class SotObject; -struct SvAggregate -{ - union - { - SotFactory * pFact; - SotObject * pObj; - }; - sal_Bool bFactory; - sal_Bool bMainObj; // sal_True, das Objekt, welches das casting steuert - - SvAggregate() - : pFact( NULL ) - , bFactory( sal_False ) - , bMainObj( sal_False ) {} - SvAggregate( SotObject * pObjP, sal_Bool bMainP ) - : pObj( pObjP ) - , bFactory( sal_False ) - , bMainObj( bMainP ) {} - SvAggregate( SotFactory * pFactP ) - : pFact( pFactP ) - , bFactory( sal_True ) - , bMainObj( sal_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 index a64df510dd07..56030d778f5c 100644 --- a/sot/inc/sot/clsids.hxx +++ b/sot/inc/sot/clsids.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,3 +32,5 @@ #include <comphelper/classids.hxx> #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/exchange.hxx b/sot/inc/sot/exchange.hxx index da5d5854f056..7ab886f314ac 100644 --- a/sot/inc/sot/exchange.hxx +++ b/sot/inc/sot/exchange.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,18 +29,12 @@ #ifndef _SOT_EXCHANGE_HXX #define _SOT_EXCHANGE_HXX -#ifndef __SGI_STL_LIST #include <list> -#endif -#ifndef __SGI_STL_VECTOR #include <vector> -#endif #include <tools/string.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/datatransfer/DataFlavor.hpp> -#ifndef _COM_SUN_STAR_DATATRANSFER_DND_DNDCONSTANTS_HDL_ #include <com/sun/star/datatransfer/dnd/DNDConstants.hdl> -#endif #include "sot/sotdllapi.h" class SotDataObject; @@ -251,3 +246,5 @@ public: }; #endif // _EXCHANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx index 064c4b6388a1..d6eba9afe60a 100644 --- a/sot/inc/sot/factory.hxx +++ b/sot/inc/sot/factory.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,20 +29,17 @@ #ifndef _SOT_FACTORY_HXX #define _SOT_FACTORY_HXX -#ifndef _TOOLS_GLOBNAME_HXX #include <tools/globname.hxx> -#endif -#ifndef _TOOLS_RTTI_HXX #include <tools/rtti.hxx> -#endif #include "sot/sotdllapi.h" +#include <vector> /************************************************************************* *************************************************************************/ class SotObject; class SotFactory; -DECLARE_LIST( SotFactoryList, SotFactory * ) +typedef ::std::vector< SotFactory* > SotFactoryList; typedef void * (*CreateInstanceType)( SotObject ** ); //==================class SotFactory======================================= @@ -88,3 +86,5 @@ private: }; #endif // _FACTORY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/filelist.hxx b/sot/inc/sot/filelist.hxx index 4db3e4866817..0ba367fa9f72 100644 --- a/sot/inc/sot/filelist.hxx +++ b/sot/inc/sot/filelist.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,32 +32,32 @@ #include <tools/stream.hxx> #include "sot/sotdllapi.h" -class FileStringList; +#include <vector> +typedef ::std::vector< String* > FileStringList; class SOT_DLLPUBLIC FileList : public SvDataCopyStream { - FileStringList* pStrList; + FileStringList aStrList; protected: // SvData-Methoden - virtual void Load( SvStream& ); - virtual void Save( SvStream& ); - virtual void Assign( const SvDataCopyStream& ); + virtual void Load( SvStream& ); + virtual void Save( SvStream& ); + virtual void Assign( const SvDataCopyStream& ); // Liste loeschen; - void ClearAll( void ); + void ClearAll( void ); public: TYPEINFO(); - FileList(); - ~FileList(); + 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 ); @@ -67,10 +68,11 @@ public: // Liste fuellen/abfragen void AppendFile( const String& rStr ); - String GetFile( sal_uLong i ) const; - sal_uLong Count( void ) const; + String GetFile( size_t i ) const; + size_t Count( void ) const; }; #endif // _FILELIST_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/formats.hxx b/sot/inc/sot/formats.hxx index 303afecb5a17..7c2c427fe126 100644 --- a/sot/inc/sot/formats.hxx +++ b/sot/inc/sot/formats.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,9 +36,7 @@ #pragma warning(push, 1) #pragma warning(disable: 4917) #endif -#include <tools/prewin.h> #include <shlobj.h> -#include <tools/postwin.h> #ifdef _MSC_VER #pragma warning(pop) #endif @@ -189,3 +188,4 @@ #endif // _SOT_FORMATS_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx index 0f72e61510a9..40cc26800317 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,12 +30,8 @@ #define _SOT_OBJECT_HXX #include <sot/sotref.hxx> -#ifndef _SOT_SOTDATA_HXX #include <sot/sotdata.hxx> -#endif -#ifndef _TOOLS_GLOBNAME_HXX #include <tools/globname.hxx> -#endif #include "sot/sotdllapi.h" /************************************************************************* @@ -49,35 +46,35 @@ void TestMemberInvariant( sal_Bool bPrint ); #define SO2_IMPL_INVARIANT(ClassName) \ -void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ } #define SO2_IMPL_INVARIANT1(ClassName,Super1) \ -void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ } #define SO2_IMPL_INVARIANT2(ClassName,Super1,Super2) \ -void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ Super2::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -85,14 +82,14 @@ void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ } #define SO2_IMPL_INVARIANT3(ClassName,Super1,Super2,Super3) \ -void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ Super2::TestObjRef( bFree ); \ Super3::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -101,7 +98,7 @@ void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ } #define SO2_IMPL_INVARIANT4(ClassName,Super1,Super2,Super3,Super4) \ -void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ +void ClassName::TestObjRef( sal_Bool bFree ) \ { \ TestMemberObjRef( bFree ); \ Super1::TestObjRef( bFree ); \ @@ -109,7 +106,7 @@ void __EXPORT ClassName::TestObjRef( sal_Bool bFree ) \ Super3::TestObjRef( bFree ); \ Super4::TestObjRef( bFree ); \ } \ -void __EXPORT ClassName::TestInvariant( sal_Bool bPrint ) \ +void ClassName::TestInvariant( sal_Bool bPrint ) \ { \ TestMemberInvariant( bPrint ); \ Super1::TestInvariant( bPrint ); \ @@ -174,18 +171,18 @@ SotFactory * ClassName::ClassFactory() \ } \ return *ppFactory; \ } \ -void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \ +void * ClassName::CreateInstance( SotObject ** ppObj ) \ { \ ClassName * p = new ClassName(); \ if( ppObj ) \ *ppObj = p; \ return p; \ } \ -const SotFactory * __EXPORT ClassName::GetSvFactory() const \ +const SotFactory * ClassName::GetSvFactory() const \ { \ return ClassFactory(); \ } \ -void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \ +void * ClassName::Cast( const SotFactory * pFact ) \ { \ void * pRet = NULL; \ if( !pFact || pFact == ClassFactory() ) \ @@ -212,7 +209,7 @@ SotFactory * ClassName::ClassFactory() \ } \ return *ppFactory; \ } \ -void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \ +void * ClassName::CreateInstance( SotObject ** ppObj ) \ { \ ClassName * p = new ClassName(); \ Super1* pSuper1 = p; \ @@ -221,11 +218,11 @@ void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \ *ppObj = pBasicObj; \ return p; \ } \ -const SotFactory * __EXPORT ClassName::GetSvFactory() const \ +const SotFactory * ClassName::GetSvFactory() const \ { \ return ClassFactory(); \ } \ -void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \ +void * ClassName::Cast( const SotFactory * pFact ) \ { \ void * pRet = NULL; \ if( !pFact || pFact == ClassFactory() ) \ @@ -255,18 +252,18 @@ SotFactory * ClassName::ClassFactory() \ } \ return *ppFactory; \ } \ -void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \ +void * ClassName::CreateInstance( SotObject ** ppObj ) \ { \ ClassName * p = new ClassName(); \ if( ppObj ) \ *ppObj = p; \ return p; \ } \ -const SotFactory * __EXPORT ClassName::GetSvFactory() const \ +const SotFactory * ClassName::GetSvFactory() const \ { \ return ClassFactory(); \ } \ -void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \ +void * ClassName::Cast( const SotFactory * pFact ) \ { \ void * pRet = NULL; \ if( !pFact || pFact == ClassFactory() ) \ @@ -298,18 +295,18 @@ SotFactory * ClassName::ClassFactory() \ } \ return *pFactory; \ } \ -void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \ +void * ClassName::CreateInstance( SotObject ** ppObj ) \ { \ ClassName * p = new ClassName(); \ if( ppObj ) \ *ppObj = p; \ return p; \ } \ -const SotFactory * __EXPORT ClassName::GetSvFactory() const \ +const SotFactory * ClassName::GetSvFactory() const \ { \ return ClassFactory(); \ } \ -void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \ +void * ClassName::Cast( const SotFactory * pFact ) \ { \ void * pRet = NULL; \ if( !pFact || pFact == ClassFactory() ) \ @@ -345,18 +342,18 @@ SotFactory * ClassName::ClassFactory() \ } \ return *ppFactory; \ } \ -void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \ +void * ClassName::CreateInstance( SotObject ** ppObj ) \ { \ ClassName * p = new ClassName(); \ if( ppObj ) \ *ppObj = p; \ return p; \ } \ -const SotFactory * __EXPORT ClassName::GetSvFactory() const \ +const SotFactory * ClassName::GetSvFactory() const \ { \ return ClassFactory(); \ } \ -void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \ +void * ClassName::Cast( const SotFactory * pFact ) \ { \ void * pRet = NULL; \ if( !pFact || pFact == ClassFactory() ) \ @@ -430,9 +427,6 @@ private: //==================class SotObjectRef====================================== SV_IMPL_REF(SotObject) -//==================class SotObject*List==================================== -SV_DECL_REF_LIST(SotObject,SotObject*) -SV_IMPL_REF_LIST(SotObject,SotObject*) - #endif // _IFACE_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx index 213eea7f4ed3..ec8a3563c5c8 100644 --- a/sot/inc/sot/sotdata.hxx +++ b/sot/inc/sot/sotdata.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,30 +32,34 @@ /************************************************************************* *************************************************************************/ -#ifndef _TOOLS_SOLAR_H #include <tools/solar.h> -#endif #include "sot/sotdllapi.h" +#include <com/sun/star/datatransfer/DataFlavor.hpp> +#include <vector> +#include <list> //==================class SotData_Impl==================================== -class List; class SotFactory; -class SotFactoryList; -class SotObjectList; +class SotObject; + +typedef ::std::vector< SotFactory* > SotFactoryList; +typedef ::std::vector< com::sun::star::datatransfer::DataFlavor* > tDataFlavorList; struct SotData_Impl { - sal_uInt32 nSvObjCount; - SotObjectList * pObjectList; + sal_uInt32 nSvObjCount; + std::list<SotObject*> aObjectList; SotFactoryList * pFactoryList; SotFactory * pSotObjectFactory; SotFactory * pSotStorageStreamFactory; SotFactory * pSotStorageFactory; - List* pDataFlavorList; + tDataFlavorList* pDataFlavorList; SotData_Impl(); }; SOT_DLLPUBLIC SotData_Impl* SOTDATA(); #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/sotdllapi.h b/sot/inc/sot/sotdllapi.h index 032fef762715..092e55d629cb 100644 --- a/sot/inc/sot/sotdllapi.h +++ b/sot/inc/sot/sotdllapi.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,3 +40,4 @@ #endif /* INCLUDED_SOTDLLAPI_H */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/sotref.hxx b/sot/inc/sot/sotref.hxx index a6728627ef2c..ab4b2c4e0a76 100644 --- a/sot/inc/sot/sotref.hxx +++ b/sot/inc/sot/sotref.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #ifndef _SOT_SOTREF_HXX #define _SOT_SOTREF_HXX -#ifndef _TOOLS_REF_HXX #include <tools/ref.hxx> -#endif //======================================================================== #ifndef SVT_DECL_SOTOBJECT_DEFINED @@ -69,3 +68,5 @@ inline ClassName##Ref::ClassName##Ref( SotObject * pObjP ) \ SO2_IMPL_REF(ClassName) #endif // _SO2REF_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx index 630c7d6a4a0f..2d17974d0a2d 100644 --- a/sot/inc/sot/stg.hxx +++ b/sot/inc/sot/stg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,29 +32,21 @@ #include <com/sun/star/uno/Any.h> #include <com/sun/star/uno/Reference.h> -#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_H_ #include <com/sun/star/io/XInputStream.hpp> -#endif -#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_H_ #include <com/sun/star/ucb/XCommandEnvironment.hpp> -#endif -#ifndef _COM_SUN_STAR_EMBED_XSTORAGE_H_ #include <com/sun/star/embed/XStorage.hpp> -#endif #include <tools/rtti.hxx> -#ifndef _TOOLS_STREAM_HXX //autogen #include <tools/stream.hxx> -#endif -#ifndef _TOOLS_GLOBNAME_HXX //autogen #include <tools/globname.hxx> -#endif +#include "sot/storinfo.hxx" #include "sot/sotdllapi.h" #include <list> + class UNOStorageHolder; typedef ::std::list< UNOStorageHolder* > UNOStorageHolderList; @@ -108,7 +101,6 @@ public: virtual sal_Bool Equals( const BaseStorageStream& rStream ) const = 0; }; -class SvStorageInfoList; class BaseStorage : public StorageBase { public: @@ -396,3 +388,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index 3c253fd80d1e..e1ce95158b12 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,18 +32,13 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Reference.h> -#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_H_ #include <com/sun/star/io/XInputStream.hpp> -#endif #include <com/sun/star/embed/XStorage.hpp> #include <sot/object.hxx> #include <sot/factory.hxx> -#ifndef _TOOLS_STREAM_HXX #include <tools/stream.hxx> -#endif -#ifndef _TOOLS_ERRCODE_HXX #include <tools/errcode.hxx> -#endif +#include "sot/storinfo.hxx" #include "sot/sotdllapi.h" #define STORAGE_FAILIFTHERE 0x02 @@ -113,7 +109,6 @@ namespace ucbhelper class Content; } -class SvStorageInfoList; class BaseStorage; class UNOStorageHolder; class SOT_DLLPUBLIC SotStorage : virtual public SotObject @@ -270,3 +265,5 @@ SO2_IMPL_REF(SotStorage) #define SvStorageStreamRef SotStorageStreamRef #endif // _SVSTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/inc/sot/storinfo.hxx b/sot/inc/sot/storinfo.hxx index 02db24529129..53af47454ea4 100644 --- a/sot/inc/sot/storinfo.hxx +++ b/sot/inc/sot/storinfo.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,8 @@ #ifndef _SOT_STORINFO_HXX #define _SOT_STORINFO_HXX -#include <tools/pstm.hxx> #include <tools/globname.hxx> -#include <tools/ownlist.hxx> +#include <vector> #include "sot/sotdllapi.h" class StgDirEntry; @@ -39,8 +39,8 @@ class SvStorageInfo friend class SvStorage; String aName; SvGlobalName aClassName; - sal_uLong nSize; - sal_Bool bStream:1, + sal_uLong nSize; + sal_Bool bStream:1, bStorage:1; SvStorageInfo(){}; // Fuer SvStorage @@ -60,13 +60,11 @@ public: sal_uLong GetSize() const { return nSize; } }; -class SOT_DLLPUBLIC SvStorageInfoList -{ - PRV_SV_DECL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) - const SvStorageInfo * Get( const String & rName ); -}; +typedef ::std::vector< SvStorageInfo > SvStorageInfoList; SOT_DLLPUBLIC sal_uLong ReadClipboardFormat( SvStream & rStm ); SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ); #endif // _STORINFO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/prj/build.lst b/sot/prj/build.lst index 63f7a94cf054..63f7a94cf054 100755..100644 --- a/sot/prj/build.lst +++ b/sot/prj/build.lst diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index 57e65862aea2..20b8efddbfff 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,9 +41,12 @@ #include <sot/clsids.hxx> #include <rtl/instance.hxx> #include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/datatransfer/DataFlavor.hpp> #include <comphelper/documentconstants.hxx> +#ifdef GetObject +#undef GetObject +#endif + using namespace::com::sun::star::uno; using namespace::com::sun::star::datatransfer; @@ -209,7 +213,7 @@ namespace /*136 SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII, "Calc 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, /*137 SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII, "Chart 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, /*138 SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII, "Math 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, - /*139 SOT_FORMATSTR_ID_STARBASE_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII, "StarBase 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, + /*139 SOT_FORMATSTR_ID_STARBASE_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII, "StarBase 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, /*140 SOT_FORMAT_GDIMETAFILE*/ { "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"", "High Contrast GDIMetaFile", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, }; return &aInstance[0]; @@ -223,11 +227,11 @@ namespace //----------------------------------------------------------------------- -static List& InitFormats_Impl() +static tDataFlavorList& InitFormats_Impl() { SotData_Impl * pSotData = SOTDATA(); if( !pSotData->pDataFlavorList ) - pSotData->pDataFlavorList = new List(); + pSotData->pDataFlavorList = new tDataFlavorList(); return *pSotData->pDataFlavorList; } @@ -257,10 +261,10 @@ sal_uLong SotExchange::RegisterFormatName( const String& rName ) : i ); // dann in der dynamischen Liste - List& rL = InitFormats_Impl(); - for( i = 0, nMax = rL.Count(); i < nMax; i++ ) + tDataFlavorList& rL = InitFormats_Impl(); + for( i = 0, nMax = rL.size(); i < nMax; i++ ) { - DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i ); + DataFlavor* pFlavor = rL[ i ]; if( pFlavor && rName == String( pFlavor->HumanPresentableName ) ) return i + SOT_FORMATSTR_ID_USER_END + 1; } @@ -272,7 +276,7 @@ sal_uLong SotExchange::RegisterFormatName( const String& rName ) pNewFlavor->HumanPresentableName = rName; pNewFlavor->DataType = ::getCppuType( (const ::rtl::OUString*) 0 ); - rL.Insert( pNewFlavor, LIST_APPEND ); + rL.push_back( pNewFlavor ); return nMax + SOT_FORMATSTR_ID_USER_END + 1; } @@ -292,10 +296,10 @@ sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType ) return i; // dann in der dynamischen Liste - List& rL = InitFormats_Impl(); - for( i = 0, nMax = rL.Count(); i < nMax; i++ ) + tDataFlavorList& rL = InitFormats_Impl(); + for( i = 0, nMax = rL.size(); i < nMax; i++ ) { - DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i ); + DataFlavor* pFlavor = rL[ i ]; if( pFlavor && rMimeType == String( pFlavor->MimeType ) ) return i + SOT_FORMATSTR_ID_USER_END + 1; } @@ -307,7 +311,7 @@ sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType ) pNewFlavor->HumanPresentableName = rMimeType; pNewFlavor->DataType = ::getCppuType( (const ::rtl::OUString*) 0 ); - rL.Insert( pNewFlavor, LIST_APPEND ); + rL.push_back( pNewFlavor ); return nMax + SOT_FORMATSTR_ID_USER_END + 1; } @@ -324,9 +328,9 @@ sal_uLong SotExchange::RegisterFormat( const DataFlavor& rFlavor ) if( !nRet ) { - List& rL = InitFormats_Impl(); - nRet = rL.Count() + SOT_FORMATSTR_ID_USER_END + 1; - rL.Insert( new DataFlavor( rFlavor ), LIST_APPEND ); + tDataFlavorList& rL = InitFormats_Impl(); + nRet = rL.size() + SOT_FORMATSTR_ID_USER_END + 1; + rL.push_back( new DataFlavor( rFlavor ) ); } return nRet; @@ -353,13 +357,13 @@ sal_Bool SotExchange::GetFormatDataFlavor( sal_uLong nFormat, DataFlavor& rFlavo } else { - List& rL = InitFormats_Impl(); + tDataFlavorList& rL = InitFormats_Impl(); nFormat -= SOT_FORMATSTR_ID_USER_END + 1; - if( rL.Count() > nFormat ) + if( rL.size() > nFormat ) { - rFlavor = *(DataFlavor*) rL.GetObject( nFormat ); + rFlavor = *rL[ nFormat ]; bRet = sal_True; } else @@ -387,12 +391,12 @@ String SotExchange::GetFormatMimeType( sal_uLong nFormat ) sMimeType.AssignAscii( FormatArray_Impl::get()[nFormat].pMimeType ); else { - List& rL = InitFormats_Impl(); + tDataFlavorList& rL = InitFormats_Impl(); nFormat -= SOT_FORMATSTR_ID_USER_END + 1; - if( rL.Count() > nFormat ) - sMimeType = ((DataFlavor*) rL.GetObject( nFormat ))->MimeType; + if( rL.size() > nFormat ) + sMimeType = rL[ nFormat ]->MimeType; } DBG_ASSERT( sMimeType.Len(), "SotExchange::GetFormatMimeType(): DataFlavor not initialized" ); @@ -425,11 +429,11 @@ sal_uLong SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) : i ); // dann in der dynamischen Liste - List& rL = InitFormats_Impl(); + tDataFlavorList& rL = InitFormats_Impl(); ::rtl::OUString aMimeType( rMimeType ); - for( i = 0, nMax = rL.Count(); i < nMax; i++ ) + for( i = 0, nMax = rL.size(); i < nMax; i++ ) { - DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i ); + DataFlavor* pFlavor = rL[ i ]; if( pFlavor && aMimeType == pFlavor->MimeType ) return i + SOT_FORMATSTR_ID_USER_END + 1; } @@ -465,10 +469,10 @@ sal_uLong SotExchange::GetFormat( const DataFlavor& rFlavor ) : i ); // dann in der dynamischen Liste - List& rL = InitFormats_Impl(); - for( i = 0, nMax = rL.Count(); i < nMax; i++ ) + tDataFlavorList& rL = InitFormats_Impl(); + for( i = 0, nMax = rL.size(); i < nMax; i++ ) { - DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i ); + DataFlavor* pFlavor = rL[ i ]; if( pFlavor && rMimeType == pFlavor->MimeType ) return i + SOT_FORMATSTR_ID_USER_END + 1; } @@ -506,3 +510,5 @@ sal_Bool SotExchange::IsInternal( const SvGlobalName& rName ) return sal_True; return sal_False; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index d04a7917b0b4..01d098e62a75 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,7 +39,6 @@ #include <sot/sotdata.hxx> #include <sot/clsids.hxx> #include <rtl/instance.hxx> -#include <com/sun/star/datatransfer/DataFlavor.hpp> /************** class SotData_Impl *********************************************/ /************************************************************************* @@ -48,7 +48,6 @@ *************************************************************************/ SotData_Impl::SotData_Impl() : nSvObjCount( 0 ) - , pObjectList( NULL ) , pFactoryList( NULL ) , pSotObjectFactory( NULL ) , pSotStorageStreamFactory( NULL ) @@ -82,29 +81,6 @@ void SotFactory::DeInit() ByteString aStr( "Objects alive: " ); aStr.Append( ByteString::CreateFromInt32( pSotData->nSvObjCount ) ); DBG_WARNING( aStr.GetBuffer() ); - -/* - SotObjectList *pObjList = pSotData->pObjectList; - - if( pObjList ) - { - SotObject * p = pObjList->First(); - while( p ) - { - String aStr( "Factory: " ); - aStr += p->GetSvFactory()->GetClassName(); - aStr += " Count: "; - aStr += p->GetRefCount(); - DBG_TRACE( "\tReferences:" ); - p->TestObjRef( sal_False ); -#ifdef TEST_INVARIANT - DBG_TRACE( "\tInvariant:" ); - p->TestInvariant( sal_True ); -#endif - p = pObjList->Next(); - } - } -*/ #endif return; } @@ -114,28 +90,24 @@ void SotFactory::DeInit() SotFactoryList* pFactoryList = pSotData->pFactoryList; if( pFactoryList ) { - SotFactory * pFact = pFactoryList->Last(); - while( NULL != (pFact = pFactoryList->Remove()) ) - { - delete pFact; - pFact = pFactoryList->Last(); - } + for ( size_t i = pFactoryList->size(); i > 0 ; ) + delete (*pFactoryList)[ --i ]; + pFactoryList->clear(); delete pFactoryList; pSotData->pFactoryList = NULL; + } - delete pSotData->pObjectList; - pSotData->pObjectList = NULL; + pSotData->aObjectList.clear(); + if( pSotData->pDataFlavorList ) { - for( sal_uLong i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ ) - delete (::com::sun::star::datatransfer::DataFlavor*) pSotData->pDataFlavorList->GetObject( i ); + for( size_t i = 0, nMax = pSotData->pDataFlavorList->size(); i < nMax; i++ ) + delete (*pSotData->pDataFlavorList)[ i ]; delete pSotData->pDataFlavorList; pSotData->pDataFlavorList = NULL; } - //delete pSOTDATA(); - //SOTDATA() = NULL; } @@ -163,14 +135,7 @@ SotFactory::SotFactory( const SvGlobalName & rName, DBG_ASSERT( aEmptyName != *this, "create factory without SvGlobalName" ); if( Find( *this ) ) { - /* - String aStr( GetClassName() ); - aStr += ", UniqueName: "; - aStr += GetHexName(); - aStr += ", create factories with the same unique name"; - DBG_ERROR( aStr ); - */ - DBG_ERROR( "create factories with the same unique name" ); + OSL_FAIL( "create factories with the same unique name" ); } } #endif @@ -178,7 +143,7 @@ SotFactory::SotFactory( const SvGlobalName & rName, if( !pSotData->pFactoryList ) pSotData->pFactoryList = new SotFactoryList(); // muss nach hinten, wegen Reihenfolge beim zerstoeren - pSotData->pFactoryList->Insert( this, LIST_APPEND ); + pSotData->pFactoryList->push_back( this ); } @@ -216,12 +181,10 @@ const SotFactory* SotFactory::Find( const SvGlobalName & rFactName ) SotData_Impl * pSotData = SOTDATA(); if( rFactName != aEmpty && pSotData->pFactoryList ) { - SotFactory * pFact = pSotData->pFactoryList->First(); - while( pFact ) - { + for ( size_t i = 0, n = pSotData->pFactoryList->size(); i < n; ++i ) { + SotFactory* pFact = (*pSotData->pFactoryList)[ i ]; if( *pFact == rFactName ) return pFact; - pFact = pSotData->pFactoryList->Next(); } } @@ -259,10 +222,9 @@ void SotFactory::IncSvObjectCount( SotObject * pObj ) { SotData_Impl * pSotData = SOTDATA(); pSotData->nSvObjCount++; - if( !pSotData->pObjectList ) - pSotData->pObjectList = new SotObjectList(); + if( pObj ) - pSotData->pObjectList->Insert( pObj ); + pSotData->aObjectList.push_back( pObj ); } @@ -276,7 +238,7 @@ void SotFactory::DecSvObjectCount( SotObject * pObj ) SotData_Impl * pSotData = SOTDATA(); pSotData->nSvObjCount--; if( pObj ) - pSotData->pObjectList->Remove( pObj ); + pSotData->aObjectList.remove( pObj ); if( !pSotData->nSvObjCount ) { //keine internen und externen Referenzen mehr @@ -293,14 +255,10 @@ void SotFactory::TestInvariant() { #ifdef TEST_INVARIANT SotData_Impl * pSotData = SOTDATA(); - if( pSotData->pObjectList ) - { - sal_uLong nCount = pSotData->pObjectList->Count(); - for( sal_uLong i = 0; i < nCount ; i++ ) - { - pSotData->pObjectList->GetObject( i )->TestInvariant( sal_False ); - } - } + + std::list<SotObject*>::iterator it; + for( it = pSotData->aObjectList.begin(); it != pSotData->aObjectList.end(); ++it ) + (*it)->TestInvariant( sal_False ); #endif } @@ -365,3 +323,4 @@ sal_Bool SotFactory::Is( const SotFactory * pSuperCl ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx index 345e6ddec84b..8ee2a30765c7 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,31 +29,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sot.hxx" -#include<tools/list.hxx> -#include<tools/stream.hxx> -#include<tools/string.hxx> -#include<tools/rtti.hxx> -#include<sot/exchange.hxx> +#include <tools/stream.hxx> +#include <tools/string.hxx> +#include <tools/rtti.hxx> +#include <sot/exchange.hxx> #include<sot/filelist.hxx> #include <osl/thread.h> TYPEINIT1_AUTOFACTORY( FileList, SvDataCopyStream ); -// String-Liste zum Speichern der Namen deklarieren -DECLARE_LIST( FileStringList, String* ) - - /************************************************************************* |* |* FileList - Ctor/Dtor |* \*************************************************************************/ -FileList::FileList() -{ - pStrList = new FileStringList(); -} - FileList::~FileList() { ClearAll(); @@ -60,13 +51,9 @@ FileList::~FileList() void FileList::ClearAll( void ) { - // Strings in der Liste loeschen - sal_uLong nCount = pStrList->Count(); - for( sal_uLong i = 0 ; i < nCount ; i++ ) - delete pStrList->GetObject( i ); - - // Liste loeschen - delete pStrList; + for ( size_t i = 0, n = aStrList.size(); i < n; ++i ) + delete aStrList[ i ]; + aStrList.clear(); } /************************************************************************* @@ -77,14 +64,8 @@ void FileList::ClearAll( void ) FileList& FileList::operator=( const FileList& rFileList ) { - // Liste duplizieren - *pStrList = *rFileList.pStrList; - - // Strings in der Liste kopieren - sal_uLong nCount = pStrList->Count(); - for( sal_uLong i = 0 ; i < nCount ; i++ ) - pStrList->Replace( new String( *rFileList.pStrList->GetObject( i ) ), i ); - + for ( size_t i = 0, n = rFileList.aStrList.size(); i < n; ++i ) + aStrList.push_back( new String( *rFileList.aStrList[ i ] ) ); return *this; } @@ -133,7 +114,7 @@ void FileList::Assign( const SvDataCopyStream& rCopyStream ) SvStream& operator<<( SvStream& rOStm, const FileList& /*rFileList*/ ) { - OSL_ENSURE(false, "Not implemented!"); + OSL_FAIL("Not implemented!"); return rOStm; } @@ -146,7 +127,6 @@ SvStream& operator<<( SvStream& rOStm, const FileList& /*rFileList*/ ) SvStream& operator>>( SvStream& rIStm, FileList& rFileList ) { rFileList.ClearAll(); - rFileList.pStrList = new FileStringList(); String aStr; sal_uInt16 c; @@ -181,19 +161,20 @@ SvStream& operator>>( SvStream& rIStm, FileList& rFileList ) void FileList::AppendFile( const String& rStr ) { - pStrList->Insert( new String( rStr ) , pStrList->Count() ); + aStrList.push_back( new String( rStr ) ); } -String FileList::GetFile( sal_uLong i ) const +String FileList::GetFile( size_t i ) const { String aStr; - if( i < pStrList->Count() ) - aStr = *pStrList->GetObject( i ); + if( i < aStrList.size() ) + aStr = *aStrList[ i ]; return aStr; } -sal_uLong FileList::Count( void ) const +size_t FileList::Count( void ) const { - return pStrList->Count(); + return aStrList.size(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx index f04d5d439bdc..4bb8800f10e0 100644 --- a/sot/source/base/formats.cxx +++ b/sot/source/base/formats.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,14 +93,14 @@ struct SotDestinationEntry_Impl */ #define EXCHG_EMPYT_ARRAY \ -static SotAction_Impl __READONLY_DATA aEmptyArr[] = \ +static SotAction_Impl const aEmptyArr[] = \ { \ { 0xffff, 0, 0 } \ }; /* */ #define EXCHG_DEST_DOC_OLEOBJ_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_OLEOBJ_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_OLEOBJ_Def[] = \ { \ { SOT_FORMATSTR_ID_INET_IMAGE, EXCHG_IN_ACTION_LINK, 0 }, \ { SOT_FORMATSTR_ID_NETSCAPE_IMAGE, EXCHG_IN_ACTION_LINK, 0 }, \ @@ -110,12 +111,12 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_OLEOBJ_Def[] = \ { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_IN_ACTION_LINK, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_OLEOBJ_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_OLEOBJ_Move[] = \ { \ { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_OLEOBJ_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_OLEOBJ_Link[] = \ { \ { SOT_FORMATSTR_ID_INET_IMAGE, EXCHG_OUT_ACTION_INSERT_INTERACTIVE, 0 }, \ { SOT_FORMATSTR_ID_NETSCAPE_IMAGE, EXCHG_OUT_ACTION_INSERT_INTERACTIVE, 0 }, \ @@ -130,7 +131,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_OLEOBJ_Link[] = \ /* */ #define EXCHG_DEST_CHARTDOC_OLEOBJ_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_CHARTDOC_OLEOBJ_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_CHARTDOC_OLEOBJ_Def[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_LINK, 0 }, \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_LINK, 0 }, \ @@ -141,12 +142,12 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_CHARTDOC_OLEOBJ_Def[] = \ { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_IN_ACTION_LINK, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_CHARTDOC_OLEOBJ_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_CHARTDOC_OLEOBJ_Move[] = \ { \ { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_CHARTDOC_OLEOBJ_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_CHARTDOC_OLEOBJ_Link[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_OUT_ACTION_INSERT_INTERACTIVE, 0 }, \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_INTERACTIVE, 0 }, \ @@ -161,7 +162,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_CHARTDOC_OLEOBJ_Link[] = \ /* */ #define EXCHG_DEST_DOC_TEXTFRAME_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_Def[] = \ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -188,7 +189,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_Def[] = \ { SOT_FORMATSTR_ID_LINK, EXCHG_IN_ACTION_MOVE, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_Move[] = \ { \ { SOT_FORMATSTR_ID_SONLK, EXCHG_IN_ACTION_MOVE, 0 }, \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_MOVE, 0 },\ @@ -212,7 +213,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_Move[] = \ { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_Copy[] = \ { \ { SOT_FORMATSTR_ID_SBA_DATAEXCHANGE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -243,7 +244,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_Copy[] = \ { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_Link[] = \ { \ { SOT_FORMATSTR_ID_SONLK, EXCHG_IN_ACTION_LINK, 0 }, \ { SOT_FORMATSTR_ID_SBA_DATAEXCHANGE, EXCHG_IN_ACTION_LINK, 0 }, \ @@ -264,7 +265,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_Link[] = \ }; #define EXCHG_DEST_DOC_TEXTFRAME_WEB_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_WEB_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_WEB_Def[] = \ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMAT_BITMAP, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -285,7 +286,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_WEB_Def[] = { SOT_FORMATSTR_ID_LINK, EXCHG_IN_ACTION_MOVE, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_WEB_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_WEB_Move[] = \ { \ { SOT_FORMATSTR_ID_SONLK, EXCHG_IN_ACTION_MOVE, 0 }, \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_MOVE, 0 },\ @@ -303,7 +304,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_WEB_Move[] = { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_WEB_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_WEB_Copy[] = \ { \ { SOT_FORMATSTR_ID_SBA_DATAEXCHANGE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -328,7 +329,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_WEB_Copy[] = { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_WEB_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_WEB_Link[] = \ { \ { SOT_FORMATSTR_ID_SONLK, EXCHG_IN_ACTION_LINK, 0 }, \ { SOT_FORMATSTR_ID_SOLK, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -343,7 +344,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_TEXTFRAME_WEB_Link[] = /* */ #define EXCHG_DEST_DOC_GRAPHOBJ_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPHOBJ_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GRAPHOBJ_Def[] = \ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -360,7 +361,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPHOBJ_Def[] = \ { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPHOBJ_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GRAPHOBJ_Move[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_REPLACE_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_REPLACE_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -373,7 +374,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPHOBJ_Move[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_REPLACE_GRAPH | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPHOBJ_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GRAPHOBJ_Copy[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_INSERT_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_INSERT_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -386,7 +387,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPHOBJ_Copy[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPHOBJ_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GRAPHOBJ_Link[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_GET_ATTRIBUTES | EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_GET_ATTRIBUTES| EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -402,7 +403,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPHOBJ_Link[] = \ /* */ #define EXCHG_DEST_DOC_LNKD_GRAPHOBJ_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Def[] = \ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -419,7 +420,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Def[] = \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Move[] =\ +static SotAction_Impl const aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Move[] =\ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_REPLACE_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_REPLACE_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -432,7 +433,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Move[] =\ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_REPLACE_GRAPH | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Copy[] =\ +static SotAction_Impl const aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Copy[] =\ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_INSERT_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_INSERT_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -445,7 +446,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Copy[] =\ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Link[] =\ +static SotAction_Impl const aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Link[] =\ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_GET_ATTRIBUTES | EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_GET_ATTRIBUTES| EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -461,7 +462,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPHOBJ_Link[] =\ /* */ #define EXCHG_DEST_DOC_GRAPH_W_IMAP_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPH_W_IMAP_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GRAPH_W_IMAP_Def[] = \ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -479,7 +480,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPH_W_IMAP_Def[] = \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPH_W_IMAP_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GRAPH_W_IMAP_Move[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_REPLACE_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_REPLACE_SVXB| EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -492,7 +493,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPH_W_IMAP_Move[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_REPLACE_GRAPH | EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPH_W_IMAP_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GRAPH_W_IMAP_Copy[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_INSERT_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_INSERT_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -505,7 +506,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPH_W_IMAP_Copy[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPH_W_IMAP_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GRAPH_W_IMAP_Link[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_GET_ATTRIBUTES | EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_GET_ATTRIBUTES| EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -521,7 +522,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GRAPH_W_IMAP_Link[] = \ /* */ #define EXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Def[] =\ +static SotAction_Impl const aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Def[] =\ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -539,7 +540,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Def[] =\ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Move[] =\ +static SotAction_Impl const aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Move[] =\ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_REPLACE_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_REPLACE_SVXB| EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -552,7 +553,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Move[] = { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_REPLACE_GRAPH | EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Copy[] =\ +static SotAction_Impl const aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Copy[] =\ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_INSERT_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_INSERT_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -565,7 +566,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Copy[] = { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Link[] =\ +static SotAction_Impl const aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Link[] =\ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_GET_ATTRIBUTES | EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_GET_ATTRIBUTES| EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -582,7 +583,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP_Link[] = /* */ #define EXCHG_DEST_DOC_IMAPREGION_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_IMAPREGION_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_IMAPREGION_Def[] = \ { \ { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, EXCHG_IN_ACTION_COPY, FILEGRPDSC_ONLY_URL }, \ @@ -590,7 +591,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_IMAPREGION_Def[] = \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_IMAPREGION_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_IMAPREGION_Copy[] = \ { \ { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, FILEGRPDSC_ONLY_URL },\ @@ -602,7 +603,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_IMAPREGION_Copy[] = \ /* */ #define EXCHG_DEST_DOC_DRAWOBJ_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_DRAWOBJ_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_DRAWOBJ_Def[] = \ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -619,7 +620,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_DRAWOBJ_Def[] = \ { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_DRAWOBJ_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_DRAWOBJ_Copy[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_REPLACE_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_REPLACE_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -632,7 +633,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_DRAWOBJ_Copy[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_REPLACE_GRAPH | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_DRAWOBJ_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_DRAWOBJ_Move[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_INSERT_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_INSERT_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -645,7 +646,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_DRAWOBJ_Move[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_DRAWOBJ_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_DRAWOBJ_Link[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_GET_ATTRIBUTES | EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_GET_ATTRIBUTES| EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -662,7 +663,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_DRAWOBJ_Link[] = \ /* */ #define EXCHG_DEST_DOC_URLBUTTON_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLBUTTON_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_URLBUTTON_Def[] = \ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -675,14 +676,14 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLBUTTON_Def[] = \ { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLBUTTON_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_URLBUTTON_Move[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_REPLACE_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_REPLACE_SVXB | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMAT_GDIMETAFILE, EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLBUTTON_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_URLBUTTON_Copy[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_INSERT_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_INSERT_SVXB | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ @@ -699,7 +700,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLBUTTON_Copy[] = \ /* */ #define EXCHG_DEST_DOC_URLFIELD_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLFIELD_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_URLFIELD_Def[] = \ { \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -707,7 +708,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLFIELD_Def[] = \ { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLFIELD_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_URLFIELD_Copy[] = \ { \ { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, FILEGRPDSC_ONLY_URL },\ @@ -715,7 +716,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLFIELD_Copy[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLFIELD_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_URLFIELD_Link[] = \ { \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_HYPERLINK, 0 }, \ { 0xffff, 0, 0 } \ @@ -723,7 +724,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_URLFIELD_Link[] = \ /* */ #define EXCHG_DEST_DOC_GROUPOBJ_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GROUPOBJ_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GROUPOBJ_Def[] = \ { \ { SOT_FORMAT_GDIMETAFILE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -740,7 +741,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GROUPOBJ_Def[] = \ { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_IN_ACTION_COPY, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GROUPOBJ_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GROUPOBJ_Move[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_REPLACE_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_REPLACE_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -753,7 +754,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GROUPOBJ_Move[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_REPLACE_GRAPH | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GROUPOBJ_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GROUPOBJ_Copy[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_INSERT_DRAWOBJ | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_INSERT_SVXB| EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -766,7 +767,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GROUPOBJ_Copy[] = \ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GROUPOBJ_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_DOC_GROUPOBJ_Link[] = \ { \ { SOT_FORMATSTR_ID_DRAWING, EXCHG_OUT_ACTION_GET_ATTRIBUTES | EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ { SOT_FORMATSTR_ID_SVXB, EXCHG_OUT_ACTION_GET_ATTRIBUTES| EXCHG_OUT_ACTION_FLAG_FILL | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -783,7 +784,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_DOC_GROUPOBJ_Link[] = \ /* */ #define EXCHG_DEST_SWDOC_FREE_AREA_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Def[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -811,7 +812,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_Def[] = \ { SOT_FORMATSTR_ID_LINK, EXCHG_IN_ACTION_MOVE, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Move[] = \ { \ { SOT_FORMATSTR_ID_SONLK, EXCHG_IN_ACTION_MOVE, 0 }, \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_MOVE, 0 },\ @@ -834,7 +835,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_Move[] = \ { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Copy[] = \ { \ { SOT_FORMATSTR_ID_SBA_DATAEXCHANGE, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -866,7 +867,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_Copy[] = \ { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Link[] = \ { \ { SOT_FORMATSTR_ID_SONLK, EXCHG_IN_ACTION_LINK, 0 }, \ { SOT_FORMATSTR_ID_SBA_DATAEXCHANGE, EXCHG_IN_ACTION_LINK, 0 }, \ @@ -887,7 +888,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_Link[] = \ }; #define EXCHG_DEST_SWDOC_FREE_AREA_WEB_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Def[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -909,7 +910,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Def[] = { SOT_FORMATSTR_ID_LINK, EXCHG_IN_ACTION_MOVE, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Move[] = \ { \ { SOT_FORMATSTR_ID_SONLK, EXCHG_IN_ACTION_MOVE, 0 }, \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_MOVE, 0 },\ @@ -926,7 +927,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Move[] = { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Copy[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_COPY, 0 },\ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -948,7 +949,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Copy[] = { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Link[] = \ { \ { SOT_FORMATSTR_ID_SONLK, EXCHG_IN_ACTION_LINK, 0 }, \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_LINK, 0 }, \ @@ -964,7 +965,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SWDOC_FREE_AREA_WEB_Link[] = /* */ #define EXCHG_DEST_SCDOC_FREE_AREA_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SCDOC_FREE_AREA_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_SCDOC_FREE_AREA_Def[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -988,7 +989,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SCDOC_FREE_AREA_Def[] = \ { SOT_FORMATSTR_ID_LINK, EXCHG_IN_ACTION_MOVE, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SCDOC_FREE_AREA_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_SCDOC_FREE_AREA_Move[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_MOVE, 0 },\ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -1012,7 +1013,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SCDOC_FREE_AREA_Move[] = \ { SOT_FORMATSTR_ID_BIFF_8, EXCHG_IN_ACTION_MOVE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SCDOC_FREE_AREA_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_SCDOC_FREE_AREA_Copy[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_COPY, 0 },\ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -1039,7 +1040,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SCDOC_FREE_AREA_Copy[] = \ { SOT_FORMATSTR_ID_BIFF_8, EXCHG_IN_ACTION_COPY | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SCDOC_FREE_AREA_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_SCDOC_FREE_AREA_Link[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_LINK, 0 }, \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_LINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ @@ -1057,7 +1058,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SCDOC_FREE_AREA_Link[] = \ /* */ #define EXCHG_DEST_SDDOC_FREE_AREA_ARRAY \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SDDOC_FREE_AREA_Def[] = \ +static SotAction_Impl const aEXCHG_DEST_SDDOC_FREE_AREA_Def[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_COPY, 0 }, \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_COPY, 0 }, \ @@ -1081,7 +1082,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SDDOC_FREE_AREA_Def[] = \ { SOT_FORMATSTR_ID_LINK, EXCHG_IN_ACTION_MOVE, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SDDOC_FREE_AREA_Move[] = \ +static SotAction_Impl const aEXCHG_DEST_SDDOC_FREE_AREA_Move[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_MOVE, 0 },\ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -1102,7 +1103,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SDDOC_FREE_AREA_Move[] = \ { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SDDOC_FREE_AREA_Copy[] = \ +static SotAction_Impl const aEXCHG_DEST_SDDOC_FREE_AREA_Copy[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_COPY, 0 },\ { SOT_FORMAT_FILE, EXCHG_OUT_ACTION_INSERT_FILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\ @@ -1126,7 +1127,7 @@ static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SDDOC_FREE_AREA_Copy[] = \ { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ { 0xffff, 0, 0 } \ }; \ -static SotAction_Impl __READONLY_DATA aEXCHG_DEST_SDDOC_FREE_AREA_Link[] = \ +static SotAction_Impl const aEXCHG_DEST_SDDOC_FREE_AREA_Link[] = \ { \ { SOT_FORMAT_FILE_LIST, EXCHG_IN_ACTION_LINK, 0 }, \ { SOT_FORMAT_FILE, EXCHG_IN_ACTION_LINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \ @@ -1167,7 +1168,7 @@ EXCHG_DEST_SDDOC_FREE_AREA_ARRAY \ EXCHG_DEST_SWDOC_FREE_AREA_WEB_ARRAY \ #define IMPL_DATA_ARRAY_3 \ -static SotDestinationEntry_Impl __READONLY_DATA aDestinationArray[] = \ +static SotDestinationEntry_Impl const aDestinationArray[] = \ { \ { EXCHG_DEST_DOC_OLEOBJ, \ aEXCHG_DEST_DOC_OLEOBJ_Def, \ @@ -1661,3 +1662,4 @@ sal_uInt16 SotExchange::IsMath( const SvGlobalName& rName ) return nRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 8c0bb0346605..1c5a24ba4657 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,7 +34,6 @@ #include <tools/debug.hxx> #include <sot/object.hxx> #include <sot/factory.hxx> -#include <sot/agg.hxx> /************** class SotObject ******************************************/ class SotObjectFactory : public SotFactory @@ -93,10 +93,6 @@ SotObject::SotObject() |* |* SotObject::~SotObject() |* -|* Beschreibung -|* Ersterstellung MM 05.06.94 -|* Letzte Aenderung MM 05.06.94 -|* *************************************************************************/ SotObject::~SotObject() { @@ -182,7 +178,7 @@ void SotObject::RemoveOwnerLock() ReleaseRef(); } else { - DBG_ERROR("OwnerLockCount underflow!"); + OSL_FAIL("OwnerLockCount underflow!"); } } @@ -207,3 +203,4 @@ sal_Bool SotObject::Close() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index bf1490447b08..940efd5a8d70 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,15 +32,9 @@ #include <sot/storinfo.hxx> #include <osl/file.hxx> #include <tools/tempfile.hxx> -#include <tools/ownlist.hxx> #include <tools/string.hxx> -#ifndef _TOOLS_FSYS_HXX #include <tools/fsys.hxx> -#endif -#ifndef _TOOLS_STREAM_HXX #include <tools/stream.hxx> -#endif -#include <tools/pstm.hxx> #include <tools/debug.hxx> #include "sot/stg.hxx" @@ -435,7 +430,7 @@ Storage::Storage( UCBStorageStream& rStrm, sal_Bool bDirect ) SvStream* pStream = rStrm.GetModifySvStream(); if ( !pStream ) { - OSL_ENSURE( sal_False, "UCBStorageStream can not provide SvStream implementation!\n" ); + OSL_FAIL( "UCBStorageStream can not provide SvStream implementation!\n" ); SetError( SVSTREAM_GENERALERROR ); pEntry = NULL; return; @@ -552,7 +547,7 @@ void Storage::FillInfoList( SvStorageInfoList* pList ) const if( !p->bInvalid ) { SvStorageInfo aInfo( *p ); - pList->Append( aInfo ); + pList->push_back( aInfo ); } p = aIter.Next(); } @@ -563,7 +558,7 @@ void Storage::FillInfoList( SvStorageInfoList* pList ) const BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, sal_Bool bDirect ) { - DBG_ERROR("Not supported!"); + OSL_FAIL("Not supported!"); /* BaseStorage* pStorage = new Storage( pIo, NULL, m ); SetError( ERRCODE_IO_NOTSUPPORTED ); @@ -581,12 +576,8 @@ BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, sal_Bool b { if( !Validate() || !ValidateMode( m ) ) return new Storage( pIo, NULL, m ); - sal_Bool bSetAutoCommit = sal_False; if( bDirect && !pEntry->bDirect ) - { - bSetAutoCommit = sal_True; bDirect = sal_False; - } StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName ); if( !p ) @@ -813,9 +804,9 @@ sal_Bool Storage::CopyTo( BaseStorage* pDest ) const SvStorageInfoList aList; FillInfoList( &aList ); sal_Bool bRes = sal_True; - for( sal_uInt16 i = 0; i < aList.Count() && bRes; i++ ) + for( size_t i = 0; i < aList.size() && bRes; i++ ) { - SvStorageInfo& rInfo = aList.GetObject( i ); + SvStorageInfo& rInfo = aList[ i ]; bRes = pThis->CopyTo( rInfo.GetName(), pDest, rInfo.GetName() ); } if( !bRes ) @@ -1089,3 +1080,4 @@ sal_Bool Storage::Equals( const BaseStorage& rStorage ) const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx index ad400f85dee5..c411b845e0a2 100644 --- a/sot/source/sdstor/stgavl.cxx +++ b/sot/source/sdstor/stgavl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -379,6 +380,7 @@ StgAvlIterator::StgAvlIterator( StgAvlNode* p ) { pRoot = p; nCount = 0; + nCur = 0; if( p ) p->StgEnum( nCount ); } @@ -417,3 +419,4 @@ StgAvlNode* StgAvlIterator::Prev() return Find( --nCur ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgavl.hxx b/sot/source/sdstor/stgavl.hxx index 29b33ae81109..8bd48ef8b62e 100644 --- a/sot/source/sdstor/stgavl.hxx +++ b/sot/source/sdstor/stgavl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #ifndef _STGAVL_HXX #define _STGAVL_HXX -#ifndef _TOOLS_SOLAR_H #include <tools/solar.h> -#endif // This class must be overloaded to define real, living nodes. // Especially, the compare function must be implemented. @@ -77,3 +76,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index 5a0fde8b9cf1..d9b5884473b0 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,11 +32,10 @@ #if defined(_MSC_VER) && (_MSC_VER<1200) #include <tools/presys.h> #endif -#include <hash_map> +#include <boost/unordered_map.hpp> #if defined(_MSC_VER) && (_MSC_VER<1200) #include <tools/postsys.h> #endif -#include <vos/macros.hxx> #include <string.h> #include <osl/endian.h> @@ -50,12 +50,12 @@ /*************************************************************************/ //----------------------------------------------------------------------------- -typedef std::hash_map +typedef boost::unordered_map < sal_Int32, StgPage *, - std::hash< sal_Int32 >, - NAMESPACE_STD(equal_to)< sal_Int32 > + boost::hash< sal_Int32 >, + std::equal_to< sal_Int32 > > UsrStgPagePtr_Impl; #ifdef _MSC_VER #pragma warning( disable: 4786 ) @@ -544,3 +544,4 @@ sal_Int32 StgCache::Pos2Page( sal_Int32 nPos ) return ( ( nPos + nPageSize - 1 ) / nPageSize ) * nPageSize - 1; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx index d6849bdd4b3d..9b47cffed6c8 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,12 +30,8 @@ #define _STGCACHE_HXX #include <osl/endian.h> -#ifndef _TOOLS_SOLAR_H #include <tools/solar.h> -#endif -#ifndef _TOOLS_STREAM_HXX #include <tools/stream.hxx> -#endif #include <stgelem.hxx> class UCBStorageStream; @@ -130,3 +127,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index 42676a9dd222..4951daa70a6c 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -819,7 +820,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper ) { delete pCur; rIo.SetError( SVSTREAM_GENERALERROR ); - // an error occured + // an error occurred return; } @@ -1055,3 +1056,4 @@ sal_Bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx index e3cf2cb78072..ccb12c4762d7 100644 --- a/sot/source/sdstor/stgdir.hxx +++ b/sot/source/sdstor/stgdir.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -130,3 +131,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index b781e4051c3d..bfde32ade4c0 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -268,11 +269,11 @@ static String ToUpperUnicode( const String & rStr ) // I don't know the locale, so en_US is hopefully fine /* com.sun.star.lang.Locale aLocale; - aLocale.Language = OUString::createFromAscii( "en" ); - aLocale.Country = OUString::createFromAscii( "US" ); + aLocale.Language = OUString(RTL_CONSTASCII_USTRINGPARAM("en")); + aLocale.Country = OUString(RTL_CONSTASCII_USTRINGPARAM("US")); */ - static rtl::OUString aEN=rtl::OUString::createFromAscii( "en" ); - static rtl::OUString aUS=rtl::OUString::createFromAscii( "US" ); + static rtl::OUString aEN(RTL_CONSTASCII_USTRINGPARAM("en")); + static rtl::OUString aUS(RTL_CONSTASCII_USTRINGPARAM("US")); static CharClass aCC( com::sun::star::lang::Locale( aEN, aUS, rtl::OUString() ) ); return aCC.toUpper( rStr, 0, rStr.Len() ); } @@ -423,3 +424,4 @@ void StgEntry::Store( void* pTo ) << nUnknown; // 7C unknown } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx index 9730813bb0ff..7ef8c4772f36 100644 --- a/sot/source/sdstor/stgelem.hxx +++ b/sot/source/sdstor/stgelem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #ifndef _STGELEM_HXX #define _STGELEM_HXX -#ifndef _TOOLS_SOLAR_H #include <tools/solar.h> -#endif #include <sot/stg.hxx> @@ -164,3 +163,5 @@ public: #define STG_MASTER -4L // page is master FAT page #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 36b841b29ca0..64169313e67e 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -383,6 +384,8 @@ sal_uLong StgIo::ValidateFATs() // DBG_ASSERT( nErr == FAT_OK ,"Storage kaputt"); return nErr; } -// DBG_ERROR("Validiere nicht (kein FileStorage)"); +// OSL_FAIL("Validiere nicht (kein FileStorage)"); return FAT_OK; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx index 45b1985618f1..91c32c7f0e1b 100644 --- a/sot/source/sdstor/stgio.hxx +++ b/sot/source/sdstor/stgio.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -78,3 +79,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 80481957b3d0..8ae6af18f7b7 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -131,27 +132,13 @@ sal_Bool StgCompObjStream::Load() sal_Char* p = new sal_Char[ (sal_uInt16) nLen1 ]; if( Read( p, nLen1 ) == (sal_uLong) nLen1 ) { - aUserName = nLen1 ? String( p, gsl_getSystemTextEncoding() ) : String(); -/* // Now we can read the CB format - 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 ) == (sal_uLong) nLen2 && nLen2 ) - nCbFormat = Exchange::RegisterFormatName( String( p ) ); - else - SetError( SVSTREAM_GENERALERROR ); - } - else if( nLen2 == -1L ) - // Windows clipboard format - *this >> nCbFormat; - else - // unknown identifier - SetError( SVSTREAM_GENERALERROR ); -*/ + //The encoding here is "ANSI", which is pretty useless seeing as + //the actual codepage used doesn't seem to be specified/stored + //anywhere :-(. Might as well pick 1252 and be consistent on + //all platforms and envs + //http://www.openoffice.org/nonav/issues/showattachment.cgi/68668/Orginal%20Document.doc + //for a good edge-case example + aUserName = nLen1 ? String( p, RTL_TEXTENCODING_MS_1252 ) : String(); nCbFormat = ReadClipboardFormat( *this ); } else @@ -166,7 +153,7 @@ sal_Bool StgCompObjStream::Store() if( GetError() != SVSTREAM_OK ) return sal_False; Seek( 0L ); - ByteString aAsciiUserName( aUserName, RTL_TEXTENCODING_ASCII_US ); + ByteString aAsciiUserName( aUserName, RTL_TEXTENCODING_MS_1252 ); *this << (sal_Int16) 1 // Version? << (sal_Int16) -2 // 0xFFFE = Byte Order Indicator << (sal_Int32) 0x0A03 // Windows 3.10 @@ -175,20 +162,6 @@ sal_Bool StgCompObjStream::Store() << (sal_Int32) (aAsciiUserName.Len() + 1) << (const char *)aAsciiUserName.GetBuffer() << (sal_uInt8) 0; // string terminator -/* // determine the clipboard format string - String aCbFmt; - if( nCbFormat > FORMAT_GDIMETAFILE ) - aCbFmt = Exchange::GetFormatName( nCbFormat ); - if( aCbFmt.Len() ) - *this << (sal_Int32) aCbFmt.Len() + 1 - << (const char*) aCbFmt - << (sal_uInt8) 0; - else if( nCbFormat ) - *this << (sal_Int32) -1 // for Windows - << (sal_Int32) nCbFormat; - else - *this << (sal_Int32) 0; // no clipboard format -*/ WriteClipboardFormat( *this, nCbFormat ); *this << (sal_Int32) 0; // terminator Commit(); @@ -228,3 +201,4 @@ sal_Bool StgOleStream::Store() return sal_Bool( GetError() == SVSTREAM_OK ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 4f3901f5212b..bf936b6ad734 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index b3a775417817..fe40be155b9e 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -823,12 +824,12 @@ sal_Int32 StgDataStrm::Read( void* pBuf, sal_Int32 n ) while( n ) { short nBytes = nPageSize - nOffset; - short nRes; StgPage* pPg; if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { + short nRes; void *p = (sal_uInt8 *) pBuf + nDone; if( nBytes == nPageSize ) { @@ -881,12 +882,12 @@ sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n ) while( n ) { short nBytes = nPageSize - nOffset; - short nRes; StgPage* pPg; if( (sal_Int32) nBytes > n ) nBytes = (short) n; if( nBytes ) { + short nRes; const void *p = (const sal_uInt8 *) pBuf + nDone; if( nBytes == nPageSize ) { @@ -1239,3 +1240,4 @@ void StgTmpStrm::FlushData() SvMemoryStream::FlushData(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index a1bb0707cdd7..a6a0ad108da9 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #ifndef _STGSTRMS_HXX #define _STGSTRMS_HXX -#ifndef _TOOLS_STREAM_HXX #include <tools/stream.hxx> -#endif class StgIo; class StgStrm; @@ -168,3 +167,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 13c254e0cb4d..ef398d081904 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,9 +42,7 @@ #include <sot/formats.hxx> #include <sot/exchange.hxx> #include <unotools/ucbstreamhelper.hxx> -#ifndef _TOOLS_FSYS_HXX #include <tools/fsys.hxx> -#endif #include <tools/cachestr.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> @@ -170,11 +169,10 @@ SotStorageStream::~SotStorageStream() *************************************************************************/ void SotStorageStream::SyncSvStream() { - sal_uLong nPos = 0; if( pOwnStm ) { pOwnStm->Flush(); - nPos = pOwnStm->Tell(); + sal_uLong nPos = pOwnStm->Tell(); SetError( pOwnStm->GetError() ); SvStream::SyncSvStream( nPos ); } @@ -392,7 +390,7 @@ sal_Bool SotStorageStream::SetProperty( const String& rName, const ::com::sun::s } else { - DBG_ERROR("Not implemented!"); + OSL_FAIL("Not implemented!"); return sal_False; } } @@ -406,7 +404,7 @@ sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::u } else { - DBG_ERROR("Not implemented!"); + OSL_FAIL("Not implemented!"); return sal_False; } } @@ -420,7 +418,7 @@ sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::u } else { - DBG_ERROR("Not implemented!"); + OSL_FAIL("Not implemented!"); return ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >(); } } @@ -483,8 +481,6 @@ void SotStorage::TestMemberInvariant( sal_Bool /*bPrint*/ ) |* der RefCounter schon um 1 erhoet. |* Die Uebergabe erfolgt in pStorageCTor. Die Variable |* ist NULL, wenn es nicht geklappt hat. -|* Ersterstellung MM 23.06.94 -|* Letzte Aenderung MM 23.06.94 |* *************************************************************************/ #define INIT_SotStorage() \ @@ -743,7 +739,7 @@ void SotStorage::RemoveUNOStorageHolder( UNOStorageHolder* pHolder ) } else { - DBG_ERROR("Not implemented!"); + OSL_FAIL("Not implemented!"); } } @@ -769,7 +765,7 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String& return xResult; for ( UNOStorageHolderList::iterator aIter = pUNOStorageHolderList->begin(); - aIter != pUNOStorageHolderList->end(); aIter++ ) + aIter != pUNOStorageHolderList->end(); ++aIter ) if ( (*aIter) && (*aIter)->GetStorageName().Equals( rEleName ) ) { // the storage is already in use @@ -808,8 +804,8 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String& uno::Any aMediaType; if ( pChildUCBStg->GetProperty( - ::rtl::OUString::createFromAscii( "MediaType" ), aMediaType ) ) - pTempStorage->SetProperty( ::rtl::OUString::createFromAscii( "MediaType" ), aMediaType ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aMediaType ) ) + pTempStorage->SetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aMediaType ); bStorageReady = !pChildUCBStg->GetError() && !pTempStorage->GetError() && pTempStorage->Commit(); @@ -827,7 +823,7 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String& try { uno::Reference< lang::XSingleServiceFactory > xStorageFactory( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.StorageFactory" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory")) ), uno::UNO_QUERY ); OSL_ENSURE( xStorageFactory.is(), "Can't create storage factory!\n" ); @@ -855,7 +851,7 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String& catch( uno::Exception& e ) { (void)e; - OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ) ); + OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ) ); } } } @@ -1467,7 +1463,7 @@ void SotStorage::SetKey( const ByteString& rKey ) ::com::sun::star::uno::Sequence < sal_Int8 > aSequ( (sal_Int8*) pBuffer, RTL_DIGEST_LENGTH_SHA1 ); ::com::sun::star::uno::Any aAny; aAny <<= aSequ; - SetProperty( ::rtl::OUString::createFromAscii("EncryptionKey"), aAny ); + SetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EncryptionKey")), aAny ); } } } @@ -1516,7 +1512,7 @@ sal_Int32 SotStorage::GetFormatID( const com::sun::star::uno::Reference < com::s return 0; ::rtl::OUString aMediaType; - xProps->getPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ) ) >>= aMediaType; + xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ) >>= aMediaType; if ( aMediaType.getLength() ) { ::com::sun::star::datatransfer::DataFlavor aDataFlavor; @@ -1561,3 +1557,4 @@ sal_Int32 SotStorage::GetVersion( const com::sun::star::uno::Reference < com::su return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 383d2f20d1c5..5f1768b8e7ef 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,21 +34,6 @@ #include <sot/exchange.hxx> -/************** class SvStorageInfoList ********************************** -*************************************************************************/ -PRV_SV_IMPL_OWNER_LIST(SvStorageInfoList,SvStorageInfo) - -const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName ) -{ - for( sal_uLong i = 0; i < Count(); i++ ) - { - const SvStorageInfo & rType = GetObject( i ); - if( rType.GetName() == rEleName ) - return &rType; - } - return NULL; -} - /************** class SvStorageInfo ************************************** *************************************************************************/ sal_uLong ReadClipboardFormat( SvStream & rStm ) @@ -109,3 +95,4 @@ void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 532877117329..198a6572dec3 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,7 +60,6 @@ #include <unotools/streamwrap.hxx> #include <unotools/ucbhelper.hxx> #include <unotools/localfilehelper.hxx> -#include <tools/list.hxx> #include <tools/urlobj.hxx> #include <unotools/streamwrap.hxx> #include <comphelper/processfactory.hxx> @@ -75,6 +75,8 @@ #include "unostorageholder.hxx" +#include <vector> + using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; @@ -101,8 +103,6 @@ public: FileStreamWrapper_Impl( const String& rName ); virtual ~FileStreamWrapper_Impl(); - //DECLARE_UNO3_AGG_DEFAULTS( FileStreamWrapper_Impl, FileInputStreamWrapper_Base); - virtual void SAL_CALL seek( sal_Int64 _nLocation ) throw ( IllegalArgumentException, IOException, RuntimeException); virtual sal_Int64 SAL_CALL getPosition( ) throw ( IOException, RuntimeException); virtual sal_Int64 SAL_CALL getLength( ) throw ( IOException, RuntimeException); @@ -201,16 +201,8 @@ void SAL_CALL FileStreamWrapper_Impl::skipBytes(sal_Int32 nBytesToSkip) throw( N ::osl::MutexGuard aGuard( m_aMutex ); checkError(); -#ifdef DBG_UTIL - sal_uInt32 nCurrentPos = m_pSvStream->Tell(); -#endif - m_pSvStream->SeekRel(nBytesToSkip); checkError(); - -#ifdef DBG_UTIL - nCurrentPos = m_pSvStream->Tell(); -#endif } //------------------------------------------------------------------------------ @@ -335,22 +327,6 @@ TYPEINIT1( UCBStorage, BaseStorage ); sal_Int32 GetFormatId_Impl( SvGlobalName aName ) { -// if ( aName == SvGlobalName( SO3_SW_CLASSID_8 ) ) -// return SOT_FORMATSTR_ID_STARWRITER_8; -// if ( aName == SvGlobalName( SO3_SWWEB_CLASSID_8 ) ) -// return SOT_FORMATSTR_ID_STARWRITERWEB_8; -// if ( aName == SvGlobalName( SO3_SWGLOB_CLASSID_8 ) ) -// return SOT_FORMATSTR_ID_STARWRITERGLOB_8; -// if ( aName == SvGlobalName( SO3_SDRAW_CLASSID_8 ) ) -// return SOT_FORMATSTR_ID_STARDRAW_8; -// if ( aName == SvGlobalName( SO3_SIMPRESS_CLASSID_8 ) ) -// return SOT_FORMATSTR_ID_STARIMPRESS_8; -// if ( aName == SvGlobalName( SO3_SC_CLASSID_8 ) ) -// return SOT_FORMATSTR_ID_STARCALC_8; -// if ( aName == SvGlobalName( SO3_SCH_CLASSID_8 ) ) -// return SOT_FORMATSTR_ID_STARCHART_8; -// if ( aName == SvGlobalName( SO3_SM_CLASSID_8 ) ) -// return SOT_FORMATSTR_ID_STARMATH_8; if ( aName == SvGlobalName( SO3_SW_CLASSID_60 ) ) return SOT_FORMATSTR_ID_STARWRITER_60; if ( aName == SvGlobalName( SO3_SWWEB_CLASSID_60 ) ) @@ -375,7 +351,7 @@ sal_Int32 GetFormatId_Impl( SvGlobalName aName ) return 0; else { - DBG_ERROR( "Unknown UCB storage format!" ); + OSL_FAIL( "Unknown UCB storage format!" ); return 0; } } @@ -424,7 +400,6 @@ SvGlobalName GetClassId_Impl( sal_Int32 nFormat ) case SOT_FORMATSTR_ID_STARMATH_60 : return SvGlobalName( SO3_SM_CLASSID_60 ); default : - //DBG_ERROR( "Unknown UCB storage format!" ); return SvGlobalName(); } } @@ -487,12 +462,6 @@ public: sal_uLong ReadSourceWriteTemporary( sal_uLong aLength ); // read aLength from source and copy to temporary, // no seeking is produced sal_uLong ReadSourceWriteTemporary(); // read source till the end and copy to temporary, - // no seeking is produced -#if 0 - 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_uLong CopySourceToTemporary(); // same as ReadSourceWriteToTemporary() // but the writing is done at the end of temporary @@ -508,7 +477,7 @@ public: SV_DECL_IMPL_REF( UCBStorageStream_Impl ); struct UCBStorageElement_Impl; -DECLARE_LIST( UCBStorageElementList_Impl, UCBStorageElement_Impl* ) +typedef ::std::vector< UCBStorageElement_Impl* > UCBStorageElementList_Impl; class UCBStorage_Impl : public SvRefBase { @@ -524,7 +493,6 @@ public: ::ucbhelper::Content* m_pContent; // the content that provides the storage elements ::utl::TempFile* m_pTempFile; // temporary file, only for storages on stream SvStream* m_pSource; // original stream, only for storages on a stream - //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 ) sal_Bool m_bModified; // only modified elements will be sent to the original content @@ -636,7 +604,7 @@ String UCBStorageElement_Impl::GetContentType() return m_xStorage->m_aContentType; else { - DBG_ERROR("Element not loaded!"); + OSL_FAIL("Element not loaded!"); return String(); } } @@ -650,7 +618,7 @@ void UCBStorageElement_Impl::SetContentType( const String& rType ) m_xStorage->m_aContentType = m_xStorage->m_aOriginalContentType = rType; } else { - DBG_ERROR("Element not loaded!"); + OSL_FAIL("Element not loaded!"); } } @@ -706,7 +674,7 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM { xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(), xProgress ); - aTemp += rtl::OUString::createFromAscii("?repairpackage"); + aTemp += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?repairpackage")); } m_pContent = new ::ucbhelper::Content( aTemp, xComEnv ); @@ -724,7 +692,7 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM ::com::sun::star::uno::Sequence < sal_Int8 > aSequ( (sal_Int8*) pBuffer, RTL_DIGEST_LENGTH_SHA1 ); ::com::sun::star::uno::Any aAny; aAny <<= aSequ; - m_pContent->setPropertyValue( ::rtl::OUString::createFromAscii("EncryptionKey"), aAny ); + m_pContent->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EncryptionKey")), aAny ); } } } @@ -762,7 +730,7 @@ Reference<XInputStream> UCBStorageStream_Impl::GetXInputStream() if( m_pAntiImpl && m_nRepresentMode != nonset ) { - DBG_ERROR( "Misuse of the XInputstream!" ); + OSL_FAIL( "Misuse of the XInputstream!" ); SetError( ERRCODE_IO_ACCESSDENIED ); } else @@ -816,7 +784,7 @@ sal_Bool UCBStorageStream_Impl::Init() { if( m_nRepresentMode == xinputstream ) { - DBG_ERROR( "XInputStream misuse!" ); + OSL_FAIL( "XInputStream misuse!" ); SetError( ERRCODE_IO_ACCESSDENIED ); return sal_False; } @@ -838,7 +806,7 @@ sal_Bool UCBStorageStream_Impl::Init() if( !m_pStream ) { - DBG_ERROR( "Suspicious temporary stream creation!" ); + OSL_FAIL( "Suspicious temporary stream creation!" ); SetError( SVSTREAM_CANNOT_MAKE ); return sal_False; } @@ -877,7 +845,7 @@ sal_Bool UCBStorageStream_Impl::Init() { // something is really wrong m_bSourceRead = sal_False; - DBG_ERROR( "Can not operate original stream!" ); + OSL_FAIL( "Can not operate original stream!" ); SetError( SVSTREAM_CANNOT_MAKE ); } @@ -919,7 +887,7 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary() #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -962,7 +930,7 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength ) #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -990,25 +958,6 @@ sal_uLong UCBStorageStream_Impl::CopySourceToTemporary() } -#if 0 -sal_uLong UCBStorageStream_Impl::CopySourceToTemporary( sal_uLong aLength ) -{ - // current position of the temporary stream is not changed - sal_uLong aResult = 0; - - if( m_bSourceRead ) - { - sal_uLong aPos = m_pStream->Tell(); - m_pStream->Seek( STREAM_SEEK_TO_END ); - aResult = ReadSourceWriteTemporary( aLength ); - m_pStream->Seek( aPos ); - } - - return aResult; - -} -#endif - // 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_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) @@ -1039,7 +988,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) #if OSL_DEBUG_LEVEL > 1 catch( Exception & e ) { - OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); #else catch( Exception & ) { @@ -1244,7 +1193,7 @@ sal_Int16 UCBStorageStream_Impl::Commit() aArg.Data = xStream; aArg.ReplaceExisting = sal_True; aAny <<= aArg; - m_pContent->executeCommand( ::rtl::OUString::createFromAscii("insert"), aAny ); + m_pContent->executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("insert")), aAny ); // wrapper now controls lifetime of temporary file m_aTempURL.Erase(); @@ -1287,7 +1236,7 @@ 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!" ); + OSL_FAIL("Revert while commit is in progress!" ); return sal_False; // ??? } @@ -1435,7 +1384,7 @@ sal_uLong UCBStorageStream::Write( const void* pData, sal_uLong nSize ) // mba: does occur in writer ! if ( pImp->m_bCommited ) { - DBG_ERROR("Writing while commit is in progress!" ); + OSL_FAIL("Writing while commit is in progress!" ); return 0; } */ @@ -1468,7 +1417,7 @@ sal_Bool UCBStorageStream::SetSize( sal_uLong nNewSize ) /* if ( pImp->m_bCommited ) { - DBG_ERROR("Changing stream size while commit is in progress!" ); + OSL_FAIL("Changing stream size while commit is in progress!" ); return sal_False; } */ @@ -1886,7 +1835,7 @@ void UCBStorage_Impl::Init() Reference < ::com::sun::star::packages::manifest::XManifestReader > xReader = Reference< ::com::sun::star::packages::manifest::XManifestReader > ( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.packages.manifest.ManifestReader" )), UNO_QUERY) ; + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.packages.manifest.ManifestReader"))), UNO_QUERY) ; Sequence < Sequence < PropertyValue > > aProps = xReader->readManifestSequence( xInputStream ); // cleanup @@ -1906,7 +1855,7 @@ void UCBStorage_Impl::Init() { // get the manifest information from the package try { - Any aAny = m_pContent->getPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ) ); + Any aAny = m_pContent->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); rtl::OUString aTmp; if ( ( aAny >>= aTmp ) && aTmp.getLength() ) m_aContentType = m_aOriginalContentType = aTmp; @@ -1951,7 +1900,7 @@ void UCBStorage_Impl::CreateContent() { xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(), m_xProgressHandler ); - aTemp += rtl::OUString::createFromAscii("?repairpackage"); + aTemp += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?repairpackage")); } m_pContent = new ::ucbhelper::Content( aTemp, xComEnv ); @@ -1978,10 +1927,10 @@ void UCBStorage_Impl::ReadContent() // create cursor for access to children Sequence< ::rtl::OUString > aProps(4); ::rtl::OUString* pProps = aProps.getArray(); - pProps[0] = ::rtl::OUString::createFromAscii( "Title" ); - pProps[1] = ::rtl::OUString::createFromAscii( "IsFolder" ); - pProps[2] = ::rtl::OUString::createFromAscii( "MediaType" ); - pProps[3] = ::rtl::OUString::createFromAscii( "Size" ); + pProps[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); + pProps[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); + pProps[2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); + pProps[3] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")); ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; try @@ -2003,7 +1952,7 @@ void UCBStorage_Impl::ReadContent() if ( m_bIsLinked ) { // unpacked storages have to deal with the meta-inf folder by themselves - if( aTitle.equalsAscii("META-INF") ) + if( aTitle.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("META-INF")) ) continue; } else @@ -2014,7 +1963,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_uLong) nSize ); - m_aChildrenList.Insert( pElement, LIST_APPEND ); + m_aChildrenList.push_back( pElement ); sal_Bool bIsOfficeDocument = m_bIsLinked || ( m_aClassId != SvGlobalName() ); if ( bIsFolder ) @@ -2042,7 +1991,7 @@ void UCBStorage_Impl::ReadContent() ::ucbhelper::Content aContent( aName, xComEnv ); ::rtl::OUString aMediaType; - Any aAny = aContent.getPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ) ); + Any aAny = aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ); if ( ( aAny >>= aMediaType ) && ( aMediaType.compareToAscii("application/vnd.sun.star.oleobject") == 0 ) ) pElement->m_bIsStorage = sal_True; else if ( !aMediaType.getLength() ) @@ -2103,14 +2052,13 @@ void UCBStorage_Impl::SetError( long nError ) sal_Int32 UCBStorage_Impl::GetObjectCount() { - sal_Int32 nCount = m_aChildrenList.Count(); - UCBStorageElement_Impl* pElement = m_aChildrenList.First(); - while ( pElement ) + sal_Int32 nCount = m_aChildrenList.size(); + for ( size_t i = 0; i < m_aChildrenList.size(); ++i ) { + UCBStorageElement_Impl* pElement = m_aChildrenList[ i ]; DBG_ASSERT( !pElement->m_bIsFolder || pElement->m_xStorage.Is(), "Storage should be open!" ); if ( pElement->m_bIsFolder && pElement->m_xStorage.Is() ) nCount += pElement->m_xStorage->GetObjectCount(); - pElement = m_aChildrenList.Next(); } return nCount; @@ -2127,7 +2075,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount() for ( sal_Int32 nProps=0; nProps<rMyProps.getLength(); nProps++ ) { const PropertyValue& rAny = rMyProps[nProps]; - if ( rAny.Name.equalsAscii("FullPath") ) + if ( rAny.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FullPath")) ) { rtl::OUString aTmp; if ( ( rAny.Value >>= aTmp ) && aTmp == rPath ) @@ -2135,7 +2083,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount() if ( aType.getLength() ) break; } - else if ( rAny.Name.equalsAscii("MediaType") ) + else if ( rAny.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType")) ) { if ( ( rAny.Value >>= aType ) && aType.getLength() && bFound ) break; @@ -2162,9 +2110,9 @@ void UCBStorage_Impl::SetProps( const Sequence < Sequence < PropertyValue > >& r // the "FullPath" of a child always starts without '/' aPath.Erase(); - UCBStorageElement_Impl* pElement = m_aChildrenList.First(); - while ( pElement ) + for ( size_t i = 0; i < m_aChildrenList.size(); ++i ) { + UCBStorageElement_Impl* pElement = m_aChildrenList[ i ]; DBG_ASSERT( !pElement->m_bIsFolder || pElement->m_xStorage.Is(), "Storage should be open!" ); if ( pElement->m_bIsFolder && pElement->m_xStorage.Is() ) pElement->m_xStorage->SetProps( rSequence, aPath ); @@ -2174,8 +2122,6 @@ void UCBStorage_Impl::SetProps( const Sequence < Sequence < PropertyValue > >& r aElementPath += pElement->m_aName; pElement->SetContentType( Find_Impl( rSequence, aElementPath ) ); } - - pElement = m_aChildrenList.Next(); } if ( m_aContentType.Len() ) @@ -2205,9 +2151,9 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < Propert if ( !m_bIsRoot ) aPath += m_aName; aPath += '/'; - aProps[0].Name = ::rtl::OUString::createFromAscii("MediaType"); + aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); aProps[0].Value <<= (::rtl::OUString ) m_aContentType; - aProps[1].Name = ::rtl::OUString::createFromAscii("FullPath"); + aProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FullPath")); aProps[1].Value <<= (::rtl::OUString ) aPath; rSequence[ nProps++ ] = aProps; @@ -2216,9 +2162,9 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < Propert aPath.Erase(); // now the properties of my elements - UCBStorageElement_Impl* pElement = m_aChildrenList.First(); - while ( pElement ) + for ( size_t i = 0; i < m_aChildrenList.size(); ++i ) { + UCBStorageElement_Impl* pElement = m_aChildrenList[ i ]; DBG_ASSERT( !pElement->m_bIsFolder || pElement->m_xStorage.Is(), "Storage should be open!" ); if ( pElement->m_bIsFolder && pElement->m_xStorage.Is() ) // storages add there properties by themselves ( see above ) @@ -2228,14 +2174,12 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < Propert // properties of streams String aElementPath( aPath ); aElementPath += pElement->m_aName; - aProps[0].Name = ::rtl::OUString::createFromAscii("MediaType"); + aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); aProps[0].Value <<= (::rtl::OUString ) pElement->GetContentType(); - aProps[1].Name = ::rtl::OUString::createFromAscii("FullPath"); + aProps[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FullPath")); aProps[1].Value <<= (::rtl::OUString ) aElementPath; rSequence[ nProps++ ] = aProps; } - - pElement = m_aChildrenList.Next(); } } @@ -2244,7 +2188,7 @@ UCBStorage_Impl::~UCBStorage_Impl() if ( m_pUNOStorageHolderList ) { for ( UNOStorageHolderList::iterator aIter = m_pUNOStorageHolderList->begin(); - aIter != m_pUNOStorageHolderList->end(); aIter++ ) + aIter != m_pUNOStorageHolderList->end(); ++aIter ) if ( *aIter ) { (*aIter)->InternalDispose(); @@ -2257,14 +2201,10 @@ UCBStorage_Impl::~UCBStorage_Impl() } // first delete elements! - UCBStorageElement_Impl* pElement = m_aChildrenList.First(); - while ( pElement ) - { - delete pElement; - pElement = m_aChildrenList.Next(); - } + for ( size_t i = 0, n = m_aChildrenList.size(); i < n; ++i ) + delete m_aChildrenList[ i ]; + m_aChildrenList.clear(); - m_aChildrenList.Clear(); delete m_pContent; delete m_pTempFile; } @@ -2336,7 +2276,6 @@ sal_Bool UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent ) sal_Int16 UCBStorage_Impl::Commit() { // send all changes to the package - UCBStorageElement_Impl* pElement = m_aChildrenList.First(); sal_Int16 nRet = COMMIT_RESULT_NOTHING_TO_DO; // there is nothing to do if the storage has been opened readonly or if it was opened in transacted mode and no @@ -2346,8 +2285,9 @@ sal_Int16 UCBStorage_Impl::Commit() try { // all errors will be caught in the "catch" statement outside the loop - while ( pElement && nRet ) + for ( size_t i = 0; i < m_aChildrenList.size() && nRet; ++i ) { + UCBStorageElement_Impl* pElement = m_aChildrenList[ i ]; ::ucbhelper::Content* pContent = pElement->GetContent(); sal_Bool bDeleteContent = sal_False; if ( !pContent && pElement->IsModified() ) @@ -2368,7 +2308,7 @@ sal_Int16 UCBStorage_Impl::Commit() // first remove all open stream handles if( !pElement->m_xStream.Is() || pElement->m_xStream->Clear() ) { - pContent->executeCommand( ::rtl::OUString::createFromAscii("delete"), makeAny( sal_Bool( sal_True ) ) ); + pContent->executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), makeAny( sal_Bool( sal_True ) ) ); nRet = COMMIT_RESULT_SUCCESS; } else @@ -2414,7 +2354,7 @@ sal_Int16 UCBStorage_Impl::Commit() nLocalRet = COMMIT_RESULT_SUCCESS; Any aAny; aAny <<= (rtl::OUString) pElement->m_aName; - pContent->setPropertyValue( ::rtl::OUString::createFromAscii("Title"), aAny ); + pContent->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")), aAny ); } if ( pElement->IsLoaded() && pElement->GetContentType() != pElement->GetOriginalContentType() ) @@ -2423,7 +2363,7 @@ sal_Int16 UCBStorage_Impl::Commit() nLocalRet = COMMIT_RESULT_SUCCESS; Any aAny; aAny <<= (rtl::OUString) pElement->GetContentType(); - pContent->setPropertyValue( ::rtl::OUString::createFromAscii("MediaType"), aAny ); + pContent->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aAny ); } if ( nLocalRet != COMMIT_RESULT_NOTHING_TO_DO ) @@ -2436,8 +2376,6 @@ sal_Int16 UCBStorage_Impl::Commit() if ( nRet == COMMIT_RESULT_FAILURE ) break; - - pElement = m_aChildrenList.Next(); } } catch ( ContentCreationException& ) @@ -2476,7 +2414,7 @@ sal_Int16 UCBStorage_Impl::Commit() // clipboard format and ClassId will be retrieved from the media type when the file is loaded again Any aType; aType <<= (rtl::OUString) m_aContentType; - m_pContent->setPropertyValue( ::rtl::OUString::createFromAscii( "MediaType" ), aType ); + m_pContent->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aType ); if ( m_bIsLinked ) { @@ -2499,7 +2437,7 @@ sal_Int16 UCBStorage_Impl::Commit() Reference < ::com::sun::star::packages::manifest::XManifestWriter > xWriter = Reference< ::com::sun::star::packages::manifest::XManifestWriter > ( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.packages.manifest.ManifestWriter" )), UNO_QUERY) ; + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.packages.manifest.ManifestWriter"))), UNO_QUERY) ; sal_Int32 nCount = GetObjectCount() + 1; Sequence < Sequence < PropertyValue > > aProps( nCount ); sal_Int32 nProps = 0; @@ -2511,7 +2449,7 @@ sal_Int16 UCBStorage_Impl::Commit() xWriter = NULL; xOutputStream = NULL; DELETEZ( pTempFile ); - aNewSubFolder.transferContent( aSource, InsertOperation_MOVE, ::rtl::OUString::createFromAscii("manifest.xml"), NameClash::OVERWRITE ); + aNewSubFolder.transferContent( aSource, InsertOperation_MOVE, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("manifest.xml")), NameClash::OVERWRITE ); } } else @@ -2522,7 +2460,7 @@ sal_Int16 UCBStorage_Impl::Commit() #endif // force writing Any aAny; - m_pContent->executeCommand( ::rtl::OUString::createFromAscii("flush"), aAny ); + m_pContent->executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("flush")), aAny ); if ( m_pSource != 0 ) { SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READ ); @@ -2583,23 +2521,22 @@ 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(); - sal_Bool bRet = sal_True; - while ( pInnerElement && bRet ) + for ( size_t i = 0; i < m_aChildrenList.size(); ) { - UCBStorageElement_Impl* pNext = m_aChildrenList.Next(); + UCBStorageElement_Impl* pInnerElement = m_aChildrenList[ i ]; if ( pInnerElement->m_bIsRemoved ) { - // is this correct use of our list class ?! - m_aChildrenList.Remove( pInnerElement ); + UCBStorageElementList_Impl::iterator it = m_aChildrenList.begin(); + ::std::advance( it, i ); + delete *it; + m_aChildrenList.erase( it ); } else { pInnerElement->m_aOriginalName = pInnerElement->m_aName; pInnerElement->m_bIsInserted = sal_False; + ++i; } - - pInnerElement = pNext; } } @@ -2611,14 +2548,16 @@ sal_Int16 UCBStorage_Impl::Commit() sal_Bool UCBStorage_Impl::Revert() { - UCBStorageElement_Impl* pElement = m_aChildrenList.First(); - sal_Bool bRet = sal_True; - while ( pElement && bRet ) + for ( size_t i = 0; i < m_aChildrenList.size(); ) { + UCBStorageElement_Impl* pElement = m_aChildrenList[ i ]; pElement->m_bIsRemoved = sal_False; if ( pElement->m_bIsInserted ) { - m_aChildrenList.Remove( pElement ); // correct usage of list ??? + UCBStorageElementList_Impl::iterator it = m_aChildrenList.begin(); + ::std::advance( it, i ); + delete *it; + m_aChildrenList.erase( it ); } else { @@ -2635,12 +2574,10 @@ sal_Bool UCBStorage_Impl::Revert() pElement->m_aName = pElement->m_aOriginalName; pElement->m_bIsRemoved = sal_False; + ++i; } - - pElement = m_aChildrenList.Next(); } - - return bRet; + return sal_True; } const String& UCBStorage::GetName() const @@ -2720,16 +2657,16 @@ sal_uLong UCBStorage::GetFormat() String UCBStorage::GetUserName() { - DBG_ERROR("UserName is not implemented in UCB storages!" ); + OSL_FAIL("UserName is not implemented in UCB storages!" ); return pImp->m_aUserTypeName; } void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const { // put information in childrenlist into StorageInfoList - UCBStorageElement_Impl* pElement = pImp->GetChildrenList().First(); - while ( pElement ) + for ( size_t i = 0; i < pImp->GetChildrenList().size(); ++i ) { + UCBStorageElement_Impl* pElement = pImp->GetChildrenList()[ i ]; if ( !pElement->m_bIsRemoved ) { // problem: what about the size of a substorage ?! @@ -2737,10 +2674,8 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const if ( pElement->m_xStream.Is() ) nSize = pElement->m_xStream->GetSize(); SvStorageInfo aInfo( pElement->m_aName, nSize, pElement->m_bIsStorage ); - pList->Append( aInfo ); + pList->push_back( aInfo ); } - - pElement = pImp->m_aChildrenList.Next(); } } @@ -2827,15 +2762,13 @@ sal_Bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const String& rName ) const { DBG_ASSERT( rName.Len(), "Name is empty!" ); - UCBStorageElement_Impl* pElement = pImp->GetChildrenList().First(); - while ( pElement ) + for ( size_t i = 0, n = pImp->GetChildrenList().size(); i < n; ++i ) { + UCBStorageElement_Impl* pElement = pImp->GetChildrenList()[ i ]; if ( pElement->m_aName == rName && !pElement->m_bIsRemoved ) - break; - pElement = pImp->m_aChildrenList.Next(); + return pElement; } - - return pElement; + return NULL; } sal_Bool UCBStorage::CopyTo( BaseStorage* pDestStg ) const @@ -2857,12 +2790,11 @@ sal_Bool UCBStorage::CopyTo( BaseStorage* pDestStg ) const pDestStg->SetDirty(); sal_Bool bRet = sal_True; - UCBStorageElement_Impl* pElement = pImp->GetChildrenList().First(); - while ( pElement && bRet ) + for ( size_t i = 0; i < pImp->GetChildrenList().size() && bRet; ++i ) { + UCBStorageElement_Impl* pElement = pImp->GetChildrenList()[ i ]; if ( !pElement->m_bIsRemoved ) bRet = CopyStorageElement_Impl( *pElement, pDestStg, pElement->m_aName ); - pElement = pImp->m_aChildrenList.Next(); } if( !bRet ) @@ -2936,7 +2868,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 = sal_True; - pImp->m_aChildrenList.Insert( pElement, LIST_APPEND ); + pImp->m_aChildrenList.push_back( pElement ); } } @@ -2948,7 +2880,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM // stream has already been created; if it has no external reference, it may be opened another time if ( pElement->m_xStream->m_pAntiImpl ) { - DBG_ERROR("Stream is already open!" ); + OSL_FAIL("Stream is already open!" ); SetError( SVSTREAM_ACCESS_DENIED ); // ??? return NULL; } @@ -2963,7 +2895,6 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM { pElement->m_xStream->PrepareCachedForReopen( nMode ); - // DBG_ASSERT( bDirect == pElement->m_xStream->m_bDirect, "Wrong DirectMode!" ); return new UCBStorageStream( pElement->m_xStream ); } } @@ -3038,7 +2969,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM // Because nothing is known about the element that should be created, an external parameter is needed ! pElement = new UCBStorageElement_Impl( rEleName ); pElement->m_bIsInserted = sal_True; - pImp->m_aChildrenList.Insert( pElement, LIST_APPEND ); + pImp->m_aChildrenList.push_back( pElement ); } if ( !pElement->m_bIsFolder && ( pElement->m_bIsStorage || !bForceUCBStorage ) ) @@ -3072,7 +3003,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM // storage has already been opened; if it has no external reference, it may be opened another time if ( pElement->m_xStorage->m_pAntiImpl ) { - DBG_ERROR("Storage is already open!" ); + OSL_FAIL("Storage is already open!" ); SetError( SVSTREAM_ACCESS_DENIED ); // ??? } else @@ -3089,7 +3020,6 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM } else { -// DBG_ASSERT( bDirect == pElement->m_xStorage->m_bDirect, "Wrong DirectMode!" ); return new UCBStorage( pElement->m_xStorage ); } } @@ -3598,3 +3528,4 @@ UNOStorageHolderList* UCBStorage::GetUNOStorageHolderList() return pImp->m_pUNOStorageHolderList; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/unostorageholder.cxx b/sot/source/sdstor/unostorageholder.cxx index 00a905125ff6..dbb54e08cd4d 100644 --- a/sot/source/sdstor/unostorageholder.cxx +++ b/sot/source/sdstor/unostorageholder.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,7 +37,7 @@ #include <comphelper/processfactory.hxx> #include "unostorageholder.hxx" -#include <sot/storinfo.hxx> +#include "sot/storinfo.hxx" using namespace ::com::sun::star; @@ -109,7 +110,7 @@ void SAL_CALL UNOStorageHolder::commited( const lang::EventObject& /*aEvent*/ ) uno::Reference< lang::XSingleServiceFactory > xStorageFactory( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.StorageFactory" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory")) ), uno::UNO_QUERY ); OSL_ENSURE( xStorageFactory.is(), "Can't create storage factory!\n" ); @@ -139,7 +140,7 @@ void SAL_CALL UNOStorageHolder::commited( const lang::EventObject& /*aEvent*/ ) SvStorageInfoList aSubStorInfoList; m_rSotStorage->FillInfoList( &aSubStorInfoList ); - for ( sal_uInt32 nInd = 0; nInd < aSubStorInfoList.Count(); nInd++ ) + for ( sal_uInt32 nInd = 0; nInd < aSubStorInfoList.size(); nInd++ ) { m_rSotStorage->Remove( aSubStorInfoList[nInd].GetName() ); if ( m_rSotStorage->GetError() ) @@ -154,8 +155,8 @@ void SAL_CALL UNOStorageHolder::commited( const lang::EventObject& /*aEvent*/ ) // CopyTo does not transport unknown media type // just workaround it uno::Any aMediaType; - if ( rTempStorage->GetProperty( ::rtl::OUString::createFromAscii( "MediaType" ), aMediaType ) ) - m_rSotStorage->SetProperty( ::rtl::OUString::createFromAscii( "MediaType" ), aMediaType ); + if ( rTempStorage->GetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aMediaType ) ) + m_rSotStorage->SetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aMediaType ); m_rSotStorage->Commit(); } @@ -195,3 +196,4 @@ void SAL_CALL UNOStorageHolder::disposing( const lang::EventObject& /*Source*/ ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/unostorageholder.hxx b/sot/source/sdstor/unostorageholder.hxx index 5e70804745a8..13743c64447e 100644 --- a/sot/source/sdstor/unostorageholder.hxx +++ b/sot/source/sdstor/unostorageholder.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 083a4d585ca1..696e0cefed93 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,3 +72,4 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImp } // extern "C" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index 45baf9eed4c5..0e765a7285c9 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,14 +84,14 @@ OLESimpleStorage::~OLESimpleStorage() uno::Sequence< ::rtl::OUString > SAL_CALL OLESimpleStorage::impl_staticGetSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(1); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.embed.OLESimpleStorage"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OLESimpleStorage")); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OLESimpleStorage::impl_staticGetImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.OLESimpleStorage"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.OLESimpleStorage")); } //------------------------------------------------------------------------- @@ -266,7 +267,7 @@ void SAL_CALL OLESimpleStorage::initialize( const uno::Sequence< uno::Any >& aAr else { uno::Reference < io::XStream > xTempFile( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ), uno::UNO_QUERY_THROW ); uno::Reference < io::XSeekable > xTempSeek( xTempFile, uno::UNO_QUERY_THROW ); uno::Reference< io::XOutputStream > xTempOut = xTempFile->getOutputStream(); @@ -425,7 +426,7 @@ void SAL_CALL OLESimpleStorage::replaceByName( const ::rtl::OUString& aName, con { uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetException( ::rtl::OUString::createFromAscii( "Can't copy raw stream" ), + throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), uno::Reference< uno::XInterface >(), aCaught ); } @@ -451,7 +452,7 @@ uno::Any SAL_CALL OLESimpleStorage::getByName( const ::rtl::OUString& aName ) uno::Any aResult; uno::Reference< io::XStream > xTempFile( - m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ), uno::UNO_QUERY ); uno::Reference< io::XSeekable > xSeekable( xTempFile, uno::UNO_QUERY_THROW ); uno::Reference< io::XOutputStream > xOutputStream = xTempFile->getOutputStream(); @@ -487,7 +488,7 @@ uno::Any SAL_CALL OLESimpleStorage::getByName( const ::rtl::OUString& aName ) uno::Reference< container::XNameContainer > xResultNameContainer( m_xFactory->createInstanceWithArguments( - ::rtl::OUString::createFromAscii( "com.sun.star.embed.OLESimpleStorage" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OLESimpleStorage")), aArgs ), uno::UNO_QUERY_THROW ); @@ -565,8 +566,8 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OLESimpleStorage::getElementNames() throw uno::RuntimeException(); // TODO: } - uno::Sequence< ::rtl::OUString > aSeq( aList.Count() ); - for ( sal_uInt32 nInd = 0; nInd < aList.Count(); nInd++ ) + uno::Sequence< ::rtl::OUString > aSeq( aList.size() ); + for ( sal_uInt32 nInd = 0; nInd < aList.size(); nInd++ ) aSeq[nInd] = aList[nInd].GetName(); return aSeq; @@ -628,7 +629,7 @@ sal_Bool SAL_CALL OLESimpleStorage::hasElements() throw uno::RuntimeException(); // TODO: } - return ( aList.Count() != 0 ); + return ( aList.size() != 0 ); } //____________________________________________________________________________________________________ @@ -809,3 +810,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OLESimpleStorage::getSupportedServiceN } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/unoolestorage/xolesimplestorage.hxx b/sot/source/unoolestorage/xolesimplestorage.hxx index 18bd6ee64f9e..3761807acca3 100644 --- a/sot/source/unoolestorage/xolesimplestorage.hxx +++ b/sot/source/unoolestorage/xolesimplestorage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -193,3 +194,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/workben/testsot.cxx b/sot/workben/testsot.cxx index 0bdc3113870f..eae0bb9f7acf 100644 --- a/sot/workben/testsot.cxx +++ b/sot/workben/testsot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,4 @@ int main (int argc, sal_Char **argv) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |