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 /svl | |
parent | 0692507dcc62e94c7af88388961db1d7d12d6dbd (diff) | |
parent | 0d2916e03ea51529e15995830a1a8c36bd72e442 (diff) |
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 'svl')
233 files changed, 2645 insertions, 2702 deletions
diff --git a/svl/AllLangResTarget_svl.mk b/svl/AllLangResTarget_svl.mk index 1ecd4dcff389..d004cb1b24fb 100644 --- a/svl/AllLangResTarget_svl.mk +++ b/svl/AllLangResTarget_svl.mk @@ -36,9 +36,6 @@ $(eval $(call gb_SrsTarget_SrsTarget,svl/res)) $(eval $(call gb_SrsTarget_set_include,svl/res,\ $$(INCLUDE) \ -I$(WORKDIR)/inc \ - -I$(SRCDIR)/svl/source/inc \ - -I$(SRCDIR)/svl/inc/ \ - -I$(SRCDIR)/svl/inc/svl \ )) $(eval $(call gb_SrsTarget_add_files,svl/res,\ diff --git a/svl/Library_fsstorage.mk b/svl/Library_fsstorage.mk index f3b8f41e3c69..3e27ae8f4357 100644 --- a/svl/Library_fsstorage.mk +++ b/svl/Library_fsstorage.mk @@ -33,10 +33,10 @@ $(eval $(call gb_Library_set_include,fsstorage,\ $$(SOLARINC) \ -I$(WORKDIR)/inc/svl \ -I$(WORKDIR)/inc/ \ - -I$(SRCDIR)/svl/inc \ - -I$(SRCDIR)/svl/inc/svl \ - -I$(SRCDIR)/svl/source/inc \ - -I$(SRCDIR)/svl/inc/pch \ + -I$(realpath $(SRCDIR)/svl/inc) \ + -I$(realpath $(SRCDIR)/svl/inc/svl) \ + -I$(realpath $(SRCDIR)/svl/source/inc) \ + -I$(realpath $(SRCDIR)/svl/inc/pch) \ -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -46,7 +46,6 @@ $(eval $(call gb_Library_add_linked_libs,fsstorage,\ cppu \ cppuhelper \ sal \ - stl \ tl \ ucbhelper \ utl \ diff --git a/svl/Library_passwordcontainer.mk b/svl/Library_passwordcontainer.mk index 08acae0930ec..58b4b6edb6a7 100644 --- a/svl/Library_passwordcontainer.mk +++ b/svl/Library_passwordcontainer.mk @@ -33,10 +33,10 @@ $(eval $(call gb_Library_set_include,passwordcontainer,\ $$(SOLARINC) \ -I$(WORKDIR)/inc/svl \ -I$(WORKDIR)/inc/ \ - -I$(SRCDIR)/svl/inc \ - -I$(SRCDIR)/svl/inc/svl \ - -I$(SRCDIR)/svl/source/inc \ - -I$(SRCDIR)/svl/inc/pch \ + -I$(realpath $(SRCDIR)/svl/inc) \ + -I$(realpath $(SRCDIR)/svl/inc/svl) \ + -I$(realpath $(SRCDIR)/svl/source/inc) \ + -I$(realpath $(SRCDIR)/svl/inc/pch) \ -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -45,7 +45,6 @@ $(eval $(call gb_Library_add_linked_libs,passwordcontainer,\ cppu \ cppuhelper \ sal \ - stl \ ucbhelper \ utl \ $(gb_STDLIBS) \ diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index 97a8ae111da7..d1996dc0dc52 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -35,8 +35,8 @@ $(eval $(call gb_Library_set_componentfile,svl,svl/util/svl)) $(eval $(call gb_Library_set_include,svl,\ $$(SOLARINC) \ - -I$(SRCDIR)/svl/source/inc \ - -I$(SRCDIR)/svl/inc/pch \ + -I$(realpath $(SRCDIR)/svl/source/inc) \ + -I$(realpath $(SRCDIR)/svl/inc/pch) \ -I$(OUTDIR)/inc/offuh \ )) @@ -54,11 +54,9 @@ $(eval $(call gb_Library_add_linked_libs,svl,\ jvmfwk \ sal \ sot \ - stl \ tl \ ucbhelper \ utl \ - vos3 \ $(gb_STDLIBS) \ )) diff --git a/svl/inc/pch/precompiled_svl.cxx b/svl/inc/pch/precompiled_svl.cxx index 5e606a09f5f8..1280dea3545d 100644 --- a/svl/inc/pch/precompiled_svl.cxx +++ b/svl/inc/pch/precompiled_svl.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_svl.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/pch/precompiled_svl.hxx b/svl/inc/pch/precompiled_svl.hxx index b2ca22672cc6..9f7e56a0591e 100644 --- a/svl/inc/pch/precompiled_svl.hxx +++ b/svl/inc/pch/precompiled_svl.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. @@ -303,7 +304,7 @@ #include <algorithm> #include <deque> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <limits> #include <list> @@ -384,6 +385,7 @@ #include <rtl/logfile.hxx> #include <rtl/math.hxx> #include <rtl/memory.h> +#include <rtl/ref.hxx> #include <rtl/strbuf.hxx> #include <rtl/string.hxx> #include <rtl/tencinfo.h> @@ -394,8 +396,8 @@ #include <rtl/ustring.hxx> #include <rtl/uuid.h> -#include "unotools/configitem.hxx" -#include "unotools/configmgr.hxx" +#include <salhelper/simplereferenceobject.hxx> +#include <salhelper/timer.hxx> #include <sot/clsids.hxx> @@ -418,15 +420,11 @@ #include <unotools/numberformatcodewrapper.hxx> #include <unotools/processfactory.hxx> -#include <vos/mutex.hxx> -#include <vos/process.hxx> -#include <vos/ref.hxx> -#include <vos/refernce.hxx> -#include <vos/security.hxx> -#include <vos/thread.hxx> -#include <vos/timer.hxx> + +#include <osl/mutex.hxx> //---MARKER--- #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/PasswordHelper.hxx b/svl/inc/svl/PasswordHelper.hxx index da9bc5da99ea..29f092f5fc9d 100644 --- a/svl/inc/svl/PasswordHelper.hxx +++ b/svl/inc/svl/PasswordHelper.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. @@ -36,11 +37,12 @@ class String; class SvPasswordHelper { - static void GetHashPassword(com::sun::star::uno::Sequence <sal_Int8>& rPassHash, const sal_Char* pPass, sal_uInt32 nLen); static void GetHashPasswordLittleEndian(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const String& sPass); static void GetHashPasswordBigEndian(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const String& sPass); public: + SVL_DLLPUBLIC static void GetHashPassword(com::sun::star::uno::Sequence <sal_Int8>& rPassHash, const sal_Char* pPass, sal_uInt32 nLen); + SVL_DLLPUBLIC static void GetHashPassword(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const String& sPass); /** Use this method to compare a given string with another given Hash value. @@ -52,3 +54,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/adrparse.hxx b/svl/inc/svl/adrparse.hxx index f2a85b9cacd5..dbb671889ec3 100644 --- a/svl/inc/svl/adrparse.hxx +++ b/svl/inc/svl/adrparse.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,8 +30,8 @@ #define _ADRPARSE_HXX #include "svl/svldllapi.h" -#include <tools/list.hxx> #include <tools/string.hxx> +#include <vector> //============================================================================ struct SvAddressEntry_Impl @@ -45,7 +46,7 @@ struct SvAddressEntry_Impl }; //============================================================================ -DECLARE_LIST(SvAddressList_Impl, SvAddressEntry_Impl *) +typedef ::std::vector< SvAddressEntry_Impl* > SvAddressList_Impl; //============================================================================ class SVL_DLLPUBLIC SvAddressParser @@ -61,7 +62,7 @@ public: ~SvAddressParser(); - sal_Int32 Count() const { return m_bHasFirst ? m_aRest.Count() + 1 : 0; } + sal_Int32 Count() const { return m_bHasFirst ? m_aRest.size() + 1 : 0; } inline UniString const & GetEmailAddress(sal_Int32 nIndex) const; @@ -94,14 +95,15 @@ inline UniString const & SvAddressParser::GetEmailAddress(sal_Int32 nIndex) const { return nIndex == 0 ? m_aFirst.m_aAddrSpec : - m_aRest.GetObject(nIndex - 1)->m_aAddrSpec; + m_aRest[ nIndex - 1 ]->m_aAddrSpec; } inline UniString const & SvAddressParser::GetRealName(sal_Int32 nIndex) const { return nIndex == 0 ? m_aFirst.m_aRealName : - m_aRest.GetObject(nIndex - 1)->m_aRealName; + m_aRest[ nIndex - 1 ]->m_aRealName; } #endif // _ADRPARSE_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/aeitem.hxx b/svl/inc/svl/aeitem.hxx index b9ff02a69e78..47c437f8a177 100644 --- a/svl/inc/svl/aeitem.hxx +++ b/svl/inc/svl/aeitem.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. @@ -69,3 +70,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/asiancfg.hxx b/svl/inc/svl/asiancfg.hxx index 4dfac8df524d..a646b26733b3 100644 --- a/svl/inc/svl/asiancfg.hxx +++ b/svl/inc/svl/asiancfg.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. @@ -67,3 +68,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/brdcst.hxx b/svl/inc/svl/brdcst.hxx index 87eeab351b3c..d8ad823ed6d8 100644 --- a/svl/inc/svl/brdcst.hxx +++ b/svl/inc/svl/brdcst.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. @@ -73,3 +74,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/broadcast.hxx b/svl/inc/svl/broadcast.hxx index 758906877bc1..1e4be881d271 100644 --- a/svl/inc/svl/broadcast.hxx +++ b/svl/inc/svl/broadcast.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. @@ -65,3 +66,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/cenumitm.hxx b/svl/inc/svl/cenumitm.hxx index 0d0cf3d7c053..b74de9373f6a 100644 --- a/svl/inc/svl/cenumitm.hxx +++ b/svl/inc/svl/cenumitm.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. @@ -54,9 +55,9 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue(com::sun::star::uno::Any & rVal, sal_uInt8 = 0) const; + virtual bool QueryValue(com::sun::star::uno::Any & rVal, sal_uInt8 = 0) const; - virtual sal_Bool PutValue(const com::sun::star::uno::Any & rVal, sal_uInt8 = 0); + virtual bool PutValue(const com::sun::star::uno::Any & rVal, sal_uInt8 = 0); virtual sal_uInt16 GetValueCount() const = 0; @@ -154,9 +155,9 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0) const; + virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0) const; - virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0); + virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0); virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; @@ -175,3 +176,4 @@ public: #endif // _SVTOOLS_CENUMITM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/cintitem.hxx b/svl/inc/svl/cintitem.hxx index 68a532cee613..a6725b2fcf0b 100644 --- a/svl/inc/svl/cintitem.hxx +++ b/svl/inc/svl/cintitem.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. @@ -64,10 +65,10 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0) const; - virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0); virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; @@ -126,10 +127,10 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0) const; - virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0); virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; @@ -188,10 +189,10 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0) const; - virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0); virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; @@ -250,10 +251,10 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0) const; - virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0); virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; @@ -281,3 +282,4 @@ inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue) #endif // _SVTOOLS_CINTITEM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/cjkoptions.hxx b/svl/inc/svl/cjkoptions.hxx index 07310c22994a..430c8e57b045 100644 --- a/svl/inc/svl/cjkoptions.hxx +++ b/svl/inc/svl/cjkoptions.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. @@ -77,3 +78,4 @@ public: #endif // _SVTOOLS_CJKOPTIONS_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/cntnrsrt.hxx b/svl/inc/svl/cntnrsrt.hxx index 7c0dc6863371..7d2c119e9fd1 100644 --- a/svl/inc/svl/cntnrsrt.hxx +++ b/svl/inc/svl/cntnrsrt.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. @@ -27,8 +28,7 @@ #ifndef _CNTRSRT_HXX #define _CNTRSRT_HXX -#if 0 -*********************************************************************** +/*********************************************************************** * * Hier folgt die Beschreibung fuer die exportierten Makros: * @@ -52,8 +52,7 @@ * * Wie DECLARE_CONTAINER_SORT, nur dass beim Aufruf des Destruktors * alle im Conatiner vorhandenen Objekte geloescht werden. -* -#endif +*/ #include <tools/contnr.hxx> @@ -172,3 +171,5 @@ sal_Bool ClassName::Seek_Entry( const Type* pObj, sal_uLong* pPos ) const } \ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/cntwall.hxx b/svl/inc/svl/cntwall.hxx index 070795e6faf3..5e7828641c8f 100644 --- a/svl/inc/svl/cntwall.hxx +++ b/svl/inc/svl/cntwall.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,9 +30,7 @@ #include "svl/svldllapi.h" -#ifndef SHL_HXX #include <tools/shl.hxx> -#endif #include <tools/rtti.hxx> #include <tools/color.hxx> #include <svl/poolitem.hxx> @@ -60,9 +59,9 @@ public: virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); void SetBitmapURL( const UniString& rURL ) { _aURL = rURL; } @@ -78,3 +77,4 @@ public: #endif // _CNTWALL_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/cntwids.hrc b/svl/inc/svl/cntwids.hrc index 01a965c38652..d14cf590d740 100644 --- a/svl/inc/svl/cntwids.hrc +++ b/svl/inc/svl/cntwids.hrc @@ -28,10 +28,8 @@ #ifndef _CNTWIDS_HRC #define _CNTWIDS_HRC -#ifndef OLD_CHAOS #define TF_NEW_TABPAGES #define CNT_COOL_ABO -#endif //========================================================================= // ARGS, MSG, ALL, FOLDER, BOXALL, BOXEXT @@ -77,7 +75,6 @@ #define WID_TO (WID_CHAOS_START + 24) #define WID_FROM (WID_CHAOS_START + 25) #define WID_TITLE (WID_CHAOS_START + 26) -#define WID_SUBJECT WID_TITLE // only here to prevent panic, should be removed #define WID_MESSAGEBODY (WID_CHAOS_START + 27) #define WID_REFERENCES (WID_CHAOS_START + 28) @@ -137,8 +134,6 @@ //PROP FOLDER VIEW #define WID_DUMMY_PROPFOLDERVIEW1 (WID_CHAOS_START + 65) #define WID_THREADING (WID_CHAOS_START + 66) -#define WID_MSG_COLUMN_INFO /* obsolete */ (WID_CHAOS_START + 67) -#define WID_FLD_COLUMN_INFO /* obsolete */ (WID_CHAOS_START + 68) #define WID_FOLDERVIEW_MODE (WID_CHAOS_START + 69) #define WID_MESSAGEVIEW_MODE (WID_CHAOS_START + 70) #define WID_SENTMESSAGEVIEW_MODE (WID_CHAOS_START + 71) @@ -153,8 +148,6 @@ //PROP FOLDER DIR #define WID_DUMMY_FOLDERDIR1 (WID_CHAOS_START + 79) #define WID_TOTALCONTENTCOUNT (WID_CHAOS_START + 80) -#define WID_NEWSGROUPCOUNT /* ??? */ (WID_CHAOS_START + 81) -#define WID_ARTICLECOUNT /* ??? */ (WID_CHAOS_START + 82) #define WID_KNOWN_RANGES (WID_CHAOS_START + 83) #define WID_IMAPFOLDERINFO (WID_CHAOS_START + 84) @@ -176,23 +169,9 @@ #define WID_PASSWORD (WID_CHAOS_START + 92) #define WID_SERVERNAME (WID_CHAOS_START + 93) #define WID_SERVERPORT (WID_CHAOS_START + 94) -// obsolete -#define WID_MAILSEND_USERNAME (WID_CHAOS_START + 95) -#define WID_MAILSEND_PASSWORD (WID_CHAOS_START + 96) -#define WID_MAILSEND_SERVERNAME (WID_CHAOS_START + 97) -#define WID_NEWSSEND_USERNAME (WID_CHAOS_START + 98) -#define WID_NEWSSEND_PASSWORD (WID_CHAOS_START + 99) -#define WID_NEWSSEND_SERVERNAME (WID_CHAOS_START + 100) -// end obsolete #define WID_SERVERBASE (WID_CHAOS_START + 101) -// not used -#define WID_SMTP_GATEWAY (WID_CHAOS_START + 102) // -> ..._DEFAULT -// obsolete -#define WID_FROM_DEFAULT (WID_CHAOS_START + 103) -// obsolete -#define WID_REPLY_TO_DEFAULT (WID_CHAOS_START + 104) #define WID_AUTOUPDATE_INTERVAL (WID_CHAOS_START + 105) #define WID_UPDATE_ENABLED (WID_CHAOS_START + 106) @@ -202,11 +181,7 @@ #define WID_BOXEXT_START (WID_CHAOS_START + 107) #define WID_CONNECTION_MODE (WID_CHAOS_START + 107) #define WID_NEWS_GROUPLIST (WID_CHAOS_START + 108) -#ifdef OLD_CHAOS -#define WID_BOX_CONNECTION_PROP (WID_CHAOS_START + 109) -#else #define WID_MESSAGE_STOREMODE (WID_CHAOS_START + 109) -#endif #define WID_DELETE_ON_SERVER (WID_CHAOS_START + 110) //PROP BOX USER @@ -243,13 +218,6 @@ #define WID_STORE_MSGS_TIMELIMIT (WID_CHAOS_START + 124) // PROP BOX -#define WID_MSG_COLUMN_WIDTHS /* obsolete */(WID_CHAOS_START + 125) - -#ifdef OLD_CHAOS - -#define WID_CHAOS_END (WID_CHAOS_START + 125) - -#else ////////////////////////////////////////////////////////////////////////// // WID's added after SO 4.0 release ( SUPD > 364 ) @@ -501,6 +469,4 @@ // END #define WID_CHAOS_END (WID_CHAOS_START + 253) -#endif /* OLD_CHAOS */ - #endif /* !_CNTWIDS_HRC */ diff --git a/svl/inc/svl/converter.hxx b/svl/inc/svl/converter.hxx index c208a370bceb..fc2513c3b61f 100644 --- a/svl/inc/svl/converter.hxx +++ b/svl/inc/svl/converter.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. @@ -41,3 +42,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/ctloptions.hxx b/svl/inc/svl/ctloptions.hxx index 1f597a293983..0ef1952d90b9 100644 --- a/svl/inc/svl/ctloptions.hxx +++ b/svl/inc/svl/ctloptions.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. @@ -92,3 +93,4 @@ public: #endif // _SVTOOLS_CTLOPTIONS_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/ctypeitm.hxx b/svl/inc/svl/ctypeitm.hxx index bb3efc756187..82f0bd1179c4 100644 --- a/svl/inc/svl/ctypeitm.hxx +++ b/svl/inc/svl/ctypeitm.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. @@ -68,9 +69,9 @@ public: XubString &rText, const IntlWrapper* pIntlWrapper = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0); INetContentType GetEnumValue() const; @@ -80,3 +81,4 @@ public: #endif /* !_SVTOOLS_CTYPEITM_HXX */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/custritm.hxx b/svl/inc/svl/custritm.hxx index f0e01a6a7c32..d0346ef5d461 100644 --- a/svl/inc/svl/custritm.hxx +++ b/svl/inc/svl/custritm.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. @@ -68,10 +69,10 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0) const; - virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0); virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; @@ -90,3 +91,4 @@ inline void CntUnencodedStringItem::SetValue(const XubString & rTheValue) #endif // _SVTOOLS_CUSTRITM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/dateitem.hxx b/svl/inc/svl/dateitem.hxx index bf2c7a3c6e54..e9bae366b018 100644 --- a/svl/inc/svl/dateitem.hxx +++ b/svl/inc/svl/dateitem.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. @@ -74,9 +75,9 @@ public: "SetDateTime() with pooled item" ); aDateTime = rDT; } - virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; }; @@ -104,3 +105,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/documentlockfile.hxx b/svl/inc/svl/documentlockfile.hxx index 071a43861bf8..3be029425c18 100644 --- a/svl/inc/svl/documentlockfile.hxx +++ b/svl/inc/svl/documentlockfile.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. @@ -69,3 +70,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/eitem.hxx b/svl/inc/svl/eitem.hxx index f6dbb9951d84..ea715c349922 100644 --- a/svl/inc/svl/eitem.hxx +++ b/svl/inc/svl/eitem.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. @@ -67,3 +68,4 @@ public: #endif // _SFXENUMITEM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/filerec.hxx b/svl/inc/svl/filerec.hxx index eef347ab772b..6b7ff27ba506 100644 --- a/svl/inc/svl/filerec.hxx +++ b/svl/inc/svl/filerec.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. @@ -39,8 +40,6 @@ SV_DECL_VARARR( SfxUINT32s, sal_uInt32, 8, 8 ) //------------------------------------------------------------------------ -#define SFX_BOOL_DONTCARE sal_Bool(2) // Don't-Care-Wert f"ur BOOLs - #define SFX_REC_PRETAG_EXT sal_uInt8(0x00) // Pre-Tag f"ur Extended-Records #define SFX_REC_PRETAG_EOR sal_uInt8(0xFF) // Pre-Tag f"ur End-Of-Records @@ -223,10 +222,7 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter protected: SvStream* _pStream; // <SvStream>, in dem der Record liegt sal_uInt32 _nStartPos; // Start-Position des Gesamt-Records im Stream - FASTBOOL _bHeaderOk; /* sal_True, wenn der Header schon geschrieben ist; - bei DBG_UTIL wird SFX_BOOL_DONTCARE ver- - wendet, um die Gr"o\se von Fix-Sized-Records - zu pr"ufen. */ + bool _bHeaderOk; /* TRUE, wenn der Header schon geschrieben ist; */ sal_uInt8 _nPreTag; // in den Header zu schreibendes 'Pre-Tag' public: @@ -241,7 +237,7 @@ public: inline void Reset(); - sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True ); + sal_uInt32 Close( bool bSeekToEndOfRec = true ); private: // not implementend, not allowed @@ -281,7 +277,7 @@ class SVL_DLLPUBLIC SfxMiniRecordReader protected: SvStream* _pStream; // <SvStream>, aus dem gelesen wird sal_uInt32 _nEofRec; // Position direkt hinter dem Record - FASTBOOL _bSkipped; // sal_True: der Record wurde explizit geskippt + bool _bSkipped; // TRUE: der Record wurde explizit geskippt sal_uInt8 _nPreTag; // aus dem Header gelesenes Pre-Tag // Drei-Phasen-Ctor f"ur Subklassen @@ -292,7 +288,7 @@ protected: _bSkipped = sal_False; _nPreTag = nTag; } - inline FASTBOOL SetHeader_Impl( sal_uInt32 nHeader ); + inline bool SetHeader_Impl( sal_uInt32 nHeader ); // als ung"ultig markieren und zur"uck-seeken void SetInvalid_Impl( sal_uInt32 nRecordStartPos ) @@ -309,7 +305,7 @@ public: inline ~SfxMiniRecordReader(); inline sal_uInt8 GetTag() const; - inline FASTBOOL IsValid() const; + inline bool IsValid() const; inline SvStream& operator*() const; @@ -374,7 +370,7 @@ public: inline void Reset(); - sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True ); + sal_uInt32 Close( bool bSeekToEndOfRec = true ); }; //------------------------------------------------------------------------ @@ -420,8 +416,8 @@ protected: SfxMiniRecordReader::Construct_Impl( pStream, SFX_REC_PRETAG_EXT ); } - FASTBOOL FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag ); - FASTBOOL ReadHeader_Impl( sal_uInt16 nTypes ); + bool FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag ); + bool ReadHeader_Impl( sal_uInt16 nTypes ); public: SfxSingleRecordReader( SvStream *pStream ); @@ -430,7 +426,7 @@ public: inline sal_uInt16 GetTag() const; inline sal_uInt8 GetVersion() const; - inline FASTBOOL HasVersion( sal_uInt16 nVersion ) const; + inline bool HasVersion( sal_uInt16 nVersion ) const; }; //------------------------------------------------------------------------ @@ -505,7 +501,7 @@ public: inline void Reset(); - sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True ); + sal_uInt32 Close( bool bSeekToEndOfRec = true ); }; //------------------------------------------------------------------------ @@ -576,7 +572,7 @@ public: void NewContent(); - virtual sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True ); + virtual sal_uInt32 Close( bool bSeekToEndOfRec = true ); }; //------------------------------------------------------------------------ @@ -625,7 +621,7 @@ public: // private: geht nicht, da einige Compiler dann auch vorherige privat machen void NewContent() - { DBG_ERROR( "NewContent() only allowed with args" ); } + { OSL_FAIL( "NewContent() only allowed with args" ); } }; //------------------------------------------------------------------------ @@ -676,17 +672,17 @@ class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader sal_uInt16 _nContentTag; // Art-Kennung des aktuellen Contents sal_uInt8 _nContentVer; // Versions-Kennung des akt. Contents - FASTBOOL ReadHeader_Impl(); + bool ReadHeader_Impl(); public: SfxMultiRecordReader( SvStream *pStream ); SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag ); ~SfxMultiRecordReader(); - FASTBOOL GetContent(); + bool GetContent(); inline sal_uInt16 GetContentTag(); inline sal_uInt8 GetContentVersion() const; - inline FASTBOOL HasContentVersion( sal_uInt16 nVersion ) const; + inline bool HasContentVersion( sal_uInt16 nVersion ) const; inline sal_uInt32 ContentCount() const; }; @@ -708,7 +704,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter : _pStream( pStream ), _nStartPos( pStream->Tell() ), - _bHeaderOk(sal_False), + _bHeaderOk(false), _nPreTag( nTag ) { DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" ); @@ -735,7 +731,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter : _pStream( pStream ), // _nTag( uninitialized ), // _nStarPos( uninitialized ), - _bHeaderOk(SFX_BOOL_DONTCARE) + _bHeaderOk(true) { DBG_ASSERT( nTag != 0 && nTag != 0xFF, "invalid Tag" ); DBG(_nStartPos = pStream->Tell()); @@ -757,7 +753,7 @@ inline SfxMiniRecordWriter::~SfxMiniRecordWriter() { // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden - if ( !_bHeaderOk DBG(||sal_True) ) + if ( !_bHeaderOk ) Close(); } @@ -781,7 +777,7 @@ inline SvStream& SfxMiniRecordWriter::operator*() const inline void SfxMiniRecordWriter::Reset() { _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI ); - _bHeaderOk = sal_False; + _bHeaderOk = false; } //========================================================================= @@ -835,7 +831,7 @@ inline sal_uInt8 SfxMiniRecordReader::GetTag() const //------------------------------------------------------------------------- -inline FASTBOOL SfxMiniRecordReader::IsValid() const +inline bool SfxMiniRecordReader::IsValid() const /* [Beschreibung] @@ -865,9 +861,9 @@ inline SvStream& SfxMiniRecordReader::operator*() const //========================================================================= -inline sal_uInt32 SfxSingleRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) +inline sal_uInt32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec ) -// siehe <SfxMiniRecordWriter::Close(FASTBOOL)> +// siehe <SfxMiniRecordWriter::Close(bool)> { sal_uInt32 nRet = 0; @@ -900,7 +896,7 @@ inline void SfxSingleRecordWriter::Reset() { _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI + SFX_REC_HEADERSIZE_SINGLE ); - _bHeaderOk = sal_False; + _bHeaderOk = false; } //========================================================================= @@ -931,7 +927,7 @@ inline sal_uInt8 SfxSingleRecordReader::GetVersion() const //------------------------------------------------------------------------- -inline FASTBOOL SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const +inline bool SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const /* [Beschreibung] @@ -1021,7 +1017,7 @@ inline void SfxMultiFixRecordWriter::Reset() _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI + SFX_REC_HEADERSIZE_SINGLE + SFX_REC_HEADERSIZE_MULTI ); - _bHeaderOk = sal_False; + _bHeaderOk = false; } //========================================================================= @@ -1054,7 +1050,7 @@ inline sal_uInt8 SfxMultiRecordReader::GetContentVersion() const //------------------------------------------------------------------------- -inline FASTBOOL SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const +inline bool SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const /* [Beschreibung] @@ -1082,3 +1078,4 @@ inline sal_uInt32 SfxMultiRecordReader::ContentCount() const #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/flagitem.hxx b/svl/inc/svl/flagitem.hxx index ce9d3cb635e7..f64efc455867 100644 --- a/svl/inc/svl/flagitem.hxx +++ b/svl/inc/svl/flagitem.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/svl/inc/svl/folderrestriction.hxx b/svl/inc/svl/folderrestriction.hxx index 66a99a4d49d1..e39c5aeb84d3 100644 --- a/svl/inc/svl/folderrestriction.hxx +++ b/svl/inc/svl/folderrestriction.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. @@ -54,3 +55,5 @@ namespace svt //........................................................................ #endif // SVTOOLS_FOLDER_RESTRICTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/fstathelper.hxx b/svl/inc/svl/fstathelper.hxx index 17fa62c5bbeb..fcc71502e639 100644 --- a/svl/inc/svl/fstathelper.hxx +++ b/svl/inc/svl/fstathelper.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. @@ -63,3 +64,5 @@ SVL_DLLPUBLIC sal_Bool IsFolder( const UniString& rURL ); } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/globalnameitem.hxx b/svl/inc/svl/globalnameitem.hxx index 897bb09fc8ba..478b530f3510 100644 --- a/svl/inc/svl/globalnameitem.hxx +++ b/svl/inc/svl/globalnameitem.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. @@ -49,11 +50,12 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; SvGlobalName GetValue() const { return m_aName; } - virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/hint.hxx b/svl/inc/svl/hint.hxx index a523ac68224f..ce840500b4ab 100644 --- a/svl/inc/svl/hint.hxx +++ b/svl/inc/svl/hint.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. @@ -70,3 +71,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/httpcook.hxx b/svl/inc/svl/httpcook.hxx index 9d2555d77848..2d5d434592af 100644 --- a/svl/inc/svl/httpcook.hxx +++ b/svl/inc/svl/httpcook.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. @@ -150,3 +151,4 @@ struct CntHTTPCookieRequest #endif // SVTOOLS_HTTPCOOK_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/ilstitem.hxx b/svl/inc/svl/ilstitem.hxx index eddbe9e0efaa..a0527cec556c 100644 --- a/svl/inc/svl/ilstitem.hxx +++ b/svl/inc/svl/ilstitem.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. @@ -55,9 +56,10 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; }; #endif // _SFXINTITEM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/imageitm.hxx b/svl/inc/svl/imageitm.hxx index 4dff6f5faebe..e6cd1d552fd1 100644 --- a/svl/inc/svl/imageitm.hxx +++ b/svl/inc/svl/imageitm.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. @@ -46,8 +47,8 @@ public: virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); void SetRotation( long nValue ); long GetRotation() const; @@ -57,3 +58,5 @@ public: }; #endif // _SFX_IMAGEITM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/inetdef.hxx b/svl/inc/svl/inetdef.hxx index 533530838700..3984dcced8f6 100644 --- a/svl/inc/svl/inetdef.hxx +++ b/svl/inc/svl/inetdef.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. @@ -27,3 +28,4 @@ #include <tools/inetdef.hxx> +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/inethist.hxx b/svl/inc/svl/inethist.hxx index 65e9f026a072..982ad1d25f43 100644 --- a/svl/inc/svl/inethist.hxx +++ b/svl/inc/svl/inethist.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,4 @@ DECL_PTRHINT (SVL_DLLPUBLIC, INetURLHistoryHint, const INetURLObject); #endif /* _INETHIST_HXX */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/inetmsg.hxx b/svl/inc/svl/inetmsg.hxx index bcfc4ad714ad..049c54219bb1 100644 --- a/svl/inc/svl/inetmsg.hxx +++ b/svl/inc/svl/inetmsg.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. @@ -27,3 +28,4 @@ #include <tools/inetmsg.hxx> +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/inetstrm.hxx b/svl/inc/svl/inetstrm.hxx index efb6c35a1b68..f1d7812f623f 100644 --- a/svl/inc/svl/inetstrm.hxx +++ b/svl/inc/svl/inetstrm.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. @@ -27,3 +28,4 @@ #include <tools/inetstrm.hxx> +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx index 24318af8fa57..3abe09c0e37c 100644 --- a/svl/inc/svl/inettype.hxx +++ b/svl/inc/svl/inettype.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. @@ -90,7 +91,9 @@ #define CONTENT_TYPE_STR_AUDIO_AIFF "audio/aiff" #define CONTENT_TYPE_STR_AUDIO_BASIC "audio/basic" #define CONTENT_TYPE_STR_AUDIO_MIDI "audio/midi" +#define CONTENT_TYPE_STR_AUDIO_VORBIS "audio/vorbis" #define CONTENT_TYPE_STR_AUDIO_WAV "audio/wav" +#define CONTENT_TYPE_STR_AUDIO_WEBM "audio/webm" #define CONTENT_TYPE_STR_X_CNT_DOCUMENT ".chaos/document" #define CONTENT_TYPE_STR_X_CNT_FSYSBOX ".chaos/fsys-box" #define CONTENT_TYPE_STR_X_CNT_CDROM_VOLUME ".chaos/fsys-cdrom-volume" @@ -155,8 +158,10 @@ #define CONTENT_TYPE_STR_TEXT_URL "text/x-url" #define CONTENT_TYPE_STR_TEXT_VCALENDAR "text/x-vCalendar" #define CONTENT_TYPE_STR_TEXT_VCARD "text/x-vCard" -#define CONTENT_TYPE_STR_VIDEO_VDO "video/vdo" #define CONTENT_TYPE_STR_VIDEO_MSVIDEO "video/x-msvideo" +#define CONTENT_TYPE_STR_VIDEO_THEORA "video/theora" +#define CONTENT_TYPE_STR_VIDEO_VDO "video/vdo" +#define CONTENT_TYPE_STR_VIDEO_WEBM "audio/webm" #define CONTENT_TYPE_STR_X_STARMAIL "x-starmail" #define CONTENT_TYPE_STR_X_VRML "x-world/x-vrml" #define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER "application/vnd.sun.xml.writer" @@ -228,7 +233,9 @@ enum INetContentType CONTENT_TYPE_AUDIO_AIFF, CONTENT_TYPE_AUDIO_BASIC, CONTENT_TYPE_AUDIO_MIDI, + CONTENT_TYPE_AUDIO_VORBIS, CONTENT_TYPE_AUDIO_WAV, + CONTENT_TYPE_AUDIO_WEBM, CONTENT_TYPE_IMAGE_GIF, CONTENT_TYPE_IMAGE_JPEG, CONTENT_TYPE_IMAGE_PCX, @@ -239,8 +246,10 @@ enum INetContentType CONTENT_TYPE_TEXT_PLAIN, CONTENT_TYPE_TEXT_URL, CONTENT_TYPE_TEXT_VCARD, - CONTENT_TYPE_VIDEO_VDO, CONTENT_TYPE_VIDEO_MSVIDEO, + CONTENT_TYPE_VIDEO_THEORA, + CONTENT_TYPE_VIDEO_VDO, + CONTENT_TYPE_VIDEO_WEBM, CONTENT_TYPE_X_CNT_MESSAGE, CONTENT_TYPE_X_CNT_DOCUMENT, CONTENT_TYPE_X_CNT_POP3BOX, @@ -474,3 +483,4 @@ public: #endif // _INETTYPE_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/instrm.hxx b/svl/inc/svl/instrm.hxx index 124c80a21630..8e97babaf372 100644 --- a/svl/inc/svl/instrm.hxx +++ b/svl/inc/svl/instrm.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,4 @@ public: #endif // SVTOOLS_INSTRM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/intitem.hxx b/svl/inc/svl/intitem.hxx index 0ee15d1738e5..9ecb9a904dc5 100644 --- a/svl/inc/svl/intitem.hxx +++ b/svl/inc/svl/intitem.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. @@ -82,10 +83,10 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; @@ -171,3 +172,4 @@ public: #endif // _SFXINTITEM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/isethint.hxx b/svl/inc/svl/isethint.hxx index 5ad244bfbd00..d03cd6942960 100644 --- a/svl/inc/svl/isethint.hxx +++ b/svl/inc/svl/isethint.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,9 +30,7 @@ #include "svl/svldllapi.h" -#ifndef _HINT_HXX #include <svl/hint.hxx> -#endif class SfxItemSet; @@ -53,3 +52,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/itemiter.hxx b/svl/inc/svl/itemiter.hxx index db3f8d4cea8d..55ad0e7b02a5 100644 --- a/svl/inc/svl/itemiter.hxx +++ b/svl/inc/svl/itemiter.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. @@ -66,3 +67,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx index 735f9b1162aa..3cec7f75dee2 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.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. @@ -121,7 +122,7 @@ class SVL_DLLPUBLIC SfxItemPool SfxItemPool* pSecondary; SfxItemPool* pMaster; sal_uInt16* _pPoolRanges; - FASTBOOL bPersistentRefCounts; + bool bPersistentRefCounts; private: // ObjectUser section @@ -140,15 +141,15 @@ private: inline sal_uInt16 GetIndex_Impl(sal_uInt16 nWhich) const; inline sal_uInt16 GetSize_Impl() const { return nEnd - nStart + 1; } - SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream ); - SVL_DLLPRIVATE FASTBOOL IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; + SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream ); + SVL_DLLPRIVATE bool IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; public: // fuer dflt. SfxItemSet::CTOR, setze dflt. WhichRanges void FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const; const sal_uInt16* GetFrozenIdRanges() const { return _pPoolRanges; } - FASTBOOL IsVer2_Impl() const; + bool IsVer2_Impl() const; #endif //--------------------------------------------------------------------- @@ -170,7 +171,7 @@ public: #ifndef TF_POOLABLE sal_uInt16 *pSlotIds = 0, #endif - FASTBOOL bLoadRefCounts = sal_True ); + bool bLoadRefCounts = true ); protected: virtual ~SfxItemPool(); public: @@ -202,11 +203,11 @@ public: virtual const SfxPoolItem& GetDefaultItem( sal_uInt16 nWhich ) const; const SfxPoolItem* LoadItem( SvStream &rStream, - FASTBOOL bDirect = sal_False, + bool bDirect = false, const SfxItemPool *pRefPool = 0 ); - FASTBOOL StoreItem( SvStream &rStream, + bool StoreItem( SvStream &rStream, const SfxPoolItem &rItem, - FASTBOOL bDirect = sal_False ) const; + bool bDirect = false ) const; sal_uInt32 GetSurrogate(const SfxPoolItem *) const; const SfxPoolItem * GetItem2(sal_uInt16 nWhich, sal_uInt32 nSurrogate) const; @@ -214,7 +215,7 @@ public: const SfxPoolItem* LoadSurrogate(SvStream& rStream, sal_uInt16 &rWhich, sal_uInt16 nSlotId, const SfxItemPool* pRefPool = 0 ); - FASTBOOL StoreSurrogate(SvStream& rStream, + bool StoreSurrogate(SvStream& rStream, const SfxPoolItem *pItem ) const; virtual SvStream & Load(SvStream &); @@ -225,11 +226,11 @@ public: sal_uInt16 GetFirstWhich() const { return nStart; } sal_uInt16 GetLastWhich() const { return nEnd; } - FASTBOOL IsInRange( sal_uInt16 nWhich ) const { + bool IsInRange( sal_uInt16 nWhich ) const { return nWhich >= nStart && nWhich <= nEnd; } - FASTBOOL IsInVersionsRange( sal_uInt16 nWhich ) const; - FASTBOOL IsInStoringRange( sal_uInt16 nWhich ) const; + bool IsInVersionsRange( sal_uInt16 nWhich ) const; + bool IsInStoringRange( sal_uInt16 nWhich ) const; void SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo ); void SetSecondaryPool( SfxItemPool *pPool ); SfxItemPool* GetSecondaryPool() const { @@ -242,8 +243,8 @@ public: void Delete(); #ifdef TF_POOLABLE - FASTBOOL IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; - FASTBOOL IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const + bool IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; + bool IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const { return IsItemFlag( rItem.Which(), nFlag ); } void SetItemInfos( const SfxItemInfo *pInfos ) { pItemInfos = pInfos; } @@ -266,7 +267,7 @@ public: { return _nFileFormatVersion; } void SetFileFormatVersion( sal_uInt16 nFileFormatVersion ); sal_uInt16 GetLoadingVersion() const; - FASTBOOL IsCurrentVersionLoading() const; + bool IsCurrentVersionLoading() const; static int IsWhich(sal_uInt16 nId) { return nId && nId <= SFX_WHICH_MAX; } @@ -301,3 +302,5 @@ inline sal_uLong SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, sal_uLong n } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/itemprop.hxx b/svl/inc/svl/itemprop.hxx index c755f6e93f34..aeaa9e26c2d9 100644 --- a/svl/inc/svl/itemprop.hxx +++ b/svl/inc/svl/itemprop.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. @@ -36,9 +37,8 @@ #include <com/sun/star/beans/PropertyState.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <vector> -/* -----------------------------21.02.00 11:03-------------------------------- - UNO III - Implementation - ---------------------------------------------------------------------------*/ + +// UNO III - Implementation #define MAP_CHAR_LEN(cchar) cchar, sizeof(cchar) - 1 struct SfxItemPropertyMapEntry @@ -108,9 +108,7 @@ public: sal_uInt32 getSize() const; }; -/* -----------------------------21.02.00 11:19-------------------------------- - ---------------------------------------------------------------------------*/ class SVL_DLLPUBLIC SfxItemPropertySet { SfxItemPropertyMap m_aMap; @@ -162,9 +160,7 @@ public: getPropertyMap() const {return &m_aMap;} }; -/* -----------------------------21.02.00 11:09-------------------------------- - ---------------------------------------------------------------------------*/ struct SfxItemPropertySetInfo_Impl; class SVL_DLLPUBLIC SfxItemPropertySetInfo : public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySetInfo> @@ -191,9 +187,7 @@ public: const SfxItemPropertyMap* getMap() const; }; -/* -----------------------------21.02.00 12:01-------------------------------- - ---------------------------------------------------------------------------*/ class SVL_DLLPUBLIC SfxExtItemPropertySetInfo: public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySetInfo > { SfxItemPropertyMap aExtMap; @@ -217,3 +211,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx index 7e6429ca37ab..b3dea2cfa08b 100644 --- a/svl/inc/svl/itemset.hxx +++ b/svl/inc/svl/itemset.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,11 +30,7 @@ #include "svl/svldllapi.h" -#if STLPORT_VERSION<321 -#include <stdarg.h> -#else #include <cstdarg> // std::va_list and friends -#endif #include <svl/poolitem.hxx> #include <tools/rtti.hxx> #include <tools/solar.h> @@ -168,9 +165,9 @@ public: void MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo ); const SfxItemSet* GetParent() const { return _pParent; } - virtual SvStream & Load( SvStream &, FASTBOOL bDirect = sal_False, + virtual SvStream & Load( SvStream &, bool bDirect = false, const SfxItemPool *pRefPool = 0 ); - virtual SvStream & Store( SvStream &, FASTBOOL bDirect = sal_False ) const; + virtual SvStream & Store( SvStream &, bool bDirect = false ) const; virtual int operator==(const SfxItemSet &) const; }; @@ -211,3 +208,4 @@ public: #endif // #ifndef _SFXITEMSET_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/languageoptions.hxx b/svl/inc/svl/languageoptions.hxx index 198455f423b3..e4d8f23804a1 100644 --- a/svl/inc/svl/languageoptions.hxx +++ b/svl/inc/svl/languageoptions.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. @@ -126,3 +127,4 @@ public: #endif // _SVTOOLS_LANGUAGEOPTIONS_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/lckbitem.hxx b/svl/inc/svl/lckbitem.hxx index 6535264eeb78..3b41c834010f 100644 --- a/svl/inc/svl/lckbitem.hxx +++ b/svl/inc/svl/lckbitem.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. @@ -55,11 +56,12 @@ public: SvLockBytes* GetValue() const { return _xVal; } - virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/listener.hxx b/svl/inc/svl/listener.hxx index e3bdea45169e..87bf85426747 100644 --- a/svl/inc/svl/listener.hxx +++ b/svl/inc/svl/listener.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. @@ -63,3 +64,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/listeneriter.hxx b/svl/inc/svl/listeneriter.hxx index 3bfb6380acaa..0dcdec811250 100644 --- a/svl/inc/svl/listeneriter.hxx +++ b/svl/inc/svl/listeneriter.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. @@ -77,3 +78,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/lngmisc.hxx b/svl/inc/svl/lngmisc.hxx index 9dbe2d4740d0..9e6c5c242451 100644 --- a/svl/inc/svl/lngmisc.hxx +++ b/svl/inc/svl/lngmisc.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. @@ -74,3 +75,5 @@ SVL_DLLPUBLIC String GetThesaurusReplaceText( const String &rText ); } // namespace linguistic #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/lockfilecommon.hxx b/svl/inc/svl/lockfilecommon.hxx index 03cffa90efd5..9f24f3c9d4bc 100644 --- a/svl/inc/svl/lockfilecommon.hxx +++ b/svl/inc/svl/lockfilecommon.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,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/lstner.hxx b/svl/inc/svl/lstner.hxx index 963ab3f2b654..c87d88ac890c 100644 --- a/svl/inc/svl/lstner.hxx +++ b/svl/inc/svl/lstner.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. @@ -76,3 +77,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/macitem.hxx b/svl/inc/svl/macitem.hxx index a82f4d11d58c..2bc93a177539 100644 --- a/svl/inc/svl/macitem.hxx +++ b/svl/inc/svl/macitem.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 @@ #include <tools/debug.hxx> #include <tools/string.hxx> -#ifndef _TABLE_HXX #include <tools/table.hxx> -#endif class SvStream; @@ -207,3 +206,5 @@ inline sal_Bool SvxMacroItem::DelMacro( sal_uInt16 nEvent ) } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/mailenum.hxx b/svl/inc/svl/mailenum.hxx index bfce28ed00db..87f66299bd33 100644 --- a/svl/inc/svl/mailenum.hxx +++ b/svl/inc/svl/mailenum.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. @@ -93,3 +94,4 @@ enum MailAction #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/memberid.hrc b/svl/inc/svl/memberid.hrc index 9f5edeae9ebb..7047e0d75e8f 100644 --- a/svl/inc/svl/memberid.hrc +++ b/svl/inc/svl/memberid.hrc @@ -49,20 +49,21 @@ #define MID_SEARCH_CELLTYPE 2 #define MID_SEARCH_ROWDIRECTION 3 #define MID_SEARCH_ALLTABLES 4 -#define MID_SEARCH_BACKWARD 5 -#define MID_SEARCH_PATTERN 6 -#define MID_SEARCH_CONTENT 7 -#define MID_SEARCH_ASIANOPTIONS 8 -#define MID_SEARCH_ALGORITHMTYPE 9 -#define MID_SEARCH_FLAGS 10 -#define MID_SEARCH_SEARCHSTRING 11 -#define MID_SEARCH_REPLACESTRING 12 -#define MID_SEARCH_LOCALE 13 -#define MID_SEARCH_CHANGEDCHARS 14 -#define MID_SEARCH_DELETEDCHARS 15 -#define MID_SEARCH_INSERTEDCHARS 16 -#define MID_SEARCH_TRANSLITERATEFLAGS 17 -#define MID_SEARCH_COMMAND 18 +#define MID_SEARCH_SEARCHFILTERED 5 +#define MID_SEARCH_BACKWARD 6 +#define MID_SEARCH_PATTERN 7 +#define MID_SEARCH_CONTENT 8 +#define MID_SEARCH_ASIANOPTIONS 9 +#define MID_SEARCH_ALGORITHMTYPE 10 +#define MID_SEARCH_FLAGS 11 +#define MID_SEARCH_SEARCHSTRING 12 +#define MID_SEARCH_REPLACESTRING 13 +#define MID_SEARCH_LOCALE 14 +#define MID_SEARCH_CHANGEDCHARS 15 +#define MID_SEARCH_DELETEDCHARS 16 +#define MID_SEARCH_INSERTEDCHARS 17 +#define MID_SEARCH_TRANSLITERATEFLAGS 18 +#define MID_SEARCH_COMMAND 19 #endif diff --git a/svl/inc/svl/metitem.hxx b/svl/inc/svl/metitem.hxx index a5eecbebfa61..92f46002d5ee 100644 --- a/svl/inc/svl/metitem.hxx +++ b/svl/inc/svl/metitem.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. @@ -44,10 +45,11 @@ public: ~SfxMetricItem() { DBG_DTOR(SfxMetricItem, 0); } - virtual int ScaleMetrics( long lMult, long lDiv ); - virtual int HasMetrics() const; + virtual bool ScaleMetrics( long lMult, long lDiv ); + virtual bool HasMetrics() const; }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/nfkeytab.hxx b/svl/inc/svl/nfkeytab.hxx index 34d483ab4d86..4fe3fd2e2df6 100644 --- a/svl/inc/svl/nfkeytab.hxx +++ b/svl/inc/svl/nfkeytab.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. @@ -127,3 +128,4 @@ public: #endif // INCLUDED_SVTOOLS_NFKEYTAB_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/nfsymbol.hxx b/svl/inc/svl/nfsymbol.hxx index 8886f0e47f85..57b2ddde339e 100644 --- a/svl/inc/svl/nfsymbol.hxx +++ b/svl/inc/svl/nfsymbol.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. @@ -61,9 +62,12 @@ enum NfSymbolType NF_SYMBOLTYPE_DATESEP = -18, // date separator NF_SYMBOLTYPE_TIMESEP = -19, // time separator NF_SYMBOLTYPE_TIME100SECSEP = -20, // time 100th seconds separator - NF_SYMBOLTYPE_PERCENT = -21 // percent % + NF_SYMBOLTYPE_PERCENT = -21, // percent % + NF_SYMBOLTYPE_FRAC_FDIV = -22 // forced divisors }; } // namespace svt #endif // INCLUDED_SVTOOLS_NFSYMBOL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/nfversi.hxx b/svl/inc/svl/nfversi.hxx index 3cd8256c90d7..fbe4d3d72a91 100644 --- a/svl/inc/svl/nfversi.hxx +++ b/svl/inc/svl/nfversi.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. @@ -67,3 +68,4 @@ #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/nranges.hxx b/svl/inc/svl/nranges.hxx index c7ba2029f5a6..2654a2125f99 100644 --- a/svl/inc/svl/nranges.hxx +++ b/svl/inc/svl/nranges.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. @@ -92,3 +93,5 @@ public: #endif #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/numuno.hxx b/svl/inc/svl/numuno.hxx index 425cff60763d..85db8c5906b9 100644 --- a/svl/inc/svl/numuno.hxx +++ b/svl/inc/svl/numuno.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. @@ -97,3 +98,4 @@ public: #endif // #ifndef _NUMUNO_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/ondemand.hxx b/svl/inc/svl/ondemand.hxx index eedb480857ae..be5849a3995f 100644 --- a/svl/inc/svl/ondemand.hxx +++ b/svl/inc/svl/ondemand.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. @@ -463,3 +464,4 @@ public: #endif // INCLUDED_SVTOOLS_ONDEMAND_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/outstrm.hxx b/svl/inc/svl/outstrm.hxx index b48cea2e04da..dba7c2847c5e 100644 --- a/svl/inc/svl/outstrm.hxx +++ b/svl/inc/svl/outstrm.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. @@ -64,3 +65,4 @@ public: #endif // SVTOOLS_OUTSTRM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx index 801441c297a1..6bb9f311119b 100644 --- a/svl/inc/svl/ownlist.hxx +++ b/svl/inc/svl/ownlist.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,8 +31,8 @@ #include "svl/svldllapi.h" #include <tools/stream.hxx> -#include <tools/ownlist.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <vector> namespace com { namespace sun { namespace star { namespace beans { @@ -75,6 +76,8 @@ public: } }; +typedef ::std::vector< SvCommand > SvCommandList_impl; + //========================================================================= class SVL_DLLPUBLIC SvCommandList /* [Beschreibung] @@ -84,9 +87,12 @@ class SVL_DLLPUBLIC SvCommandList in die Liste gestellt. */ { - PRV_SV_DECL_OWNER_LIST(SvCommandList,SvCommand); - SvCommand & Append( const String & rCommand, const String & rArg ); - sal_Bool AppendCommands( const String & rCmd, sal_uInt16 * pEaten ); +private: + SvCommandList_impl aCommandList; + +public: + SvCommand& Append( const String & rCommand, const String & rArg ); + sal_Bool AppendCommands( const String & rCmd, sal_uInt16 * pEaten ); String GetCommands() const; sal_Bool FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); @@ -94,6 +100,18 @@ class SVL_DLLPUBLIC SvCommandList SVL_DLLPUBLIC friend SvStream& operator >> ( SvStream& rStm, SvCommandList & ); SVL_DLLPUBLIC friend SvStream& operator << ( SvStream&, const SvCommandList & ); + + size_t size() const { return aCommandList.size(); } + + SvCommand operator[]( size_t i) { + return aCommandList[ i ]; + } + + void clear() { + aCommandList.clear(); + } }; #endif // _OWNLIST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/pickerhelper.hxx b/svl/inc/svl/pickerhelper.hxx index 307031b578d1..bf877722f541 100644 --- a/svl/inc/svl/pickerhelper.hxx +++ b/svl/inc/svl/pickerhelper.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. @@ -67,3 +68,5 @@ namespace svt //----------------------------------------------------------------------------- #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/pickerhistory.hxx b/svl/inc/svl/pickerhistory.hxx index af282e72513d..45f9ab15c33b 100644 --- a/svl/inc/svl/pickerhistory.hxx +++ b/svl/inc/svl/pickerhistory.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. @@ -49,3 +50,4 @@ namespace svt #endif // SVTOOLS_PICKERHISTORY_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/pickerhistoryaccess.hxx b/svl/inc/svl/pickerhistoryaccess.hxx index 1a4e8ced8381..392933a431a4 100644 --- a/svl/inc/svl/pickerhistoryaccess.hxx +++ b/svl/inc/svl/pickerhistoryaccess.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,9 +31,7 @@ #include "svl/svldllapi.h" -#ifndef _COM_SUN_STAR_UNO_REFERENX_HXX_ #include <com/sun/star/uno/Reference.hxx> -#endif //......................................................................... namespace svt @@ -52,3 +51,4 @@ namespace svt #endif // SVTOOLS_PICKERHISTORYACCESS_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/poolcach.hxx b/svl/inc/svl/poolcach.hxx index 182c9739f0cf..c8b1b87ee3ef 100644 --- a/svl/inc/svl/poolcach.hxx +++ b/svl/inc/svl/poolcach.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. @@ -67,3 +68,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx index 48e5a80166b7..0101720da14d 100644 --- a/svl/inc/svl/poolitem.hxx +++ b/svl/inc/svl/poolitem.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. @@ -101,7 +102,7 @@ enum SfxFieldUnit { SFX_FUNIT_NONE, SFX_FUNIT_MM, SFX_FUNIT_CM, SFX_FUNIT_M, SFX_FUNIT_KM, SFX_FUNIT_TWIP, SFX_FUNIT_POINT, SFX_FUNIT_PICA, - SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CUSTOM + SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CHAR, SFX_FUNIT_LINE, SFX_FUNIT_CUSTOM }; enum SfxMapUnit @@ -196,12 +197,6 @@ private: inline sal_uLong ReleaseRef( sal_uLong n = 1 ) const; SVL_DLLPRIVATE long Delete_Impl(void*); -#if 0 - // @@@ virtual, but private, and dummy impl. @@@ - virtual void Store( SvStream & ) const; - virtual void GetVersion() const; -#endif - protected: SfxPoolItem( sal_uInt16 nWhich = 0 ); SfxPoolItem( const SfxPoolItem& ); @@ -229,11 +224,11 @@ public: const IntlWrapper * pIntlWrapper = 0 ) const; virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; - virtual int ScaleMetrics( long lMult, long lDiv ); - virtual int HasMetrics() const; + virtual bool ScaleMetrics( long lMult, long lDiv ); + virtual bool HasMetrics() const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nItemVersion ) const; virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; @@ -413,38 +408,6 @@ public: }; // ----------------------------------------------------------------------- - -#if 0 /* @@@ NOT USED @@@ */ -class SfxInvalidItem: public SfxPoolItem -{ -friend class SfxItemSet; - - const SfxPoolItem* pDefaultItem; - -private: - TYPEINFO(); - SfxInvalidItem( sal_uInt16 nWhich, const SfxPoolItem &rDefault ); - SfxInvalidItem( const SfxInvalidItem& ); - virtual ~SfxInvalidItem(); - -public: - virtual int operator==( const SfxPoolItem& ) const; - - virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresMetric, - XubString &rText, - const IntlWrapper * = 0 ) const; - const SfxPoolItem* GetDefaultItem() const { return pDefaultItem; } - - // von sich selbst eine Kopie erzeugen - virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const; - virtual SvStream& Store(SvStream &, sal_uInt16 nVer ) const; -}; -#endif /* @@@ NOT USED @@@ */ - -// ----------------------------------------------------------------------- // Handle Klasse fuer PoolItems class SVL_DLLPUBLIC SfxItemHandle @@ -466,24 +429,6 @@ DECL_PTRHINT(SVL_DLLPUBLIC, SfxPoolItemHint, SfxPoolItem); // ----------------------------------------------------------------------- -#if 0 /* @@@ NOT USED @@@ */ -class SfxItemChangedHint: public SfxHint -{ - const SfxPoolItem& _rOld; - const SfxPoolItem& _rNew; - -public: - TYPEINFO(); \ - SfxItemChangedHint( const SfxPoolItem &rOld, - const SfxPoolItem &rNew ) - : _rOld( rOld ), - _rNew( rNew ) - {} - - const SfxPoolItem& GetOldItem() const { return _rOld; } - const SfxPoolItem& GetNewItem() const { return _rNew; } -}; - -#endif /* @@@ NOT USED @@@ */ - #endif // #ifndef _SFXPOOLITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/ptitem.hxx b/svl/inc/svl/ptitem.hxx index c3072acdb933..46963d8b7ade 100644 --- a/svl/inc/svl/ptitem.hxx +++ b/svl/inc/svl/ptitem.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. @@ -68,10 +69,12 @@ public: aVal = rNewVal; } - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/rectitem.hxx b/svl/inc/svl/rectitem.hxx index b63d06096bd8..31f5717ee1f1 100644 --- a/svl/inc/svl/rectitem.hxx +++ b/svl/inc/svl/rectitem.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. @@ -67,11 +68,12 @@ public: DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); aVal = rNewVal; } - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/restrictedpaths.hxx b/svl/inc/svl/restrictedpaths.hxx index 11d57af35ce0..29263af43415 100644 --- a/svl/inc/svl/restrictedpaths.hxx +++ b/svl/inc/svl/restrictedpaths.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. @@ -80,3 +81,5 @@ namespace svt } // namespace svt #endif // SVTOOLS_RESTRICTEDPATHS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/rngitem.hxx b/svl/inc/svl/rngitem.hxx index 320c358f5520..0a90af8c16d5 100644 --- a/svl/inc/svl/rngitem.hxx +++ b/svl/inc/svl/rngitem.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. @@ -112,3 +113,5 @@ public: #endif #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/sfontitm.hxx b/svl/inc/svl/sfontitm.hxx index 3ce183ecbead..ac1e30061c05 100644 --- a/svl/inc/svl/sfontitm.hxx +++ b/svl/inc/svl/sfontitm.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. @@ -67,26 +68,20 @@ public: virtual int operator ==(const SfxPoolItem & rItem) const; virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const { return new SfxFontItem(*this); } sal_Bool hasFont() const { return m_bHasFont; } - sal_Bool hasColor() const { return m_bHasColor; } - sal_Bool hasFillColor() const { return m_bHasFillColor; } const XubString & getName() const { return m_aName; } - const XubString & getStyleName() const { return m_aStyleName; } const Size & getSize() const { return m_aSize; } - const Color & getColor() const { return m_aColor; } - const Color & getFillColor() const { return m_aFillColor; } rtl_TextEncoding getCharSet() const { return m_nCharSet; } @@ -94,51 +89,30 @@ public: LanguageType getLanguage() const { return m_nLanguage; } sal_Int16 getFamily() const { return m_nFamily; } - sal_Int16 getPitch() const { return m_nPitch; } - sal_Int16 getWeight() const { return m_nWeight; } - sal_Int16 getWidthType() const { return m_nWidthType; } - sal_Int16 getItalic() const { return m_nItalic; } - sal_Int16 getUnderline() const { return m_nUnderline; } - sal_Int16 getStrikeout() const { return m_nStrikeout; } - sal_Int16 getOrientation() const { return m_nOrientation; } - sal_Bool getWordLine() const { return m_bWordLine; } - sal_Bool getOutline() const { return m_bOutline; } - sal_Bool getShadow() const { return m_bShadow; } - sal_Bool getKerning() const { return m_bKerning; } inline void setFont(sal_Int16 nTheFamily, const XubString & rTheName, const XubString & rTheStyleName, sal_Int16 nThePitch, rtl_TextEncoding nTheCharSet); - inline void setWeight(sal_Int16 nTheWeight); - inline void setItalic(sal_Int16 nTheItalic); - inline void setHeight(sal_Int32 nHeight); - inline void setColor(const Color & rTheColor); - inline void setFillColor(const Color & rTheFillColor); - inline void setUnderline(sal_Int16 nTheUnderline); - inline void setStrikeout(sal_Int16 nTheStrikeout); - inline void setOutline(sal_Bool bTheOutline); - inline void setShadow(sal_Bool bTheShadow); - inline void setLanguage(LanguageType nTheLanguage); }; @@ -239,3 +213,4 @@ inline void SfxFontItem::setLanguage(LanguageType nTheLanguage) #endif // _SFONTITM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/sharecontrolfile.hxx b/svl/inc/svl/sharecontrolfile.hxx index 9ca8eb3222d0..245a2b3a89d4 100644 --- a/svl/inc/svl/sharecontrolfile.hxx +++ b/svl/inc/svl/sharecontrolfile.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. @@ -83,3 +84,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/slstitm.hxx b/svl/inc/svl/slstitm.hxx index d3f0249c18ea..3aa181d5cf7d 100644 --- a/svl/inc/svl/slstitm.hxx +++ b/svl/inc/svl/slstitm.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. @@ -27,9 +28,10 @@ #ifndef _SFXSLSTITM_HXX #define _SFXSLSTITM_HXX +#include <vector> + #include "svl/svldllapi.h" #include <tools/rtti.hxx> -#include <tools/list.hxx> #include <svl/poolitem.hxx> #include <com/sun/star/uno/Sequence.h> @@ -44,15 +46,14 @@ public: TYPEINFO(); SfxStringListItem(); - SfxStringListItem( sal_uInt16 nWhich, const List* pList=NULL ); + SfxStringListItem( sal_uInt16 nWhich, const std::vector<String> *pList=NULL ); SfxStringListItem( sal_uInt16 nWhich, SvStream& rStream ); SfxStringListItem( const SfxStringListItem& rItem ); ~SfxStringListItem(); - List * GetList(); + std::vector<String>& GetList(); - const List * GetList() const - { return SAL_CONST_CAST(SfxStringListItem *, this)->GetList(); } + const std::vector<String>& GetList() const; #ifndef TF_POOLABLE virtual int IsPoolable() const; @@ -74,11 +75,13 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const; virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; - void Sort( sal_Bool bAscending = sal_True, List* pParallelList = 0 ); + void Sort( sal_Bool bAscending = sal_True); - virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/smplhint.hxx b/svl/inc/svl/smplhint.hxx index 9e3e867b1703..1ce98191a059 100644 --- a/svl/inc/svl/smplhint.hxx +++ b/svl/inc/svl/smplhint.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. @@ -97,3 +98,5 @@ public: Name::~Name() {} #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/srchcfg.hxx b/svl/inc/svl/srchcfg.hxx index 7f98010c3d08..bf4760c04b0b 100644 --- a/svl/inc/svl/srchcfg.hxx +++ b/svl/inc/svl/srchcfg.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. @@ -80,3 +81,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/srchdefs.hxx b/svl/inc/svl/srchdefs.hxx index a6cdf56f8665..55aa25e5afe4 100644 --- a/svl/inc/svl/srchdefs.hxx +++ b/svl/inc/svl/srchdefs.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. @@ -47,3 +48,4 @@ #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/srchitem.hxx b/svl/inc/svl/srchitem.hxx index 8053a204881a..7a0be711147b 100644 --- a/svl/inc/svl/srchitem.hxx +++ b/svl/inc/svl/srchitem.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. @@ -73,6 +74,7 @@ class SVL_DLLPUBLIC SvxSearchItem : sal_uInt16 nAppFlag; // Fuer welche Applikation ist der Dialog ueberhaupt sal_Bool bRowDirection; // Suchrichtung Zeilenweise/Spaltenweise sal_Bool bAllTables; // in alle Tabellen suchen + sal_Bool bSearchFiltered; // search filtered cells. // Writer-spezifisch sal_Bool bNotes; @@ -89,8 +91,8 @@ public: SvxSearchItem( const SvxSearchItem& rItem ); virtual ~SvxSearchItem(); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual int operator == ( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -142,6 +144,9 @@ public: sal_Bool IsAllTables() const { return bAllTables; } void SetAllTables(sal_Bool bNew) { bAllTables = bNew; } + sal_Bool IsSearchFiltered() const { return bSearchFiltered; } + void SetSearchFiltered(sal_Bool b) { bSearchFiltered = b; } + sal_uInt16 GetCellType() const { return nCellType; } void SetCellType(sal_uInt16 nNewCellType) { nCellType = nNewCellType; } @@ -291,3 +296,4 @@ sal_Bool SvxSearchItem::IsMatchFullHalfWidthForms() const #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/stritem.hxx b/svl/inc/svl/stritem.hxx index e7885f9065da..ddcb4dfa8b63 100644 --- a/svl/inc/svl/stritem.hxx +++ b/svl/inc/svl/stritem.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. @@ -53,3 +54,4 @@ public: #endif // _SFXSTRITEM_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/strmadpt.hxx b/svl/inc/svl/strmadpt.hxx index 936e33071706..eceb68a3b1aa 100644 --- a/svl/inc/svl/strmadpt.hxx +++ b/svl/inc/svl/strmadpt.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. @@ -133,3 +134,4 @@ public: #endif // SVTOOLS_STRMADPT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/style.hrc b/svl/inc/svl/style.hrc index f49a95e48f67..b507e6ed960b 100644 --- a/svl/inc/svl/style.hrc +++ b/svl/inc/svl/style.hrc @@ -35,5 +35,3 @@ #define SFXSTYLEBIT_ALL 0xFFFF // alle Vorlagen #endif - - diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx index 5ae5cb8e673b..615d5d690aba 100644 --- a/svl/inc/svl/style.hxx +++ b/svl/inc/svl/style.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. @@ -43,9 +44,7 @@ #include <svl/brdcst.hxx> #include <svl/poolitem.hxx> -#ifndef _SFX_STYLE_HRC #include <svl/style.hrc> -#endif class SfxItemSet; class SfxItemPool; @@ -395,3 +394,4 @@ private: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/stylepool.hxx b/svl/inc/svl/stylepool.hxx index b820c9442229..c6db7d42c707 100644 --- a/svl/inc/svl/stylepool.hxx +++ b/svl/inc/svl/stylepool.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. @@ -42,9 +43,7 @@ private: public: typedef boost::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t; - // --> OD 2008-03-07 #i86923# explicit StylePool( SfxItemSet* pIgnorableItems = 0 ); - // <-- /** Insert a SfxItemSet into the style pool. @@ -98,3 +97,5 @@ public: virtual ~IStylePoolIteratorAccess() {}; }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index 19ee3a9e5077..52b35ac3a6d5 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.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,8 +29,7 @@ #ifndef _SVARRAY_HXX #define _SVARRAY_HXX -#if 0 -*********************************************************************** +/*********************************************************************** * * Hier folgt die Beschreibung fuer die exportierten Makros: * @@ -81,12 +81,11 @@ * Sortierung mit Hilfe der Object-operatoren "<" und "==" * * JP 09.10.96: vordefinierte Arrays: -* VarArr: SvBools, SvULongs, SvUShorts, SvLongs, SvShorts +* VarArr: SvULongs, SvUShorts * PtrArr: SvStrings, SvStringsDtor * SortArr: SvStringsSort, SvStringsSortDtor, * SvStringsISort, SvStringsISortDtor -*********************************************************************** -#endif +***********************************************************************/ #include "svl/svldllapi.h" @@ -141,12 +140,12 @@ void Insert( const nm *pI, sal_uInt16 nP,\ #define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem )\ ArrElem& nm::operator[](sal_uInt16 nP) const\ {\ - DBG_ASSERT( pData && nP < nA,"Op[]");\ + OSL_ENSURE( pData && nP < nA,"Op[]");\ return *(pData+nP);\ }\ void nm::Insert( const nm *pI, sal_uInt16 nP, sal_uInt16 nStt, sal_uInt16 nE)\ {\ - DBG_ASSERT(nP<=nA,"Ins,Ar[Start.End]");\ + OSL_ENSURE(nP<=nA,"Ins,Ar[Start.End]");\ if( USHRT_MAX == nE ) \ nE = pI->nA; \ if( nStt < nE ) \ @@ -220,7 +219,7 @@ nm::nm( sal_uInt16 nInit, sal_uInt8 )\ if( nInit )\ {\ pData = (AE*)(rtl_allocateMemory(sizeof(AE) * nInit));\ - DBG_ASSERT( pData, "CTOR, allocate");\ + OSL_ENSURE( pData, "CTOR, allocate");\ }\ }\ \ @@ -237,7 +236,7 @@ void nm::_resize (size_t n)\ \ void nm::Insert( const AERef aE, sal_uInt16 nP )\ {\ - DBG_ASSERT(nP <= nA && nA < USHRT_MAX, "Ins 1");\ + OSL_ENSURE(nP <= nA && nA < USHRT_MAX, "Ins 1");\ if (nFree < 1)\ _resize (nA + ((nA > 1) ? nA : 1));\ if( pData && nP < nA )\ @@ -248,7 +247,7 @@ void nm::Insert( const AERef aE, sal_uInt16 nP )\ \ void nm::Insert( const AE* pE, sal_uInt16 nL, sal_uInt16 nP )\ {\ - DBG_ASSERT(nP<=nA && ((long)nA+nL)<USHRT_MAX,"Ins n");\ + OSL_ENSURE(nP<=nA && ((long)nA+nL)<USHRT_MAX,"Ins n");\ if (nFree < nL)\ _resize (nA + ((nA > nL) ? nA : nL));\ if( pData && nP < nA )\ @@ -291,7 +290,7 @@ void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\ {\ if( !nL )\ return;\ - DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ + OSL_ENSURE( nP < nA && nP + nL <= nA,"Del");\ if( pData && nP+1 < nA )\ memmove( pData+nP, pData+nP+nL, (nA-nP-nL) * sizeof( AE ));\ nA = nA - nL; nFree = nFree + nL;\ @@ -442,7 +441,7 @@ SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis) void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )\ { \ if( nL ) {\ - DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ + OSL_ENSURE( nP < nA && nP + nL <= nA,"Del");\ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ Base::Remove( nP, nL ); \ @@ -457,15 +456,9 @@ _SV_DECL_PTRARR_DEF( SvPtrarr, VoidPtr, 0, 1, SVL_DLLPUBLIC ) // SORTARR - Begin -#ifdef __MWERKS__ -#define __MWERKS__PRIVATE public -#else -#define __MWERKS__PRIVATE private -#endif - #define _SORT_CLASS_DEF(nm, AE, IS, GS, vis)\ typedef sal_Bool (*FnForEach_##nm)( const AE&, void* );\ -class vis nm : __MWERKS__PRIVATE nm##_SAR \ +class vis nm : private nm##_SAR \ {\ public:\ nm(sal_uInt16 nSize = IS, sal_uInt8 nG = GS)\ @@ -634,28 +627,11 @@ void nm::Remove( const AE &aE, sal_uInt16 nL )\ nm##_SAR::Remove( nP, nL);\ }\ -#if defined(TCPP) - -#define _SORTARR_BLC_CASTS(nm, AE )\ - sal_Bool Insert( AE &aE ) {\ - return Insert( (const AE&)aE );\ - }\ - sal_uInt16 GetPos( AE& aE ) const { \ - return SvPtrarr::GetPos((const VoidPtr&)aE);\ - }\ - void Remove( AE& aE, sal_uInt16 nL = 1 ) { \ - Remove( (const AE&) aE, nL );\ - } - -#else - #define _SORTARR_BLC_CASTS(nm, AE )\ sal_uInt16 GetPos( const AE& aE ) const { \ return SvPtrarr::GetPos((const VoidPtr&)aE);\ } -#endif - #define _SV_DECL_PTRARR_SORT_ALG(nm, AE, IS, GS, vis)\ SV_DECL_PTRARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\ _SORT_CLASS_DEF(nm, AE, IS, GS, vis)\ @@ -742,7 +718,7 @@ _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis) _SV_IMPL_SORTAR_ALG( nm,AE )\ void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \ if( nL ) {\ - DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ + OSL_ENSURE( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ SvPtrarr::Remove( nP, nL ); \ @@ -754,7 +730,7 @@ _SV_SEEK_PTR( nm, AE ) _SV_IMPL_SORTAR_ALG( nm,AE )\ void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \ if( nL ) {\ - DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ + OSL_ENSURE( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ SvPtrarr::Remove( nP, nL ); \ @@ -767,13 +743,13 @@ SV_IMPL_VARARR(nm##_SAR, AE)\ _SV_IMPL_SORTAR_ALG( nm,AE )\ _SV_SEEK_OBJECT( nm,AE ) -#if defined (C40) || defined (C41) || defined (C42) || defined(C50) || defined(C52) +#if defined (C40) || defined (C41) || defined (C42) || defined(C50) #define C40_INSERT( c, p, n) Insert( (c const *) p, n ) #define C40_PTR_INSERT( c, p) Insert( (c const *) p ) #define C40_REPLACE( c, p, n) Replace( (c const *) p, n ) #define C40_GETPOS( c, r) GetPos( (c const *)r ) #else -#if defined WTC || defined ICC || defined HPUX || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400) +#if defined ICC || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400) #define C40_INSERT( c, p, n ) Insert( (c const *&) p, n ) #define C40_PTR_INSERT( c, p ) Insert( (c const *&) p ) #define C40_REPLACE( c, p, n ) Replace( (c const *&) p, n ) @@ -787,3 +763,5 @@ _SV_SEEK_OBJECT( nm,AE ) #endif #endif //_SVARRAY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx index 35448521c459..8fb7b2f06f8d 100644 --- a/svl/inc/svl/svdde.hxx +++ b/svl/inc/svl/svdde.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. @@ -33,6 +34,7 @@ #include <tools/string.hxx> #include <tools/list.hxx> #include <tools/link.hxx> +#include <vector> class DdeString; class DdeData; @@ -47,35 +49,19 @@ class DdeExecute; class DdeItem; class DdeTopic; class DdeService; -class ConvList; struct DdeDataImp; struct DdeImp; class DdeItemImp; +struct Conversation; #ifndef _SVDDE_NOLISTS -DECLARE_LIST( DdeConnections, DdeConnection* ) DECLARE_LIST( DdeServices, DdeService* ) -DECLARE_LIST( DdeTopics, DdeTopic* ) -DECLARE_LIST( DdeItems, DdeItem* ) #else -typedef List DdeConnections; typedef List DdeServices; -typedef List DdeTopics; -typedef List DdeItems; #endif -//#if 0 // _SOLAR__PRIVATE -DECLARE_LIST( DdeTransactions, DdeTransaction* ) -DECLARE_LIST( DdeFormats, long ) -//#else -//typedef List DdeTransactions; -//typedef List DdeFormats; -//#endif - -#ifndef STRING_LIST -#define STRING_LIST -DECLARE_LIST( StringList, String * ) -#endif +typedef ::std::vector< long > DdeFormats; +typedef ::std::vector< Conversation* > ConvList; // ----------- // - DdeData - @@ -89,9 +75,8 @@ class SVL_DLLPUBLIC DdeData friend class DdeTransaction; DdeDataImp* pImp; -//#if 0 // _SOLAR__PRIVATE SVL_DLLPRIVATE void Lock(); -//#endif + void SetFormat( sal_uLong nFmt ); public: @@ -111,42 +96,6 @@ public: static sal_uLong GetExternalFormat( sal_uLong nFmt ); static sal_uLong GetInternalFormat( sal_uLong nFmt ); }; -// ------------------ -// - DdeServiceList - -// ------------------ - -class DdeServiceList -{ - StringList aServices; - -public: - DdeServiceList( const String* = NULL ); - ~DdeServiceList(); - - StringList& GetServices() { return aServices; } - -private: - DdeServiceList( const DdeServiceList& ); - const DdeServiceList& operator= ( const DdeServiceList& ); -}; - -// ---------------- -// - DdeTopicList - -// ---------------- - -class DdeTopicList -{ - StringList aTopics; - -//#if 0 // _SOLAR__PRIVATE - DECL_LINK( Data, DdeData* ); -//#endif -public: - DdeTopicList( const String& ); - ~DdeTopicList(); - - StringList& GetTopics() { return aTopics; } -}; // ------------------ // - DdeTransaction - @@ -276,7 +225,7 @@ class SVL_DLLPUBLIC DdeConnection { friend class DdeInternal; friend class DdeTransaction; - DdeTransactions aTransactions; + std::vector<DdeTransaction*> aTransactions; DdeString* pService; DdeString* pTopic; DdeImp* pImp; @@ -288,7 +237,7 @@ public: long GetError(); long GetConvId(); - static const DdeConnections& GetConnections(); + static const std::vector<DdeConnection*>& GetConnections(); sal_Bool IsConnected(); @@ -375,7 +324,7 @@ private: private: DdeString* pName; String aItem; - DdeItems aItems; + std::vector<DdeItem*> aItems; Link aConnectLink; Link aDisconnectLink; Link aGetLink; @@ -407,7 +356,7 @@ public: DdeItem* AddItem( const DdeItem& ); // werden kopiert ! void RemoveItem( const DdeItem& ); const String& GetCurItem() { return aItem; } - const DdeItems& GetItems() { return aItems; } + const std::vector<DdeItem*>& GetItems() const { return aItems; } private: DdeTopic( const DdeTopic& ); @@ -438,7 +387,7 @@ protected: const DdeTopic* GetSysTopic() const { return pSysTopic; } private: - DdeTopics aTopics; + std::vector<DdeTopic*> aTopics; DdeFormats aFormats; DdeTopic* pSysTopic; DdeString* pName; @@ -455,7 +404,7 @@ public: short GetError() { return nStatus; } static DdeServices& GetServices(); - DdeTopics& GetTopics() { return aTopics; } + std::vector<DdeTopic*>& GetTopics() { return aTopics; } void AddTopic( const DdeTopic& ); void RemoveTopic( const DdeTopic& ); @@ -478,3 +427,5 @@ inline long DdeTransaction::GetError() return rDde.GetError(); } #endif // _SVDDE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/svl.hrc b/svl/inc/svl/svl.hrc index d63e84f2b91f..599e645978ff 100644 --- a/svl/inc/svl/svl.hrc +++ b/svl/inc/svl/svl.hrc @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: svtools.hrc,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -46,111 +43,118 @@ #define STR_SVT_MIMETYPE_APP_ZIP (STR_SVT_MIMETYPE_START+10) #define STR_SVT_MIMETYPE_AUDIO_AIFF (STR_SVT_MIMETYPE_START+11) #define STR_SVT_MIMETYPE_AUDIO_BASIC (STR_SVT_MIMETYPE_START+12) -#define STR_SVT_MIMETYPE_AUDIO_MIDI (STR_SVT_MIMETYPE_START+13) -#define STR_SVT_MIMETYPE_AUDIO_WAV (STR_SVT_MIMETYPE_START+14) -#define STR_SVT_MIMETYPE_IMAGE_GIF (STR_SVT_MIMETYPE_START+15) -#define STR_SVT_MIMETYPE_IMAGE_JPEG (STR_SVT_MIMETYPE_START+16) -#define STR_SVT_MIMETYPE_IMAGE_PCX (STR_SVT_MIMETYPE_START+17) -#define STR_SVT_MIMETYPE_IMAGE_BMP (STR_SVT_MIMETYPE_START+18) -#define STR_SVT_MIMETYPE_TEXT_HTML (STR_SVT_MIMETYPE_START+19) -#define STR_SVT_MIMETYPE_TEXT_PLAIN (STR_SVT_MIMETYPE_START+20) -#define STR_SVT_MIMETYPE_TEXT_URL (STR_SVT_MIMETYPE_START+21) -#define STR_SVT_MIMETYPE_TEXT_VCARD (STR_SVT_MIMETYPE_START+22) -#define STR_SVT_MIMETYPE_VIDEO_VDO (STR_SVT_MIMETYPE_START+23) -#define STR_SVT_MIMETYPE_VIDEO_MSVIDEO (STR_SVT_MIMETYPE_START+24) -#define STR_SVT_MIMETYPE_X_STARMAIL (STR_SVT_MIMETYPE_START+25) -#define STR_SVT_MIMETYPE_X_VRML (STR_SVT_MIMETYPE_START+26) -#define STR_SVT_MIMETYPE_APP_STARHELP (STR_SVT_MIMETYPE_START+27) -#define STR_SVT_MIMETYPE_APP_STARIMPRESS (STR_SVT_MIMETYPE_START+28) -#define STR_SVT_MIMETYPE_APP_SCHED_CMB (STR_SVT_MIMETYPE_START+29) -#define STR_SVT_MIMETYPE_APP_SCHED_EVT (STR_SVT_MIMETYPE_START+30) -#define STR_SVT_MIMETYPE_APP_SCHED_TASK (STR_SVT_MIMETYPE_START+31) -#define STR_SVT_MIMETYPE_APP_SCHED_TVIEW (STR_SVT_MIMETYPE_START+32) +#define STR_SVT_MIMETYPE_AUDIO_VORBIS (STR_SVT_MIMETYPE_START+13) +#define STR_SVT_MIMETYPE_AUDIO_MIDI (STR_SVT_MIMETYPE_START+14) +#define STR_SVT_MIMETYPE_AUDIO_WAV (STR_SVT_MIMETYPE_START+15) +#define STR_SVT_MIMETYPE_IMAGE_GIF (STR_SVT_MIMETYPE_START+16) +#define STR_SVT_MIMETYPE_IMAGE_JPEG (STR_SVT_MIMETYPE_START+17) +#define STR_SVT_MIMETYPE_IMAGE_PCX (STR_SVT_MIMETYPE_START+18) +#define STR_SVT_MIMETYPE_IMAGE_BMP (STR_SVT_MIMETYPE_START+19) +#define STR_SVT_MIMETYPE_TEXT_HTML (STR_SVT_MIMETYPE_START+20) +#define STR_SVT_MIMETYPE_TEXT_PLAIN (STR_SVT_MIMETYPE_START+21) +#define STR_SVT_MIMETYPE_TEXT_URL (STR_SVT_MIMETYPE_START+22) +#define STR_SVT_MIMETYPE_TEXT_VCARD (STR_SVT_MIMETYPE_START+23) +#define STR_SVT_MIMETYPE_VIDEO_THEORA (STR_SVT_MIMETYPE_START+24) +#define STR_SVT_MIMETYPE_VIDEO_VDO (STR_SVT_MIMETYPE_START+25) +#define STR_SVT_MIMETYPE_VIDEO_MSVIDEO (STR_SVT_MIMETYPE_START+26) +#define STR_SVT_MIMETYPE_X_STARMAIL (STR_SVT_MIMETYPE_START+27) +#define STR_SVT_MIMETYPE_X_VRML (STR_SVT_MIMETYPE_START+28) +#define STR_SVT_MIMETYPE_APP_STARHELP (STR_SVT_MIMETYPE_START+29) +#define STR_SVT_MIMETYPE_APP_STARIMPRESS (STR_SVT_MIMETYPE_START+30) +#define STR_SVT_MIMETYPE_APP_SCHED_CMB (STR_SVT_MIMETYPE_START+31) +#define STR_SVT_MIMETYPE_APP_SCHED_EVT (STR_SVT_MIMETYPE_START+32) +#define STR_SVT_MIMETYPE_APP_SCHED_TASK (STR_SVT_MIMETYPE_START+33) +#define STR_SVT_MIMETYPE_APP_SCHED_TVIEW (STR_SVT_MIMETYPE_START+34) + +#define STR_SVT_MIMETYPE_CNT_MSG (STR_SVT_MIMETYPE_START+35) +#define STR_SVT_MIMETYPE_CNT_DOCUMENT (STR_SVT_MIMETYPE_START+36) +#define STR_SVT_MIMETYPE_CNT_POP3BOX (STR_SVT_MIMETYPE_START+37) +#define STR_SVT_MIMETYPE_CNT_IMAPBOX (STR_SVT_MIMETYPE_START+38) +#define STR_SVT_MIMETYPE_CNT_IMAPFLD (STR_SVT_MIMETYPE_START+39) +#define STR_SVT_MIMETYPE_CNT_VIMBOX (STR_SVT_MIMETYPE_START+40) +#define STR_SVT_MIMETYPE_CNT_VIMINBOX (STR_SVT_MIMETYPE_START+41) +#define STR_SVT_MIMETYPE_CNT_BBBOX (STR_SVT_MIMETYPE_START+42) +#define STR_SVT_MIMETYPE_CNT_VIM_BB (STR_SVT_MIMETYPE_START+43) +#define STR_SVT_MIMETYPE_CNT_NEWSBOX (STR_SVT_MIMETYPE_START+44) +#define STR_SVT_MIMETYPE_CNT_NEWSGRP (STR_SVT_MIMETYPE_START+45) +#define STR_SVT_MIMETYPE_CNT_OUTBOX (STR_SVT_MIMETYPE_START+46) +#define STR_SVT_MIMETYPE_CNT_FTPBOX (STR_SVT_MIMETYPE_START+47) +#define STR_SVT_MIMETYPE_CNT_FTPFLD (STR_SVT_MIMETYPE_START+48) +#define STR_SVT_MIMETYPE_CNT_FTPFILE (STR_SVT_MIMETYPE_START+49) +#define STR_SVT_MIMETYPE_CNT_FTPLINK (STR_SVT_MIMETYPE_START+50) +#define STR_SVT_MIMETYPE_CNT_HTTPBOX (STR_SVT_MIMETYPE_START+51) +#define STR_SVT_MIMETYPE_CNT_FSYSBOX (STR_SVT_MIMETYPE_START+52) +#define STR_SVT_MIMETYPE_CNT_FSYSFLD (STR_SVT_MIMETYPE_START+53) +#define STR_SVT_MIMETYPE_CNT_FSYSFILE (STR_SVT_MIMETYPE_START+54) +#define STR_SVT_MIMETYPE_CNT_FSYSURLFILE (STR_SVT_MIMETYPE_START+55) +#define STR_SVT_MIMETYPE_CNT_PUBLBOX (STR_SVT_MIMETYPE_START+56) +#define STR_SVT_MIMETYPE_CNT_SRCHBOX (STR_SVT_MIMETYPE_START+57) +#define STR_SVT_MIMETYPE_CNT_SUBSCRBOX (STR_SVT_MIMETYPE_START+58) +#define STR_SVT_MIMETYPE_CNT_BOOKMARK (STR_SVT_MIMETYPE_START+59) +#define STR_SVT_MIMETYPE_CNT_CDF (STR_SVT_MIMETYPE_START+60) +#define STR_SVT_MIMETYPE_CNT_CDFSUB (STR_SVT_MIMETYPE_START+61) +#define STR_SVT_MIMETYPE_CNT_CDFITEM (STR_SVT_MIMETYPE_START+62) +#define STR_SVT_MIMETYPE_CNT_STARCHANNEL (STR_SVT_MIMETYPE_START+63) +#define STR_SVT_MIMETYPE_CNT_TRASHBOX (STR_SVT_MIMETYPE_START+64) +#define STR_SVT_MIMETYPE_CNT_TRASH (STR_SVT_MIMETYPE_START+65) +#define STR_SVT_MIMETYPE_CNT_REMOV_VOL (STR_SVT_MIMETYPE_START+66) +#define STR_SVT_MIMETYPE_CNT_FIX_VOL (STR_SVT_MIMETYPE_START+67) +#define STR_SVT_MIMETYPE_CNT_REM_VOL (STR_SVT_MIMETYPE_START+68) +#define STR_SVT_MIMETYPE_CNT_RAM_VOL (STR_SVT_MIMETYPE_START+69) +#define STR_SVT_MIMETYPE_CNT_CDROM (STR_SVT_MIMETYPE_START+70) +#define STR_SVT_MIMETYPE_CNT_DISK_35 (STR_SVT_MIMETYPE_START+71) +#define STR_SVT_MIMETYPE_CNT_DISK_525 (STR_SVT_MIMETYPE_START+72) +#define STR_SVT_MIMETYPE_CNT_TAPEDRIVE (STR_SVT_MIMETYPE_START+73) +#define STR_SVT_MIMETYPE_APP_GAL (STR_SVT_MIMETYPE_START+74) +#define STR_SVT_MIMETYPE_APP_GAL_THEME (STR_SVT_MIMETYPE_START+75) +#define STR_SVT_MIMETYPE_CNT_SEPARATOR (STR_SVT_MIMETYPE_START+76) +#define STR_SVT_MIMETYPE_APP_STARW_GLOB (STR_SVT_MIMETYPE_START+77) +#define STR_SVT_MIMETYPE_APP_SDM (STR_SVT_MIMETYPE_START+78) +#define STR_SVT_MIMETYPE_APP_SMD (STR_SVT_MIMETYPE_START+79) +#define STR_SVT_MIMETYPE_APP_STARW_WEB (STR_SVT_MIMETYPE_START+80) +#define STR_SVT_MIMETYPE_SCHEDULE (STR_SVT_MIMETYPE_START+81) +#define STR_SVT_MIMETYPE_SCHEDULE_EVT (STR_SVT_MIMETYPE_START+82) +#define STR_SVT_MIMETYPE_SCHEDULE_TASK (STR_SVT_MIMETYPE_START+83) +#define STR_SVT_MIMETYPE_SCHEDULE_FEVT (STR_SVT_MIMETYPE_START+84) +#define STR_SVT_MIMETYPE_SCHEDULE_FTASK (STR_SVT_MIMETYPE_START+85) +#define STR_SVT_MIMETYPE_FRAMESET (STR_SVT_MIMETYPE_START+86) +#define STR_SVT_MIMETYPE_MACRO (STR_SVT_MIMETYPE_START+87) +#define STR_SVT_MIMETYPE_CNT_SFSYSFOLDER (STR_SVT_MIMETYPE_START+88) +#define STR_SVT_MIMETYPE_CNT_SFSYSFILE (STR_SVT_MIMETYPE_START+89) +#define STR_SVT_MIMETYPE_APP_TEMPLATE (STR_SVT_MIMETYPE_START+90) +#define STR_SVT_MIMETYPE_IMAGE_GENERIC (STR_SVT_MIMETYPE_START+91) +#define STR_SVT_MIMETYPE_APP_MSEXCEL (STR_SVT_MIMETYPE_START+92) +#define STR_SVT_MIMETYPE_APP_MSEXCEL_TEMPL (STR_SVT_MIMETYPE_START+93) +#define STR_SVT_MIMETYPE_APP_MSPPOINT (STR_SVT_MIMETYPE_START+94) +#define STR_SVT_MIMETYPE_TEXT_VCALENDAR (STR_SVT_MIMETYPE_START+95) +#define STR_SVT_MIMETYPE_TEXT_ICALENDAR (STR_SVT_MIMETYPE_START+96) +#define STR_SVT_MIMETYPE_TEXT_XMLICALENDAR (STR_SVT_MIMETYPE_START+97) +#define STR_SVT_MIMETYPE_TEXT_CDE_CALENDAR_APP (STR_SVT_MIMETYPE_START+98) +#define STR_SVT_MIMETYPE_INET_MSG_RFC822 (STR_SVT_MIMETYPE_START+99) +#define STR_SVT_MIMETYPE_INET_MULTI_ALTERNATIVE (STR_SVT_MIMETYPE_START+100) +#define STR_SVT_MIMETYPE_INET_MULTI_DIGEST (STR_SVT_MIMETYPE_START+101) +#define STR_SVT_MIMETYPE_INET_MULTI_PARALLEL (STR_SVT_MIMETYPE_START+102) +#define STR_SVT_MIMETYPE_INET_MULTI_RELATED (STR_SVT_MIMETYPE_START+103) +#define STR_SVT_MIMETYPE_INET_MULTI_MIXED (STR_SVT_MIMETYPE_START+104) +#define STR_SVT_MIMETYPE_APP_IMPRESSPACKED (STR_SVT_MIMETYPE_START+105) +#define STR_SVT_MIMETYPE_APP_JAR (STR_SVT_MIMETYPE_START+106) +#define STR_SVT_MIMETYPE_IMAGE_PNG (STR_SVT_MIMETYPE_START+107) +#define STR_SVT_MIMETYPE_IMAGE_TIFF (STR_SVT_MIMETYPE_START+108) + +#define STR_SVT_MIMETYPE_APP_SXCALC (STR_SVT_MIMETYPE_START+109) +#define STR_SVT_MIMETYPE_APP_SXCHART (STR_SVT_MIMETYPE_START+110) +#define STR_SVT_MIMETYPE_APP_SXDRAW (STR_SVT_MIMETYPE_START+111) +#define STR_SVT_MIMETYPE_APP_SXMATH (STR_SVT_MIMETYPE_START+112) +#define STR_SVT_MIMETYPE_APP_SXWRITER (STR_SVT_MIMETYPE_START+113) +#define STR_SVT_MIMETYPE_APP_SXIMPRESS (STR_SVT_MIMETYPE_START+114) +#define STR_SVT_MIMETYPE_APP_SXGLOBAL (STR_SVT_MIMETYPE_START+115) +#define STR_SVT_MIMETYPE_APP_SXIPACKED (STR_SVT_MIMETYPE_START+116) + -#define STR_SVT_MIMETYPE_CNT_MSG (STR_SVT_MIMETYPE_START+33) -#define STR_SVT_MIMETYPE_CNT_DOCUMENT (STR_SVT_MIMETYPE_START+34) -#define STR_SVT_MIMETYPE_CNT_POP3BOX (STR_SVT_MIMETYPE_START+35) -#define STR_SVT_MIMETYPE_CNT_IMAPBOX (STR_SVT_MIMETYPE_START+36) -#define STR_SVT_MIMETYPE_CNT_IMAPFLD (STR_SVT_MIMETYPE_START+37) -#define STR_SVT_MIMETYPE_CNT_VIMBOX (STR_SVT_MIMETYPE_START+38) -#define STR_SVT_MIMETYPE_CNT_VIMINBOX (STR_SVT_MIMETYPE_START+39) -#define STR_SVT_MIMETYPE_CNT_BBBOX (STR_SVT_MIMETYPE_START+40) -#define STR_SVT_MIMETYPE_CNT_VIM_BB (STR_SVT_MIMETYPE_START+41) -#define STR_SVT_MIMETYPE_CNT_NEWSBOX (STR_SVT_MIMETYPE_START+42) -#define STR_SVT_MIMETYPE_CNT_NEWSGRP (STR_SVT_MIMETYPE_START+43) -#define STR_SVT_MIMETYPE_CNT_OUTBOX (STR_SVT_MIMETYPE_START+44) -#define STR_SVT_MIMETYPE_CNT_FTPBOX (STR_SVT_MIMETYPE_START+45) -#define STR_SVT_MIMETYPE_CNT_FTPFLD (STR_SVT_MIMETYPE_START+46) -#define STR_SVT_MIMETYPE_CNT_FTPFILE (STR_SVT_MIMETYPE_START+47) -#define STR_SVT_MIMETYPE_CNT_FTPLINK (STR_SVT_MIMETYPE_START+48) -#define STR_SVT_MIMETYPE_CNT_HTTPBOX (STR_SVT_MIMETYPE_START+49) -#define STR_SVT_MIMETYPE_CNT_FSYSBOX (STR_SVT_MIMETYPE_START+50) -#define STR_SVT_MIMETYPE_CNT_FSYSFLD (STR_SVT_MIMETYPE_START+51) -#define STR_SVT_MIMETYPE_CNT_FSYSFILE (STR_SVT_MIMETYPE_START+52) -#define STR_SVT_MIMETYPE_CNT_FSYSURLFILE (STR_SVT_MIMETYPE_START+53) -#define STR_SVT_MIMETYPE_CNT_PUBLBOX (STR_SVT_MIMETYPE_START+54) -#define STR_SVT_MIMETYPE_CNT_SRCHBOX (STR_SVT_MIMETYPE_START+55) -#define STR_SVT_MIMETYPE_CNT_SUBSCRBOX (STR_SVT_MIMETYPE_START+56) -#define STR_SVT_MIMETYPE_CNT_BOOKMARK (STR_SVT_MIMETYPE_START+57) -#define STR_SVT_MIMETYPE_CNT_CDF (STR_SVT_MIMETYPE_START+58) -#define STR_SVT_MIMETYPE_CNT_CDFSUB (STR_SVT_MIMETYPE_START+59) -#define STR_SVT_MIMETYPE_CNT_CDFITEM (STR_SVT_MIMETYPE_START+60) -#define STR_SVT_MIMETYPE_CNT_STARCHANNEL (STR_SVT_MIMETYPE_START+61) -#define STR_SVT_MIMETYPE_CNT_TRASHBOX (STR_SVT_MIMETYPE_START+62) -#define STR_SVT_MIMETYPE_CNT_TRASH (STR_SVT_MIMETYPE_START+63) -#define STR_SVT_MIMETYPE_CNT_REMOV_VOL (STR_SVT_MIMETYPE_START+64) -#define STR_SVT_MIMETYPE_CNT_FIX_VOL (STR_SVT_MIMETYPE_START+65) -#define STR_SVT_MIMETYPE_CNT_REM_VOL (STR_SVT_MIMETYPE_START+66) -#define STR_SVT_MIMETYPE_CNT_RAM_VOL (STR_SVT_MIMETYPE_START+67) -#define STR_SVT_MIMETYPE_CNT_CDROM (STR_SVT_MIMETYPE_START+68) -#define STR_SVT_MIMETYPE_CNT_DISK_35 (STR_SVT_MIMETYPE_START+69) -#define STR_SVT_MIMETYPE_CNT_DISK_525 (STR_SVT_MIMETYPE_START+70) -#define STR_SVT_MIMETYPE_CNT_TAPEDRIVE (STR_SVT_MIMETYPE_START+71) -#define STR_SVT_MIMETYPE_APP_GAL (STR_SVT_MIMETYPE_START+72) -#define STR_SVT_MIMETYPE_APP_GAL_THEME (STR_SVT_MIMETYPE_START+73) -#define STR_SVT_MIMETYPE_CNT_SEPARATOR (STR_SVT_MIMETYPE_START+74) -#define STR_SVT_MIMETYPE_APP_STARW_GLOB (STR_SVT_MIMETYPE_START+75) -#define STR_SVT_MIMETYPE_APP_SDM (STR_SVT_MIMETYPE_START+76) -#define STR_SVT_MIMETYPE_APP_SMD (STR_SVT_MIMETYPE_START+77) -#define STR_SVT_MIMETYPE_APP_STARW_WEB (STR_SVT_MIMETYPE_START+78) -#define STR_SVT_MIMETYPE_SCHEDULE (STR_SVT_MIMETYPE_START+79) -#define STR_SVT_MIMETYPE_SCHEDULE_EVT (STR_SVT_MIMETYPE_START+80) -#define STR_SVT_MIMETYPE_SCHEDULE_TASK (STR_SVT_MIMETYPE_START+81) -#define STR_SVT_MIMETYPE_SCHEDULE_FEVT (STR_SVT_MIMETYPE_START+82) -#define STR_SVT_MIMETYPE_SCHEDULE_FTASK (STR_SVT_MIMETYPE_START+83) -#define STR_SVT_MIMETYPE_FRAMESET (STR_SVT_MIMETYPE_START+84) -#define STR_SVT_MIMETYPE_MACRO (STR_SVT_MIMETYPE_START+85) -#define STR_SVT_MIMETYPE_CNT_SFSYSFOLDER (STR_SVT_MIMETYPE_START+86) -#define STR_SVT_MIMETYPE_CNT_SFSYSFILE (STR_SVT_MIMETYPE_START+87) -#define STR_SVT_MIMETYPE_APP_TEMPLATE (STR_SVT_MIMETYPE_START+88) -#define STR_SVT_MIMETYPE_IMAGE_GENERIC (STR_SVT_MIMETYPE_START+89) -#define STR_SVT_MIMETYPE_APP_MSEXCEL (STR_SVT_MIMETYPE_START+90) -#define STR_SVT_MIMETYPE_APP_MSEXCEL_TEMPL (STR_SVT_MIMETYPE_START+91) -#define STR_SVT_MIMETYPE_APP_MSPPOINT (STR_SVT_MIMETYPE_START+92) -#define STR_SVT_MIMETYPE_TEXT_VCALENDAR (STR_SVT_MIMETYPE_START+93) -#define STR_SVT_MIMETYPE_TEXT_ICALENDAR (STR_SVT_MIMETYPE_START+94) -#define STR_SVT_MIMETYPE_TEXT_XMLICALENDAR (STR_SVT_MIMETYPE_START+95) -#define STR_SVT_MIMETYPE_TEXT_CDE_CALENDAR_APP (STR_SVT_MIMETYPE_START+96) -#define STR_SVT_MIMETYPE_INET_MSG_RFC822 (STR_SVT_MIMETYPE_START+97) -#define STR_SVT_MIMETYPE_INET_MULTI_ALTERNATIVE (STR_SVT_MIMETYPE_START+98) -#define STR_SVT_MIMETYPE_INET_MULTI_DIGEST (STR_SVT_MIMETYPE_START+99) -#define STR_SVT_MIMETYPE_INET_MULTI_PARALLEL (STR_SVT_MIMETYPE_START+100) -#define STR_SVT_MIMETYPE_INET_MULTI_RELATED (STR_SVT_MIMETYPE_START+101) -#define STR_SVT_MIMETYPE_INET_MULTI_MIXED (STR_SVT_MIMETYPE_START+102) -#define STR_SVT_MIMETYPE_APP_IMPRESSPACKED (STR_SVT_MIMETYPE_START+103) -#define STR_SVT_MIMETYPE_APP_JAR (STR_SVT_MIMETYPE_START+104) -#define STR_SVT_MIMETYPE_IMAGE_PNG (STR_SVT_MIMETYPE_START+105) -#define STR_SVT_MIMETYPE_IMAGE_TIFF (STR_SVT_MIMETYPE_START+106) +#define STR_SVT_MIMETYPE_VIDEO_WEBM (STR_SVT_MIMETYPE_START+117) +#define STR_SVT_MIMETYPE_AUDIO_WEBM (STR_SVT_MIMETYPE_START+118) -#define STR_SVT_MIMETYPE_APP_SXCALC (STR_SVT_MIMETYPE_START+107) -#define STR_SVT_MIMETYPE_APP_SXCHART (STR_SVT_MIMETYPE_START+108) -#define STR_SVT_MIMETYPE_APP_SXDRAW (STR_SVT_MIMETYPE_START+109) -#define STR_SVT_MIMETYPE_APP_SXMATH (STR_SVT_MIMETYPE_START+110) -#define STR_SVT_MIMETYPE_APP_SXWRITER (STR_SVT_MIMETYPE_START+111) -#define STR_SVT_MIMETYPE_APP_SXIMPRESS (STR_SVT_MIMETYPE_START+112) -#define STR_SVT_MIMETYPE_APP_SXGLOBAL (STR_SVT_MIMETYPE_START+113) -#define STR_SVT_MIMETYPE_APP_SXIPACKED (STR_SVT_MIMETYPE_START+114) -#define STR_SVT_MIMETYPE_END (STR_SVT_MIMETYPE_APP_SXIPACKED) +#define STR_SVT_MIMETYPE_END (STR_SVT_MIMETYPE_AUDIO_WEBM) #define STR_COLUM_DT_AUTO (STR_SVT_MIMETYPE_END+1) diff --git a/svl/inc/svl/svldata.hxx b/svl/inc/svl/svldata.hxx index 7d666a7e0d15..1a869b5a5a1f 100644 --- a/svl/inc/svl/svldata.hxx +++ b/svl/inc/svl/svldata.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. @@ -70,3 +71,4 @@ public: #endif // _SVL_SVLDATA_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/svldllapi.h b/svl/inc/svl/svldllapi.h index 0616a6fa59a9..59f663910896 100644 --- a/svl/inc/svl/svldllapi.h +++ b/svl/inc/svl/svldllapi.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_SVLDLLAPI_H */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx index 88f318c2d5d3..0d46662237d4 100644 --- a/svl/inc/svl/svstdarr.hxx +++ b/svl/inc/svl/svstdarr.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. @@ -25,221 +26,98 @@ * ************************************************************************/ -#if 0 -*********************************************************************** +/*********************************************************************** * * Die vordefinierte Arrays werden ueber POSITIV-Defines aktiviert: * (die defines setzen sich aus "_SVSTDARR_" und dem Namen des Array * ohne "Sv" zusammen) * -* VarArr: SvBools, SvULongs, SvUShorts, SvLongs, SvShorts +* VarArr: SvULongs, SvUShorts * PtrArr: SvStrings, SvStringsDtor * SortArr: SvStringsSort, SvStringsSortDtor, * SvStringsISort, SvStringsISortDtor, -* SvUShortsSort -*********************************************************************** -#endif +***********************************************************************/ #include "svl/svldllapi.h" #include <svl/svarray.hxx> #include <deque> -typedef std::deque< sal_Bool > SvBools; - -typedef std::deque< sal_uInt8 > SvBytes; - -//#ifdef _SVSTDARR_ULONGS #ifndef _SVSTDARR_ULONGS_DECL SV_DECL_VARARR_VISIBILITY( SvULongs, sal_uLong, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_ULONGS_DECL #endif -//#endif - -//#ifdef _SVSTDARR_ULONGSSORT -#ifndef _SVSTDARR_ULONGSSORT_DECL -SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, sal_uLong, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_ULONGSSORT_DECL -#endif -//#endif -//#ifdef _SVSTDARR_USHORTS #ifndef _SVSTDARR_USHORTS_DECL SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_USHORTS_DECL #endif -//#endif - -//#ifdef _SVSTDARR_USHORTSSORT -#ifndef _SVSTDARR_USHORTSSORT_DECL - -typedef sal_Bool (*FnForEach_SvUShortsSort)( const sal_uInt16&, void* ); -class SVL_DLLPUBLIC SvUShortsSort : __MWERKS__PRIVATE SvUShorts -{ -public: - SvUShortsSort(sal_uInt8 nSize = 1, sal_uInt8 nG = 1) - : SvUShorts(nSize,nG) {} - - void Insert( const SvUShortsSort *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX ); - sal_Bool Insert( const sal_uInt16 aE ); - sal_Bool Insert( const sal_uInt16 aE, sal_uInt16& rP ); - void Insert( const sal_uInt16 *pE, sal_uInt16 nL ); - // remove ab Pos - void RemoveAt( const sal_uInt16 nP, sal_uInt16 nL = 1 ); - // remove ab dem Eintrag - void Remove( const sal_uInt16 nP, sal_uInt16 nL = 1 ); - sal_Bool Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP = 0 ) const; - - sal_uInt16 Count() const { return SvUShorts::Count(); } - const sal_uInt16* GetData() const { return (const sal_uInt16*)pData; } - - const sal_uInt16& operator[](sal_uInt16 nP) const { - return SvUShorts::operator[]( nP ); - } - const sal_uInt16& GetObject(sal_uInt16 nP) const { - return SvUShorts::GetObject( nP ); - } - void ForEach( FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) - { - _ForEach( 0, nA, (FnForEach_SvUShorts)fnForEach, pArgs ); - } - void ForEach( sal_uInt16 nS, sal_uInt16 nE, - FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) - { - _ForEach( nS, nE, (FnForEach_SvUShorts)fnForEach, pArgs ); - } -private: - SvUShortsSort( const SvUShortsSort& ); - SvUShortsSort& operator=( const SvUShortsSort& ); -}; - -#define _SVSTDARR_USHORTSSORT_DECL -#endif -//#endif - -//#ifdef _SVSTDARR_LONGS -#ifndef _SVSTDARR_LONGS_DECL -SV_DECL_VARARR_VISIBILITY( SvLongs, long, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_LONGS_DECL -#endif -//#endif -//#ifdef _SVSTDARR_LONGSSORT -#ifndef _SVSTDARR_LONGSSORT_DECL -SV_DECL_VARARR_SORT_VISIBILITY( SvLongsSort, long, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_LONGSSORT_DECL -#endif -//#endif - -typedef std::deque< short > SvShorts; - -/* - form here all Arrays for Strings, ByteString and then - len of a string (xub_StrLen) -#if (defined(_SVSTDARR_STRINGS) && !defined(_SVSTDARR_STRINGS_DECL)) || \ - (defined(_SVSTDARR_STRINGSDTOR) && !defined(_SVSTDARR_STRINGSDTOR_DECL)) || \ - (defined(_SVSTDARR_STRINGSSORT) && !defined(_SVSTDARR_STRINGSSORT_DECL)) || \ - (defined(_SVSTDARR_STRINGSSORTDTOR) && !defined(_SVSTDARR_STRINGSSORTDTOR_DECL)) || \ - (defined(_SVSTDARR_STRINGSISORT) && !defined(_SVSTDARR_STRINGSISORT_DECL)) || \ - (defined(_SVSTDARR_STRINGSISORTDTOR) && !defined(_SVSTDARR_STRINGSISORTDTOR_DECL)) || \ - (defined(_SVSTDARR_BYTESTRINGS) && !defined(_SVSTDARR_BYTESTRINGS_DECL)) || \ - (defined(_SVSTDARR_BYTESTRINGSDTOR) && !defined(_SVSTDARR_BYTESTRINGSDTOR_DECL)) || \ - (defined(_SVSTDARR_BYTESTRINGSSORT) && !defined(_SVSTDARR_BYTESTRINGSSORT_DECL)) || \ - (defined(_SVSTDARR_BYTESTRINGSSORTDTOR) && !defined(_SVSTDARR_BYTESTRINGSSORTDTOR_DECL)) || \ - (defined(_SVSTDARR_BYTESTRINGSISORT) && !defined(_SVSTDARR_BYTESTRINGSISORT_DECL)) || \ - (defined(_SVSTDARR_BYTESTRINGSISORTDTOR) && !defined(_SVSTDARR_BYTESTRINGSISORTDTOR_DECL)) || \ - (defined(_SVSTDARR_XUB_STRLEN) && !defined(_SVSTDARR_XUB_STRLEN_DECL)) ||\ - (defined(_SVSTDARR_XUB_STRLENSORT) && !defined(_SVSTDARR_XUB_STRLENSORT_DECL)) -*/ #include <tools/string.hxx> typedef String* StringPtr; typedef ByteString* ByteStringPtr; -//#endif -//#ifdef _SVSTDARR_STRINGS #ifndef _SVSTDARR_STRINGS_DECL SV_DECL_PTRARR_VISIBILITY( SvStrings, StringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_STRINGS_DECL #endif -//#endif -//#ifdef _SVSTDARR_STRINGSDTOR #ifndef _SVSTDARR_STRINGSDTOR_DECL SV_DECL_PTRARR_DEL_VISIBILITY( SvStringsDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_STRINGSDTOR_DECL #endif -//#endif -//#ifdef _SVSTDARR_STRINGSSORT #ifndef _SVSTDARR_STRINGSSORT_DECL SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsSort, StringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_STRINGSSORT_DECL #endif -//#endif -//#ifdef _SVSTDARR_STRINGSSORTDTOR #ifndef _SVSTDARR_STRINGSSORTDTOR_DECL SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsSortDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_STRINGSSORTDTOR_DECL #endif -//#endif -//#ifdef _SVSTDARR_STRINGSISORT #ifndef _SVSTDARR_STRINGSISORT_DECL SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsISort, StringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_STRINGSISORT_DECL #endif -//#endif -//#ifdef _SVSTDARR_STRINGSISORTDTOR #ifndef _SVSTDARR_STRINGSISORTDTOR_DECL SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsISortDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_STRINGSISORTDTOR_DECL #endif -//#endif -//#ifdef _SVSTDARR_BYTESTRINGS #ifndef _SVSTDARR_BYTESTRINGS_DECL SV_DECL_PTRARR_VISIBILITY( SvByteStrings, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTESTRINGS_DECL #endif -//#endif -//#ifdef _SVSTDARR_BYTESTRINGSDTOR #ifndef _SVSTDARR_BYTESTRINGSDTOR_DECL SV_DECL_PTRARR_DEL_VISIBILITY( SvByteStringsDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTESTRINGSDTOR_DECL #endif -//#endif -//#ifdef _SVSTDARR_BYTESTRINGSSORT #ifndef _SVSTDARR_BYTESTRINGSSORT_DECL SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsSort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTESTRINGSSORT_DECL #endif -//#endif -//#ifdef _SVSTDARR_BYTESTRINGSSORTDTOR #ifndef _SVSTDARR_BYTESTRINGSSORTDTOR_DECL SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsSortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTESTRINGSSORTDTOR_DECL #endif -//#endif -//#ifdef _SVSTDARR_BYTESTRINGSISORT #ifndef _SVSTDARR_BYTESTRINGSISORT_DECL SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsISort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTESTRINGSISORT_DECL #endif -//#endif -//#ifdef _SVSTDARR_BYTESTRINGSISORTDTOR #ifndef _SVSTDARR_BYTESTRINGSISORTDTOR_DECL SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_BYTESTRINGSISORTDTOR_DECL #endif -//#endif typedef std::deque< xub_StrLen > SvXub_StrLens; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/szitem.hxx b/svl/inc/svl/szitem.hxx index 0e1aa5b365b1..b3b78d9e8891 100644 --- a/svl/inc/svl/szitem.hxx +++ b/svl/inc/svl/szitem.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. @@ -58,9 +59,9 @@ public: const IntlWrapper * = 0 ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; @@ -75,3 +76,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx index 57a26c3109ec..4e18504fbfc7 100644 --- a/svl/inc/svl/undo.hxx +++ b/svl/inc/svl/undo.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. @@ -471,3 +472,5 @@ protected: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/urihelper.hxx b/svl/inc/svl/urihelper.hxx index ab2ae5878cc2..3baab37f7896 100644 --- a/svl/inc/svl/urihelper.hxx +++ b/svl/inc/svl/urihelper.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. @@ -233,3 +234,5 @@ SVL_DLLPUBLIC INetURLObject::FSysStyle queryFSysStyle(UniString const & rFileUrl } #endif // SVTOOLS_URIHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/urlbmk.hxx b/svl/inc/svl/urlbmk.hxx index 9a37184c8ec1..8922dbb4feb9 100644 --- a/svl/inc/svl/urlbmk.hxx +++ b/svl/inc/svl/urlbmk.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. @@ -67,3 +68,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/urlfilter.hxx b/svl/inc/svl/urlfilter.hxx index d8c053ab573e..a61e5a2f8e95 100644 --- a/svl/inc/svl/urlfilter.hxx +++ b/svl/inc/svl/urlfilter.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. @@ -61,3 +62,5 @@ public: }; #endif // SVTOOLS_URL_FILTER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/visitem.hxx b/svl/inc/svl/visitem.hxx index 0305e0563938..70f3ce994754 100644 --- a/svl/inc/svl/visitem.hxx +++ b/svl/inc/svl/visitem.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. @@ -69,10 +70,10 @@ public: const IntlWrapper * = 0) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; @@ -91,3 +92,5 @@ public: }; #endif // _SFXVISIBILITYITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/whiter.hxx b/svl/inc/svl/whiter.hxx index eb9bb7d7e732..bb3936eb6961 100644 --- a/svl/inc/svl/whiter.hxx +++ b/svl/inc/svl/whiter.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. @@ -58,3 +59,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/xmlement.hxx b/svl/inc/svl/xmlement.hxx index d2680fbbf404..779bad3f3c55 100644 --- a/svl/inc/svl/xmlement.hxx +++ b/svl/inc/svl/xmlement.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 _SVTOOLS_XMLEMENT_HXX #define _SVTOOLS_XMLEMENT_HXX -#ifndef _SAL_TYPES_H #include <sal/types.h> -#endif struct SvXMLEnumMapEntry { @@ -41,3 +40,4 @@ struct SvXMLEnumMapEntry #endif // _SVTOOLS_XMLEMENT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index abb627567856..ae51e2ddcbbd 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.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,9 +30,7 @@ #include "svl/svldllapi.h" #include <tools/string.hxx> -#ifndef _TABLE_HXX //autogen #include <tools/table.hxx> -#endif #include <i18npool/lang.h> #include <svl/svarray.hxx> #include <com/sun/star/uno/Reference.hxx> @@ -61,6 +60,9 @@ namespace com { namespace sun { namespace star { } }}} +namespace rtl { + class OUString; +} #define SV_COUNTRY_LANGUAGE_OFFSET 5000 // Max count of formats per country/language #define SV_MAX_ANZ_STANDARD_FORMATE 100 // Max count of builtin default formats per CL @@ -212,9 +214,7 @@ enum NfEvalDateFormat }; -//#if 0 // _SOLAR__PRIVATE #define _ZFORLIST_DECLARE_TABLE -//#endif #ifdef _ZFORLIST_DECLARE_TABLE DECLARE_TABLE (SvNumberFormatTable, SvNumberformat*) DECLARE_TABLE (SvNumberFormatterIndexTable, sal_uInt32*) @@ -245,12 +245,10 @@ class SVL_DLLPUBLIC NfCurrencyEntry private: -//#if 0 // _SOLAR__PRIVATE // nDecimalFormat := 0, 1, 2 // #,##0 or #,##0.00 or #,##0.-- are assigned SVL_DLLPRIVATE void Impl_BuildFormatStringNumChars( String&, const LocaleDataWrapper&, sal_uInt16 nDecimalFormat ) const; -//#endif // __PRIVATE public: @@ -405,7 +403,7 @@ public: @return <TRUE/> if string new and ok and inserted. <FALSE/> if string already exists or an unresolvable parse error - occured, in which case nCheckPos is the error position within rString. + occurred, in which case nCheckPos is the error position within rString. If the error occurs at position 0 or rString is empty nCheckPos will be 1, so an error in the string is always indicated by nCheckPos not being zero. @@ -417,10 +415,13 @@ public: sal_Bool PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge = LANGUAGE_DONTKNOW ); + bool PutEntry( rtl::OUString& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + /** Same as <method>PutEntry</method> but the format code string is considered to be of language/country eLnge and is converted to language/country eNewLnge */ - sal_Bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, + bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -428,7 +429,7 @@ public: is considered to be of the System language/country eLnge and is converted to another System language/country eNewLnge. In this case the automatic currency is converted too. */ - sal_Bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, + bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -1029,3 +1030,5 @@ inline sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear( #endif // _ZFORLIST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index f610b44c4b6b..aa84528b96d5 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.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. @@ -144,7 +145,7 @@ public: const ImpSvNumberformatInfo& Info() const { return aI; } // Get count of substrings (symbols) - sal_uInt16 GetnAnz() const { return nAnzStrings;} + sal_uInt16 GetCount() const { return nAnzStrings;} Color* GetColor() const { return pColor; } void SetColor( Color* pCol, String& rName ) @@ -174,6 +175,18 @@ private: class SVL_DLLPUBLIC SvNumberformat { + struct LocaleType + { + sal_uInt8 mnNumeralShape; + sal_uInt8 mnCalendarType; + LanguageType meLanguage; + + ::rtl::OUString generateCode() const; + + LocaleType(); + LocaleType(sal_uInt32 nRawCode); + }; + public: // Ctor for Load SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge ); @@ -214,7 +227,7 @@ public: sal_Bool IsAdditionalStandardDefined() const { return nNewStandardDefined == SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS; } - LanguageType GetLanguage() const { return eLnge;} + LanguageType GetLanguage() const { return maLocale.meLanguage;} const String& GetFormatstring() const { return sFormatstring; } @@ -250,7 +263,7 @@ public: // True if 4th subformat present sal_Bool HasTextFormat() const { - return (NumFor[3].GetnAnz() > 0) || + return (NumFor[3].GetCount() > 0) || (NumFor[3].Info().eScannedType == NUMBERFORMAT_TEXT); } @@ -298,7 +311,7 @@ public: // strings of the format were matched and not just the starting // sequence, so we don't have to check if GetnAnz() includes // [modifiers] or anything else if both counts are equal. - sal_uInt16 nCnt = NumFor[nNumFor].GetnAnz(); + sal_uInt16 nCnt = NumFor[nNumFor].GetCount(); if ( nAllCount == nCnt ) return sal_True; if ( nAllCount < nCnt ) // check ignoring [modifiers] and so on @@ -321,6 +334,10 @@ public: // Whether the negative format is without a sign or not sal_Bool IsNegativeWithoutSign() const; + sal_Bool IsNegativeInBracket() const; + + sal_Bool HasPositiveBracketPlaceholder() const; + // Whether a new SYMBOLTYPE_CURRENCY is contained in the format sal_Bool HasNewCurrency() const; @@ -455,7 +472,7 @@ private: double fLimit1; // Value for first condition double fLimit2; // Value for second condition ImpSvNumberformatScan& rScan; // Format code scanner - LanguageType eLnge; // Language/country of the format + LocaleType maLocale; // Language/country of the format, numeral shape and calendar type from Excel. SvNumberformatLimitOps eOp1; // Operator for first condition SvNumberformatLimitOps eOp2; // Operator for second condition sal_uInt16 nNewStandardDefined; // new builtin formats as of version 6 @@ -488,8 +505,29 @@ private: xub_StrLen& nPos, String& sSymbol ); - // get xxx of "[$-xxx]" as LanguageType, starting at and advancing position nPos - SVL_DLLPRIVATE static LanguageType ImpGetLanguageType( const String& rString, xub_StrLen& nPos ); + /** + * Parse the content of '[$-xxx] or '[$-xxxxxxxx]' and extract the locale + * type from it. Given the string, start parsing at position specified by + * nPos, and store the end position with nPos when the parsing is + * complete. The nPos should point to the '$' before the parsing, and to + * the closing bracket after the parsing. When the content is [$-xxx], + * the xxx part represents the language type (aka LCID) in hex numerals. + * When the content is [$-xxxxxxxx] the last 4 digits represent the LCID + * (again in hex), the next 2 digits represent the calendar type, and the + * 2 highest digits (if exists) is the numeral shape. + * + * @reference + * http://office.microsoft.com/en-us/excel-help/creating-international-number-formats-HA001034635.aspx + * + * @param rString input string + * @param nPos position (see above). + * + * @return struct containing numeral shape, calendar type, and LCID that + * specifies language type. See i18npool/lang.h for a complete + * list of language types. These numbers also correspond with the + * numbers used by Microsoft Office. + */ + SVL_DLLPRIVATE static LocaleType ImpGetLocaleType( const String& rString, xub_StrLen& nPos ); // standard number output SVL_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, String& OutString ); @@ -591,3 +629,5 @@ private: }; #endif // _ZFORMAT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 999cdf8947de..67366a6aee68 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,2 +1,3 @@ -sl svl : L10N:l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL +sl svl : TRANSLATIONS:translations rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL sl svl\prj nmake - all svl_prj NULL +# sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL diff --git a/svl/qa/complex/ConfigItems/helper/AccessibilityOptTest.cxx b/svl/qa/complex/ConfigItems/helper/AccessibilityOptTest.cxx index 10112c07ac8c..63a88e733efb 100644 --- a/svl/qa/complex/ConfigItems/helper/AccessibilityOptTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/AccessibilityOptTest.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. @@ -390,3 +391,5 @@ void AccessibilityOptTest::impl_checkAccessibilityOptions() impl_checkSetHelpTipSeconds(); impl_checkSetSelectionInReadonly(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/complex/ConfigItems/helper/AccessibilityOptTest.hxx b/svl/qa/complex/ConfigItems/helper/AccessibilityOptTest.hxx index cf2146f54e49..89dce6d2bdd1 100644 --- a/svl/qa/complex/ConfigItems/helper/AccessibilityOptTest.hxx +++ b/svl/qa/complex/ConfigItems/helper/AccessibilityOptTest.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. @@ -68,3 +69,5 @@ private: }; #endif // #ifndef SVTOOLS_ACCESSIBILITYOPTTEST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx index b342eff7ff76..3172fd9322d6 100644 --- a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.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. @@ -46,13 +47,11 @@ namespace css = ::com::sun::star; namespace svl{ //============================================================================= -static const ::rtl::OUString PROP_TEST = ::rtl::OUString::createFromAscii("Test"); -static const ::rtl::OUString TEST_PICKLIST = ::rtl::OUString::createFromAscii("checkPicklist"); -static const ::rtl::OUString TEST_URLHISTORY = ::rtl::OUString::createFromAscii("checkURLHistory"); -static const ::rtl::OUString TEST_HELPBOOKMARKS = ::rtl::OUString::createFromAscii("checkHelpBookmarks"); -// static const ::rtl::OUString TEST_ACCESSIBILITYOPTIONS = ::rtl::OUString::createFromAscii("checkAccessibilityOptions"); -// static const ::rtl::OUString TEST_PRINTOPTIONS = ::rtl::OUString::createFromAscii("checkPrintOptions"); -static const ::rtl::OUString TEST_USEROPTIONS = ::rtl::OUString::createFromAscii("checkUserOptions"); +static const ::rtl::OUString PROP_TEST (RTL_CONSTASCII_USTRINGPARAM("Test")); +static const ::rtl::OUString TEST_PICKLIST (RTL_CONSTASCII_USTRINGPARAM("checkPicklist")); +static const ::rtl::OUString TEST_URLHISTORY (RTL_CONSTASCII_USTRINGPARAM("checkURLHistory")); +static const ::rtl::OUString TEST_HELPBOOKMARKS (RTL_CONSTASCII_USTRINGPARAM("checkHelpBookmarks")); +static const ::rtl::OUString TEST_USEROPTIONS (RTL_CONSTASCII_USTRINGPARAM("checkUserOptions")); //============================================================================= class ConfigItemTest : public ::cppu::WeakImplHelper2< css::task::XJob , @@ -188,14 +187,14 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL ConfigItemTest::getSupportedServi //============================================================================= ::rtl::OUString SAL_CALL ConfigItemTest::st_getImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.svl.ConfigItemTest"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.svl.ConfigItemTest")); } //============================================================================= css::uno::Sequence< ::rtl::OUString > SAL_CALL ConfigItemTest::st_getSupportedServiceNames() { css::uno::Sequence< ::rtl::OUString > lServices(1); - lServices[0] = ::rtl::OUString::createFromAscii("com.sun.star.test.ConfigItems"); + lServices[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.test.ConfigItems")); return lServices; } @@ -223,14 +222,14 @@ static ::cppu::ImplementationEntry const lRegEntries[] = }; //============================================================================= -extern "C" void SAL_CALL component_getImplementationEnvironment(const char** pEnvTypeName, +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const char** pEnvTypeName, uno_Environment** ) { *pEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //============================================================================= -extern "C" void * SAL_CALL component_getFactory(const char* sImplName , +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const char* sImplName , void* pServiceManager, void* pRegistryKey ) { @@ -243,3 +242,5 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void* pServiceManager, { return ::cppu::component_writeInfoHelper(pServiceManager, pRegistryKey, lRegEntries); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/complex/ConfigItems/helper/HistoryOptTest.cxx b/svl/qa/complex/ConfigItems/helper/HistoryOptTest.cxx index 4f8e2159847d..09eae2f5d37e 100644 --- a/svl/qa/complex/ConfigItems/helper/HistoryOptTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/HistoryOptTest.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,14 +42,14 @@ namespace css = ::com::sun::star; //============================================================================= -static const ::rtl::OUString MESSAGE_CLEAR_FAILED = ::rtl::OUString::createFromAscii("Clearing the list failed."); -static const ::rtl::OUString MESSAGE_SETSIZE_FAILED = ::rtl::OUString::createFromAscii("Setting a new size for a list failed."); -static const ::rtl::OUString MESSAGE_MISS_HISTORY = ::rtl::OUString::createFromAscii("Could not get config access to history list inside config."); -static const ::rtl::OUString MESSAGE_MISS_ITEMLIST = ::rtl::OUString::createFromAscii("Could not get config access to item list inside config."); -static const ::rtl::OUString MESSAGE_MISS_ORDERLIST = ::rtl::OUString::createFromAscii("Could not get config access to order list inside config."); -static const ::rtl::OUString MESSAGE_MISS_ITEM = ::rtl::OUString::createFromAscii("Could not locate item."); -static const ::rtl::OUString MESSAGE_UNEXPECTED_ITEM = ::rtl::OUString::createFromAscii("Found an unexpected item."); -static const ::rtl::OUString MESSAGE_WRONG_ORDER = ::rtl::OUString::createFromAscii("Wrong order in history list."); +static const ::rtl::OUString MESSAGE_CLEAR_FAILED (RTL_CONSTASCII_USTRINGPARAM("Clearing the list failed.")); +static const ::rtl::OUString MESSAGE_SETSIZE_FAILED (RTL_CONSTASCII_USTRINGPARAM("Setting a new size for a list failed.")); +static const ::rtl::OUString MESSAGE_MISS_HISTORY (RTL_CONSTASCII_USTRINGPARAM("Could not get config access to history list inside config.")); +static const ::rtl::OUString MESSAGE_MISS_ITEMLIST (RTL_CONSTASCII_USTRINGPARAM("Could not get config access to item list inside config.")); +static const ::rtl::OUString MESSAGE_MISS_ORDERLIST (RTL_CONSTASCII_USTRINGPARAM("Could not get config access to order list inside config.")); +static const ::rtl::OUString MESSAGE_MISS_ITEM (RTL_CONSTASCII_USTRINGPARAM("Could not locate item.")); +static const ::rtl::OUString MESSAGE_UNEXPECTED_ITEM (RTL_CONSTASCII_USTRINGPARAM("Found an unexpected item.")); +static const ::rtl::OUString MESSAGE_WRONG_ORDER (RTL_CONSTASCII_USTRINGPARAM("Wrong order in history list.")); //============================================================================= HistoryOptTest::HistoryOptTest() @@ -464,13 +465,13 @@ void HistoryOptTest::impl_clearList(const ::rtl::OUString& sList) css::uno::Reference< css::beans::XPropertySet > xFirstItem; css::uno::Sequence< ::rtl::OUString > sFileList; - if (sList.equalsAscii("PickList")) + if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PickList"))) m_xCfg->getByName(s_sPickList) >>= xListAccess; - else if (sList.equalsAscii("URLHistory")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLHistory"))) m_xCfg->getByName(s_sURLHistory) >>= xListAccess; - else if (sList.equalsAscii("HelpBookmarks")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpBookmarks"))) m_xCfg->getByName(s_sHelpBookmarks) >>= xListAccess; if (xListAccess.is()) @@ -501,13 +502,13 @@ sal_Bool HistoryOptTest::impl_isListEmpty(const ::rtl::OUString& sList) css::uno::Reference< css::container::XNameAccess > xOrderList; sal_Bool bRet = sal_True; - if (sList.equalsAscii("PickList")) + if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PickList"))) m_xCfg->getByName(s_sPickList) >>= xListAccess; - else if (sList.equalsAscii("URLHistory")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLHistory"))) m_xCfg->getByName(s_sURLHistory) >>= xListAccess; - else if (sList.equalsAscii("HelpBookmarks")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpBookmarks"))) m_xCfg->getByName(s_sHelpBookmarks) >>= xListAccess; if (xListAccess.is()) @@ -539,7 +540,7 @@ void HistoryOptTest::impl_checkGetSize(const ::rtl::OUString& sList) sal_uInt32 nSize = 0; sal_uInt32 nSize_ = 0; - if (sList.equalsAscii("PickList")) + if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PickList"))) { nSize = aHistoryOpt.GetSize(ePICKLIST); @@ -552,7 +553,7 @@ void HistoryOptTest::impl_checkGetSize(const ::rtl::OUString& sList) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetSize(ePICKLIST) error!")), 0); } - else if (sList.equalsAscii("URLHistory")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLHistory"))) { nSize = aHistoryOpt.GetSize(eHISTORY); @@ -566,7 +567,7 @@ void HistoryOptTest::impl_checkGetSize(const ::rtl::OUString& sList) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetSize(eHISTORY) error!")), 0); } - else if (sList.equalsAscii("HelpBookmarks")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpBookmarks"))) { nSize = aHistoryOpt.GetSize(eHELPBOOKMARKS); @@ -590,7 +591,7 @@ void HistoryOptTest::impl_checkSetSize(const ::rtl::OUString& sList) sal_uInt32 nSize = 0; sal_uInt32 nSize_ = 0; - if (sList.equalsAscii("PickList")) + if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PickList"))) { xSet->getPropertyValue(s_sPickListSize) >>= nSize; aHistoryOpt.SetSize(ePICKLIST, (nSize+1)); @@ -601,7 +602,7 @@ void HistoryOptTest::impl_checkSetSize(const ::rtl::OUString& sList) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetSize(ePICKLIST) error!")), 0); } - else if (sList.equalsAscii("URLHistory")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLHistory"))) { xSet->getPropertyValue(s_sURLHistorySize) >>= nSize; aHistoryOpt.SetSize(eHISTORY, (nSize+1)); @@ -612,7 +613,7 @@ void HistoryOptTest::impl_checkSetSize(const ::rtl::OUString& sList) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetSize(eHISTORY) error!")), 0); } - else if (sList.equalsAscii("HelpBookmarks")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpBookmarks"))) { xSet->getPropertyValue(s_sHelpBookmarksSize) >>= nSize; aHistoryOpt.SetSize(eHELPBOOKMARKS, (nSize+1)); @@ -628,7 +629,7 @@ void HistoryOptTest::impl_checkSetSize(const ::rtl::OUString& sList) // test SvtHistoryOptions::Clear() void HistoryOptTest::impl_checkClear(const ::rtl::OUString& sList) { - if (sList.equalsAscii("PickList")) + if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PickList"))) { aHistoryOpt.Clear(ePICKLIST); if ( !impl_isListEmpty(s_sPickList) ) @@ -636,7 +637,7 @@ void HistoryOptTest::impl_checkClear(const ::rtl::OUString& sList) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Clear(ePICKLIST) error!")), 0); } - else if (sList.equalsAscii("URLHistory")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLHistory"))) { aHistoryOpt.Clear(eHISTORY); if ( !impl_isListEmpty(s_sURLHistory) ) @@ -644,7 +645,7 @@ void HistoryOptTest::impl_checkClear(const ::rtl::OUString& sList) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Clear(eHISTORY) error!")), 0); } - else if (sList.equalsAscii("HelpBookmarks")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpBookmarks"))) { aHistoryOpt.Clear(eHELPBOOKMARKS); if ( !impl_isListEmpty(s_sHelpBookmarks) ) @@ -657,14 +658,14 @@ void HistoryOptTest::impl_checkClear(const ::rtl::OUString& sList) // test SvtHistoryOptions::GetList() void HistoryOptTest::impl_checkGetList(const ::rtl::OUString& sList) { - if (sList.equalsAscii("PickList")) + if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PickList"))) { impl_clearList(s_sPickList); aHistoryOpt.AppendItem( ePICKLIST , - ::rtl::OUString::createFromAscii("file:///c/test1"), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii("") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///c/test1")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aHistoryList = aHistoryOpt.GetList( ePICKLIST ); if ( aHistoryList.getLength()==0 ) @@ -672,14 +673,14 @@ void HistoryOptTest::impl_checkGetList(const ::rtl::OUString& sList) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetList(ePICKLIST) error!")), 0); } - else if (sList.equalsAscii("URLHistory")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLHistory"))) { impl_clearList(s_sURLHistory); aHistoryOpt.AppendItem( eHISTORY , - ::rtl::OUString::createFromAscii("file:///c/test1"), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii("") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///c/test1")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aHistoryList = aHistoryOpt.GetList( eHISTORY ); if ( aHistoryList.getLength()==0 ) @@ -687,14 +688,14 @@ void HistoryOptTest::impl_checkGetList(const ::rtl::OUString& sList) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetList(eHISTORY) error!")), 0); } - else if (sList.equalsAscii("HelpBookmarks")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpBookmarks"))) { impl_clearList(s_sHelpBookmarks); aHistoryOpt.AppendItem( eHELPBOOKMARKS , - ::rtl::OUString::createFromAscii("file:///c/test1"), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii("") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///c/test1")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aHistoryList = aHistoryOpt.GetList( eHELPBOOKMARKS ); if ( aHistoryList.getLength()==0 ) @@ -705,7 +706,7 @@ void HistoryOptTest::impl_checkGetList(const ::rtl::OUString& sList) void HistoryOptTest::impl_checkAppendItem(const ::rtl::OUString& sList) { - if (sList.equalsAscii("PickList")) + if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PickList"))) { impl_clearList(s_sPickList); sal_Int32 nListSize = aHistoryOpt.GetSize(ePICKLIST); @@ -713,18 +714,18 @@ void HistoryOptTest::impl_checkAppendItem(const ::rtl::OUString& sList) for (sal_Int32 i=0; i<nListSize; ++i) aHistoryOpt.AppendItem( ePICKLIST , ::rtl::OUString::valueOf(i), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii("") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); aHistoryOpt.AppendItem( ePICKLIST , ::rtl::OUString::valueOf(nListSize), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii("") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); } - else if (sList.equalsAscii("URLHistory")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLHistory"))) { impl_clearList(s_sURLHistory); sal_Int32 nListSize = aHistoryOpt.GetSize(eHISTORY); @@ -732,18 +733,18 @@ void HistoryOptTest::impl_checkAppendItem(const ::rtl::OUString& sList) for (sal_Int32 i=0; i<nListSize; ++i) aHistoryOpt.AppendItem( eHISTORY , ::rtl::OUString::valueOf(i), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii("") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); aHistoryOpt.AppendItem( eHISTORY , ::rtl::OUString::valueOf(nListSize), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii(""), - ::rtl::OUString::createFromAscii("") ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); } - else if (sList.equalsAscii("HelpBookmarks")) + else if (sList.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HelpBookmarks"))) { //impl_clearList(s_sHelpBookmarks); //sal_Int32 nListSize = aHistoryOpt.GetSize(eHELPBOOKMARKS); @@ -751,15 +752,15 @@ void HistoryOptTest::impl_checkAppendItem(const ::rtl::OUString& sList) //for (sal_Int32 i=0; i<nListSize; ++i) // aHistoryOpt.AppendItem( eHELPBOOKMARKS , // ::rtl::OUString::valueOf(i), - // ::rtl::OUString::createFromAscii(""), - // ::rtl::OUString::createFromAscii(""), - // ::rtl::OUString::createFromAscii("") ); + // ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + // ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + // ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); //aHistoryOpt.AppendItem( eHELPBOOKMARKS , // ::rtl::OUString::valueOf(nListSize), - // ::rtl::OUString::createFromAscii(""), - // ::rtl::OUString::createFromAscii(""), - // ::rtl::OUString::createFromAscii("") ); + // ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + // ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + // ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); } } @@ -796,3 +797,5 @@ void HistoryOptTest::impl_checkHelpBookmarks() impl_checkAppendItem(s_sHelpBookmarks); } */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/complex/ConfigItems/helper/HistoryOptTest.hxx b/svl/qa/complex/ConfigItems/helper/HistoryOptTest.hxx index 05ea7edb01cc..c73a71e3d81e 100644 --- a/svl/qa/complex/ConfigItems/helper/HistoryOptTest.hxx +++ b/svl/qa/complex/ConfigItems/helper/HistoryOptTest.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. @@ -201,3 +202,5 @@ class HistoryOptTest }; #endif // #ifndef SVTOOLS_HISTORYOPTTEST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/complex/ConfigItems/helper/PrintOptTest.cxx b/svl/qa/complex/ConfigItems/helper/PrintOptTest.cxx index 0731aa2a4253..b02c7deba53b 100644 --- a/svl/qa/complex/ConfigItems/helper/PrintOptTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/PrintOptTest.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. @@ -35,24 +36,24 @@ namespace css = ::com::sun::star; // using test only -#define ROOTNODE_PRINTOPTION rtl::OUString::createFromAscii("org.openoffice.Office.Common/Print/Option") -#define PROPERTYNAME_REDUCETRANSPARENCY rtl::OUString::createFromAscii("ReduceTransparency") -#define PROPERTYNAME_REDUCEDTRANSPARENCYMODE rtl::OUString::createFromAscii("ReducedTransparencyMode") -#define PROPERTYNAME_REDUCEGRADIENTS rtl::OUString::createFromAscii("ReduceGradients") -#define PROPERTYNAME_REDUCEDGRADIENTMODE rtl::OUString::createFromAscii("ReducedGradientMode") -#define PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT rtl::OUString::createFromAscii("ReducedGradientStepCount") -#define PROPERTYNAME_REDUCEBITMAPS rtl::OUString::createFromAscii("ReduceBitmaps") -#define PROPERTYNAME_REDUCEDBITMAPMODE rtl::OUString::createFromAscii("ReducedBitmapMode") -#define PROPERTYNAME_REDUCEDBITMAPRESOLUTION rtl::OUString::createFromAscii("ReducedBitmapResolution") -#define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY rtl::OUString::createFromAscii("ReducedBitmapIncludesTransparency") -#define PROPERTYNAME_CONVERTTOGREYSCALES rtl::OUString::createFromAscii("ConvertToGreyscales") +#define ROOTNODE_PRINTOPTION rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Print/Option")) +#define PROPERTYNAME_REDUCETRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceTransparency")) +#define PROPERTYNAME_REDUCEDTRANSPARENCYMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedTransparencyMode")) +#define PROPERTYNAME_REDUCEGRADIENTS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceGradients")) +#define PROPERTYNAME_REDUCEDGRADIENTMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientMode")) +#define PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientStepCount")) +#define PROPERTYNAME_REDUCEBITMAPS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceBitmaps")) +#define PROPERTYNAME_REDUCEDBITMAPMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapMode")) +#define PROPERTYNAME_REDUCEDBITMAPRESOLUTION rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapResolution")) +#define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapIncludesTransparency")) +#define PROPERTYNAME_CONVERTTOGREYSCALES rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ConvertToGreyscales")) PrintOptTest::PrintOptTest() { m_xCfg = css::uno::Reference< css::container::XNameAccess >( ::comphelper::ConfigurationHelper::openConfig( ::utl::getProcessServiceFactory(), - rtl::OUString::createFromAscii("org.openoffice.Office.Common/Print/Option"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Print/Option")), ::comphelper::ConfigurationHelper::E_STANDARD), css::uno::UNO_QUERY); @@ -61,7 +62,7 @@ PrintOptTest::PrintOptTest() //UniString sTmp = UniString("printer"); //xub_StrLen nTokenCount = sTmp.GetTokenCount('/'); //sTmp = sTmp.GetToken(nTokenCount - 1, '/'); - m_xCfg->getByName(rtl::OUString::createFromAscii("Printer")) >>= m_xNode; + m_xCfg->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Printer"))) >>= m_xNode; } } @@ -396,9 +397,9 @@ void PrintOptTest::impl_checkPrint() if ( bNewValue == bOldValue ) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReduceTransparency() error!"), + "the SetReduceTransparency() error!")), 0); } @@ -412,9 +413,9 @@ void PrintOptTest::impl_checkPrint() if(bNewValue == bOldValue) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the IsReduceTransparency() error!"), + "the IsReduceTransparency() error!")), 0); } @@ -429,9 +430,9 @@ void PrintOptTest::impl_checkPrint() if ( nNewMode == nOldMode ) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReducedTransparencyMode() error!"), + "the SetReducedTransparencyMode() error!")), 0); } @@ -445,10 +446,10 @@ void PrintOptTest::impl_checkPrint() if(nNewMode == nOldMode) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." "the IsReducedTransparencyMode() error!" - "nOldMode's value is :"), + "nOldMode's value is :")), 0); } @@ -462,9 +463,9 @@ void PrintOptTest::impl_checkPrint() if (bNewValue == bOldValue) //test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReduceGradients() error!"), + "the SetReduceGradients() error!")), 0); } @@ -479,9 +480,9 @@ void PrintOptTest::impl_checkPrint() if (bNewValue == bOldValue) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the IsReduceGradients() error!"), + "the IsReduceGradients() error!")), 0); } @@ -496,9 +497,9 @@ void PrintOptTest::impl_checkPrint() if (nNewMode == nOldMode)// test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetRedecedGradientMode() error!"), + "the SetRedecedGradientMode() error!")), 0); } @@ -512,9 +513,9 @@ void PrintOptTest::impl_checkPrint() if (nNewMode == nOldMode) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the GetReducedGradientMode() error!"), + "the GetReducedGradientMode() error!")), 0); } @@ -531,9 +532,9 @@ void PrintOptTest::impl_checkPrint() if (nNewStepCount == nOldStepCount) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReducedGradientStepCount() error!"), + "the SetReducedGradientStepCount() error!")), 0); } @@ -548,9 +549,9 @@ void PrintOptTest::impl_checkPrint() if (nNewStepCount == nOldStepCount) //test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the GetReduceGradientStepCount() error!"), + "the GetReduceGradientStepCount() error!")), 0); } @@ -564,9 +565,9 @@ void PrintOptTest::impl_checkPrint() if (bNewValue == bOldValue) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReduceBitmaps() error!"), + "the SetReduceBitmaps() error!")), 0); } @@ -580,9 +581,9 @@ void PrintOptTest::impl_checkPrint() if (bNewValue == bOldValue) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the IsReduceBitmaps() error!"), + "the IsReduceBitmaps() error!")), 0); } @@ -596,9 +597,9 @@ void PrintOptTest::impl_checkPrint() if (nNewMode == nOldMode)// test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReduceBitmap() error!"), + "the SetReduceBitmap() error!")), 0); } @@ -612,9 +613,9 @@ void PrintOptTest::impl_checkPrint() if (nNewMode == nOldMode) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReduceBitmapMode() error!"), + "the SetReduceBitmapMode() error!")), 0); } @@ -628,9 +629,9 @@ void PrintOptTest::impl_checkPrint() if (nNewMode == nOldMode)// test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the GetReduceBitmapMode() error!"), + "the GetReduceBitmapMode() error!")), 0); } @@ -647,9 +648,9 @@ void PrintOptTest::impl_checkPrint() if (nNewResolution == nOldResolution)// test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReducedBitmapResolution() error!"), + "the SetReducedBitmapResolution() error!")), 0); } @@ -663,9 +664,9 @@ void PrintOptTest::impl_checkPrint() if (nNewResolution == nOldResolution) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the GetReduceBitmapResolution() error!"), + "the GetReduceBitmapResolution() error!")), 0); } @@ -679,9 +680,9 @@ void PrintOptTest::impl_checkPrint() if (bNewValue == bOldValue) // test the old source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetReducedBitmapIncludesTransparency() error!"), + "the SetReducedBitmapIncludesTransparency() error!")), 0); } @@ -695,9 +696,9 @@ void PrintOptTest::impl_checkPrint() if (bNewValue == bOldValue) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the IsReducedBitmapIncludesTransparency() error!"), + "the IsReducedBitmapIncludesTransparency() error!")), 0); } @@ -711,9 +712,9 @@ void PrintOptTest::impl_checkPrint() if (bNewValue == bOldValue) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the SetConvertToGreyscales() error!"), + "the SetConvertToGreyscales() error!")), 0); } @@ -727,9 +728,11 @@ void PrintOptTest::impl_checkPrint() if (bNewValue == bOldValue) // test the new source { throw css::uno::RuntimeException( - rtl::OUString::createFromAscii( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "null com.sun.star.configuration." - "the IsConvertToGreyscales() error!"), + "the IsConvertToGreyscales() error!")), 0); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/complex/ConfigItems/helper/PrintOptTest.hxx b/svl/qa/complex/ConfigItems/helper/PrintOptTest.hxx index 7d366dc38090..2d43d7057154 100644 --- a/svl/qa/complex/ConfigItems/helper/PrintOptTest.hxx +++ b/svl/qa/complex/ConfigItems/helper/PrintOptTest.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. @@ -82,3 +83,5 @@ private: // methods }; #endif // #ifndef SVTOOLS_PRINTOPTTEST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/complex/ConfigItems/helper/UserOptTest.cxx b/svl/qa/complex/ConfigItems/helper/UserOptTest.cxx index b14d20a76694..c1e03e915ed2 100644 --- a/svl/qa/complex/ConfigItems/helper/UserOptTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/UserOptTest.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. @@ -30,24 +31,24 @@ namespace css = ::com::sun::star; //============================================================================= -static const ::rtl::OUString MESSAGE_SETCOMPANY_FAILED = ::rtl::OUString::createFromAscii("set company failed") ; -static const ::rtl::OUString MESSAGE_SETFIRSTNAME_FAILED = ::rtl::OUString::createFromAscii("set firstname failed") ; -static const ::rtl::OUString MESSAGE_SETLASTNAME_FAILED = ::rtl::OUString::createFromAscii("set lastname failed") ; -static const ::rtl::OUString MESSAGE_SETID_FAILED = ::rtl::OUString::createFromAscii("set ID failed") ; -static const ::rtl::OUString MESSAGE_SETSTREET_FAILED = ::rtl::OUString::createFromAscii("set street failed") ; -static const ::rtl::OUString MESSAGE_SETCITY_FAILED = ::rtl::OUString::createFromAscii("set city failed") ; -static const ::rtl::OUString MESSAGE_SETSTATE_FAILED = ::rtl::OUString::createFromAscii("set state failed") ; -static const ::rtl::OUString MESSAGE_SETZIP_FAILED = ::rtl::OUString::createFromAscii("set zip failed") ; -static const ::rtl::OUString MESSAGE_SETCOUNTRY_FAILED = ::rtl::OUString::createFromAscii("set country failed") ; -static const ::rtl::OUString MESSAGE_SETPOSITION_FAILED = ::rtl::OUString::createFromAscii("set position failed") ; -static const ::rtl::OUString MESSAGE_SETTITLE_FAILED = ::rtl::OUString::createFromAscii("set title failed") ; -static const ::rtl::OUString MESSAGE_SETTELEPHONEHOME_FAILED = ::rtl::OUString::createFromAscii("set telephonehome failed") ; -static const ::rtl::OUString MESSAGE_SETTELEPHONEWORK_FAILED = ::rtl::OUString::createFromAscii("set telephonework failed") ; -static const ::rtl::OUString MESSAGE_SETFAX_FAILED = ::rtl::OUString::createFromAscii("set fax failed") ; -static const ::rtl::OUString MESSAGE_SETEMAIL_FAILED = ::rtl::OUString::createFromAscii("set email failed") ; -static const ::rtl::OUString MESSAGE_SETCUSTOMERNUMBER_FAILED = ::rtl::OUString::createFromAscii("set customernumber failed"); -static const ::rtl::OUString MESSAGE_SETFATHERSNAME_FAILED = ::rtl::OUString::createFromAscii("set fathersname failed") ; -static const ::rtl::OUString MESSAGE_SETAPARTMENT_FAILED = ::rtl::OUString::createFromAscii("set apartment failed") ; +static const ::rtl::OUString MESSAGE_SETCOMPANY_FAILED (RTL_CONSTASCII_USTRINGPARAM("set company failed")) ; +static const ::rtl::OUString MESSAGE_SETFIRSTNAME_FAILED (RTL_CONSTASCII_USTRINGPARAM("set firstname failed")) ; +static const ::rtl::OUString MESSAGE_SETLASTNAME_FAILED (RTL_CONSTASCII_USTRINGPARAM("set lastname failed")) ; +static const ::rtl::OUString MESSAGE_SETID_FAILED (RTL_CONSTASCII_USTRINGPARAM("set ID failed")) ; +static const ::rtl::OUString MESSAGE_SETSTREET_FAILED (RTL_CONSTASCII_USTRINGPARAM("set street failed")) ; +static const ::rtl::OUString MESSAGE_SETCITY_FAILED (RTL_CONSTASCII_USTRINGPARAM("set city failed")) ; +static const ::rtl::OUString MESSAGE_SETSTATE_FAILED (RTL_CONSTASCII_USTRINGPARAM("set state failed")) ; +static const ::rtl::OUString MESSAGE_SETZIP_FAILED (RTL_CONSTASCII_USTRINGPARAM("set zip failed")) ; +static const ::rtl::OUString MESSAGE_SETCOUNTRY_FAILED (RTL_CONSTASCII_USTRINGPARAM("set country failed")) ; +static const ::rtl::OUString MESSAGE_SETPOSITION_FAILED (RTL_CONSTASCII_USTRINGPARAM("set position failed")) ; +static const ::rtl::OUString MESSAGE_SETTITLE_FAILED (RTL_CONSTASCII_USTRINGPARAM("set title failed")) ; +static const ::rtl::OUString MESSAGE_SETTELEPHONEHOME_FAILED (RTL_CONSTASCII_USTRINGPARAM("set telephonehome failed")) ; +static const ::rtl::OUString MESSAGE_SETTELEPHONEWORK_FAILED (RTL_CONSTASCII_USTRINGPARAM("set telephonework failed")) ; +static const ::rtl::OUString MESSAGE_SETFAX_FAILED (RTL_CONSTASCII_USTRINGPARAM("set fax failed")) ; +static const ::rtl::OUString MESSAGE_SETEMAIL_FAILED (RTL_CONSTASCII_USTRINGPARAM("set email failed")) ; +static const ::rtl::OUString MESSAGE_SETCUSTOMERNUMBER_FAILED (RTL_CONSTASCII_USTRINGPARAM("set customernumber failed")); +static const ::rtl::OUString MESSAGE_SETFATHERSNAME_FAILED (RTL_CONSTASCII_USTRINGPARAM("set fathersname failed")) ; +static const ::rtl::OUString MESSAGE_SETAPARTMENT_FAILED (RTL_CONSTASCII_USTRINGPARAM("set apartment failed")) ; //============================================================================= @@ -83,24 +84,24 @@ void UserOptTest::impl_checkUserData() impl_checkSetFathersName( ::rtl::OUString() ); impl_checkSetApartment( ::rtl::OUString() ); - impl_checkSetCompany( ::rtl::OUString::createFromAscii("RedFlag2000") ); - impl_checkSetFirstName( ::rtl::OUString::createFromAscii("Yan") ); - impl_checkSetLastName( ::rtl::OUString::createFromAscii("Wu") ); - impl_checkSetID( ::rtl::OUString::createFromAscii("wuy") ); - impl_checkSetStreet( ::rtl::OUString::createFromAscii("SouthFifthRing") ); - impl_checkSetCity( ::rtl::OUString::createFromAscii("Beijing") ); - impl_checkSetState( ::rtl::OUString::createFromAscii("Beijing") ); - impl_checkSetZip( ::rtl::OUString::createFromAscii("100176") ); - impl_checkSetCountry( ::rtl::OUString::createFromAscii("China") ); - impl_checkSetPosition( ::rtl::OUString::createFromAscii("Engineer") ); - impl_checkSetTitle( ::rtl::OUString::createFromAscii("Software Engineer") ); - impl_checkSetTelephoneHome( ::rtl::OUString::createFromAscii("010-51570010") ); - impl_checkSetTelephoneWork( ::rtl::OUString::createFromAscii("010-51570010") ); - impl_checkSetFax( ::rtl::OUString::createFromAscii("010-51570010") ); - impl_checkSetEmail( ::rtl::OUString::createFromAscii("wuy@redflag2000.cn") ); - //impl_checkSetCustomerNumber( ::rtl::OUString::createFromAscii("87654321") ); - impl_checkSetFathersName( ::rtl::OUString::createFromAscii("father") ); - impl_checkSetApartment( ::rtl::OUString::createFromAscii("apartment") ); + impl_checkSetCompany( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RedFlag2000")) ); + impl_checkSetFirstName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Yan")) ); + impl_checkSetLastName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wu")) ); + impl_checkSetID( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("wuy")) ); + impl_checkSetStreet( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SouthFifthRing")) ); + impl_checkSetCity( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Beijing")) ); + impl_checkSetState( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Beijing")) ); + impl_checkSetZip( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("100176")) ); + impl_checkSetCountry( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("China")) ); + impl_checkSetPosition( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Engineer")) ); + impl_checkSetTitle( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Software Engineer")) ); + impl_checkSetTelephoneHome( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("010-51570010")) ); + impl_checkSetTelephoneWork( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("010-51570010")) ); + impl_checkSetFax( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("010-51570010")) ); + impl_checkSetEmail( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("wuy@redflag2000.cn")) ); + //impl_checkSetCustomerNumber( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("87654321")) ); + impl_checkSetFathersName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("father")) ); + impl_checkSetApartment( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("apartment")) ); } void UserOptTest::impl_checkSetCompany( const ::rtl::OUString& sUserData ) @@ -264,3 +265,5 @@ void UserOptTest::impl_checkSetApartment( const ::rtl::OUString& sUserData ) if ( sCheck != sUserData ) throw css::uno::Exception(MESSAGE_SETAPARTMENT_FAILED, 0); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/complex/ConfigItems/helper/UserOptTest.hxx b/svl/qa/complex/ConfigItems/helper/UserOptTest.hxx index 8fc63a58a9cc..11e7de6794c1 100644 --- a/svl/qa/complex/ConfigItems/helper/UserOptTest.hxx +++ b/svl/qa/complex/ConfigItems/helper/UserOptTest.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. @@ -68,3 +69,5 @@ private: }; #endif // #ifndef SVTOOLS_USEROPTTEST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/export.map b/svl/qa/export.map index 7321bbca16ad..3308588ef6f8 100644 --- a/svl/qa/export.map +++ b/svl/qa/export.map @@ -27,7 +27,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; diff --git a/svl/qa/test_URIHelper.cxx b/svl/qa/test_URIHelper.cxx index cdf6b1780884..c206def13830 100644 --- a/svl/qa/test_URIHelper.cxx +++ b/svl/qa/test_URIHelper.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. @@ -30,6 +31,12 @@ #include "sal/config.h" +#include <cppunit/TestSuite.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestCase.h> +#include <cppunit/plugin/TestPlugIn.h> +#include <cppunit/extensions/HelperMacros.h> + #include <cstddef> #include "com/sun/star/lang/Locale.hpp" @@ -54,7 +61,6 @@ #include "cppuhelper/bootstrap.hxx" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/implbase2.hxx" -#include "testshl/simpleheader.hxx" #include "osl/diagnose.h" #include "rtl/strbuf.hxx" #include "rtl/string.h" @@ -63,6 +69,7 @@ #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include <sal/macros.h> #include "tools/solar.h" #include "unotools/charclass.hxx" @@ -284,7 +291,7 @@ void Test::testNormalizedMakeRelative() { "nonex3/nonex4" } #endif }; - for (std::size_t i = 0; i < sizeof tests / sizeof tests[0]; ++i) { + for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) { css::uno::Reference< css::uri::XUriReference > ref( URIHelper::normalizedMakeRelative( m_context, rtl::OUString::createFromAscii(tests[i].base), @@ -335,7 +342,13 @@ void Test::testFindFirstURLInText() { "ftp://bla.bla.bla/blubber/", 3, 29 }, { "..\\ftp://bla.bla.bla/blubber/...", 0, 0, 0 }, { "..\\ftp:\\\\bla.bla.bla\\blubber/...", +//Sync with tools/source/fsys/urlobj.cxx and changeScheme +#ifdef LINUX + "smb://bla.bla.bla/blubber%2F", 7, 29 }, +#endif +#ifdef WNT "file://bla.bla.bla/blubber%2F", 7, 29 }, +#endif { "http://sun.com", "http://sun.com/", 0, 14 }, { "http://sun.com/", "http://sun.com/", 0, 15 }, { "http://www.xerox.com@www.pcworld.com/go/3990332.htm", 0, 0, 0 }, @@ -414,7 +427,7 @@ void Test::testFindFirstURLInText() { com::sun::star::lang::Locale( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")), rtl::OUString())); - for (std::size_t i = 0; i < sizeof tests / sizeof tests[0]; ++i) { + for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) { rtl::OUString input(rtl::OUString::createFromAscii(tests[i].input)); xub_StrLen begin = 0; xub_StrLen end = static_cast< xub_StrLen >(input.getLength()); @@ -452,8 +465,10 @@ void Test::testFindFirstURLInText() { css::uno::Reference< css::uno::XComponentContext > Test::m_context; -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); +CPPUNIT_TEST_SUITE_REGISTRATION(Test); } -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/unit/makefile.mk b/svl/qa/unit/makefile.mk new file mode 100644 index 000000000000..ab59123b7efc --- /dev/null +++ b/svl/qa/unit/makefile.mk @@ -0,0 +1,96 @@ +# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +# +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Novell, Inc. +# Portions created by the Initial Developer are Copyright (C) 2010 the +# Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +# + +PRJ=..$/.. +PRJNAME=svl +TARGET=qa_unit + +ENABLE_EXCEPTIONS=TRUE + +.INCLUDE : settings.mk + +CFLAGSCXX += $(CPPUNIT_CFLAGS) -I../../inc + +SHL1TARGET = $(TARGET) +SHL1OBJS = $(SLO)$/svl.obj +SHL1STDLIBS= \ + $(UNOTOOLSLIB) \ + $(SVLLIB) \ + $(TOOLSLIB) \ + $(I18NISOLANGLIB) \ + $(UCBHELPERLIB) \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SOTLIB) \ + $(SALLIB) \ + $(CPPUNITLIB) + +SHL1IMPLIB = i$(SHL1TARGET) +DEF1NAME = $(SHL1TARGET) +SHL1VERSIONMAP=version.map + +.INCLUDE: target.mk + +.IF "$(OS)" == "WNT" +my_file = file:/// +.ELSE +my_file = file:// +.END + +ALLTAR: test + +$(MISC)$/$(TARGET)$/types.rdb .ERRREMOVE : $(SOLARBINDIR)$/types.rdb + $(MKDIRHIER) $(@:d) + $(GNUCOPY) $? $@ + +$(MISC)/$(TARGET)/udkapi.rdb .ERRREMOVE : $(SOLARBINDIR)$/udkapi.rdb + $(MKDIRHIER) $(@:d) + $(GNUCOPY) $? $@ + +#Make a services.rdb with the services we know we need to get up and running +$(MISC)/$(TARGET)/services.rdb .ERRREMOVE : $(MISC)/$(TARGET)/udkapi.rdb makefile.mk + $(MKDIRHIER) $(@:d) + $(REGCOMP) -register -br $(MISC)/$(TARGET)/udkapi.rdb -r $@ -wop \ + -c i18npool.uno$(DLLPOST) + +#Tweak things so that we use the .res files in the solver +STAR_RESOURCEPATH:=$(PWD)/$(BIN)$(PATH_SEPERATOR)$(SOLARBINDIR) +.EXPORT : STAR_RESOURCEPATH + +test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/services.rdb $(MISC)$/$(TARGET)$/types.rdb $(MISC)/$(TARGET)/udkapi.rdb + @echo ---------------------------------------------------------- + @echo - start unit test \#1 on library $(SHL1TARGETN) + @echo In the environment: STAR_RESOURCEPATH=$$STAR_RESOURCEPATH + @echo ---------------------------------------------------------- + $(CPPUNITTESTER) $(SHL1TARGETN) \ + -env:UNO_SERVICES=$(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb \ + -env:UNO_TYPES="$(my_file)$(PWD)/$(MISC)/$(TARGET)/types.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/udkapi.rdb" \ + -env:OOO_BASE_DIR="$(my_file)$(PWD)/$(MISC)/$(TARGET)" \ + -env:BRAND_BASE_DIR="$(my_file)$(PWD)/$(MISC)/$(TARGET)" \ + -env:UNO_USER_PACKAGES_CACHE="$(my_file)$(PWD)/$(MISC)/$(TARGET)" diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx new file mode 100644 index 000000000000..201a20ee1e57 --- /dev/null +++ b/svl/qa/unit/svl.cxx @@ -0,0 +1,298 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell, Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "precompiled_svl.hxx" + +#ifdef WNT +# undef ERROR +#endif + +#include <cppunit/TestAssert.h> +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> + +#include <sal/config.h> +#include <osl/file.hxx> +#include <osl/process.h> +#include <rtl/ustrbuf.hxx> + +#include <cppuhelper/bootstrap.hxx> +#include <comphelper/processfactory.hxx> + +#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> +#include <com/sun/star/sheet/GeneralFunction.hpp> +#include <com/sun/star/lang/XComponent.hpp> + +#include <i18npool/lang.h> + +#include "svl/zforlist.hxx" +#include "svl/zformat.hxx" + +#define DEBUG_UNIT_TEST 0 + +#if DEBUG_UNIT_TEST +#include <iostream> +#endif + +using namespace ::com::sun::star; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + +#if DEBUG_UNIT_TEST +using ::std::cout; +using ::std::endl; +#endif + +namespace { + +#if DEBUG_UNIT_TEST +::std::ostream& operator<< (::std::ostream& os, const OUString& str) +{ + return os << ::rtl::OUStringToOString(str, RTL_TEXTENCODING_UTF8).getStr(); +} +#endif + +class Test : public CppUnit::TestFixture { +public: + Test(); + ~Test(); + + virtual void setUp(); + virtual void tearDown(); + + void testNumberFormat(); + + CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(testNumberFormat); + CPPUNIT_TEST_SUITE_END(); + +private: + uno::Reference< uno::XComponentContext > m_xContext; +}; + +Test::Test() +{ + m_xContext = cppu::defaultBootstrap_InitialComponentContext(); + + uno::Reference<lang::XMultiComponentFactory> xFactory(m_xContext->getServiceManager()); + uno::Reference<lang::XMultiServiceFactory> xSM(xFactory, uno::UNO_QUERY_THROW); + + //Without this we're crashing because callees are using + //getProcessServiceFactory. In general those should be removed in favour + //of retaining references to the root ServiceFactory as its passed around + comphelper::setProcessServiceFactory(xSM); +} + +void Test::setUp() +{ +} + +void Test::tearDown() +{ +} + +Test::~Test() +{ + uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose(); +} + +void Test::testNumberFormat() +{ + LanguageType eLang = LANGUAGE_ENGLISH_US; + + const char* pNumber[] = { + "General", + "0", + "0.00", + "#,##0", + "#,##0.00", + "#,###.00", + 0 + }; + + const char* pScientific[] = { + "0.00E+000", + "0.00E+00", + 0 + }; + + const char* pPercent[] = { + "0%", + "0.00%", + 0 + }; + + const char* pFraction[] = { + "# \?/\?", + "# \?\?/\?\?", + "# \?/4", + "# \?\?/100", + 0 + }; + +#if 0 // TODO: Find out why on some systems the last two currency format codes differ. + const char* pCurrency[] = { + "$#,##0;[RED]-$#,##0", + "$#,##0.00;[RED]-$#,##0.00", + "#,##0.00 CCC", + "$#,##0.--;[RED]-$#,##0.--", + "$#,##0;-$#,##0", + "$#,##0;-$#,##0", + 0 + }; +#endif + + const char* pDate[] = { + "MM/DD/YY", + "MM/DD/YYYY", + "MMM D, YY", + "MMM D, YYYY", + "D. MMM. YYYY", + "MMMM D, YYYY", + "D. MMMM YYYY", + "NN, MMM D, YY", + "NN DD/MMM YY", + "NN, MMMM D, YYYY", + "NNNNMMMM D, YYYY", + "MM-DD", + "YY-MM-DD", + "YYYY-MM-DD", + "MM/YY", + "MMM DD", + "MMMM", + "QQ YY", + "WW", + "MM/DD/YY", + "WW", + 0 + }; + + const char* pTime[] = { + "HH:MM AM/PM", + "HH:MM:SS AM/PM", + "[HH]:MM:SS", + "MM:SS.00", + "[HH]:MM:SS.00", + "HH:MM:SS AM/PM", + "HH:MM:SS AM/PM", + 0 + }; + + const char* pDateTime[] = { + "MM/DD/YY HH:MM AM/PM", + "MM/DD/YY HH:MM AM/PM", + 0 + }; + + const char* pBoolean[] = { + "BOOLEAN", + 0 + }; + + const char* pText[] = { + "@", + 0 + }; + + struct { + NfIndexTableOffset eStart; + NfIndexTableOffset eEnd; + size_t nSize; + const char** pCodes; + } aTests[] = { + { NF_NUMBER_START, NF_NUMBER_END, 6, pNumber }, + { NF_SCIENTIFIC_START, NF_SCIENTIFIC_END, 2, pScientific }, + { NF_PERCENT_START, NF_PERCENT_END, 2, pPercent }, + { NF_FRACTION_START, NF_FRACTION_END, 4, pFraction }, +#if 0 // TODO: Find out why on some systems the last two currency format codes differ. + { NF_CURRENCY_START, NF_CURRENCY_END, 6, pCurrency }, +#endif + { NF_DATE_START, NF_DATE_END, 21, pDate }, + { NF_TIME_START, NF_TIME_END, 7, pTime }, + { NF_DATETIME_START, NF_DATETIME_END, 2, pDateTime }, + { NF_BOOLEAN, NF_BOOLEAN, 1, pBoolean }, + { NF_TEXT, NF_TEXT, 1, pText } + }; + + SvNumberFormatter aFormatter(eLang); + + for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i) + { + size_t nStart = aTests[i].eStart; + size_t nEnd = aTests[i].eEnd; + + CPPUNIT_ASSERT_MESSAGE("Unexpected number of formats for this category.", + (nEnd - nStart + 1) == aTests[i].nSize); + + for (size_t j = nStart; j <= nEnd; ++j) + { + sal_uInt32 nIndex = + aFormatter.GetFormatIndex(static_cast<NfIndexTableOffset>(j)); + const SvNumberformat* p = aFormatter.GetEntry(nIndex); + + CPPUNIT_ASSERT_MESSAGE("Number format entry is expected, but doesn't exist.", p); + OUString aCode = p->GetFormatstring(); + bool bEqual = aCode.equalsAscii(aTests[i].pCodes[j-nStart]); + CPPUNIT_ASSERT_MESSAGE("Unexpected number format code.", bEqual); + } + } + + xub_StrLen nPos; + short nType = NUMBERFORMAT_DEFINED; + sal_uInt32 nKey; + OUString aCode; + // Thai date format (implicit locale). + aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-1070000]d/mm/yyyy;@")); + if (!aFormatter.PutEntry(aCode, nPos, nType, nKey)) + { + CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[$-1070000]d/mm/yyyy;@'", false); + } + + // Thai date format (explicit locale) + aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-107041E]d/mm/yyyy;@")); + if (!aFormatter.PutEntry(aCode, nPos, nType, nKey)) + { + CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[$-107041E]d/mm/yyyy;@'", false); + } + + // Thai date format (using buddhist calendar type). + aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[~buddhist]D MMMM YYYY")); + if (!aFormatter.PutEntry(aCode, nPos, nType, nKey)) + { + CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[~buddhist]D MMMM YYYY'", false); + } +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Test); + +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/qa/unit/version.map b/svl/qa/unit/version.map new file mode 100644 index 000000000000..3308588ef6f8 --- /dev/null +++ b/svl/qa/unit/version.map @@ -0,0 +1,34 @@ +#************************************************************************* +# +# 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. +# +#************************************************************************* + +UDK_3_0_0 { + global: + cppunitTestPlugIn; + + local: + *; +}; diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx index 02da1db70d63..2052a2f18d42 100644 --- a/svl/source/config/asiancfg.cxx +++ b/svl/source/config/asiancfg.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,16 +39,14 @@ //----------------------------------------------------------------------------- using namespace utl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::beans; using namespace com::sun::star::lang; -#define C2U(cChar) OUString::createFromAscii(cChar) -const sal_Char sStartEndCharacters[] = "StartEndCharacters"; -const sal_Char sStartCharacters[] = "StartCharacters"; -const sal_Char sEndCharacters[] = "EndCharacters"; +using ::rtl::OUString; + +#define C2U(cChar) OUString(RTL_CONSTASCII_USTRINGPARAM(cChar)) //----------------------------------------------------------------------------- struct SvxForbiddenStruct_Impl @@ -72,9 +71,7 @@ struct SvxAsianConfig_Impl bKerningWesternTextOnly(sal_True), nCharDistanceCompression(0) {} }; -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ Sequence<OUString> lcl_GetPropertyNames() { Sequence<OUString> aNames(2); @@ -92,16 +89,12 @@ SvxAsianConfig::SvxAsianConfig(sal_Bool bEnableNotify) : EnableNotification(lcl_GetPropertyNames()); Load(); } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ SvxAsianConfig::~SvxAsianConfig() { delete pImpl; } -/* -----------------------------17.01.01 09:57-------------------------------- - ---------------------------------------------------------------------------*/ void SvxAsianConfig::Load() { Sequence<Any> aValues = GetProperties(lcl_GetPropertyNames()); @@ -111,7 +104,7 @@ void SvxAsianConfig::Load() pValues[1] >>= pImpl->nCharDistanceCompression; pImpl->aForbiddenArr.DeleteAndDestroy(0, pImpl->aForbiddenArr.Count()); - OUString sPropPrefix(C2U(sStartEndCharacters)); + OUString sPropPrefix(C2U("StartEndCharacters")); Sequence<OUString> aNodes = GetNodeNames(sPropPrefix); Sequence<OUString> aPropNames(aNodes.getLength() * 2); @@ -143,16 +136,12 @@ void SvxAsianConfig::Load() pImpl->aForbiddenArr.Insert(pInsert, pImpl->aForbiddenArr.Count()); } } -/* -----------------------------17.01.01 09:57-------------------------------- - ---------------------------------------------------------------------------*/ void SvxAsianConfig::Notify( const Sequence<OUString>& ) { Load(); } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ void SvxAsianConfig::Commit() { Sequence<Any> aValues(2); @@ -162,7 +151,7 @@ void SvxAsianConfig::Commit() PutProperties(lcl_GetPropertyNames(), aValues); - OUString sNode(C2U(sStartEndCharacters)); + OUString sNode(C2U("StartEndCharacters")); if(!pImpl->aForbiddenArr.Count()) ClearNodeSet(sNode); else @@ -170,8 +159,8 @@ void SvxAsianConfig::Commit() Sequence<PropertyValue> aSetValues(2 * pImpl->aForbiddenArr.Count()); PropertyValue* pSetValues = aSetValues.getArray(); sal_Int32 nSetValue = 0; - const OUString sStartChars(C2U(sStartCharacters)); - const OUString sEndChars(C2U(sEndCharacters)); + const OUString sStartChars(C2U("StartCharacters")); + const OUString sEndChars(C2U("EndCharacters")); for(sal_uInt16 i = 0; i < pImpl->aForbiddenArr.Count(); i++) { OUString sPrefix(sNode); @@ -189,40 +178,30 @@ void SvxAsianConfig::Commit() ReplaceSetProperties(sNode, aSetValues); } } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SvxAsianConfig::IsKerningWesternTextOnly() const { return pImpl->bKerningWesternTextOnly; } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ void SvxAsianConfig::SetKerningWesternTextOnly(sal_Bool bSet) { pImpl->bKerningWesternTextOnly = bSet; SetModified(); } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int16 SvxAsianConfig::GetCharDistanceCompression() const { return pImpl->nCharDistanceCompression; } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ void SvxAsianConfig::SetCharDistanceCompression(sal_Int16 nSet) { DBG_ASSERT(nSet >= 0 && nSet < 3, "compression value illegal"); SetModified(); pImpl->nCharDistanceCompression = nSet; } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence<lang::Locale> SvxAsianConfig::GetStartEndCharLocales() { Sequence<Locale> aRet(pImpl->aForbiddenArr.Count()); @@ -233,9 +212,7 @@ uno::Sequence<lang::Locale> SvxAsianConfig::GetStartEndCharLocales() } return aRet; } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SvxAsianConfig::GetStartEndChars( const Locale& rLocale, OUString& rStartChars, OUString& rEndChars ) @@ -252,9 +229,7 @@ sal_Bool SvxAsianConfig::GetStartEndChars( const Locale& rLocale, } return sal_False; } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ void SvxAsianConfig::SetStartEndChars( const Locale& rLocale, const OUString* pStartChars, const OUString* pEndChars ) @@ -285,7 +260,9 @@ void SvxAsianConfig::SetStartEndChars( const Locale& rLocale, } #ifdef DBG_UTIL else if(!bFound) - DBG_ERROR("attempt to clear unavailable data"); + OSL_FAIL("attempt to clear unavailable data"); #endif SetModified(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx index cb332ac579f1..a3a19fe443c8 100644 --- a/svl/source/config/cjkoptions.cxx +++ b/svl/source/config/cjkoptions.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. @@ -44,11 +45,9 @@ using namespace ::com::sun::star::uno; using namespace ::rtl; -#define C2U(cChar) OUString::createFromAscii(cChar) +#define C2U(cChar) OUString(RTL_CONSTASCII_USTRINGPARAM(cChar)) #define CFG_READONLY_DEFAULT sal_False -/* -----------------------------10.04.01 12:39-------------------------------- - ---------------------------------------------------------------------------*/ class SvtCJKOptions_Impl : public utl::ConfigItem { sal_Bool bIsLoaded; @@ -98,9 +97,7 @@ public: void SetAll(sal_Bool bSet); sal_Bool IsReadOnly(SvtCJKOptions::EOption eOption) const; }; -/*-- 10.04.01 12:41:57--------------------------------------------------- - -----------------------------------------------------------------------*/ namespace { struct PropertyNames @@ -130,15 +127,11 @@ SvtCJKOptions_Impl::SvtCJKOptions_Impl() : bROVerticalCallOut(CFG_READONLY_DEFAULT) { } -/*-- 10.04.01 12:41:57--------------------------------------------------- - -----------------------------------------------------------------------*/ SvtCJKOptions_Impl::~SvtCJKOptions_Impl() { } -/* -----------------------------20.04.01 14:34-------------------------------- - ---------------------------------------------------------------------------*/ void SvtCJKOptions_Impl::SetAll(sal_Bool bSet) { if ( @@ -168,9 +161,7 @@ void SvtCJKOptions_Impl::SetAll(sal_Bool bSet) NotifyListeners(0); } } -/*-- 10.04.01 12:41:56--------------------------------------------------- - -----------------------------------------------------------------------*/ void SvtCJKOptions_Impl::Load() { Sequence<OUString> &rPropertyNames = PropertyNames::get(); @@ -232,17 +223,13 @@ void SvtCJKOptions_Impl::Load() } bIsLoaded = sal_True; } -/*-- 10.04.01 12:41:57--------------------------------------------------- - -----------------------------------------------------------------------*/ void SvtCJKOptions_Impl::Notify( const Sequence< OUString >& ) { Load(); NotifyListeners(0); } -/*-- 10.04.01 12:41:57--------------------------------------------------- - -----------------------------------------------------------------------*/ void SvtCJKOptions_Impl::Commit() { Sequence<OUString> &rPropertyNames = PropertyNames::get(); @@ -365,9 +352,7 @@ void SvtCJKOptions_Impl::Commit() aValues.realloc(nRealCount); PutProperties(aNames, aValues); } -/*-- 13.02.2003 12:12--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SvtCJKOptions_Impl::IsReadOnly(SvtCJKOptions::EOption eOption) const { sal_Bool bReadOnly = CFG_READONLY_DEFAULT; @@ -393,7 +378,7 @@ sal_Bool SvtCJKOptions_Impl::IsReadOnly(SvtCJKOptions::EOption eOption) const static SvtCJKOptions_Impl* pCJKOptions = NULL; static sal_Int32 nCJKRefCount = 0; -namespace { struct CJKMutex : public rtl::Static< ::osl::Mutex , CJKMutex >{}; } +namespace { struct theCJKOptionsMutex : public rtl::Static< ::osl::Mutex , theCJKOptionsMutex >{}; } // class SvtCJKOptions -------------------------------------------------- @@ -401,7 +386,7 @@ namespace { struct CJKMutex : public rtl::Static< ::osl::Mutex , CJKMutex >{}; } SvtCJKOptions::SvtCJKOptions(sal_Bool bDontLoad) { // Global access, must be guarded (multithreading) - ::osl::MutexGuard aGuard( CJKMutex::get() ); + ::osl::MutexGuard aGuard( theCJKOptionsMutex::get() ); if ( !pCJKOptions ) { pCJKOptions = new SvtCJKOptions_Impl; @@ -419,7 +404,7 @@ SvtCJKOptions::SvtCJKOptions(sal_Bool bDontLoad) SvtCJKOptions::~SvtCJKOptions() { // Global access, must be guarded (multithreading) - ::osl::MutexGuard aGuard( CJKMutex::get() ); + ::osl::MutexGuard aGuard( theCJKOptionsMutex::get() ); if ( !--nCJKRefCount ) DELETEZ( pCJKOptions ); } @@ -477,28 +462,23 @@ sal_Bool SvtCJKOptions::IsVerticalCallOutEnabled() const DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded"); return pCJKOptions->IsVerticalCallOutEnabled(); } -/*-- 20.04.01 14:32:04--------------------------------------------------- - -----------------------------------------------------------------------*/ void SvtCJKOptions::SetAll(sal_Bool bSet) { DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded"); pCJKOptions->SetAll(bSet); } -/*-- 20.04.01 14:32:06--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SvtCJKOptions::IsAnyEnabled() const { DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded"); return pCJKOptions->IsAnyEnabled(); } -/*-- 13.02.2003 12:11--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SvtCJKOptions::IsReadOnly(EOption eOption) const { DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded"); return pCJKOptions->IsReadOnly(eOption); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx index 983c202cb709..57f445d68e62 100644 --- a/svl/source/config/ctloptions.cxx +++ b/svl/source/config/ctloptions.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. @@ -37,7 +38,7 @@ #include <com/sun/star/uno/Any.h> #include <com/sun/star/uno/Sequence.hxx> #include <osl/mutex.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <svl/smplhint.hxx> #include <rtl/instance.hxx> #include <unotools/syslocale.hxx> @@ -118,7 +119,7 @@ sal_Bool SvtCTLOptions_Impl::IsReadOnly(SvtCTLOptions::EOption eOption) const case SvtCTLOptions::E_CTLTEXTNUMERALS : bReadOnly = m_bROCTLTextNumerals ; break; case SvtCTLOptions::E_CTLSEQUENCECHECKINGRESTRICTED: bReadOnly = m_bROCTLRestricted ; break; case SvtCTLOptions::E_CTLSEQUENCECHECKINGTYPEANDREPLACE: bReadOnly = m_bROCTLTypeAndReplace; break; - default: DBG_ERROR( "SvtCTLOptions_Impl::IsReadOnly() - invalid option" ); + default: OSL_FAIL( "SvtCTLOptions_Impl::IsReadOnly() - invalid option" ); } return bReadOnly; } @@ -490,3 +491,4 @@ sal_Bool SvtCTLOptions::IsReadOnly(EOption eOption) const } // ----------------------------------------------------------------------------- +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx index b0ec824f2b17..cf486f361402 100644 --- a/svl/source/config/itemholder2.cxx +++ b/svl/source/config/itemholder2.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. @@ -58,7 +59,7 @@ ItemHolder2::ItemHolder2() { css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::lang::XComponent > xCfg( - xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), + xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))), css::uno::UNO_QUERY); if (xCfg.is()) xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this)); @@ -79,7 +80,7 @@ ItemHolder2::ItemHolder2() sMsg += ::rtl::OString(rEx.Message.getStr(), rEx.Message.getLength(), RTL_TEXTENCODING_ASCII_US); - DBG_ERROR(sMsg.getStr()); + OSL_FAIL(sMsg.getStr()); } } #else @@ -177,3 +178,5 @@ void ItemHolder2::impl_deleteItem(TItemInfo& rItem) rItem.pItem = 0; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/config/itemholder2.hxx b/svl/source/config/itemholder2.hxx index 9314021b5750..884536d89bb0 100644 --- a/svl/source/config/itemholder2.hxx +++ b/svl/source/config/itemholder2.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. @@ -87,3 +88,5 @@ class ItemHolder2 : private ItemHolderMutexBase #undef css #endif // INCLUDED_SVTOOLS_ITEMHOLDER2_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx index 9d9a31b85b40..8ba0593b6c7f 100644 --- a/svl/source/config/languageoptions.cxx +++ b/svl/source/config/languageoptions.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. @@ -32,7 +33,7 @@ #include <svl/cjkoptions.hxx> #include <svl/ctloptions.hxx> #include <i18npool/mslangid.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <osl/mutex.hxx> #include <rtl/instance.hxx> #include <com/sun/star/i18n/ScriptType.hpp> @@ -146,30 +147,22 @@ sal_Bool SvtLanguageOptions::IsCTLSequenceChecking() const { return m_pCTLOptions->IsCTLSequenceChecking(); } -/*-- 26.09.2005 15:48:23--------------------------------------------------- - -----------------------------------------------------------------------*/ void SvtLanguageOptions::SetCTLSequenceCheckingRestricted( sal_Bool _bEnable ) { m_pCTLOptions->SetCTLSequenceCheckingRestricted( _bEnable ); } -/*-- 26.09.2005 15:48:23--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SvtLanguageOptions::IsCTLSequenceCheckingRestricted( void ) const { return m_pCTLOptions->IsCTLSequenceCheckingRestricted(); } -/*-- 26.09.2005 15:48:23--------------------------------------------------- - -----------------------------------------------------------------------*/ void SvtLanguageOptions::SetCTLSequenceCheckingTypeAndReplace( sal_Bool _bEnable ) { m_pCTLOptions->SetCTLSequenceCheckingTypeAndReplace( _bEnable ); } -/*-- 26.09.2005 15:48:24--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SvtLanguageOptions::IsCTLSequenceCheckingTypeAndReplace() const { return m_pCTLOptions->IsCTLSequenceCheckingTypeAndReplace(); @@ -200,7 +193,6 @@ sal_Bool SvtLanguageOptions::IsReadOnly(SvtLanguageOptions::EOption eOption) con } return bReadOnly; } -/* -----------------30.04.2003 11:03-----------------*/ // returns for a language the scripttype sal_uInt16 SvtLanguageOptions::GetScriptTypeOfLanguage( sal_uInt16 nLang ) @@ -227,10 +219,6 @@ sal_uInt16 SvtLanguageOptions::GetScriptTypeOfLanguage( sal_uInt16 nLang ) } // ----------------------------------------------------------------------------- - -/*-- 27.10.2005 08:18:01--------------------------------------------------- - - -----------------------------------------------------------------------*/ SvtSystemLanguageOptions::SvtSystemLanguageOptions() : utl::ConfigItem( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("System/L10N") )) { @@ -244,15 +232,11 @@ SvtSystemLanguageOptions::SvtSystemLanguageOptions() : aValues[0]>>= m_sWin16SystemLocale; } } -/*-- 27.10.2005 08:18:01--------------------------------------------------- - -----------------------------------------------------------------------*/ SvtSystemLanguageOptions::~SvtSystemLanguageOptions() { } -/*-- 27.10.2005 08:18:02--------------------------------------------------- - -----------------------------------------------------------------------*/ void SvtSystemLanguageOptions::Commit() { //does nothing @@ -263,9 +247,7 @@ void SvtSystemLanguageOptions::Notify( const com::sun::star::uno::Sequence< r // no listeners supported yet } -/*-- 27.10.2005 08:36:14--------------------------------------------------- - -----------------------------------------------------------------------*/ LanguageType SvtSystemLanguageOptions::GetWin16SystemLanguage() { if( m_sWin16SystemLocale.getLength() == 0 ) @@ -274,3 +256,4 @@ LanguageType SvtSystemLanguageOptions::GetWin16SystemLanguage() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/config/srchcfg.cxx b/svl/source/config/srchcfg.cxx index cf9fd1799650..e2450bdd0e84 100644 --- a/svl/source/config/srchcfg.cxx +++ b/svl/source/config/srchcfg.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,12 +39,13 @@ //----------------------------------------------------------------------------- using namespace utl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::beans; -#define C2U(cChar) OUString::createFromAscii(cChar) +using ::rtl::OUString; + +#define C2U(cChar) OUString(RTL_CONSTASCII_USTRINGPARAM(cChar)) //----------------------------------------------------------------------------- typedef SvxSearchEngineData* SvxSearchEngineDataPtr; @@ -54,9 +56,7 @@ struct SvxSearchConfig_Impl { SvxSearchEngineArr aEngineArr; }; -/* -----------------------------19.03.01 14:00-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SvxSearchEngineData::operator==(const SvxSearchEngineData& rData) { return sEngineName == rData.sEngineName && @@ -73,9 +73,7 @@ sal_Bool SvxSearchEngineData::operator==(const SvxSearchEngineData& rData) sExactSeparator == rData.sExactSeparator && nExactCaseMatch == rData.nExactCaseMatch; } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ const Sequence<OUString>& lcl_GetSearchPropertyNames_Impl() { static Sequence<OUString> aNames; @@ -111,16 +109,12 @@ SvxSearchConfig::SvxSearchConfig(sal_Bool bEnableNotify) : } Load(); } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ SvxSearchConfig::~SvxSearchConfig() { delete pImpl; } -/* -----------------------------17.01.01 09:57-------------------------------- - ---------------------------------------------------------------------------*/ void SvxSearchConfig::Load() { pImpl->aEngineArr.DeleteAndDestroy(0, pImpl->aEngineArr.Count()); @@ -167,16 +161,12 @@ void SvxSearchConfig::Load() pImpl->aEngineArr.Insert(pNew, pImpl->aEngineArr.Count()); } } -/* -----------------------------17.01.01 09:57-------------------------------- - ---------------------------------------------------------------------------*/ void SvxSearchConfig::Notify( const Sequence<OUString>& ) { Load(); } -/* -----------------------------16.01.01 15:36-------------------------------- - ---------------------------------------------------------------------------*/ void SvxSearchConfig::Commit() { OUString sNode; @@ -223,24 +213,18 @@ void SvxSearchConfig::Commit() ReplaceSetProperties(sNode, aSetValues); } } -/* -----------------------------19.03.01 10:02-------------------------------- - ---------------------------------------------------------------------------*/ sal_uInt16 SvxSearchConfig::Count() { return pImpl->aEngineArr.Count(); } -/* -----------------------------19.03.01 10:02-------------------------------- - ---------------------------------------------------------------------------*/ const SvxSearchEngineData& SvxSearchConfig::GetData(sal_uInt16 nPos) { DBG_ASSERT(nPos < pImpl->aEngineArr.Count(), "wrong array index"); return *pImpl->aEngineArr[nPos]; } -/* -----------------------------19.03.01 10:38-------------------------------- - ---------------------------------------------------------------------------*/ const SvxSearchEngineData* SvxSearchConfig::GetData(const rtl::OUString& rEngineName) { for(sal_uInt16 nPos = 0; nPos < pImpl->aEngineArr.Count(); nPos++) @@ -250,9 +234,7 @@ const SvxSearchEngineData* SvxSearchConfig::GetData(const rtl::OUString& rEngin } return 0; } -/* -----------------------------19.03.01 10:02-------------------------------- - ---------------------------------------------------------------------------*/ void SvxSearchConfig::SetData(const SvxSearchEngineData& rData) { for(sal_uInt16 nPos = 0; nPos < pImpl->aEngineArr.Count(); nPos++) @@ -269,9 +251,7 @@ void SvxSearchConfig::SetData(const SvxSearchEngineData& rData) pImpl->aEngineArr.Insert(pInsert, pImpl->aEngineArr.Count()); SetModified(); } -/* -----------------------------19.03.01 10:38-------------------------------- - ---------------------------------------------------------------------------*/ void SvxSearchConfig::RemoveData(const rtl::OUString& rEngineName) { for(sal_uInt16 nPos = 0; nPos < pImpl->aEngineArr.Count(); nPos++) @@ -285,3 +265,4 @@ void SvxSearchConfig::RemoveData(const rtl::OUString& rEngineName) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/filepicker/pickerhistory.cxx b/svl/source/filepicker/pickerhistory.cxx index 27a217f1688c..75cd4bc9b48d 100644 --- a/svl/source/filepicker/pickerhistory.cxx +++ b/svl/source/filepicker/pickerhistory.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. @@ -136,3 +137,4 @@ namespace svt } // namespace svt //......................................................................... +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx index 9e5a8b2027f9..21b6a3bffa4e 100644 --- a/svl/source/filerec/filerec.cxx +++ b/svl/source/filerec/filerec.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. @@ -74,11 +75,11 @@ SV_IMPL_VARARR( SfxUINT32s, sal_uInt32 ); sal_uInt32 SfxMiniRecordWriter::Close ( - FASTBOOL bSeekToEndOfRec /* sal_True (default) + bool bSeekToEndOfRec /* true (default) Der Stream wird an das Ende des Records positioniert. - sal_False + false Der Stream wird an den Anfang des Contents (also hinter den Header) positioniert. @@ -118,26 +119,9 @@ sal_uInt32 SfxMiniRecordWriter::Close _pStream->Seek( nEndPos ); // Header wurde JETZT geschrieben - _bHeaderOk = sal_True; + _bHeaderOk = true; return nEndPos; } -#ifdef DBG_UTIL - // mu\s Fix-Size-Record gepr"uft werden? - else if ( SFX_BOOL_DONTCARE == _bHeaderOk ) - { - // Header auslesen, um Soll-Gr"o\se zu bestimmen - sal_uInt32 nEndPos = _pStream->Tell(); - _pStream->Seek( _nStartPos ); - sal_uInt32 nHeader; - *_pStream >> nHeader; - _pStream->Seek( nEndPos ); - - // Soll-Gr"o\se mit Ist-Gr"o\se vergleichen - DBG_ASSERT( nEndPos - SFX_REC_OFS(nHeader) == _nStartPos + sizeof(sal_uInt32), - "fixed record size incorrect" ); - DbgOutf( "SfxFileRec: written record until %ul", nEndPos ); - } -#endif // Record war bereits geschlossen return 0; @@ -260,7 +244,7 @@ sal_uInt16 SfxMiniRecordReader::ScanRecordType //------------------------------------------------------------------------- -FASTBOOL SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader ) +bool SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader ) /* [Beschreibung] @@ -272,7 +256,7 @@ FASTBOOL SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader ) */ { - FASTBOOL bRet = sal_True; + bool bRet = true; // Record-Ende und Pre-Tag aus dem Header ermitteln _nEofRec = _pStream->Tell() + SFX_REC_OFS(nHeader); @@ -282,7 +266,7 @@ FASTBOOL SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader ) if ( _nPreTag == SFX_REC_PRETAG_EOR ) { _pStream->SetError( ERRCODE_IO_WRONGFORMAT ); - bRet = sal_False; + bRet = true; } return bRet; } @@ -487,7 +471,7 @@ SfxSingleRecordWriter::SfxSingleRecordWriter //========================================================================= -inline FASTBOOL SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes ) +inline bool SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes ) /* [Beschreibung] @@ -498,13 +482,13 @@ inline FASTBOOL SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes ) */ { - FASTBOOL bRet; + bool bRet; // Basisklassen-Header einlesen sal_uInt32 nHeader=0; *_pStream >> nHeader; if ( !SetHeader_Impl( nHeader ) ) - bRet = sal_False; + bRet = false; else { // eigenen Header einlesen @@ -561,7 +545,7 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, sal_uInt16 nTag //------------------------------------------------------------------------- -FASTBOOL SfxSingleRecordReader::FindHeader_Impl +bool SfxSingleRecordReader::FindHeader_Impl ( sal_uInt16 nTypes, // arithm. Veroderung erlaubter Record-Typen sal_uInt16 nTag // zu findende Record-Art-Kennung @@ -674,7 +658,7 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter //------------------------------------------------------------------------ -sal_uInt32 SfxMultiFixRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) +sal_uInt32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec ) // siehe <SfxMiniRecordWriter> @@ -799,7 +783,7 @@ void SfxMultiVarRecordWriter::NewContent() //------------------------------------------------------------------------- -sal_uInt32 SfxMultiVarRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) +sal_uInt32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec ) // siehe <SfxMiniRecordWriter> @@ -872,7 +856,7 @@ void SfxMultiMixRecordWriter::NewContent //========================================================================= -FASTBOOL SfxMultiRecordReader::ReadHeader_Impl() +bool SfxMultiRecordReader::ReadHeader_Impl() /* [Beschreibung] @@ -898,12 +882,13 @@ FASTBOOL SfxMultiRecordReader::ReadHeader_Impl() else _pStream->Seek( _nContentSize ); _pContentOfs = new sal_uInt32[_nContentCount]; + memset(_pContentOfs, 0, _nContentCount*sizeof(sal_uInt32)); //! darf man jetzt so einr"ucken #if defined(OSL_LITENDIAN) - _pStream->Read( _pContentOfs, sizeof(sal_uInt32)*_nContentCount ); + _pStream->Read( _pContentOfs, sizeof(sal_uInt32)*_nContentCount ); #else - for ( sal_uInt16 n = 0; n < _nContentCount; ++n ) - *_pStream >> _pContentOfs[n]; + for ( sal_uInt16 n = 0; n < _nContentCount; ++n ) + *_pStream >> _pContentOfs[n]; #endif _pStream->Seek( nContentPos ); } @@ -915,7 +900,10 @@ FASTBOOL SfxMultiRecordReader::ReadHeader_Impl() //------------------------------------------------------------------------- SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream ) -: _pContentOfs( NULL ), _nContentNo(0) + : _pContentOfs(0) + , _nContentSize(0) + , _nContentCount(0) + , _nContentNo(0) { // Position im Stream merken, um im Fehlerfall zur"uck-seeken zu k"onnen _nStartPos = pStream->Tell(); @@ -963,7 +951,7 @@ SfxMultiRecordReader::~SfxMultiRecordReader() //------------------------------------------------------------------------- -FASTBOOL SfxMultiRecordReader::GetContent() +bool SfxMultiRecordReader::GetContent() /* [Beschreibung] @@ -1014,3 +1002,4 @@ FASTBOOL SfxMultiRecordReader::GetContent() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index 62fc88f6053a..a641a5d80c04 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.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. @@ -52,15 +53,15 @@ using namespace ::com::sun::star; uno::Sequence< ::rtl::OUString > SAL_CALL FSStorageFactory::impl_staticGetSupportedServiceNames() { uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.embed.FileSystemStorageFactory"); - aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.FileSystemStorageFactory"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.FileSystemStorageFactory")); + aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.FileSystemStorageFactory")); return aRet; } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL FSStorageFactory::impl_staticGetImplementationName() { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.FileSystemStorageFactory"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.embed.FileSystemStorageFactory")); } //------------------------------------------------------------------------- @@ -120,7 +121,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA { if( !( aArguments[1] >>= nStorageMode ) ) { - OSL_ENSURE( sal_False, "Wrong second argument!\n" ); + OSL_FAIL( "Wrong second argument!\n" ); throw uno::Exception(); // TODO: Illegal argument } // it's allways possible to read written storage in this implementation @@ -134,13 +135,13 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA { if ( !aURL.getLength() ) { - OSL_ENSURE( sal_False, "Empty URL is provided!\n" ); + OSL_FAIL( "Empty URL is provided!\n" ); throw uno::Exception(); // TODO: illegal argument } } else { - OSL_ENSURE( sal_False, "Wrong first argument!\n" ); + OSL_FAIL( "Wrong first argument!\n" ); throw uno::Exception(); // TODO: Illegal argument } @@ -153,12 +154,12 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA if( aArguments[2] >>= aDescr ) { aPropsToSet.realloc(1); - aPropsToSet[0].Name = ::rtl::OUString::createFromAscii( "URL" ); + aPropsToSet[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")); aPropsToSet[0].Value <<= aURL; for ( sal_Int32 nInd = 0, nNumArgs = 1; nInd < aDescr.getLength(); nInd++ ) { - if ( aDescr[nInd].Name.equalsAscii( "InteractionHandler" ) ) + if ( aDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InteractionHandler" ) ) ) { aPropsToSet.realloc( ++nNumArgs ); aPropsToSet[nNumArgs-1].Name = aDescr[nInd].Name; @@ -166,12 +167,12 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA break; } else - OSL_ENSURE( sal_False, "Unacceptable property, will be ignored!\n" ); + OSL_FAIL( "Unacceptable property, will be ignored!\n" ); } } else { - OSL_ENSURE( sal_False, "Wrong third argument!\n" ); + OSL_FAIL( "Wrong third argument!\n" ); throw uno::Exception(); // TODO: Illegal argument } } @@ -182,7 +183,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstanceWithA || aURL.equalsIgnoreAsciiCaseAsciiL( "vnd.sun.star.zip", 16 ) || ::utl::UCBContentHelper::IsDocument( aURL ) ) { - OSL_ENSURE( sal_False, "File system storages can be based only on file URLs!\n" ); // ??? + OSL_FAIL( "File system storages can be based only on file URLs!\n" ); // ??? throw uno::Exception(); // TODO: illegal argument } @@ -266,3 +267,4 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( } // extern "C" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index 73460ef3d277..2a6e2caca288 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.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. @@ -34,9 +35,7 @@ #include <com/sun/star/ucb/XContentAccess.hpp> #include <com/sun/star/ucb/XSimpleFileAccess.hpp> -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEIODEXCEPTION_HPP_ #include <com/sun/star/ucb/InteractiveIOException.hpp> -#endif #include <com/sun/star/ucb/IOErrorCode.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> @@ -53,9 +52,7 @@ #include <com/sun/star/sdbc/XRow.hpp> -#ifndef _COMPHELPER_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <comphelper/storagehelper.hxx> #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -258,8 +255,8 @@ void FSStorage::CopyContentToStorage_Impl( ::ucbhelper::Content* pContent, const // create cursor for access to children uno::Sequence< ::rtl::OUString > aProps( 2 ); ::rtl::OUString* pProps = aProps.getArray(); - pProps[0] = ::rtl::OUString::createFromAscii( "TargetURL" ); - pProps[1] = ::rtl::OUString::createFromAscii( "IsFolder" ); + pProps[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TargetURL")); + pProps[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")); ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; try @@ -304,7 +301,7 @@ void FSStorage::CopyContentToStorage_Impl( ::ucbhelper::Content* pContent, const catch( ucb::InteractiveIOException& r ) { if ( r.Code == ucb::IOErrorCode_NOT_EXISTING ) - OSL_ENSURE( sal_False, "The folder does not exist!\n" ); + OSL_FAIL( "The folder does not exist!\n" ); else throw; } @@ -443,7 +440,7 @@ void SAL_CALL FSStorage::copyToStorage( const uno::Reference< embed::XStorage >& catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Can't copy raw stream" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), uno::Reference< io::XInputStream >(), aCaught ); } @@ -553,7 +550,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement( catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Can't copy raw stream" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), uno::Reference< io::XInputStream >(), aCaught ); } @@ -662,7 +659,7 @@ uno::Reference< embed::XStorage > SAL_CALL FSStorage::openStorageElement( catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Can't copy raw stream" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), uno::Reference< io::XInputStream >(), aCaught ); } @@ -699,7 +696,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::cloneStreamElement( const ::rt uno::Reference< io::XInputStream > xInStream = aResultContent.openStream(); xTempResult = uno::Reference < io::XStream >( - m_pImpl->m_xFactory->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ), + m_pImpl->m_xFactory->createInstance ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ), uno::UNO_QUERY_THROW ); uno::Reference < io::XOutputStream > xTempOut = xTempResult->getOutputStream(); uno::Reference < io::XInputStream > xTempIn = xTempResult->getInputStream(); @@ -737,7 +734,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::cloneStreamElement( const ::rt catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Can't copy raw stream" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), uno::Reference< io::XInputStream >(), aCaught ); } @@ -935,7 +932,7 @@ void SAL_CALL FSStorage::renameElement( const ::rtl::OUString& aElementName, con catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Can't copy raw stream" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), uno::Reference< io::XInputStream >(), aCaught ); } @@ -1020,7 +1017,7 @@ void SAL_CALL FSStorage::copyElementTo( const ::rtl::OUString& aElementName, catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Can't copy raw stream" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), uno::Reference< io::XInputStream >(), aCaught ); } @@ -1100,7 +1097,7 @@ uno::Any SAL_CALL FSStorage::getByName( const ::rtl::OUString& aName ) catch ( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetException( ::rtl::OUString::createFromAscii( "Can not open element!\n" ), + throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can not open element!\n")), uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -1124,7 +1121,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorage::getElementNames() uno::Sequence< ::rtl::OUString > aProps( 1 ); ::rtl::OUString* pProps = aProps.getArray(); - pProps[0] = ::rtl::OUString::createFromAscii( "Title" ); + pProps[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; uno::Sequence< ::rtl::OUString > aResult; @@ -1149,11 +1146,11 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorage::getElementNames() catch( ucb::InteractiveIOException& r ) { if ( r.Code == ucb::IOErrorCode_NOT_EXISTING ) - OSL_ENSURE( sal_False, "The folder does not exist!\n" ); + OSL_FAIL( "The folder does not exist!\n" ); else { uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( ::rtl::OUString::createFromAscii( "Can not open storage!\n" ), + throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can not open storage!\n")), uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -1166,7 +1163,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorage::getElementNames() catch ( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( ::rtl::OUString::createFromAscii( "Can not open storage!\n" ), + throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can not open storage!\n")), uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -1200,7 +1197,7 @@ sal_Bool SAL_CALL FSStorage::hasByName( const ::rtl::OUString& aName ) catch ( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw lang::WrappedTargetRuntimeException( ::rtl::OUString::createFromAscii( "Can not open storage!\n" ), + throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can not open storage!\n")), uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ), aCaught ); @@ -1239,7 +1236,7 @@ sal_Bool SAL_CALL FSStorage::hasElements() throw io::IOException(); // TODO: error handling uno::Sequence< ::rtl::OUString > aProps( 1 ); - aProps[0] = ::rtl::OUString::createFromAscii( "TargetURL" ); + aProps[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TargetURL")); ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; try @@ -1338,7 +1335,7 @@ void SAL_CALL FSStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, if ( !m_pImpl ) throw lang::DisposedException(); - if ( aPropertyName.equalsAscii( "URL" ) || aPropertyName.equalsAscii( "OpenMode" ) ) + if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URL")) || aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OpenMode")) ) throw beans::PropertyVetoException(); // TODO else throw beans::UnknownPropertyException(); // TODO @@ -1356,9 +1353,9 @@ uno::Any SAL_CALL FSStorage::getPropertyValue( const ::rtl::OUString& aPropertyN if ( !m_pImpl ) throw lang::DisposedException(); - if ( aPropertyName.equalsAscii( "URL" ) ) + if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URL")) ) return uno::makeAny( m_pImpl->m_aURL ); - else if ( aPropertyName.equalsAscii( "OpenMode" ) ) + else if ( aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OpenMode")) ) return uno::makeAny( m_pImpl->m_nMode ); throw beans::UnknownPropertyException(); // TODO @@ -1552,7 +1549,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl catch( uno::Exception& ) { uno::Any aCaught( ::cppu::getCaughtException() ); - throw embed::StorageWrappedTargetException( ::rtl::OUString::createFromAscii( "Can't copy raw stream" ), + throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't copy raw stream")), uno::Reference< io::XInputStream >(), aCaught ); } @@ -1612,3 +1609,4 @@ void SAL_CALL FSStorage::removeStreamElementByHierarchicalName( const ::rtl::OUS } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/fsstor/fsstorage.hxx b/svl/source/fsstor/fsstorage.hxx index 04bd3dead578..7d8a14489453 100644 --- a/svl/source/fsstor/fsstorage.hxx +++ b/svl/source/fsstor/fsstorage.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. @@ -335,3 +336,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/fsstor/oinputstreamcontainer.cxx b/svl/source/fsstor/oinputstreamcontainer.cxx index ffa86cdb981d..dfa81504ba61 100644 --- a/svl/source/fsstor/oinputstreamcontainer.cxx +++ b/svl/source/fsstor/oinputstreamcontainer.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. @@ -345,3 +346,4 @@ void SAL_CALL OFSInputStreamContainer::removeEventListener( const uno::Reference +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/fsstor/oinputstreamcontainer.hxx b/svl/source/fsstor/oinputstreamcontainer.hxx index 939eb16c05af..e417b8e874c2 100644 --- a/svl/source/fsstor/oinputstreamcontainer.hxx +++ b/svl/source/fsstor/oinputstreamcontainer.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. @@ -94,3 +95,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/fsstor/ostreamcontainer.cxx b/svl/source/fsstor/ostreamcontainer.cxx index b9210f685014..99c00d83b908 100644 --- a/svl/source/fsstor/ostreamcontainer.cxx +++ b/svl/source/fsstor/ostreamcontainer.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. @@ -565,3 +566,4 @@ void SAL_CALL OFSStreamContainer::waitForCompletion() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/fsstor/ostreamcontainer.hxx b/svl/source/fsstor/ostreamcontainer.hxx index 67fbf88b64c6..42c2045a11d2 100644 --- a/svl/source/fsstor/ostreamcontainer.hxx +++ b/svl/source/fsstor/ostreamcontainer.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. @@ -123,3 +124,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/inc/fsfactory.hxx b/svl/source/inc/fsfactory.hxx index d5e4e1d56373..f0abc4badbf1 100644 --- a/svl/source/inc/fsfactory.hxx +++ b/svl/source/inc/fsfactory.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. @@ -70,3 +71,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/inc/passwordcontainer.hxx b/svl/source/inc/passwordcontainer.hxx index e03432906f5f..bcbd51b1360e 100644 --- a/svl/source/inc/passwordcontainer.hxx +++ b/svl/source/inc/passwordcontainer.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. @@ -215,7 +216,7 @@ public: { ::com::sun::star::uno::Sequence< ::rtl::OUString > aNode( 1 ); *aNode.getArray() = path; - *aNode.getArray() += ::rtl::OUString::createFromAscii( "/Store" ); + *aNode.getArray() += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/Store")); EnableNotification( aNode ); } @@ -424,3 +425,4 @@ public: #endif // #ifndef INCLUDED_COMPHELPER_PASSWORDCONTAINER_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index 013b6c760096..bf2180770172 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.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. @@ -82,11 +83,21 @@ struct SfxItemPool_Impl sal_uInt16 nStoringStart, nStoringEnd; // zu speichernder Range sal_uInt8 nMajorVer, nMinorVer; // Pool selbst SfxMapUnit eDefMetric; - FASTBOOL bInSetItem; - FASTBOOL bStreaming; // in Load() bzw. Store() + bool bInSetItem; + bool bStreaming; // in Load() bzw. Store() SfxItemPool_Impl( sal_uInt16 nStart, sal_uInt16 nEnd ) : ppPoolItems (new SfxPoolItemArray_Impl*[ nEnd - nStart + 1]) + , nLoadingVersion(0) + , nInitRefCount(0) + , nVerStart(0) + , nVerEnd(0) + , nStoringStart(0) + , nStoringEnd(0) + , nMajorVer(0) + , nMinorVer(0) + , bInSetItem(false) + , bStreaming(false) { memset( ppPoolItems, 0, sizeof( SfxPoolItemArray_Impl* ) * ( nEnd - nStart + 1) ); } @@ -130,7 +141,7 @@ struct SfxItemPool_Impl rStream >> nFileTag; \ if ( nTag != nFileTag ) \ { \ - DBG_ERROR( #nTag ); /*! s.u. */ \ + OSL_FAIL( #nTag ); /*! s.u. */ \ /*! error-code setzen und auswerten! */ \ (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \ pImp->bStreaming = sal_False; \ @@ -143,7 +154,7 @@ struct SfxItemPool_Impl rStream >> nFileTag; \ if ( nTag != nFileTag ) \ { \ - DBG_ERROR( #nTag ); /*! s.u. */ \ + OSL_FAIL( #nTag ); /*! s.u. */ \ /*! error-code setzen und auswerten! */ \ (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \ pImp->bStreaming = sal_False; \ @@ -157,7 +168,7 @@ struct SfxItemPool_Impl rStream >> nFileTag; \ if ( nTag1 != nFileTag && nTag2 != nFileTag ) \ { \ - DBG_ERROR( #nTag1 ); /*! s.u. */ \ + OSL_FAIL( #nTag1 ); /*! s.u. */ \ /*! error-code setzen und auswerten! */ \ (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \ pImp->bStreaming = sal_False; \ @@ -202,3 +213,4 @@ inline sal_uInt16 SfxItemPool::GetIndex_Impl(sal_uInt16 nWhich) const return nWhich - nStart; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/aeitem.cxx b/svl/source/items/aeitem.cxx index 370a3ebeb44e..e45c6acbaa26 100644 --- a/svl/source/items/aeitem.cxx +++ b/svl/source/items/aeitem.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,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <tools/string.hxx> @@ -312,3 +311,4 @@ void SfxAllEnumItem::RemoveAllValues() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx index a67df72113ba..03f3ae784da9 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.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. @@ -32,9 +33,7 @@ #include <svl/cenumitm.hxx> #include <whassert.hxx> -#ifndef _CPPUHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> -#endif //============================================================================ // @@ -70,7 +69,7 @@ SfxEnumItemInterface::GetPresentation(SfxItemPresentation, SfxMapUnit, //============================================================================ // virtual -sal_Bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) +bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= sal_Int32(GetEnumValue()); @@ -79,7 +78,7 @@ sal_Bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uI //============================================================================ // virtual -sal_Bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, +bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nTheValue = 0; @@ -89,7 +88,7 @@ sal_Bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, SetEnumValue(sal_uInt16(nTheValue)); return true; } - DBG_ERROR("SfxEnumItemInterface::PutValue(): Wrong type"); + OSL_FAIL("SfxEnumItemInterface::PutValue(): Wrong type"); return false; } @@ -233,7 +232,7 @@ SfxItemPresentation CntBoolItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const +bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= sal_Bool(m_bValue); return true; @@ -241,7 +240,7 @@ sal_Bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) cons //============================================================================ // virtual -sal_Bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) +bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Bool bTheValue = sal_Bool(); if (rVal >>= bTheValue) @@ -249,7 +248,7 @@ sal_Bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) m_bValue = bTheValue; return true; } - DBG_ERROR("CntBoolItem::PutValue(): Wrong type"); + OSL_FAIL("CntBoolItem::PutValue(): Wrong type"); return false; } @@ -288,7 +287,8 @@ UniString CntBoolItem::GetValueTextByVal(sal_Bool bTheValue) const { return bTheValue ? - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) : - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False")); + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) : + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE")); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cintitem.cxx b/svl/source/items/cintitem.cxx index 11f68ed69071..1f949babf9dc 100644 --- a/svl/source/items/cintitem.cxx +++ b/svl/source/items/cintitem.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. @@ -87,26 +88,26 @@ SfxItemPresentation CntByteItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int8 nValue = m_nValue; rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int8 nValue = sal_Int8(); if (rVal >>= nValue) { m_nValue = nValue; - return sal_True; + return true; } - DBG_ERROR( "CntByteItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "CntByteItem::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -222,27 +223,27 @@ SfxItemPresentation CntUInt16Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { DBG_ASSERT( nValue <= USHRT_MAX, "Overflow in UInt16 value!"); m_nValue = (sal_uInt16)nValue; - return sal_True; + return true; } - DBG_ERROR( "CntUInt16Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "CntUInt16Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -354,26 +355,26 @@ SfxItemPresentation CntInt32Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { m_nValue = nValue; - return sal_True; + return true; } - DBG_ERROR( "CntInt32Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "CntInt32Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -487,28 +488,28 @@ SfxItemPresentation CntUInt32Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; DBG_ASSERT( nValue>=0, "Overflow in UInt32 value!"); rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { DBG_ASSERT( nValue>=0, "Overflow in UInt32 value!"); m_nValue = nValue; - return sal_True; + return true; } - DBG_ERROR( "CntUInt32Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "CntUInt32Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -560,3 +561,4 @@ SfxFieldUnit CntUInt32Item::GetUnit() const return SFX_FUNIT_NONE; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index e5d635990086..22cd8a77904c 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.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. @@ -150,18 +151,19 @@ SfxPoolItem* CntWallpaperItem::Clone( SfxItemPool* ) const //---------------------------------------------------------------------------- // virtual -sal_Bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&,sal_uInt8 ) const +bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8) const { - DBG_ERROR("Not implemented!"); - return sal_False; + OSL_FAIL("Not implemented!"); + return false; } //---------------------------------------------------------------------------- // virtual -sal_Bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&,sal_uInt8 ) +bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8) { - DBG_ERROR("Not implemented!"); - return sal_False; + OSL_FAIL("Not implemented!"); + return false; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cstitem.src b/svl/source/items/cstitem.src index 009fcb19e3c6..206fe1a18893 100644 --- a/svl/source/items/cstitem.src +++ b/svl/source/items/cstitem.src @@ -30,40 +30,3 @@ String STR_COLUM_DT_AUTO { Text [ en-US ] = "automatic" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx index 184b692eaad9..d1fe8b9461f9 100644 --- a/svl/source/items/ctypeitm.cxx +++ b/svl/source/items/ctypeitm.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. @@ -223,7 +224,7 @@ void CntContentTypeItem::SetValue( const INetContentType eType ) //---------------------------------------------------------------------------- // virtual -sal_Bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const +bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= rtl::OUString(GetValue()); return true; @@ -231,7 +232,7 @@ sal_Bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt //---------------------------------------------------------------------------- // virtual -sal_Bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal,sal_uInt8 ) +bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8) { rtl::OUString aValue; if ( rVal >>= aValue ) @@ -246,6 +247,8 @@ sal_Bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal,sal_ return true; } - DBG_ERROR( "CntContentTypeItem::PutValue - Wrong type!" ); + OSL_FAIL( "CntContentTypeItem::PutValue - Wrong type!" ); return false; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx index ff5d2dadd751..e64f47ec2a3e 100644 --- a/svl/source/items/custritm.cxx +++ b/svl/source/items/custritm.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. @@ -60,7 +61,7 @@ int CntUnencodedStringItem::operator ==(const SfxPoolItem & rItem) const // virtual int CntUnencodedStringItem::Compare(SfxPoolItem const & rWith) const { - DBG_ERROR("CntUnencodedStringItem::Compare(): No international"); + OSL_FAIL("CntUnencodedStringItem::Compare(): No international"); DBG_CHKTHIS(CntUnencodedStringItem, 0); DBG_ASSERT(rWith.ISA(CntUnencodedStringItem), "CntUnencodedStringItem::Compare(): Bad type"); @@ -106,7 +107,7 @@ CntUnencodedStringItem::GetPresentation(SfxItemPresentation, SfxMapUnit, //============================================================================ // virtual -sal_Bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) +bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= rtl::OUString(m_aValue); @@ -115,7 +116,7 @@ sal_Bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_ //============================================================================ // virtual -sal_Bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, +bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { rtl::OUString aTheValue; @@ -124,7 +125,7 @@ sal_Bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, m_aValue = UniString(aTheValue); return true; } - DBG_ERROR("CntUnencodedStringItem::PutValue(): Wrong type"); + OSL_FAIL("CntUnencodedStringItem::PutValue(): Wrong type"); return false; } @@ -136,3 +137,4 @@ SfxPoolItem * CntUnencodedStringItem::Clone(SfxItemPool *) const return new CntUnencodedStringItem(*this); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx index eeaebb3fa2a7..e4c05f0abce0 100644 --- a/svl/source/items/dateitem.cxx +++ b/svl/source/items/dateitem.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. @@ -174,7 +175,7 @@ SfxItemPresentation SfxDateTimeItem::GetPresentation //---------------------------------------------------------------------------- // virtual -sal_Bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, +bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; @@ -188,16 +189,16 @@ sal_Bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, aValue.Minutes, aValue.Seconds, aValue.HundredthSeconds ) ); - return sal_True; + return true; } - DBG_ERROR( "SfxDateTimeItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxDateTimeItem::PutValue - Wrong type!" ); + return false; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, +bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; @@ -209,7 +210,7 @@ sal_Bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, aDateTime.GetMonth(), aDateTime.GetYear() ); rVal <<= aValue; - return sal_True; + return true; } // ----------------------------------------------------------------------- @@ -276,3 +277,4 @@ SfxItemPresentation SfxColumnDateTimeItem::GetPresentation +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/eitem.cxx b/svl/source/items/eitem.cxx index c8b7f3db287f..6f6e3bfd2835 100644 --- a/svl/source/items/eitem.cxx +++ b/svl/source/items/eitem.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. @@ -45,3 +46,4 @@ TYPEINIT1(SfxEnumItem, CntEnumItem); TYPEINIT1_AUTOFACTORY(SfxBoolItem, CntBoolItem); +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx index d1c0b84078a4..a151d430cd0d 100644 --- a/svl/source/items/flagitem.cxx +++ b/svl/source/items/flagitem.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. @@ -161,3 +162,4 @@ SfxPoolItem* SfxFlagItem::Clone(SfxItemPool *) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx index c630a6b9b4f2..aa36b0afa30c 100644 --- a/svl/source/items/globalnameitem.cxx +++ b/svl/source/items/globalnameitem.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. @@ -80,10 +81,10 @@ SfxPoolItem* SfxGlobalNameItem::Clone(SfxItemPool *) const //---------------------------------------------------------------------------- // virtual -sal_Bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Reference < com::sun::star::script::XTypeConverter > xConverter - ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), + ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), com::sun::star::uno::UNO_QUERY ); com::sun::star::uno::Sequence< sal_Int8 > aSeq; com::sun::star::uno::Any aNew; @@ -94,21 +95,22 @@ sal_Bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_ if ( aSeq.getLength() == 16 ) { m_aName.MakeFromMemory( (void*) aSeq.getConstArray() ); - return sal_True; + return true; } - DBG_ERROR( "SfxGlobalNameItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxGlobalNameItem::PutValue - Wrong type!" ); + return true; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const +bool SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 ); void* pData = ( void* ) &m_aName.GetCLSID(); memcpy( aSeq.getArray(), pData, 16 ); rVal <<= aSeq; - return sal_True; + return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index 66bc832c8125..f8d575b52175 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.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. @@ -75,25 +76,25 @@ SfxPoolItem* SfxIntegerListItem::Clone( SfxItemPool * ) const return new SfxIntegerListItem( *this ); } -sal_Bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { ::com::sun::star::uno::Reference < ::com::sun::star::script::XTypeConverter > xConverter - ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), + ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), ::com::sun::star::uno::UNO_QUERY ); ::com::sun::star::uno::Any aNew; try { aNew = xConverter->convertTo( rVal, ::getCppuType((const ::com::sun::star::uno::Sequence < sal_Int32 >*)0) ); } catch (::com::sun::star::uno::Exception&) { - return sal_False; + return true; } return ( aNew >>= m_aList ); } -sal_Bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const +bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { rVal <<= m_aList; - return sal_True; + return true; } void SfxIntegerListItem::GetList( SvULongs& rList ) const @@ -101,3 +102,5 @@ void SfxIntegerListItem::GetList( SvULongs& rList ) const for ( sal_Int32 n=0; n<m_aList.getLength(); n++ ) rList.Insert( m_aList[n], sal::static_int_cast< sal_uInt16 >(n) ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx index cd91f082ee1f..4daa24f2a442 100644 --- a/svl/source/items/imageitm.cxx +++ b/svl/source/items/imageitm.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. @@ -87,7 +88,7 @@ int SfxImageItem::operator==( const SfxPoolItem& rItem ) const return( ((SfxImageItem&) rItem).GetValue() == GetValue() && (*pImp == *(((SfxImageItem&)rItem).pImp) ) ); } -sal_Bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const +bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq( 4 ); aSeq[0] = ::com::sun::star::uno::makeAny( GetValue() ); @@ -96,10 +97,10 @@ sal_Bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) c aSeq[3] = ::com::sun::star::uno::makeAny( rtl::OUString( pImp->aURL )); rVal = ::com::sun::star::uno::makeAny( aSeq ); - return sal_True; + return true; } -sal_Bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq; if (( rVal >>= aSeq ) && ( aSeq.getLength() == 4 )) @@ -112,10 +113,10 @@ sal_Bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 aSeq[2] >>= pImp->bMirrored; if ( aSeq[3] >>= aURL ) pImp->aURL = aURL; - return sal_True; + return true; } - return sal_False; + return false; } void SfxImageItem::SetRotation( long nValue ) @@ -143,3 +144,4 @@ String SfxImageItem::GetURL() const return pImp->aURL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx index 13c691123537..85f9d309f435 100644 --- a/svl/source/items/intitem.cxx +++ b/svl/source/items/intitem.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. @@ -111,26 +112,26 @@ SfxItemPresentation SfxInt16Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const +bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int16 nValue = m_nValue; rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 ) { sal_Int16 nValue = sal_Int16(); if (rVal >>= nValue) { m_nValue = nValue; - return sal_True; + return true; } - DBG_ERROR( "SfxInt16Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxInt16Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -239,20 +240,21 @@ SfxMetricItem::SfxMetricItem(const SfxMetricItem & rItem): //============================================================================ // virtual -int SfxMetricItem::ScaleMetrics(long nMult, long nDiv) +bool SfxMetricItem::ScaleMetrics(long nMult, long nDiv) { BigInt aTheValue(GetValue()); aTheValue *= nMult; aTheValue += nDiv / 2; aTheValue /= nDiv; SetValue(aTheValue); - return 1; + return true; } //============================================================================ // virtual -int SfxMetricItem::HasMetrics() const +bool SfxMetricItem::HasMetrics() const { - return 1; + return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemiter.cxx b/svl/source/items/itemiter.cxx index 57b5dc8e727c..cd349a8c9321 100644 --- a/svl/source/items/itemiter.cxx +++ b/svl/source/items/itemiter.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,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif - #include <svl/itemiter.hxx> #include <svl/itempool.hxx> #include <svl/itemset.hxx> @@ -117,3 +115,4 @@ const SfxPoolItem* SfxItemIter::PrevItem() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index c5c0aa68addf..6d9346a3ac5c 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.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. @@ -30,8 +31,6 @@ #include <string.h> #include <stdio.h> -#ifndef GCC -#endif #include <svl/itempool.hxx> #include "whassert.hxx" @@ -74,7 +73,7 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( sal_uInt16 nWhich ) const // ----------------------------------------------------------------------- -inline FASTBOOL SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag ) const +inline bool SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag ) const { sal_uInt16 nItemFlag = pItemInfos[nPos]._nFlags; return nFlag == (nItemFlag & nFlag); @@ -82,7 +81,7 @@ inline FASTBOOL SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const +bool SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const { for ( const SfxItemPool *pPool = this; pPool; pPool = pPool->pSecondary ) { @@ -118,7 +117,7 @@ SfxItemPool::SfxItemPool #ifndef TF_POOLABLE sal_uInt16* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */ #endif - FASTBOOL bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ + bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ ) /* [Beschreibung] @@ -179,7 +178,7 @@ SfxItemPool::SfxItemPool pImp->nInitRefCount = 1; pImp->nVerStart = nStart; pImp->nVerEnd = nEnd; - pImp->bInSetItem = sal_False; + pImp->bInSetItem = false; pImp->nStoringStart = nStartWhich; pImp->nStoringEnd = nEndWhich; @@ -238,7 +237,7 @@ SfxItemPool::SfxItemPool pImp->nInitRefCount = 1; pImp->nVerStart = rPool.pImp->nVerStart; pImp->nVerEnd = rPool.pImp->nVerEnd; - pImp->bInSetItem = sal_False; + pImp->bInSetItem = false; pImp->nStoringStart = nStart; pImp->nStoringEnd = nEnd; @@ -399,7 +398,7 @@ void SfxItemPool::Free(SfxItemPool* pPool) { // tell all the registered SfxItemPoolUsers that the pool is in destruction SfxItemPoolUserVector aListCopy(pPool->maSfxItemPoolUsers.begin(), pPool->maSfxItemPoolUsers.end()); - for(SfxItemPoolUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); aIterator++) + for(SfxItemPoolUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); ++aIterator) { SfxItemPoolUser* pSfxItemPoolUser = *aIterator; DBG_ASSERT(pSfxItemPoolUser, "corrupt SfxItemPoolUser list (!)"); @@ -449,7 +448,7 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) for( size_t i = (*ppItemArr)->size(); i; ++ppHtArr, --i ) if ( !(*ppHtArr) ) { - DBG_ERROR( "old secondary pool must be empty" ); + OSL_FAIL( "old secondary pool must be empty" ); bOK = sal_False; break; } @@ -748,7 +747,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich { if ( pSecondary ) return pSecondary->Put( rItem, nWhich ); - DBG_ERROR( "unknown Which-Id - cannot put item" ); + OSL_FAIL( "unknown Which-Id - cannot put item" ); } // SID oder nicht poolable (neue Definition)? @@ -882,7 +881,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) pSecondary->Remove( rItem ); return; } - DBG_ERROR( "unknown Which-Id - cannot remove item" ); + OSL_FAIL( "unknown Which-Id - cannot remove item" ); } // SID oder nicht poolable (neue Definition)? @@ -1166,3 +1165,4 @@ void SfxItemPool::SetFileFormatVersion( sal_uInt16 nFileFormatVersion ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index eb146afe893b..95ae5f4e71ec 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.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. @@ -32,7 +33,7 @@ #include <svl/itempool.hxx> #include <svl/itemset.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> -#include <hash_map> +#include <boost/unordered_map.hpp> /************************************************************************* UNO III Implementation *************************************************************************/ @@ -41,10 +42,6 @@ using namespace com::sun::star::beans; using namespace com::sun::star::lang; using namespace com::sun::star::uno; -/*-- 16.02.2009 10:03:55--------------------------------------------------- - - -----------------------------------------------------------------------*/ - struct equalOUString { bool operator()(const ::rtl::OUString& r1, const ::rtl::OUString& r2) const @@ -53,7 +50,7 @@ struct equalOUString } }; -typedef ::std::hash_map< ::rtl::OUString, +typedef ::boost::unordered_map< ::rtl::OUString, SfxItemPropertySimpleEntry, ::rtl::OUStringHash, equalOUString > SfxItemPropertyHashMap_t; @@ -72,9 +69,6 @@ SfxItemPropertyMap_Impl::SfxItemPropertyMap_Impl( const SfxItemPropertyMap_Impl* m_aPropSeq = pSource->m_aPropSeq; } -/*-- 16.02.2009 10:03:51--------------------------------------------------- - - -----------------------------------------------------------------------*/ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ) : m_pImpl( new SfxItemPropertyMap_Impl ) { @@ -85,23 +79,17 @@ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ++pEntries; } } -/*-- 16.02.2009 12:46:41--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMap* pSource ) : m_pImpl( new SfxItemPropertyMap_Impl( pSource->m_pImpl ) ) { } -/*-- 16.02.2009 10:03:51--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertyMap::~SfxItemPropertyMap() { delete m_pImpl; } -/*-- 16.02.2009 10:03:51--------------------------------------------------- - -----------------------------------------------------------------------*/ const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const ::rtl::OUString &rName ) const { SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName); @@ -110,9 +98,6 @@ const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const ::rtl::OU return &aIter->second; } -/*-- 16.02.2009 10:44:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Sequence<beans::Property> SfxItemPropertyMap::getProperties() const { if( !m_pImpl->m_aPropSeq.getLength() ) @@ -138,9 +123,7 @@ uno::Sequence<beans::Property> SfxItemPropertyMap::getProperties() const return m_pImpl->m_aPropSeq; } -/*-- 16.02.2009 11:04:31--------------------------------------------------- - -----------------------------------------------------------------------*/ beans::Property SfxItemPropertyMap::getPropertyByName( const ::rtl::OUString rName ) const throw( beans::UnknownPropertyException ) { @@ -156,17 +139,13 @@ beans::Property SfxItemPropertyMap::getPropertyByName( const ::rtl::OUString rNa aProp.Attributes = sal::static_int_cast< sal_Int16 >(pEntry->nFlags); return aProp; } -/*-- 16.02.2009 11:09:16--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SfxItemPropertyMap::hasPropertyByName( const ::rtl::OUString& rName ) const { SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName); return aIter != m_pImpl->end(); } -/*-- 16.02.2009 11:25:14--------------------------------------------------- - -----------------------------------------------------------------------*/ void SfxItemPropertyMap::mergeProperties( const uno::Sequence< beans::Property >& rPropSeq ) { const beans::Property* pPropArray = rPropSeq.getConstArray(); @@ -181,9 +160,7 @@ void SfxItemPropertyMap::mergeProperties( const uno::Sequence< beans::Property > (*m_pImpl)[pPropArray[nElement].Name] = aTemp; } } -/*-- 18.02.2009 12:04:42--------------------------------------------------- - -----------------------------------------------------------------------*/ PropertyEntryVector_t SfxItemPropertyMap::getPropertyEntries() const { PropertyEntryVector_t aRet; @@ -198,29 +175,21 @@ PropertyEntryVector_t SfxItemPropertyMap::getPropertyEntries() const } return aRet; } -/*-- 18.02.2009 15:11:06--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_uInt32 SfxItemPropertyMap::getSize() const { return m_pImpl->size(); } -/*-- 16.02.2009 13:44:54--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertySet::~SfxItemPropertySet() { } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SfxItemPropertySet::FillItem(SfxItemSet&, sal_uInt16, sal_Bool) const { return sal_False; } -/* -----------------------------06.06.01 12:32-------------------------------- - ---------------------------------------------------------------------------*/ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEntry, const SfxItemSet& rSet, Any& rAny ) const throw(RuntimeException) @@ -256,9 +225,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn rAny.setValue( &nTmp, *rEntry.pType ); } } -/* -----------------------------06.06.01 12:32-------------------------------- - ---------------------------------------------------------------------------*/ void SfxItemPropertySet::getPropertyValue( const rtl::OUString &rName, const SfxItemSet& rSet, Any& rAny ) const throw(RuntimeException, UnknownPropertyException) @@ -269,9 +236,7 @@ void SfxItemPropertySet::getPropertyValue( const rtl::OUString &rName, throw UnknownPropertyException(); getPropertyValue( *pEntry,rSet, rAny ); } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ Any SfxItemPropertySet::getPropertyValue( const rtl::OUString &rName, const SfxItemSet& rSet ) const throw(RuntimeException, UnknownPropertyException) @@ -280,9 +245,7 @@ Any SfxItemPropertySet::getPropertyValue( const rtl::OUString &rName, getPropertyValue( rName,rSet, aVal ); return aVal; } -/* -----------------------------15.11.00 14:46-------------------------------- - ---------------------------------------------------------------------------*/ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEntry, const Any& aVal, SfxItemSet& rSet ) const @@ -321,9 +284,7 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEn delete pNewItem; } } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ void SfxItemPropertySet::setPropertyValue( const rtl::OUString &rName, const Any& aVal, SfxItemSet& rSet ) const @@ -338,9 +299,7 @@ void SfxItemPropertySet::setPropertyValue( const rtl::OUString &rName, } setPropertyValue(*pEntry, aVal, rSet); } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ PropertyState SfxItemPropertySet::getPropertyState(const SfxItemPropertySimpleEntry& rEntry, const SfxItemSet& rSet) const throw() { @@ -382,9 +341,7 @@ PropertyState SfxItemPropertySet::getPropertyState( eRet = PropertyState_AMBIGUOUS_VALUE; return eRet; } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ Reference<XPropertySetInfo> SfxItemPropertySet::getPropertySetInfo() const { @@ -392,75 +349,57 @@ Reference<XPropertySetInfo> m_xInfo = new SfxItemPropertySetInfo( &m_aMap ); return m_xInfo; } -/*-- 16.02.2009 13:49:25--------------------------------------------------- - -----------------------------------------------------------------------*/ struct SfxItemPropertySetInfo_Impl { SfxItemPropertyMap* m_pOwnMap; }; -/*-- 16.02.2009 13:49:24--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertySetInfo::SfxItemPropertySetInfo(const SfxItemPropertyMap *pMap ) : m_pImpl( new SfxItemPropertySetInfo_Impl ) { m_pImpl->m_pOwnMap = new SfxItemPropertyMap( pMap ); } -/*-- 16.02.2009 13:49:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertySetInfo::SfxItemPropertySetInfo(const SfxItemPropertyMapEntry *pEntries ) : m_pImpl( new SfxItemPropertySetInfo_Impl ) { m_pImpl->m_pOwnMap = new SfxItemPropertyMap( pEntries ); } -/* -----------------------------21.02.00 11:09-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< Property > SAL_CALL SfxItemPropertySetInfo::getProperties( ) throw(RuntimeException) { return m_pImpl->m_pOwnMap->getProperties(); } -/*-- 16.02.2009 13:49:27--------------------------------------------------- - -----------------------------------------------------------------------*/ const SfxItemPropertyMap* SfxItemPropertySetInfo::getMap() const { return m_pImpl->m_pOwnMap; } -/*-- 16.02.2009 12:43:36--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertySetInfo::~SfxItemPropertySetInfo() { delete m_pImpl->m_pOwnMap; delete m_pImpl; } -/* -----------------------------21.02.00 11:27-------------------------------- - ---------------------------------------------------------------------------*/ Property SAL_CALL SfxItemPropertySetInfo::getPropertyByName( const ::rtl::OUString& rName ) throw(UnknownPropertyException, RuntimeException) { return m_pImpl->m_pOwnMap->getPropertyByName( rName ); } -/* -----------------------------21.02.00 11:28-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SAL_CALL SfxItemPropertySetInfo::hasPropertyByName( const ::rtl::OUString& rName ) throw(RuntimeException) { return m_pImpl->m_pOwnMap->hasPropertyByName( rName ); } -/* -----------------------------21.02.00 12:03-------------------------------- - ---------------------------------------------------------------------------*/ SfxExtItemPropertySetInfo::SfxExtItemPropertySetInfo( const SfxItemPropertyMapEntry *pMap, const Sequence<Property>& rPropSeq ) : @@ -468,32 +407,24 @@ SfxExtItemPropertySetInfo::SfxExtItemPropertySetInfo( { aExtMap.mergeProperties( rPropSeq ); } -/*-- 16.02.2009 12:06:49--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxExtItemPropertySetInfo::~SfxExtItemPropertySetInfo() { } -/* -----------------------------21.02.00 12:03-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< Property > SAL_CALL SfxExtItemPropertySetInfo::getProperties( ) throw(RuntimeException) { return aExtMap.getProperties(); } -/* -----------------------------21.02.00 12:03-------------------------------- - ---------------------------------------------------------------------------*/ Property SAL_CALL SfxExtItemPropertySetInfo::getPropertyByName( const rtl::OUString& rPropertyName ) throw(UnknownPropertyException, RuntimeException) { return aExtMap.getPropertyByName( rPropertyName ); } -/* -----------------------------21.02.00 12:03-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SAL_CALL SfxExtItemPropertySetInfo::hasPropertyByName( const rtl::OUString& rPropertyName ) throw(RuntimeException) @@ -501,3 +432,4 @@ SfxExtItemPropertySetInfo::hasPropertyByName( const rtl::OUString& rPropertyName return aExtMap.hasPropertyByName( rPropertyName ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 250e7f99a6ec..147d90b0ea09 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.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. @@ -30,10 +31,7 @@ #include <string.h> -#if STLPORT_VERSION>=321 #include <cstdarg> -#endif - #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS @@ -51,7 +49,7 @@ // STATIC DATA ----------------------------------------------------------- static const sal_uInt16 nInitCount = 10; // einzelne USHORTs => 5 Paare ohne '0' -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 static sal_uLong nRangesCopyCount = 0; // wie oft wurden Ranges kopiert #endif @@ -235,7 +233,9 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, void SfxItemSet::InitRanges_Impl(const sal_uInt16 *pWhichPairTable) { DBG_CHKTHIS(SfxItemSet, 0); - DBG_TRACE1("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); + #if OSL_DEBUG_LEVEL > 1 + OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); + #endif sal_uInt16 nCnt = 0; const sal_uInt16* pPtr = pWhichPairTable; @@ -315,7 +315,9 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ): *ppDst = &_pPool->Put( **ppSrc ); // dann noch die Which Ranges kopieren - DBG_TRACE1("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); + #if OSL_DEBUG_LEVEL > 1 + OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); + #endif std::ptrdiff_t cnt = pPtr - rASet._pWhichRanges+1; _pWhichRanges = new sal_uInt16[ cnt ]; memcpy( _pWhichRanges, rASet._pWhichRanges, sizeof( sal_uInt16 ) * cnt); @@ -726,7 +728,7 @@ void SfxItemSet::PutExtended break; default: - DBG_ERROR( "invalid Argument for eDontCareAs" ); + OSL_FAIL( "invalid Argument for eDontCareAs" ); } } else @@ -751,7 +753,7 @@ void SfxItemSet::PutExtended break; default: - DBG_ERROR( "invalid Argument for eDefaultAs" ); + OSL_FAIL( "invalid Argument for eDefaultAs" ); } } pPtr += 2; @@ -973,7 +975,7 @@ const SfxPoolItem* SfxItemSet::GetItem return pItem; // sonst Fehler melden - DBG_ERROR( "invalid argument type" ); + OSL_FAIL( "invalid argument type" ); } // kein Item gefunden oder falschen Typ gefunden @@ -1498,7 +1500,7 @@ sal_uInt16 SfxItemSet::GetWhichByPos( sal_uInt16 nPos ) const SvStream &SfxItemSet::Store ( SvStream& rStream, // Zielstream f"ur normale Items - FASTBOOL bDirect // sal_True: Items direkt speicher, sal_False: Surrogate + bool bDirect // TRUE: Items direkt speicher, FALSE: Surrogate ) const /* [Beschreibung] @@ -1565,7 +1567,7 @@ SvStream &SfxItemSet::Load ( SvStream& rStream, // Stream, aus dem geladen werden soll - FASTBOOL bDirect, /* sal_True + bool bDirect, /* TRUE Items werden direkt aus dem Stream gelesen, nicht "uber Surrogate @@ -1874,12 +1876,12 @@ static SfxItemArray AddItem_Impl(SfxItemArray pItems, sal_uInt16 nOldSize, sal_u { // alte Items vor nPos kopieren if ( nPos ) - memcpy( (void*) pNew, pItems, nPos * sizeof(SfxPoolItem **) ); + memcpy( (void*) pNew, pItems, nPos * sizeof(SfxPoolItem *) ); // alte Items hinter nPos kopieren if ( nPos < nOldSize ) memcpy( (void*) (pNew + nPos + 1), pItems + nPos, - (nOldSize-nPos) * sizeof(SfxPoolItem **) ); + (nOldSize-nPos) * sizeof(SfxPoolItem *) ); } // neues Item initialisieren @@ -2039,73 +2041,6 @@ void SfxItemSet::DisableItem(sal_uInt16 nWhich) // ----------------------------------------------------------------------- -#if 0 -sal_Bool SfxAllItemSet::Remove(sal_uInt16 nWhich) -{ - DBG_CHKTHIS(SfxAllItemSet, 0); - sal_uInt16 *pPtr = _pWhichRanges; - sal_uInt16 nPos = 0; - while( *pPtr ) - { - if( *pPtr <= nWhich && nWhich <= *(pPtr+1) ) - { - sal_uInt16 *pTmp = pPtr; - sal_uInt16 nLeft = 0; - sal_uInt16 nRest = 0; - while(*++pTmp){ - if( nLeft & 1 ) - nRest = *pTmp - *(pTmp-1) + 1; - ++nLeft; - } - - // in diesem Bereich - nPos += nWhich - *pPtr; - nRest -= nWhich - *pPtr; - // 3,3 - if(*pPtr == nWhich && *(pPtr+1) == nWhich) { - memmove(pPtr, pPtr + 2, nLeft * sizeof(sal_uInt16)); - nFree += 2; - } - // Anfang - else if(*pPtr == nWhich) - (*pPtr)++; - // Ende - else if(*(pPtr+1) == nWhich) - (*(pPtr+1))--; - else { - if(nPos + nRest + 2 > nFree) { - sal_uInt16 nOf = pPtr - _pWhichRanges; - _pWhichRanges = IncrSize(_pWhichRanges, nPos + nRest, nInitCount); - nFree += nInitCount; - pPtr = _pWhichRanges + nOf; - } - memmove(pPtr +2, pPtr, (nLeft+2) * sizeof(sal_uInt16)); - *++pPtr = nWhich-1; - *++pPtr = nWhich+1; - nFree -= 2; - } - SfxPoolItem* pItem = *( _aItems + nPos ); - if( pItem ) - { - if(_pPool) - _pPool->Remove(*pItem ); - else - delete pItem; - --_nCount; - } - memmove(_aItems + nPos +1, _aItems + nPos, - sizeof(SfxPoolItem *) * (nRest - 1)); - break; // dann beim Parent suchen - } - nPos += *(pPtr+1) - *pPtr + 1; - pPtr += 2; - } - return *pPtr? sal_True: sal_False; -} -#endif - -// ----------------------------------------------------------------------- - SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const { DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet); @@ -2120,3 +2055,4 @@ SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const return bItems ? new SfxAllItemSet(*this) : new SfxAllItemSet(*_pPool); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx index 433bfeec1e8e..872420a35322 100644 --- a/svl/source/items/lckbitem.cxx +++ b/svl/source/items/lckbitem.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. @@ -137,7 +138,7 @@ SvStream& SfxLockBytesItem::Store(SvStream &rStream, sal_uInt16 ) const //---------------------------------------------------------------------------- // virtual -sal_Bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Sequence< sal_Int8 > aSeq; if ( rVal >>= aSeq ) @@ -153,16 +154,16 @@ sal_Bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_u else _xVal = NULL; - return sal_True; + return true; } - DBG_ERROR( "SfxLockBytesItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxLockBytesItem::PutValue - Wrong type!" ); + return true; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const +bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { if ( _xVal.Is() ) { @@ -172,7 +173,7 @@ sal_Bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 if ( _xVal->Stat( &aStat, SVSTATFLAG_DEFAULT ) == ERRCODE_NONE ) nLen = aStat.nSize; else - return sal_False; + return false; sal_uLong nRead = 0; com::sun::star::uno::Sequence< sal_Int8 > aSeq( nLen ); @@ -186,6 +187,7 @@ sal_Bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 rVal <<= aSeq; } - return sal_True; + return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index 1cd7e194d266..b9c6ddc79cec 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.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. @@ -29,9 +30,6 @@ #include "precompiled_svl.hxx" #include <tools/stream.hxx> -#ifndef GCC -#endif - #include <svl/macitem.hxx> // STATIC DATA ----------------------------------------------------------- @@ -293,3 +291,4 @@ sal_uInt16 SvxMacroItem::GetVersion( sal_uInt16 nFileFormatVersion ) const ? 0 : aMacroTable.GetVersion(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx index 3684a748db14..db0dc169c9dc 100644 --- a/svl/source/items/nranges.cxx +++ b/svl/source/items/nranges.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. @@ -575,7 +576,7 @@ SfxNumRanges& SfxNumRanges::operator -= } // we should never be here - DBG_ERROR( "SfxNumRanges::operator-=: internal error" ); + OSL_FAIL( "SfxNumRanges::operator-=: internal error" ); } // while pTarget[ nTargetPos ] = 0; @@ -594,64 +595,6 @@ SfxNumRanges& SfxNumRanges::operator -= delete [] pTarget; return *this; - - /* untested code from MI commented out (MDA, 28.01.97) - do - { - // 1st range is smaller than 2nd range? - if ( pRange1[1] < pRange2[0] ) - // => keep 1st range - pRange1 += 2; - - // 2nd range is smaller than 1st range? - else if ( pRange2[1] < pRange1[0] ) - // => skip 2nd range - pRange2 += 2; - - // 2nd range totally overlaps the 1st range? - else if ( pRange2[0] <= pRange1[0] && pRange2[1] >= pRange1[1] ) - // => remove 1st range - memmove( pRange1, pRange1+2, sizeof(NUMTYPE) * (pEndOfTarget-pRange1+2) ); - - // 2nd range overlaps only the beginning of 1st range? - else if ( pRange2[0] <= pRange1[0] && pRange2[1] < pRange1[1] ) - { - // => cut the beginning of 1st range and goto next 2nd range - pRange1[0] = pRange2[1] + 1; - pRange2 += 2; - } - - // 2nd range overlaps only the end of 1st range? - else if ( pRange2[0] > pRange1[0] && pRange2[1] >= pRange1[0] ) - // => cut the beginning of 1st range - pRange1[0] = pRange2[1]+1; - - // 2nd range is a real subset of 1st range - else - { - // => split 1st range and goto next 2nd range - memmove( pRange1+3, pRange1+1, sizeof(NUMTYPE) * (pEndOfTarget-pRange1-1) ); - pRange1[1] = pRange2[0] - 1; - pRange1[2] = pRange2[1] + 1; - pRange1 += 2; - pRange2 += 2; - } - } - while ( *pRange1 && *pRange2 ); - - // assign the differentiated ranges - delete[] _pRanges; - NUMTYPE nUShorts = Count_Impl(pTarget) + 1; - if ( 1 != nUShorts ) - { - _pRanges = new NUMTYPE[ nUShorts ]; - memcpy( _pRanges, pTarget, nUShorts * sizeof(NUMTYPE) ); - _pRanges[ nUShorts-1 ] = 0; - } - else - _pRanges = 0; - return *this; - */ } //------------------------------------------------------------------------ @@ -848,3 +791,5 @@ sal_Bool SfxNumRanges::Contains( NUMTYPE n ) const return sal_False; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx index 6e13a3b77485..9a2b109682b5 100644 --- a/svl/source/items/poolcach.cxx +++ b/svl/source/items/poolcach.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. @@ -30,9 +31,6 @@ #include <limits.h> -#ifndef GCC -#endif - #include <svl/itempool.hxx> #include <svl/itemset.hxx> #include <svl/poolcach.hxx> @@ -142,3 +140,4 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, sal_Bo +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index ec55ba09195c..d75560f5a26d 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.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,9 +32,6 @@ #include <string.h> #include <stdio.h> -#ifndef GCC -#endif - #include <tools/solar.h> #include <svl/itempool.hxx> #include "whassert.hxx" @@ -202,8 +200,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const SfxMultiMixRecordWriter aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS, 0 ); // erst Atomaren-Items und dann die Sets schreiben (wichtig beim Laden) - for ( pImp->bInSetItem = sal_False; pImp->bInSetItem <= sal_True && !rStream.GetError(); ++pImp->bInSetItem ) + for (int ft = 0 ; ft < 2 && !rStream.GetError(); ft++) { + pImp->bInSetItem = ft != 0; + SfxPoolItemArray_Impl **pArr = pImp->ppPoolItems; SfxPoolItem **ppDefItem = ppStaticDefaults; const sal_uInt16 nSize = GetSize_Impl(); @@ -274,7 +274,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const } } - pImp->bInSetItem = sal_False; + pImp->bInSetItem = false; } // die gesetzten Defaults speichern (Pool-Defaults) @@ -404,7 +404,7 @@ void SfxItemPool::readTheItems ( nLastSurrogate = nSurrogate; // Ref-Count und Item laden - sal_uInt16 nRef; + sal_uInt16 nRef(0); rStream >> nRef; pItem = pDefItem->Create(rStream, nVersion); @@ -607,7 +607,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) for ( sal_uInt16 nVerNo = 0; aVerRec.GetContent(); ++nVerNo ) { // Header f"ur einzelne Version einlesen - sal_uInt16 nVersion, nHStart, nHEnd; + sal_uInt16 nVersion(0), nHStart(0), nHEnd(0); rStream >> nVersion >> nHStart >> nHEnd; sal_uInt16 nCount = nHEnd - nHStart + 1; @@ -616,6 +616,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) { // Add new Version sal_uInt16 *pMap = new sal_uInt16[nCount]; + memset(pMap, 0, nCount * sizeof(sal_uInt16)); for ( sal_uInt16 n = 0; n < nCount; ++n ) rStream >> pMap[n]; SetVersionMap( nVersion, nHStart, nHEnd, pMap ); @@ -625,15 +626,15 @@ SvStream &SfxItemPool::Load(SvStream &rStream) } // Items laden - FASTBOOL bSecondaryLoaded = sal_False; + bool bSecondaryLoaded = false; long nSecondaryEnd = 0; { SfxMultiRecordReader aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS); while ( aWhichIdsRec.GetContent() ) { // SlotId, Which-Id und Item-Version besorgen - sal_uInt32 nCount; - sal_uInt16 nVersion, nWhich; + sal_uInt32 nCount(0); + sal_uInt16 nVersion(0), nWhich(0); //!sal_uInt16 nSlotId = aWhichIdsRec.GetContentTag(); rStream >> nWhich; if ( pImp->nLoadingVersion != pImp->nVersion ) @@ -665,7 +666,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) // Sekund"arpool einlesen pSecondary->Load( rStream ); - bSecondaryLoaded = sal_True; + bSecondaryLoaded = true; nSecondaryEnd = rStream.Tell(); // zur"uck zu unseren eigenen Items @@ -686,7 +687,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) while ( aDefsRec.GetContent() ) { // SlotId, Which-Id und Item-Version besorgen - sal_uInt16 nVersion, nWhich; + sal_uInt16 nVersion(0), nWhich(0); //!sal_uInt16 nSlotId = aDefsRec.GetContentTag(); rStream >> nWhich; if ( pImp->nLoadingVersion != pImp->nVersion ) @@ -739,7 +740,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_STARTPOOL_4 ); rStream >> pImp->nMajorVer >> pImp->nMinorVer; } - sal_uInt32 nAttribSize; + sal_uInt32 nAttribSize(0); int bOwnPool = sal_True; UniString aExternName; if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 2 ) @@ -772,7 +773,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) sal_uLong nStartPos = rStream.Tell(); rStream.SeekRel( nAttribSize ); CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_SIZES ); - sal_uInt32 nSizeTableLen; + sal_uInt32 nSizeTableLen(0); rStream >> nSizeTableLen; sal_Char *pBuf = new sal_Char[nSizeTableLen]; rStream.Read( pBuf, nSizeTableLen ); @@ -784,18 +785,18 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) { // Version-Map finden (letztes sal_uLong der Size-Table gibt Pos an) rStream.Seek( nEndOfSizes - sizeof(sal_uInt32) ); - sal_uInt32 nVersionMapPos; + sal_uInt32 nVersionMapPos(0); rStream >> nVersionMapPos; rStream.Seek( nVersionMapPos ); // Versions-Maps einlesen CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_VERSIONMAP ); - sal_uInt16 nVerCount; + sal_uInt16 nVerCount(0); rStream >> nVerCount; for ( sal_uInt16 nVerNo = 0; nVerNo < nVerCount; ++nVerNo ) { // Header f"ur einzelne Version einlesen - sal_uInt16 nVersion, nHStart, nHEnd; + sal_uInt16 nVersion(0), nHStart(0), nHEnd(0); rStream >> nVersion >> nHStart >> nHEnd; sal_uInt16 nCount = nHEnd - nHStart + 1; sal_uInt16 nBytes = (nCount)*sizeof(sal_uInt16); @@ -805,6 +806,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) { // Add new Version sal_uInt16 *pMap = new sal_uInt16[nCount]; + memset(pMap, 0, nCount * sizeof(sal_uInt16)); for ( sal_uInt16 n = 0; n < nCount; ++n ) rStream >> pMap[n]; SetVersionMap( nVersion, nHStart, nHEnd, pMap ); @@ -818,9 +820,9 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) // Items laden rStream.Seek( nStartPos ); CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_ITEMS ); - FASTBOOL bSecondaryLoaded = sal_False; + bool bSecondaryLoaded = false; long nSecondaryEnd = 0; - sal_uInt16 nWhich, nSlot; + sal_uInt16 nWhich(0), nSlot(0); while ( rStream >> nWhich, nWhich ) { // ggf. Which-Id aus alter Version verschieben? @@ -831,8 +833,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) sal_uInt16 nMappedWhich = GetWhich(nSlot, sal_False); int bKnownItem = bOwnPool || IsWhich(nMappedWhich); - sal_uInt16 nRef, nCount, nVersion; - sal_uInt32 nAttrSize; + sal_uInt16 nRef(0), nCount(0), nVersion(0); + sal_uInt32 nAttrSize(0); rStream >> nVersion >> nCount; SfxPoolItemArray_Impl **ppArr = 0; @@ -867,7 +869,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) // Sekund"arpool einlesen pSecondary->Load1_Impl( rStream ); - bSecondaryLoaded = sal_True; + bSecondaryLoaded = true; nSecondaryEnd = rStream.Tell(); // zur"uck zu unseren eigenen Items @@ -981,8 +983,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) int bKnownItem = bOwnPool || IsWhich(nMappedWhich); sal_uLong nPos = nLastPos; - sal_uInt32 nSize; - sal_uInt16 nVersion; + sal_uInt32 nSize(0); + sal_uInt16 nVersion(0); rStream >> nVersion; if ( bKnownItem ) @@ -1072,7 +1074,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate { // Read the first surrogate - sal_uInt32 nSurrogat; + sal_uInt32 nSurrogat(0); rStream >> nSurrogat; // Is item stored directly? @@ -1090,7 +1092,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate // auf jeden Fall aufgel"ost werden. if ( !pRefPool ) pRefPool = this; - FASTBOOL bResolvable = pRefPool->GetName().Len() > 0; + bool bResolvable = pRefPool->GetName().Len() > 0; if ( !bResolvable ) { // Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId @@ -1125,7 +1127,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate : 0; if ( !pItem ) { - DBG_ERROR( "can't resolve surrogate" ); + OSL_FAIL( "can't resolve surrogate" ); rWhich = 0; // nur zur Sicherheit fuer richtige Stream-Pos return 0; } @@ -1153,7 +1155,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::StoreSurrogate +bool SfxItemPool::StoreSurrogate ( SvStream& rStream, const SfxPoolItem* pItem @@ -1166,7 +1168,7 @@ FASTBOOL SfxItemPool::StoreSurrogate [R"uckgabewert] - FASTBOOL sal_True + bool TRUE es wurde ein echtes Surrogat gespeichert, auch SFX_ITEMS_NULL bei 'pItem==0', SFX_ITEMS_STATICDEFAULT und SFX_ITEMS_POOLDEFAULT @@ -1181,7 +1183,7 @@ FASTBOOL SfxItemPool::StoreSurrogate { if ( pItem ) { - FASTBOOL bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); + bool bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); rStream << ( bRealSurrogate ? GetSurrogate( pItem ) : SFX_ITEMS_DIRECT ); @@ -1227,7 +1229,7 @@ sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const +bool SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const { return nWhich >= pImp->nStoringStart && nWhich <= pImp->nStoringEnd; @@ -1444,14 +1446,14 @@ sal_uInt16 SfxItemPool::GetNewWhich // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const +bool SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const { return nWhich >= pImp->nVerStart && nWhich <= pImp->nVerEnd; } // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsCurrentVersionLoading() const +bool SfxItemPool::IsCurrentVersionLoading() const /* [Beschreibung] @@ -1542,7 +1544,7 @@ sal_uInt16 SfxItemPool::GetLoadingVersion() const //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsVer2_Impl() const +bool SfxItemPool::IsVer2_Impl() const { return pMaster->pImp->nMajorVer >= 2; } @@ -1550,8 +1552,8 @@ FASTBOOL SfxItemPool::IsVer2_Impl() const //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, - FASTBOOL bDirect ) const +bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, + bool bDirect ) const /* [Beschreibung] @@ -1576,7 +1578,7 @@ FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, [Querverweise] - <SfxItemPool::LoadItem(SvStream&,FASTBOOL)const> + <SfxItemPool::LoadItem(SvStream&,bool)const> */ { @@ -1616,13 +1618,13 @@ FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, //------------------------------------------------------------------------- -const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, +const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, const SfxItemPool *pRefPool ) // pRefPool==-1 => nicht putten! { - sal_uInt16 nWhich, nSlot; // nSurrogate; + sal_uInt16 nWhich(0), nSlot(0); // nSurrogate; rStream >> nWhich >> nSlot; sal_Bool bDontPut = (SfxItemPool*)-1 == pRefPool; @@ -1637,8 +1639,8 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, else { // WID in der Version nicht vorhanden => ueberspringen - sal_uInt32 nSurro; - sal_uInt16 nVersion, nLen; + sal_uInt32 nSurro(0); + sal_uInt16 nVersion(0), nLen(0); rStream >> nSurro; if ( SFX_ITEMS_DIRECT == nSurro ) { @@ -1650,7 +1652,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, } // wird eine andere Version geladen? - FASTBOOL bCurVersion = pRefPool->IsCurrentVersionLoading(); + bool bCurVersion = pRefPool->IsCurrentVersionLoading(); if ( !bCurVersion ) // Which-Id auf neue Version mappen nWhich = pRefPool->GetNewWhich( nWhich ); @@ -1676,8 +1678,8 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, if ( bDirect || ( nWhich && !pItem ) ) { // bDirekt bzw. nicht IsPoolable() => Item direkt laden - sal_uInt16 nVersion; - sal_uInt32 nLen; + sal_uInt16 nVersion(0); + sal_uInt32 nLen(0); rStream >> nVersion >> nLen; sal_uLong nIStart = rStream.Tell(); @@ -1711,3 +1713,4 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index 8626daeffbd5..ec2909fbd9ad 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.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. @@ -360,75 +361,6 @@ SfxPoolItem* SfxVoidItem::Clone(SfxItemPool *) const } // SfxInvalidItem --------------------------------------------------------- -#if 0 /* @@@ NOT USED @@@ */ -SfxInvalidItem::SfxInvalidItem( sal_uInt16 nWhich, const SfxPoolItem &rDefault ): - SfxPoolItem(nWhich), - pDefaultItem(&rDefault) -{ - DBG_CTOR(SfxInvalidItem, 0); -} - -// ------------------------------------------------------------------------ -SfxInvalidItem::SfxInvalidItem( const SfxInvalidItem& rCopy): - SfxPoolItem(rCopy), - pDefaultItem(rCopy.pDefaultItem) -{ - DBG_CTOR(SfxInvalidItem, 0); - //! pDefaultItem->ReleaseRef? -} - -// ------------------------------------------------------------------------ -SfxInvalidItem::~SfxInvalidItem() -{ - DBG_DTOR(SfxInvalidItem, 0); -} - -// ------------------------------------------------------------------------ -int SfxInvalidItem::operator==( const SfxPoolItem& rCmp) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - DBG_ASSERT( SfxPoolItem::operator==(rCmp), "unequal type" ); - return *pDefaultItem == *((SfxInvalidItem&)rCmp).pDefaultItem; -} - -// ------------------------------------------------------------------------ -SfxItemPresentation SfxInvalidItem::GetPresentation -( - SfxItemPresentation ePresentation, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresentationMetric, - XubString& rText, - const IntlWrapper * -) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - rText.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Invalid")); - return SFX_ITEM_PRESENTATION_NAMELESS; -} - -// ------------------------------------------------------------------------ -SfxPoolItem* SfxInvalidItem::Clone(SfxItemPool *) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - return new SfxInvalidItem(*this); -} - -// ------------------------------------------------------------------------ -SfxPoolItem* SfxInvalidItem::Create(SvStream &, sal_uInt16 nVersion) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - DBG_ERROR("SfxInvalidItem::Create() ist sinnlos"); - return Clone(); -} - -// ------------------------------------------------------------------------ -SvStream& SfxInvalidItem::Store(SvStream &rStream, sal_uInt16 nItemVersion ) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - DBG_ERROR("SfxInvalidItem::Store() ist sinnlos"); - return rStream; -} -#endif /* @@@ NOT USED @@@ */ // SfxItemHandle ---------------------------------------------------------- SfxItemHandle::SfxItemHandle(SfxPoolItem &rItem): @@ -477,48 +409,36 @@ SfxItemHandle::~SfxItemHandle() } // ------------------------------------------------------------------------ -int SfxPoolItem::ScaleMetrics( long /*lMult*/, long /*lDiv*/ ) +bool SfxPoolItem::ScaleMetrics( long /*lMult*/, long /*lDiv*/ ) { - return 0; + return false; } // ------------------------------------------------------------------------ -int SfxPoolItem::HasMetrics() const +bool SfxPoolItem::HasMetrics() const { - return 0; + return false; } // ----------------------------------------------------------------------- -#if 0 /* @@@ NOT USED @@@ */ -void SfxPoolItem::GetVersion() const -{ - DBG_ERROR( "dummy called" ); -} -// ----------------------------------------------------------------------- -void SfxPoolItem::Store(SvStream &rStream) const +bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8 ) const { - DBG_ERROR( "dummy called" ); + OSL_FAIL("There is no implementation for QueryValue for this item!"); + return false; } -#endif /* @@@ NOT USED @@@ */ // ----------------------------------------------------------------------- -sal_Bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8 ) const +bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8 ) { - DBG_ERROR("There is no implementation for QueryValue for this item!"); - return sal_False; -} - -// ----------------------------------------------------------------------- - -sal_Bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8 ) -{ - DBG_ERROR("There is no implementation for PutValue for this item!"); - return sal_False; + OSL_FAIL("There is no implementation for PutValue for this item!"); + return false; } SfxVoidItem::~SfxVoidItem() { DBG_DTOR(SfxVoidItem, 0); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx index cd557312932c..e3d3ad5fdc1a 100644 --- a/svl/source/items/ptitem.cxx +++ b/svl/source/items/ptitem.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. @@ -139,7 +140,7 @@ SvStream& SfxPointItem::Store(SvStream &rStream, sal_uInt16 ) const // ----------------------------------------------------------------------- -sal_Bool SfxPointItem::QueryValue( uno::Any& rVal, +bool SfxPointItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); @@ -155,20 +156,20 @@ sal_Bool SfxPointItem::QueryValue( uno::Any& rVal, case 0: rVal <<= aTmp; break; case MID_X: rVal <<= aTmp.X; break; case MID_Y: rVal <<= aTmp.Y; break; - default: DBG_ERROR("Wrong MemberId!"); return sal_False; + default: OSL_FAIL("Wrong MemberId!"); return true; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SfxPointItem::PutValue( const uno::Any& rVal, +bool SfxPointItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = sal_False; + bool bRet = false; awt::Point aValue; sal_Int32 nVal = 0; if ( !nMemberId ) @@ -194,7 +195,7 @@ sal_Bool SfxPointItem::PutValue( const uno::Any& rVal, case 0: aVal.setX( aValue.X ); aVal.setY( aValue.Y ); break; case MID_X: aVal.setX( nVal ); break; case MID_Y: aVal.setY( nVal ); break; - default: DBG_ERROR("Wrong MemberId!"); return sal_False; + default: OSL_FAIL("Wrong MemberId!"); return false; } } @@ -203,3 +204,4 @@ sal_Bool SfxPointItem::PutValue( const uno::Any& rVal, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx index 7aae8caceac5..ddf19201e63b 100644 --- a/svl/source/items/rectitem.cxx +++ b/svl/source/items/rectitem.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. @@ -139,7 +140,7 @@ SvStream& SfxRectangleItem::Store(SvStream &rStream, sal_uInt16 ) const // ----------------------------------------------------------------------- -sal_Bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, +bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId) const { nMemberId &= ~CONVERT_TWIPS; @@ -157,17 +158,17 @@ sal_Bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, case MID_RECT_RIGHT: rVal <<= aVal.getY(); break; case MID_WIDTH: rVal <<= aVal.getWidth(); break; case MID_HEIGHT: rVal <<= aVal.getHeight(); break; - default: DBG_ERROR("Wrong MemberID!"); return sal_False; + default: OSL_FAIL("Wrong MemberID!"); return false; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, +bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bRet = sal_False; + bool bRet = false; nMemberId &= ~CONVERT_TWIPS; com::sun::star::awt::Rectangle aValue; sal_Int32 nVal = 0; @@ -190,7 +191,7 @@ sal_Bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, case MID_RECT_RIGHT: aVal.setY( nVal ); break; case MID_WIDTH: aVal.setWidth( nVal ); break; case MID_HEIGHT: aVal.setHeight( nVal ); break; - default: DBG_ERROR("Wrong MemberID!"); return sal_False; + default: OSL_FAIL("Wrong MemberID!"); return false; } } @@ -199,3 +200,4 @@ sal_Bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx index 2bb4fb4236c9..6be0975f8535 100644 --- a/svl/source/items/rngitem.cxx +++ b/svl/source/items/rngitem.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. @@ -52,3 +53,4 @@ #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/rngitem_inc.cxx b/svl/source/items/rngitem_inc.cxx index a9d68980ec6a..5be6228f147f 100755..100644 --- a/svl/source/items/rngitem_inc.cxx +++ b/svl/source/items/rngitem_inc.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. @@ -238,3 +239,5 @@ SvStream& SfxXRangesItem::Store( SvStream &rStream, sal_uInt16 ) const #undef NUMTYPE #undef SfxXRangeItem #undef SfxXRangesItem + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/sfontitm.cxx b/svl/source/items/sfontitm.cxx index f22c1cb7c26a..61afc8a2004a 100644 --- a/svl/source/items/sfontitm.cxx +++ b/svl/source/items/sfontitm.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. @@ -137,3 +138,4 @@ SvStream & SfxFontItem::Store(SvStream & rStream, sal_uInt16) const return rStream; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/sitem.cxx b/svl/source/items/sitem.cxx index 7f990aec36d3..a077a6f5380f 100644 --- a/svl/source/items/sitem.cxx +++ b/svl/source/items/sitem.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,10 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -// INCLUDE --------------------------------------------------------------- - -#ifndef GCC -#endif #include <tools/string.hxx> #include <tools/stream.hxx> @@ -111,3 +108,4 @@ SvStream& SfxSetItem::Store(SvStream& rStream, sal_uInt16) const return rStream; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx index be214cccf599..74239d48546e 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.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. @@ -46,11 +47,11 @@ class SfxImpStringList { public: sal_uInt16 nRefCount; - List aList; + std::vector<String> aList; SfxImpStringList() { nRefCount = 1; } ~SfxImpStringList(); - void Sort( sal_Bool bAscending, List* ); + void Sort( sal_Bool bAscending); }; //------------------------------------------------------------------------ @@ -58,21 +59,14 @@ public: SfxImpStringList::~SfxImpStringList() { DBG_ASSERT(nRefCount!=0xffff,"ImpList already deleted"); - String* pStr = (String*)aList.First(); - while( pStr ) - { - delete pStr; - pStr = (String*)aList.Next(); - } nRefCount = 0xffff; } //------------------------------------------------------------------------ -void SfxImpStringList::Sort( sal_Bool bAscending, List* pParallelList ) +void SfxImpStringList::Sort( sal_Bool bAscending) { - DBG_ASSERT(!pParallelList || pParallelList->Count() >= aList.Count(),"Sort:ParallelList too small"); - sal_uLong nCount = aList.Count(); + sal_uLong nCount = aList.size(); if( nCount > 1 ) { nCount -= 2; @@ -83,10 +77,10 @@ void SfxImpStringList::Sort( sal_Bool bAscending, List* pParallelList ) bSwapped = sal_False; for( sal_uLong nCur = 0; nCur <= nCount; nCur++ ) { - String* pStr1 = (String*)aList.GetObject( nCur ); - String* pStr2 = (String*)aList.GetObject( nCur+1 ); + String aStr1 = aList[nCur]; + String aStr2 = aList[nCur+1]; // COMPARE_GREATER => pStr2 ist groesser als pStr1 - StringCompare eCompare = pStr1->CompareIgnoreCaseToAscii( *pStr2 ); //@@@ + StringCompare eCompare = aStr1.CompareIgnoreCaseToAscii( aStr2 ); //@@@ sal_Bool bSwap = sal_False; if( bAscending ) { @@ -99,15 +93,8 @@ void SfxImpStringList::Sort( sal_Bool bAscending, List* pParallelList ) if( bSwap ) { bSwapped = sal_True; - aList.Replace( pStr1, nCur + 1 ); - aList.Replace( pStr2, nCur ); - if( pParallelList ) - { - void* p1 = pParallelList->GetObject( nCur ); - void* p2 = pParallelList->GetObject( nCur + 1 ); - pParallelList->Replace( p1, nCur + 1 ); - pParallelList->Replace( p2, nCur ); - } + aList[nCur+1] = aStr1; + aList[nCur] = aStr2; } } } @@ -123,7 +110,7 @@ SfxStringListItem::SfxStringListItem() : //------------------------------------------------------------------------ -SfxStringListItem::SfxStringListItem( sal_uInt16 which, const List* pList ) : +SfxStringListItem::SfxStringListItem( sal_uInt16 which, const std::vector<String>* pList ) : SfxPoolItem( which ), pImp(NULL) { @@ -133,14 +120,8 @@ SfxStringListItem::SfxStringListItem( sal_uInt16 which, const List* pList ) : { pImp = new SfxImpStringList; - long i, nCount = pList->Count(); - String *pStr1, *pStr2; - for( i=0; i < nCount; i++ ) - { - pStr1 = (String*)pList->GetObject(i); - pStr2 = new String( *pStr1 ); - pImp->aList.Insert( pStr2, LIST_APPEND ); - } + if (pImp) + pImp->aList = *pList; } } @@ -156,13 +137,15 @@ SfxStringListItem::SfxStringListItem( sal_uInt16 which, SvStream& rStream ) : if( nEntryCount ) pImp = new SfxImpStringList; - long i; - String* pStr; - for( i=0; i < nEntryCount; i++ ) + if (pImp) { - pStr = new String; - readByteString(rStream, *pStr); - pImp->aList.Insert( pStr, LIST_APPEND ); + long i; + String aStr; + for( i=0; i < nEntryCount; i++ ) + { + readByteString(rStream, aStr); + pImp->aList.push_back(aStr); + } } } @@ -170,10 +153,8 @@ SfxStringListItem::SfxStringListItem( sal_uInt16 which, SvStream& rStream ) : SfxStringListItem::SfxStringListItem( const SfxStringListItem& rItem ) : SfxPoolItem( rItem ), - pImp(NULL) + pImp(rItem.pImp) { - pImp = rItem.pImp; - if( pImp ) { DBG_ASSERT(pImp->nRefCount!=0xffff,"ImpList not valid"); @@ -197,12 +178,17 @@ SfxStringListItem::~SfxStringListItem() //------------------------------------------------------------------------ -List* SfxStringListItem::GetList() +std::vector<String>& SfxStringListItem::GetList() { if( !pImp ) pImp = new SfxImpStringList; DBG_ASSERT(pImp->nRefCount!=0xffff,"ImpList not valid"); - return &(pImp->aList); + return pImp->aList; +} + +const std::vector<String>& SfxStringListItem::GetList () const +{ + return SAL_CONST_CAST(SfxStringListItem *, this)->GetList(); } //------------------------------------------------------------------------ @@ -213,10 +199,7 @@ int SfxStringListItem::operator==( const SfxPoolItem& rItem ) const SfxStringListItem* pItem = (SfxStringListItem*)&rItem; - if( pImp == pItem->pImp ) - return sal_True; - else - return sal_False; + return pImp == pItem->pImp; } //------------------------------------------------------------------------ @@ -267,16 +250,11 @@ SvStream& SfxStringListItem::Store( SvStream & rStream, sal_uInt16 ) const DBG_ASSERT(pImp->nRefCount!=0xffff,"ImpList not valid"); - long nCount = pImp->aList.Count(); + sal_uInt32 nCount = pImp->aList.size(); rStream << nCount; - long i; - String* pStr; - for( i=0; i < nCount; i++ ) - { - pStr = (String*)(pImp->aList.GetObject( i )); - writeByteString(rStream, *pStr); - } + for( sal_uInt32 i=0; i < nCount; i++ ) + writeByteString(rStream, pImp->aList[i]); return rStream; } @@ -307,17 +285,15 @@ void SfxStringListItem::SetString( const XubString& rStr ) else nLen = nDelimPos - nStart; - XubString* pStr = new XubString(aStr.Copy(nStart, nLen)); // String gehoert der Liste - pImp->aList.Insert( pStr, LIST_APPEND ); + pImp->aList.push_back(aStr.Copy(nStart, nLen)); nStart += nLen + 1 ; // delimiter ueberspringen } while( nDelimPos != STRING_NOTFOUND ); // Kein Leerstring am Ende - if( pImp->aList.Last() && - !((XubString*)pImp->aList.Last())->Len() ) - delete (XubString*)pImp->aList.Remove( pImp->aList.Count()-1 ); + if (!pImp->aList.empty() && !(pImp->aList.rbegin())->Len()) + pImp->aList.pop_back(); } //------------------------------------------------------------------------ @@ -328,13 +304,17 @@ XubString SfxStringListItem::GetString() if ( pImp ) { DBG_ASSERT(pImp->nRefCount!=0xffff,"ImpList not valid"); - XubString* pStr = (XubString*)(pImp->aList.First()); - while( pStr ) + + std::vector<String>::iterator iter; + for (iter = pImp->aList.begin();;) { - aStr += *pStr; - pStr = (XubString*)(pImp->aList.Next()); - if ( pStr ) + aStr += *iter; + ++iter; + + if (iter != pImp->aList.end()) aStr += '\r'; + else + break; } } aStr.ConvertLineEnd(); @@ -354,11 +334,11 @@ int SfxStringListItem::IsPoolable() const //------------------------------------------------------------------------ -void SfxStringListItem::Sort( sal_Bool bAscending, List* pParallelList ) +void SfxStringListItem::Sort( sal_Bool bAscending) { DBG_ASSERT(GetRefCount()==0,"Sort:RefCount!=0"); if( pImp ) - pImp->Sort( bAscending, pParallelList ); + pImp->Sort( bAscending); } //---------------------------------------------------------------------------- @@ -373,42 +353,42 @@ void SfxStringListItem::SetStringList( const com::sun::star::uno::Sequence< rtl: pImp->nRefCount--; pImp = new SfxImpStringList; - for ( sal_Int32 n = 0; n < rList.getLength(); n++ ) + if (pImp) { - XubString* pStr = new XubString( rList[n] ); // String gehoert der Liste - pImp->aList.Insert( pStr, LIST_APPEND ); + for ( sal_Int32 n = 0; n < rList.getLength(); n++ ) + pImp->aList.push_back(XubString(rList[n])); } } //---------------------------------------------------------------------------- void SfxStringListItem::GetStringList( com::sun::star::uno::Sequence< rtl::OUString >& rList ) const { - long nCount = pImp->aList.Count(); + long nCount = pImp->aList.size(); rList.realloc( nCount ); for( long i=0; i < nCount; i++ ) - rList[i] = *(String*)(pImp->aList.GetObject( i )); + rList[i] = pImp->aList[i]; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal,sal_uInt8 ) +bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Sequence< rtl::OUString > aValue; if ( rVal >>= aValue ) { SetStringList( aValue ); - return sal_True; + return true; } - DBG_ERROR( "SfxStringListItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxStringListItem::PutValue - Wrong type!" ); + return false; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const +bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { // GetString() is not const!!! SfxStringListItem* pThis = const_cast< SfxStringListItem * >( this ); @@ -416,7 +396,8 @@ sal_Bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 com::sun::star::uno::Sequence< rtl::OUString > aStringList; pThis->GetStringList( aStringList ); rVal = ::com::sun::star::uno::makeAny( aStringList ); - return sal_True; + return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index 225a5b99907b..d1d0bf7483f5 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.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,6 +32,7 @@ // include --------------------------------------------------------------- #include <svl/srchitem.hxx> +#include <sal/macros.h> #include <unotools/searchopt.hxx> #include <com/sun/star/util/XReplaceable.hpp> @@ -51,7 +53,7 @@ using namespace com::sun::star::util; #define CFG_ROOT_NODE "Office.Common/SearchOptions" -#define SRCH_PARAMS 11 +#define SRCH_PARAMS 12 #define SRCH_PARA_OPTIONS "Options" #define SRCH_PARA_FAMILY "Family" #define SRCH_PARA_COMMAND "Command" @@ -59,6 +61,7 @@ using namespace com::sun::star::util; #define SRCH_PARA_APPFLAG "AppFlag" #define SRCH_PARA_ROWDIR "RowDirection" #define SRCH_PARA_ALLTABLES "AllTables" +#define SRCH_PARA_SEARCHFILTERED "SearchFiltered" #define SRCH_PARA_BACKWARD "Backward" #define SRCH_PARA_PATTERN "Pattern" #define SRCH_PARA_CONTENT "Content" @@ -96,7 +99,7 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames() "Japanese/IsIgnoreMiddleDot" // 18 }; - const int nCount = sizeof( aTranslitNames ) / sizeof( aTranslitNames[0] ); + const int nCount = SAL_N_ELEMENTS( aTranslitNames ); Sequence< ::rtl::OUString > aNames( nCount ); ::rtl::OUString* pNames = aNames.getArray(); for (sal_Int32 i = 0; i < nCount; ++i) @@ -109,7 +112,7 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames() SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : SfxPoolItem( nId ), - ConfigItem( ::rtl::OUString::createFromAscii( CFG_ROOT_NODE ) ), + ConfigItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFG_ROOT_NODE )) ), aSearchOpt ( SearchAlgorithms_ABSOLUTE, SearchFlags::LEV_RELAXED, @@ -124,6 +127,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : nAppFlag ( SVX_SEARCHAPP_WRITER ), bRowDirection ( sal_True ), bAllTables ( sal_False ), + bSearchFiltered ( sal_False ), bNotes ( sal_False), bBackward ( sal_False ), bPattern ( sal_False ), @@ -196,7 +200,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) : SfxPoolItem ( rItem ), - ConfigItem( ::rtl::OUString::createFromAscii( CFG_ROOT_NODE ) ), + ConfigItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFG_ROOT_NODE )) ), aSearchOpt ( rItem.aSearchOpt ), eFamily ( rItem.eFamily ), @@ -205,6 +209,7 @@ SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) : nAppFlag ( rItem.nAppFlag ), bRowDirection ( rItem.bRowDirection ), bAllTables ( rItem.bAllTables ), + bSearchFiltered ( rItem.bSearchFiltered ), bNotes ( rItem.bNotes), bBackward ( rItem.bBackward ), bPattern ( rItem.bPattern ), @@ -254,6 +259,7 @@ int SvxSearchItem::operator==( const SfxPoolItem& rItem ) const ( eFamily == rSItem.eFamily ) && ( bRowDirection == rSItem.bRowDirection ) && ( bAllTables == rSItem.bAllTables ) && + ( bSearchFiltered == rSItem.bSearchFiltered ) && ( nCellType == rSItem.nCellType ) && ( nAppFlag == rSItem.nAppFlag ) && ( bAsianOptions == rSItem.bAsianOptions ) && @@ -425,7 +431,7 @@ void SvxSearchItem::SetTransliterationFlags( sal_Int32 nFlags ) aSearchOpt.transliterateFlags = nFlags; } -sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const +bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -447,6 +453,8 @@ sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nM aSeq[5].Value <<= bRowDirection; aSeq[6].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_ALLTABLES )); aSeq[6].Value <<= bAllTables; + aSeq[6].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_SEARCHFILTERED )); + aSeq[6].Value <<= bSearchFiltered; aSeq[7].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_BACKWARD )); aSeq[7].Value <<= bBackward; aSeq[8].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_PATTERN )); @@ -468,6 +476,8 @@ sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nM rVal <<= (sal_Bool) bRowDirection; break; case MID_SEARCH_ALLTABLES: rVal <<= (sal_Bool) bAllTables; break; + case MID_SEARCH_SEARCHFILTERED: + rVal <<= (sal_Bool) bSearchFiltered; break; case MID_SEARCH_BACKWARD: rVal <<= (sal_Bool) bBackward; break; case MID_SEARCH_PATTERN: @@ -505,18 +515,18 @@ sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nM default: DBG_ERRORFILE( "SvxSearchItem::QueryValue(): Unknown MemberId" ); - return sal_False; + return false; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) +bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = sal_False; + bool bRet = false; sal_Int32 nInt = 0; switch ( nMemberId ) { @@ -528,12 +538,12 @@ sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt sal_Int16 nConvertedCount( 0 ); for ( sal_Int32 i = 0; i < aSeq.getLength(); ++i ) { - if ( aSeq[i].Name.equalsAscii( SRCH_PARA_OPTIONS ) ) + if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_OPTIONS ) ) ) { if ( ( aSeq[i].Value >>= aSearchOpt ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_FAMILY ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_FAMILY ) ) ) { sal_uInt16 nTemp( 0 ); if ( ( aSeq[i].Value >>= nTemp ) == sal_True ) @@ -542,47 +552,52 @@ sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt ++nConvertedCount; } } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_COMMAND ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_COMMAND ) ) ) { if ( ( aSeq[i].Value >>= nCommand ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_CELLTYPE ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_CELLTYPE ) ) ) { if ( ( aSeq[i].Value >>= nCellType ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_APPFLAG ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_APPFLAG ) ) ) { if ( ( aSeq[i].Value >>= nAppFlag ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ROWDIR ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_ROWDIR ) ) ) { if ( ( aSeq[i].Value >>= bRowDirection ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ALLTABLES ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_ALLTABLES ) ) ) { if ( ( aSeq[i].Value >>= bAllTables ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_BACKWARD ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_SEARCHFILTERED ) ) ) + { + if ( ( aSeq[i].Value >>= bSearchFiltered ) == sal_True ) + ++nConvertedCount; + } + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_BACKWARD ) ) ) { if ( ( aSeq[i].Value >>= bBackward ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_PATTERN ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_PATTERN ) ) ) { if ( ( aSeq[i].Value >>= bPattern ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_CONTENT ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_CONTENT ) ) ) { if ( ( aSeq[i].Value >>= bContent ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ASIANOPT ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_ASIANOPT ) ) ) { if ( ( aSeq[i].Value >>= bAsianOptions ) == sal_True ) ++nConvertedCount; @@ -603,6 +618,8 @@ sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt bRet = (rVal >>= bRowDirection); break; case MID_SEARCH_ALLTABLES: bRet = (rVal >>= bAllTables); break; + case MID_SEARCH_SEARCHFILTERED: + bRet = (rVal >>= bSearchFiltered); break; case MID_SEARCH_BACKWARD: bRet = (rVal >>= bBackward); break; case MID_SEARCH_PATTERN: @@ -644,10 +661,11 @@ sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt break; } default: - DBG_ERROR( "Unknown MemberId" ); + OSL_FAIL( "Unknown MemberId" ); } return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx index de2d97d23c6a..2dc013bdf5d4 100644 --- a/svl/source/items/stritem.cxx +++ b/svl/source/items/stritem.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. @@ -70,3 +71,4 @@ SfxPoolItem * SfxStringItem::Clone(SfxItemPool *) const return new SfxStringItem(*this); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 8af4a67ea4f3..815247cb4724 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.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,16 +29,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ #include <com/sun/star/lang/XComponent.hpp> -#endif #define _SVSTDARR_STRINGS #define _SVSTDARR_STRINGSSORTDTOR #define _SVSTDARR_BYTESTRINGS #define _SVSTDARR_BYTESTRINGSSORTDTOR -#include <rtl/uuid.h> #include <tools/tenccvt.hxx> #include <comphelper/processfactory.hxx> #include <unotools/intlwrapper.hxx> @@ -52,6 +50,7 @@ #include <svl/svstdarr.hxx> #include <unotools/syslocale.hxx> #include <algorithm> +#include <comphelper/servicehelper.hxx> #define STYLESTREAM "SfxStyleSheets" #define STYLESTREAM_VERSION sal_uInt16(50) @@ -280,7 +279,7 @@ sal_Bool SfxStyleSheetBase::SetParent( const XubString& rName ) SfxStyleSheetBase* pIter = rPool.Find(rName, nFamily); if( rName.Len() && !pIter ) { - DBG_ERROR( "StyleSheet-Parent nicht gefunden" ); + OSL_FAIL( "StyleSheet-Parent nicht gefunden" ); return sal_False; } // rekursive Verknuepfungen verhindern @@ -310,7 +309,7 @@ sal_Bool SfxStyleSheetBase::SetFollow( const XubString& rName ) { if( !rPool.Find( rName, nFamily ) ) { - DBG_ERROR( "StyleSheet-Follow nicht gefunden" ); + OSL_FAIL( "StyleSheet-Follow nicht gefunden" ); return sal_False; } aFollow = rName; @@ -485,7 +484,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx) ++z; } } - DBG_ERROR("falscher Index"); + OSL_FAIL("falscher Index"); return 0; } @@ -642,7 +641,7 @@ sal_Bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL); SfxStyleSheetBase *pStyle = aIter.Find(rStyle); - DBG_ASSERT(pStyle, "Vorlage nicht gefunden. Writer mit Solar <2541??"); + OSL_ENSURE(pStyle, "Vorlage nicht gefunden. Writer mit Solar <2541??"); if(pStyle) return pStyle->SetParent(rParent); else @@ -699,11 +698,11 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r ) SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos) { - DBG_ASSERT( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); + OSL_ENSURE( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); SfxStyleSheetIterator aIter(this, eFam, mask); rtl::Reference< SfxStyleSheetBase > xStyle( aIter.Find( rName ) ); - DBG_ASSERT( !xStyle.is(), "svl::SfxStyleSheetBasePool::Make(), StyleSheet already exists" ); + OSL_ENSURE( !xStyle.is(), "svl::SfxStyleSheetBasePool::Make(), StyleSheet already exists" ); SfxStyleSheetIterator& rIter = GetIterator_Impl(); if( !xStyle.is() ) @@ -827,16 +826,18 @@ void SfxStyleSheetBasePool::Remove( SfxStyleSheetBase* p ) void SfxStyleSheetBasePool::Insert( SfxStyleSheetBase* p ) { - DBG_ASSERT( p, "svl::SfxStyleSheetBasePool::Insert(), no stylesheet?" ); +#if OSL_DEBUG_LEVEL > 0 + OSL_ENSURE( p, "svl::SfxStyleSheetBasePool::Insert(), no stylesheet?" ); SfxStyleSheetIterator aIter(this, p->GetFamily(), p->GetMask()); SfxStyleSheetBase* pOld = aIter.Find( p->GetName() ); - DBG_ASSERT( !pOld, "svl::SfxStyleSheetBasePool::Insert(), StyleSheet already inserted" ); + OSL_ENSURE( !pOld, "svl::SfxStyleSheetBasePool::Insert(), StyleSheet already inserted" ); if( p->GetParent().Len() ) { pOld = aIter.Find( p->GetParent() ); - DBG_ASSERT( pOld, "svl::SfxStyleSheetBasePool::Insert(), Parent not found!" ); + OSL_ENSURE( pOld, "svl::SfxStyleSheetBasePool::Insert(), Parent not found!" ); } +#endif aStyles.push_back( rtl::Reference< SfxStyleSheetBase >( p ) ); Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) ); } @@ -1378,20 +1379,16 @@ SfxUnoStyleSheet* SfxUnoStyleSheet::getUnoStyleSheet( const ::com::sun::star::un // -------------------------------------------------------------------- +namespace +{ + class theSfxUnoStyleSheetIdentifier : public rtl::Static< UnoTunnelIdInit, theSfxUnoStyleSheetIdentifier > {}; +} + const ::com::sun::star::uno::Sequence< ::sal_Int8 >& SfxUnoStyleSheet::getIdentifier() { - static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0; - if( !pSeq ) - { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !pSeq ) - { - static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 ); - rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); - pSeq = &aSeq; - } - } - return *pSeq; + return theSfxUnoStyleSheetIdentifier::get().getSeq(); } // -------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index 8ad8346af075..1873ffda3a3b 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.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. @@ -54,11 +55,10 @@ namespace { std::vector< StylePool::SfxItemSet_Pointer_t > maItemSet; const SfxPoolItem *mpItem; // my pool item Node *mpUpper; // if I'm a child node that's my parent node - // --> OD 2008-03-07 #i86923# + // #i86923# const bool mbIsItemIgnorable; - // <-- public: - // --> OD 2008-03-07 #i86923# + // #i86923# Node() // root node Ctor : mChildren(), maItemSet(), @@ -73,36 +73,30 @@ namespace { mpUpper( pParent ), mbIsItemIgnorable( bIgnorable ) {} - // <-- ~Node(); - // --> OD 2008-03-11 #i86923# + // #i86923# bool hasItemSet( const bool bCheckUsage ) const; - // <-- - // --> OD 2008-04-29 #i87808# -// const StylePool::SfxItemSet_Pointer_t getItemSet() const { return aItemSet[aItemSet.size()-1]; } + // #i87808# const StylePool::SfxItemSet_Pointer_t getItemSet() const { return maItemSet.back(); } const StylePool::SfxItemSet_Pointer_t getUsedOrLastAddedItemSet() const; - // <-- void setItemSet( const SfxItemSet& rSet ){ maItemSet.push_back( StylePool::SfxItemSet_Pointer_t( rSet.Clone() ) ); } - // --> OD 2008-03-11 #i86923# + // #i86923# Node* findChildNode( const SfxPoolItem& rItem, const bool bIsItemIgnorable = false ); Node* nextItemSet( Node* pLast, const bool bSkipUnusedItemSet, const bool bSkipIgnorable ); - // <-- const SfxPoolItem& getPoolItem() const { return *mpItem; } - // --> OD 2008-03-11 #i86923# + // #i86923# bool hasIgnorableChildren( const bool bCheckUsage ) const; const StylePool::SfxItemSet_Pointer_t getItemSetOfIgnorableChild( const bool bSkipUnusedItemSets ) const; - // <-- }; - // --> OD 2008-04-29 #i87808# + // #i87808# const StylePool::SfxItemSet_Pointer_t Node::getUsedOrLastAddedItemSet() const { std::vector< StylePool::SfxItemSet_Pointer_t >::const_reverse_iterator aIter; @@ -117,9 +111,8 @@ namespace { return maItemSet.back(); } - // <-- - // --> OD 2008-05-06 #i86923# + // #i86923# bool Node::hasItemSet( const bool bCheckUsage ) const { bool bHasItemSet = false; @@ -146,12 +139,10 @@ namespace { } return bHasItemSet; } - // <-- - // --> OD 2008-03-07 #i86923# + // #i86923# Node* Node::findChildNode( const SfxPoolItem& rItem, const bool bIsItemIgnorable ) - // <-- { Node* pNextNode = this; std::vector<Node*>::iterator aIter = mChildren.begin(); @@ -162,9 +153,8 @@ namespace { return *aIter; ++aIter; } - // --> OD 2008-03-07 #i86923# + // #i86923# pNextNode = new Node( rItem, pNextNode, bIsItemIgnorable ); - // <-- mChildren.push_back( pNextNode ); return pNextNode; } @@ -202,15 +192,14 @@ namespace { Node *pNext = 0; while( aIter != mChildren.end() ) { - // --> OD 2008-03-11 #i86923# + // #i86923# if ( bSkipIgnorable && (*aIter)->mbIsItemIgnorable ) { ++aIter; continue; } - // <-- pNext = *aIter; - // --> OD 2008-03-11 #i86923# + // #i86923# if ( pNext->hasItemSet( bSkipUnusedItemSets ) ) { return pNext; @@ -221,7 +210,6 @@ namespace { return pNext; } pNext = pNext->nextItemSet( 0, bSkipUnusedItemSets, bSkipIgnorable ); // 0 => downstairs only - // <-- if( pNext ) return pNext; ++aIter; @@ -229,14 +217,13 @@ namespace { // Searching upstairs if( pLast && mpUpper ) { - // --> OD 2008-03-11 #i86923# + // #i86923# pNext = mpUpper->nextItemSet( this, bSkipUnusedItemSets, bSkipIgnorable ); - // <-- } return pNext; } - // --> OD 2008-03-11 #i86923# + // #i86923# bool Node::hasIgnorableChildren( const bool bCheckUsage ) const { bool bHasIgnorableChildren( false ); @@ -289,7 +276,6 @@ namespace { StylePool::SfxItemSet_Pointer_t pReturn; return pReturn; } - // <-- Node::~Node() { @@ -310,7 +296,7 @@ namespace { const bool mbSkipUnusedItemSets; const bool mbSkipIgnorable; public: - // --> OD 2008-03-07 #i86923# + // #i86923# Iterator( std::map< const SfxItemSet*, Node >& rR, const bool bSkipUnusedItemSets, const bool bSkipIgnorable ) @@ -320,7 +306,6 @@ namespace { mbSkipUnusedItemSets( bSkipUnusedItemSets ), mbSkipIgnorable( bSkipIgnorable ) {} - // <-- virtual StylePool::SfxItemSet_Pointer_t getNext(); virtual ::rtl::OUString getName(); }; @@ -334,31 +319,25 @@ namespace { { mpNode = &mpCurrNode->second; ++mpCurrNode; - // --> OD 2008-03-11 #i86923# + // #i86923# if ( mpNode->hasItemSet( mbSkipUnusedItemSets ) ) { - // --> OD 2008-04-30 #i87808# -// return pNode->getItemSet(); + // #i87808# return mpNode->getUsedOrLastAddedItemSet(); - // <-- } - // <-- } - // --> OD 2008-03-11 #i86923# + // #i86923# mpNode = mpNode->nextItemSet( mpNode, mbSkipUnusedItemSets, mbSkipIgnorable ); if ( mpNode && mpNode->hasItemSet( mbSkipUnusedItemSets ) ) { - // --> OD 2008-04-30 #i87808# -// return pNode->getItemSet(); + // #i87808# return mpNode->getUsedOrLastAddedItemSet(); - // <-- } if ( mbSkipIgnorable && mpNode && mpNode->hasIgnorableChildren( mbSkipUnusedItemSets ) ) { return mpNode->getItemSetOfIgnorableChild( mbSkipUnusedItemSets ); } - // <-- } return pReturn; } @@ -368,10 +347,7 @@ namespace { ::rtl::OUString aString; if( mpNode && mpNode->hasItemSet( false ) ) { - // --> OD 2008-04-30 #i87808# -// aString = StylePool::nameOf( pNode->getItemSet() ); aString = StylePool::nameOf( mpNode->getUsedOrLastAddedItemSet() ); - // <-- } return aString; } @@ -396,11 +372,10 @@ class StylePoolImpl private: std::map< const SfxItemSet*, Node > maRoot; sal_Int32 mnCount; - // --> OD 2008-03-07 #i86923# + // #i86923# SfxItemSet* mpIgnorableItems; - // <-- public: - // --> OD 2008-03-07 #i86923# + // #i86923# explicit StylePoolImpl( SfxItemSet* pIgnorableItems = 0 ) : maRoot(), mnCount(0), @@ -418,14 +393,12 @@ public: { delete mpIgnorableItems; } - // <-- StylePool::SfxItemSet_Pointer_t insertItemSet( const SfxItemSet& rSet ); - // --> OD 2008-03-07 #i86923# + // #i86923# IStylePoolIteratorAccess* createIterator( bool bSkipUnusedItemSets = false, bool bSkipIgnorableItems = false ); - // <-- sal_Int32 getCount() const { return mnCount; } }; @@ -437,8 +410,7 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& const SfxPoolItem* pItem = aIter.GetCurItem(); // Every SfxPoolItem in the SfxItemSet causes a step deeper into the tree, // a complete empty SfxItemSet would stay at the root node. - // --> OD 2008-03-07 #i86923# - // insert ignorable items to the tree leaves. + // #i86923# insert ignorable items to the tree leaves. std::auto_ptr<SfxItemSet> pFoundIgnorableItems; if ( mpIgnorableItems ) { @@ -469,7 +441,6 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& pItem = aIgnorableItemsIter.NextItem(); } } - // <-- // Every leaf node represents an inserted item set, but "non-leaf" nodes represents subsets // of inserted itemsets. // These nodes could have but does not need to have a shared_ptr to a item set. @@ -485,18 +456,12 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& #ifdef DEBUG { sal_Int32 nCheck = -1; - sal_Int32 nNo = -1; IStylePoolIteratorAccess* pIter = createIterator(); StylePool::SfxItemSet_Pointer_t pTemp; do { ++nCheck; pTemp = pIter->getNext(); - if( pCurNode->hasItemSet( false ) && pTemp.get() == pCurNode->getItemSet().get() ) - { - ::rtl::OUString aStr = StylePool::nameOf( pTemp ); - nNo = nCheck; - } } while( pTemp.get() ); DBG_ASSERT( mnCount == nCheck, "Wrong counting"); delete pIter; @@ -505,37 +470,32 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& return pCurNode->getItemSet(); } -// --> OD 2008-03-07 #i86923# +// #i86923# IStylePoolIteratorAccess* StylePoolImpl::createIterator( bool bSkipUnusedItemSets, bool bSkipIgnorableItems ) { return new Iterator( maRoot, bSkipUnusedItemSets, bSkipIgnorableItems ); } -// <-- - // Ctor, Dtor and redirected methods of class StylePool, nearly inline ;-) -// --> OD 2008-03-07 #i86923# +// #i86923# StylePool::StylePool( SfxItemSet* pIgnorableItems ) : pImpl( new StylePoolImpl( pIgnorableItems ) ) {} -// <-- StylePool::SfxItemSet_Pointer_t StylePool::insertItemSet( const SfxItemSet& rSet ) { return pImpl->insertItemSet( rSet ); } -// --> OD 2008-03-11 #i86923# +// #i86923# IStylePoolIteratorAccess* StylePool::createIterator( const bool bSkipUnusedItemSets, const bool bSkipIgnorableItems ) { return pImpl->createIterator( bSkipUnusedItemSets, bSkipIgnorableItems ); } -// <-- sal_Int32 StylePool::getCount() const { return pImpl->getCount(); } StylePool::~StylePool() { delete pImpl; } -// End of class StylePool - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/szitem.cxx b/svl/source/items/szitem.cxx index 161468b1009b..4bb7238c9b76 100644 --- a/svl/source/items/szitem.cxx +++ b/svl/source/items/szitem.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. @@ -135,7 +136,7 @@ SvStream& SfxSizeItem::Store(SvStream &rStream, sal_uInt16 ) const } // ----------------------------------------------------------------------- -sal_Bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, +bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); @@ -159,20 +160,20 @@ sal_Bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, rVal <<= aTmp.getWidth(); break; case MID_HEIGHT: rVal <<= aTmp.getHeight(); break; - default: DBG_ERROR("Wrong MemberId!"); return sal_False; + default: OSL_FAIL("Wrong MemberId!"); return false; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, +bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = sal_False; + bool bRet = false; com::sun::star::awt::Size aValue; sal_Int32 nVal = 0; if ( !nMemberId ) @@ -209,3 +210,4 @@ sal_Bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx index 81726f017f3a..599709d70938 100644 --- a/svl/source/items/visitem.cxx +++ b/svl/source/items/visitem.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. @@ -85,21 +86,21 @@ SfxItemPresentation SfxVisibilityItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= m_nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { if (rVal >>= m_nValue) - return sal_True; + return true; - DBG_ERROR( "SfxInt16Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxInt16Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -140,6 +141,8 @@ UniString SfxVisibilityItem::GetValueTextByVal(sal_Bool bTheValue) const { return bTheValue ? - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) : - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False")); + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) : + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE")); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx index 237cf73f6c7f..0fa492b19443 100644 --- a/svl/source/items/whassert.hxx +++ b/svl/source/items/whassert.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. @@ -52,3 +53,5 @@ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/whiter.cxx b/svl/source/items/whiter.cxx index 17e0e18115bb..b9fb9ca46330 100644 --- a/svl/source/items/whiter.cxx +++ b/svl/source/items/whiter.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,7 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -// INCLUDE --------------------------------------------------------------- #include <svl/whiter.hxx> #include <svl/itemset.hxx> @@ -120,3 +120,4 @@ sal_uInt16 SfxWhichIter::LastWhich() return PrevWhich(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx index f8b190d0cb4c..43eb637ae991 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.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. @@ -30,21 +31,15 @@ #define _SVARRAY_CXX -#define _SVSTDARR_BOOLS -#define _SVSTDARR_BYTES #define _SVSTDARR_ULONGS -#define _SVSTDARR_ULONGSSORT -#define _SVSTDARR_USHORTS -#define _SVSTDARR_LONGS -#define _SVSTDARR_LONGSSORT -#define _SVSTDARR_SHORTS +#define _SVSTDARR_sal_uInt16S #define _SVSTDARR_STRINGS #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_STRINGSSORT #define _SVSTDARR_STRINGSSORTDTOR #define _SVSTDARR_STRINGSISORT #define _SVSTDARR_STRINGSISORTDTOR -#define _SVSTDARR_USHORTSSORT +#define _SVSTDARR_sal_uInt16SSORT #define _SVSTDARR_BYTESTRINGS #define _SVSTDARR_BYTESTRINGSDTOR @@ -54,7 +49,6 @@ #define _SVSTDARR_BYTESTRINGSISORTDTOR #define _SVSTDARR_XUB_STRLEN -#define _SVSTDARR_XUB_STRLENSORT #include <svl/svstdarr.hxx> #include <tools/string.hxx> @@ -70,10 +64,6 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const SV_IMPL_VARARR( SvULongs, sal_uLong ) SV_IMPL_VARARR( SvUShorts, sal_uInt16 ) -SV_IMPL_VARARR( SvLongs, long) - -SV_IMPL_VARARR_SORT( SvULongsSort, sal_uLong ) -SV_IMPL_VARARR_SORT( SvLongsSort, long ) SV_IMPL_PTRARR( SvStrings, StringPtr ) SV_IMPL_PTRARR( SvStringsDtor, StringPtr ) @@ -181,98 +171,6 @@ sal_Bool SvStringsISortDtor::Seek_Entry( const StringPtr aE, sal_uInt16* pP ) co return sal_False; } -// ---------------- Ushorts ------------------------------------- - -/* SortArray fuer UShorts */ -sal_Bool SvUShortsSort::Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP ) const -{ - register sal_uInt16 nO = SvUShorts::Count(), - nM, - nU = 0; - if( nO > 0 ) - { - nO--; - while( nU <= nO ) - { - nM = nU + ( nO - nU ) / 2; - if( *(pData + nM) == aE ) - { - if( pP ) *pP = nM; - return sal_True; - } - else if( *(pData + nM) < aE ) - nU = nM + 1; - else if( nM == 0 ) - { - if( pP ) *pP = nU; - return sal_False; - } - else - nO = nM - 1; - } - } - if( pP ) *pP = nU; - return sal_False; -} - -void SvUShortsSort::Insert( const SvUShortsSort * pI, sal_uInt16 nS, sal_uInt16 nE ) -{ - if( USHRT_MAX == nE ) - nE = pI->Count(); - sal_uInt16 nP; - const sal_uInt16 * pIArr = pI->GetData(); - for( ; nS < nE; ++nS ) - { - if( ! Seek_Entry( *(pIArr+nS), &nP) ) - SvUShorts::Insert( *(pIArr+nS), nP ); - if( ++nP >= Count() ) - { - SvUShorts::Insert( pI, nP, nS+1, nE ); - nS = nE; - } - } -} - -sal_Bool SvUShortsSort::Insert( const sal_uInt16 aE ) -{ - sal_uInt16 nP; - sal_Bool bExist = Seek_Entry( aE, &nP ); - if( !bExist ) - SvUShorts::Insert( aE, nP ); - return !bExist; -} - -sal_Bool SvUShortsSort::Insert( const sal_uInt16 aE, sal_uInt16& rP ) -{ - sal_Bool bExist = Seek_Entry( aE, &rP ); - if( !bExist ) - SvUShorts::Insert( aE, rP ); - return !bExist; -} - -void SvUShortsSort::Insert( const sal_uInt16* pE, sal_uInt16 nL) -{ - sal_uInt16 nP; - for( sal_uInt16 n = 0; n < nL; ++n ) - if( ! Seek_Entry( *(pE+n), &nP )) - SvUShorts::Insert( *(pE+n), nP ); -} - -// remove ab Pos -void SvUShortsSort::RemoveAt( const sal_uInt16 nP, sal_uInt16 nL ) -{ - if( nL ) - SvUShorts::Remove( nP, nL); -} - -// remove ab dem Eintrag -void SvUShortsSort::Remove( const sal_uInt16 aE, sal_uInt16 nL ) -{ - sal_uInt16 nP; - if( nL && Seek_Entry( aE, &nP ) ) - SvUShorts::Remove( nP, nL); -} - // ---------------- bytestrings ------------------------------------- // Array mit anderer Seek-Methode! @@ -366,3 +264,4 @@ sal_Bool SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, sal_uInt16* return sal_False; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/PasswordHelper.cxx b/svl/source/misc/PasswordHelper.cxx index 73e1c6c050a0..50649dc4d1c5 100644 --- a/svl/source/misc/PasswordHelper.cxx +++ b/svl/source/misc/PasswordHelper.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. @@ -101,3 +102,4 @@ bool SvPasswordHelper::CompareHashPassword(const uno::Sequence<sal_Int8>& rOldPa return bResult; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx index e21037e0217f..e0087aa5220d 100644 --- a/svl/source/misc/adrparse.cxx +++ b/svl/source/misc/adrparse.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. @@ -700,10 +701,10 @@ SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser, nLen); } if (pParser->m_bHasFirst) - pParser->m_aRest.Insert(new SvAddressEntry_Impl( + pParser->m_aRest.push_back(new SvAddressEntry_Impl( aTheAddrSpec, - aTheRealName), - LIST_APPEND); + aTheRealName) + ); else { pParser->m_bHasFirst = true; @@ -768,14 +769,15 @@ SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser, SvAddressParser::SvAddressParser(UniString const & rInput): m_bHasFirst(false) { - SvAddressParser_Impl(this, rInput); + SvAddressParser_Impl aDoParse(this, rInput); } //============================================================================ SvAddressParser::~SvAddressParser() { - for (sal_uLong i = m_aRest.Count(); i != 0;) - delete m_aRest.Remove(--i); + for ( size_t i = m_aRest.size(); i > 0; ) + delete m_aRest[ --i ]; + m_aRest.clear(); } //============================================================================ @@ -916,3 +918,4 @@ bool SvAddressParser::createRFC822Mailbox(String const & rPhrase, return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/documentlockfile.cxx b/svl/source/misc/documentlockfile.cxx index 0e04a3fd7ae0..286bf282ed7f 100644 --- a/svl/source/misc/documentlockfile.cxx +++ b/svl/source/misc/documentlockfile.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. @@ -102,7 +103,7 @@ sal_Bool DocumentLockFile::CreateOwnLockFile() try { 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 > xSeekable( xTempFile, uno::UNO_QUERY_THROW ); @@ -170,13 +171,11 @@ uno::Reference< io::XInputStream > DocumentLockFile::OpenStream() { ::osl::MutexGuard aGuard( m_aMutex ); - uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSimpleFileAccess( - xFactory->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SimpleFileAccess") ), - uno::UNO_QUERY_THROW ); + uno::Reference < ::com::sun::star::ucb::XCommandEnvironment > xEnv; + ::ucbhelper::Content aSourceContent( m_aURL, xEnv ); // the file can be opened readonly, no locking will be done - return xSimpleFileAccess->openFileRead( m_aURL ); + return aSourceContent.openStream(); } // ---------------------------------------------------------------------- @@ -223,12 +222,12 @@ void DocumentLockFile::RemoveFile() || !aFileData[LOCKFILE_USERURL_ID].equals( aNewEntry[LOCKFILE_USERURL_ID] ) ) throw io::IOException(); // not the owner, access denied - uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSimpleFileAccess( - xFactory->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SimpleFileAccess") ), - uno::UNO_QUERY_THROW ); - xSimpleFileAccess->kill( m_aURL ); + uno::Reference < ::com::sun::star::ucb::XCommandEnvironment > xEnv; + ::ucbhelper::Content aCnt(m_aURL, xEnv); + aCnt.executeCommand(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), + uno::makeAny(sal_Bool(sal_True))); } } // namespace svt +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx index 61c98bf5a851..64afaf2c3333 100644 --- a/svl/source/misc/filenotation.cxx +++ b/svl/source/misc/filenotation.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. @@ -123,6 +124,7 @@ namespace svt } OSL_ENSURE( bSuccess, "OFileNotation::OFileNotation: could not detect the format!" ); + (void)bSuccess; } //--------------------------------------------------------------------- @@ -134,7 +136,7 @@ namespace svt case N_URL: return m_sFileURL; } - OSL_ENSURE(sal_False, "OFileNotation::get: inavlid enum value!"); + OSL_FAIL("OFileNotation::get: inavlid enum value!"); return ::rtl::OUString(); } @@ -142,3 +144,4 @@ namespace svt } // namespace svt //......................................................................... +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/folderrestriction.cxx b/svl/source/misc/folderrestriction.cxx index e854b64b7830..28ff69d61f24 100644 --- a/svl/source/misc/folderrestriction.cxx +++ b/svl/source/misc/folderrestriction.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. @@ -104,3 +105,4 @@ namespace svt } // namespace svt +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/fstathelper.cxx b/svl/source/misc/fstathelper.cxx index b90df8fb6f7e..15494cdedc85 100644 --- a/svl/source/misc/fstathelper.cxx +++ b/svl/source/misc/fstathelper.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. @@ -48,7 +49,7 @@ sal_Bool FStatHelper::GetModifiedDateTimeOfFile( const UniString& rURL, ::ucbhelper::Content aTestContent( rURL, uno::Reference< XCommandEnvironment > ()); uno::Any aAny = aTestContent.getPropertyValue( - OUString::createFromAscii( "DateModified" ) ); + OUString(RTL_CONSTASCII_USTRINGPARAM("DateModified")) ); if( aAny.hasValue() ) { bRet = sal_True; @@ -97,3 +98,4 @@ sal_Bool FStatHelper::IsFolder( const UniString& rURL ) return bExist; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index 6e637f1b35a5..eba1e4083d38 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.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. @@ -540,3 +541,4 @@ sal_Bool INetURLHistory::QueryUrl_Impl (const INetURLObject &rUrl) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 86d60bd971ad..cb16349ab487 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.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. @@ -298,7 +299,9 @@ MediaTypeEntry const aStaticTypeNameMap[CONTENT_TYPE_LAST + 1] { CONTENT_TYPE_STR_AUDIO_AIFF, CONTENT_TYPE_AUDIO_AIFF, "aif" }, { CONTENT_TYPE_STR_AUDIO_BASIC, CONTENT_TYPE_AUDIO_BASIC, "au" }, { CONTENT_TYPE_STR_AUDIO_MIDI, CONTENT_TYPE_AUDIO_MIDI, "mid" }, + { CONTENT_TYPE_STR_AUDIO_VORBIS, CONTENT_TYPE_AUDIO_VORBIS, "ogg" }, { CONTENT_TYPE_STR_AUDIO_WAV, CONTENT_TYPE_AUDIO_WAV, "wav" }, + { CONTENT_TYPE_STR_AUDIO_WEBM, CONTENT_TYPE_AUDIO_WEBM, "webm" }, { CONTENT_TYPE_STR_IMAGE_GENERIC, CONTENT_TYPE_IMAGE_GENERIC, "tmp" }, { CONTENT_TYPE_STR_IMAGE_GIF, CONTENT_TYPE_IMAGE_GIF, "gif" }, { CONTENT_TYPE_STR_IMAGE_JPEG, CONTENT_TYPE_IMAGE_JPEG, "jpg" }, @@ -328,8 +331,10 @@ MediaTypeEntry const aStaticTypeNameMap[CONTENT_TYPE_LAST + 1] { CONTENT_TYPE_STR_TEXT_VCALENDAR, CONTENT_TYPE_TEXT_VCALENDAR, "vcs" }, { CONTENT_TYPE_STR_TEXT_VCARD, CONTENT_TYPE_TEXT_VCARD, "vcf" }, - { CONTENT_TYPE_STR_VIDEO_VDO, CONTENT_TYPE_VIDEO_VDO, "vdo" }, { CONTENT_TYPE_STR_VIDEO_MSVIDEO, CONTENT_TYPE_VIDEO_MSVIDEO, "avi" }, + { CONTENT_TYPE_STR_VIDEO_THEORA, CONTENT_TYPE_VIDEO_THEORA, "ogg" }, + { CONTENT_TYPE_STR_VIDEO_VDO, CONTENT_TYPE_VIDEO_VDO, "vdo" }, + { CONTENT_TYPE_STR_VIDEO_WEBM, CONTENT_TYPE_VIDEO_WEBM, "webm" }, { CONTENT_TYPE_STR_X_STARMAIL, CONTENT_TYPE_X_STARMAIL, "smd" }, { CONTENT_TYPE_STR_X_VRML, CONTENT_TYPE_X_VRML, "wrl" } }; @@ -356,7 +361,9 @@ sal_uInt16 const aStaticResourceIDMap[CONTENT_TYPE_LAST + 1] STR_SVT_MIMETYPE_AUDIO_AIFF, // CONTENT_TYPE_AUDIO_AIFF STR_SVT_MIMETYPE_AUDIO_BASIC, // CONTENT_TYPE_AUDIO_BASIC STR_SVT_MIMETYPE_AUDIO_MIDI, // CONTENT_TYPE_AUDIO_MIDI + STR_SVT_MIMETYPE_AUDIO_VORBIS, // CONTENT_TYPE_AUDIO_VORBIS STR_SVT_MIMETYPE_AUDIO_WAV, // CONTENT_TYPE_AUDIO_WAV + STR_SVT_MIMETYPE_AUDIO_WEBM, // CONTENT_TYPE_AUDIO_WEBM STR_SVT_MIMETYPE_IMAGE_GIF, // CONTENT_TYPE_IMAGE_GIF STR_SVT_MIMETYPE_IMAGE_JPEG, // CONTENT_TYPE_IMAGE_JPEG STR_SVT_MIMETYPE_IMAGE_PCX, // CONTENT_TYPE_IMAGE_PCX @@ -367,8 +374,10 @@ sal_uInt16 const aStaticResourceIDMap[CONTENT_TYPE_LAST + 1] STR_SVT_MIMETYPE_TEXT_PLAIN, // CONTENT_TYPE_TEXT_PLAIN STR_SVT_MIMETYPE_TEXT_URL, // CONTENT_TYPE_TEXT_URL STR_SVT_MIMETYPE_TEXT_VCARD, // CONTENT_TYPE_TEXT_VCARD - STR_SVT_MIMETYPE_VIDEO_VDO, // CONTENT_TYPE_VIDEO_VDO STR_SVT_MIMETYPE_VIDEO_MSVIDEO, // CONTENT_TYPE_VIDEO_MSVIDEO + STR_SVT_MIMETYPE_VIDEO_THEORA, // CONTENT_TYPE_VIDEO_THEORA + STR_SVT_MIMETYPE_VIDEO_VDO, // CONTENT_TYPE_VIDEO_VDO + STR_SVT_MIMETYPE_VIDEO_WEBM, // CONTENT_TYPE_VIDEO_WEBM STR_SVT_MIMETYPE_CNT_MSG, // CONTENT_TYPE_X_CNT_MESSAGE STR_SVT_MIMETYPE_CNT_DOCUMENT, // CONTENT_TYPE_X_CNT_DOCUMENT STR_SVT_MIMETYPE_CNT_POP3BOX, // CONTENT_TYPE_X_CNT_POP3BOX @@ -502,6 +511,7 @@ MediaTypeEntry const aStaticExtensionMap[] { "met", CONTENT_TYPE_IMAGE_GENERIC, "" }, { "mid", CONTENT_TYPE_AUDIO_MIDI, "" }, { "midi", CONTENT_TYPE_AUDIO_MIDI, "" }, + { "ogg", CONTENT_TYPE_AUDIO_VORBIS, "" }, { "pbm", CONTENT_TYPE_IMAGE_GENERIC, "" }, { "pcd", CONTENT_TYPE_IMAGE_GENERIC, "" }, { "pct", CONTENT_TYPE_IMAGE_GENERIC, "" }, @@ -549,6 +559,7 @@ MediaTypeEntry const aStaticExtensionMap[] { "vdo", CONTENT_TYPE_VIDEO_VDO, "" }, { "vor", CONTENT_TYPE_APP_VND_TEMPLATE, "" }, { "wav", CONTENT_TYPE_AUDIO_WAV, "" }, + { "webm", CONTENT_TYPE_VIDEO_WEBM, "" }, { "wmf", CONTENT_TYPE_IMAGE_GENERIC, "" }, { "wrl", CONTENT_TYPE_X_VRML, "" }, { "xbm", CONTENT_TYPE_IMAGE_GENERIC, "" }, @@ -930,7 +941,7 @@ UniString INetContentTypes::GetContentType(INetContentType eTypeID) Registration::GetContentType(eTypeID); if (aTypeName.Len() == 0) { - DBG_ERROR("INetContentTypes::GetContentType(): Bad ID"); + OSL_FAIL("INetContentTypes::GetContentType(): Bad ID"); return UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( CONTENT_TYPE_STR_APP_OCTSTREAM)); @@ -1338,3 +1349,4 @@ UniString INetContentTypes::appendUSASCIIParameter(UniString const & return aResult; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index aba411079074..2eba00efd565 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.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. @@ -34,7 +35,8 @@ #include <rtl/ustrbuf.hxx> #include <rtl/ustring.hxx> -using namespace rtl; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; namespace linguistic { @@ -167,3 +169,4 @@ String GetThesaurusReplaceText( const String &rText ) } // namespace linguistic +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx index aed62ce30737..c725a8a2d74a 100644 --- a/svl/source/misc/lockfilecommon.cxx +++ b/svl/source/misc/lockfilecommon.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. @@ -55,6 +56,8 @@ #include <unotools/useroptions.hxx> +#include <salhelper/linkhelper.hxx> + #include <svl/lockfilecommon.hxx> using namespace ::com::sun::star; @@ -73,7 +76,7 @@ LockFileCommon::LockFileCommon( const ::rtl::OUString& aOrigURL, const uno::Refe ::rtl::OUString aShareURLString = aDocURL.GetPartBeforeLastName(); aShareURLString += aPrefix; aShareURLString += aDocURL.GetName(); - aShareURLString += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "#" ) ); + aShareURLString += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "%23" ) ); // '#' m_aURL = INetURLObject( aShareURLString ).GetMainURL( INetURLObject::NO_DECODE ); } @@ -88,36 +91,19 @@ INetURLObject LockFileCommon::ResolveLinks( const INetURLObject& aDocURL ) if ( aDocURL.HasError() ) throw lang::IllegalArgumentException(); - ::rtl::OUString aURLToCheck = aDocURL.GetMainURL( INetURLObject::NO_DECODE ); - - sal_Bool bNeedsChecking = sal_True; - sal_Int32 nMaxLinkCount = 128; - sal_Int32 nCount = 0; + ::rtl::OUString aURLToCheck = aDocURL.GetMainURL(INetURLObject::NO_DECODE); - while( bNeedsChecking ) + // there is currently no UCB functionality to resolve the symbolic links; + // since the lock files are used only for local file systems the osl + // functionality is used directly + salhelper::LinkResolver aResolver(osl_FileStatus_Mask_FileName); + osl::FileBase::RC eStatus = aResolver.fetchFileStatus(aURLToCheck); + if (eStatus == osl::FileBase::E_None) + aURLToCheck = aResolver.m_aStatus.getFileURL(); + else if (eStatus == osl::FileBase::E_MULTIHOP) { - bNeedsChecking = sal_False; - // do not allow too deep links - if ( nCount++ >= nMaxLinkCount ) - throw io::IOException(); - - // there is currently no UCB functionality to resolve the symbolic links; - // since the lock files are used only for local file systems the osl functionality is used directly - - ::osl::FileStatus aStatus( FileStatusMask_Type | FileStatusMask_LinkTargetURL ); - ::osl::DirectoryItem aItem; - if ( ::osl::FileBase::E_None == ::osl::DirectoryItem::get( aURLToCheck, aItem ) - && aItem.is() && ::osl::FileBase::E_None == aItem.getFileStatus( aStatus ) ) - { - if ( aStatus.isValid( FileStatusMask_Type ) - && aStatus.isValid( FileStatusMask_LinkTargetURL ) - && aStatus.getFileType() == ::osl::FileStatus::Link ) - { - aURLToCheck = aStatus.getLinkTargetURL(); - bNeedsChecking = sal_True; - } - } + throw io::IOException(); } return INetURLObject( aURLToCheck ); @@ -270,3 +256,4 @@ uno::Sequence< ::rtl::OUString > LockFileCommon::GenerateOwnEntry() } // namespace svt +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/mediatyp.src b/svl/source/misc/mediatyp.src index 333963c1d2d9..1d191c9d93b6 100644 --- a/svl/source/misc/mediatyp.src +++ b/svl/source/misc/mediatyp.src @@ -28,7 +28,6 @@ // // Internet Media Type Presentations // -// $Author: rt $ $Date: 2008-04-10 21:44:39 $ $Revision: 1.7 $ //============================================================================ #ifndef _SVTOOLS_HRC @@ -110,11 +109,21 @@ String STR_SVT_MIMETYPE_AUDIO_MIDI Text [ en-US ] = "Audio file" ; }; +String STR_SVT_MIMETYPE_AUDIO_VORBIS +{ + Text [ en-US ] = "Audio file" ; +}; + String STR_SVT_MIMETYPE_AUDIO_WAV { Text [ en-US ] = "Audio file" ; }; +String STR_SVT_MIMETYPE_AUDIO_WEBM +{ + Text [ en-US ] = "Audio file" ; +}; + String STR_SVT_MIMETYPE_IMAGE_GIF { Text [ en-US ] = "Graphics" ; @@ -155,12 +164,22 @@ String STR_SVT_MIMETYPE_TEXT_VCARD Text [ en-US ] = "vCard file" ; }; +String STR_SVT_MIMETYPE_VIDEO_MSVIDEO +{ + Text [ en-US ] = "Video file" ; +}; + +String STR_SVT_MIMETYPE_VIDEO_THEORA +{ + Text [ en-US ] = "Video file" ; +}; + String STR_SVT_MIMETYPE_VIDEO_VDO { Text [ en-US ] = "Video file" ; }; -String STR_SVT_MIMETYPE_VIDEO_MSVIDEO +String STR_SVT_MIMETYPE_VIDEO_WEBM { Text [ en-US ] = "Video file" ; }; @@ -580,28 +599,3 @@ String STR_SVT_MIMETYPE_APP_SXIPACKED { Text [ en-US ] = "%PRODUCTNAME %PRODUCTXMLFILEFORMATVERSION Presentation (packed)" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svl/source/misc/ownlist.cxx b/svl/source/misc/ownlist.cxx index 5d1d728b26e2..0e3fae02ff8e 100644 --- a/svl/source/misc/ownlist.cxx +++ b/svl/source/misc/ownlist.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,8 +39,6 @@ using namespace com::sun::star; //========================================================================= //============== SvCommandList ============================================ //========================================================================= -PRV_SV_IMPL_OWNER_LIST(SvCommandList,SvCommand) - static String parseString(const String & rCmd, sal_uInt16 * pIndex) { @@ -109,78 +108,11 @@ sal_Bool SvCommandList::AppendCommands value = (rCmd.GetChar(index) == '\"') ? parseString(rCmd, &index) : parseWord(rCmd, &index); } - SvCommand * pCmd = new SvCommand(name, value); - aTypes.Insert(pCmd, LIST_APPEND); + aCommandList.push_back( SvCommand(name, value)); } *pEaten = index; -// sal_uInt16 nPos = 0; -// while( nPos < rCmd.Len() ) -// { -// // ein Zeichen ? Dann faengt hier eine Option an -// if( isalpha( rCmd[nPos] ) ) -// { -// String aValue; -// sal_uInt16 nStt = nPos; -// register char c; - -// while( nPos < rCmd.Len() && -// ( isalnum(c=rCmd[nPos]) || '-'==c || '.'==c ) ) -// nPos++; - -// String aToken( rCmd.Copy( nStt, nPos-nStt ) ); - -// while( nPos < rCmd.Len() && -// ( !String::IsPrintable( (c=rCmd[nPos]), -// RTL_TEXTENCODING_MS_1252 ) || isspace(c) ) ) -// nPos++; - -// // hat die Option auch einen Wert? -// if( nPos!=rCmd.Len() && '='==c ) -// { -// nPos++; - -// while( nPos < rCmd.Len() && -// ( !String::IsPrintable( (c=rCmd[nPos]), -// RTL_TEXTENCODING_MS_1252 ) || isspace(c) ) ) -// nPos++; - -// if( nPos != rCmd.Len() ) -// { -// sal_uInt16 nLen = 0; -// nStt = nPos; -// if( '"' == c ) -// { -// nPos++; nStt++; -// while( nPos < rCmd.Len() && -// '"' != rCmd[nPos] ) -// nPos++, nLen++; -// if( nPos!=rCmd.Len() ) -// nPos++; -// } -// else -// // hier sind wir etwas laxer als der -// // Standard und erlauben alles druckbare -// while( nPos < rCmd.Len() && -// String::IsPrintable( (c=rCmd[nPos]), -// RTL_TEXTENCODING_MS_1252 ) && -// !isspace( c ) ) -// nPos++, nLen++; - -// if( nLen ) -// aValue = rCmd( nStt, nLen ); -// } -// } - -// SvCommand * pCmd = new SvCommand( aToken, aValue ); -// aTypes.Insert( pCmd, LIST_APPEND ); -// } -// else -// // white space un unerwartete Zeichen ignorieren wie -// nPos++; -// } -// *pEaten = nPos; return sal_True; } @@ -198,16 +130,16 @@ String SvCommandList::GetCommands() const */ { String aRet; - for( sal_uLong i = 0; i < aTypes.Count(); i++ ) + for( sal_uLong i = 0; i < aCommandList.size(); i++ ) { if( i != 0 ) aRet += ' '; - SvCommand * pCmd = (SvCommand *)aTypes.GetObject( i ); - aRet += pCmd->GetCommand(); - if( pCmd->GetArgument().Len() ) + SvCommand aCmd = aCommandList[ i ]; + aRet += aCmd.GetCommand(); + if( aCmd.GetArgument().Len() ) { aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "=\"" ) ); - aRet += pCmd->GetArgument(); + aRet += aCmd.GetArgument(); aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "\"" ) ); } } @@ -230,9 +162,8 @@ SvCommand & SvCommandList::Append SvCommand & Das erteugte Objekt wird zur"uckgegeben. */ { - SvCommand * pCmd = new SvCommand( rCommand, rArg ); - aTypes.Insert( pCmd, LIST_APPEND ); - return *pCmd; + aCommandList.push_back( SvCommand( rCommand, rArg ) ); + return aCommandList.back(); } //========================================================================= @@ -258,9 +189,9 @@ SvStream & operator >> { while( nCount-- ) { - SvCommand * pCmd = new SvCommand(); - rStm >> *pCmd; - rThis.aTypes.Insert( pCmd, LIST_APPEND ); + SvCommand aCmd; + rStm >> aCmd; + rThis.aCommandList.push_back( aCmd ); } } return rStm; @@ -283,13 +214,12 @@ SvStream & operator << SvStream & Der "ubergebene Stream. */ { - sal_uInt32 nCount = rThis.aTypes.Count(); + sal_uInt32 nCount = rThis.aCommandList.size(); rStm << nCount; for( sal_uInt32 i = 0; i < nCount; i++ ) { - SvCommand * pCmd = (SvCommand *)rThis.aTypes.GetObject( i ); - rStm << *pCmd; + rStm << rThis.aCommandList[ i ]; } return rStm; } @@ -313,15 +243,15 @@ sal_Bool SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < void SvCommandList::FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence ) { - const sal_Int32 nCount = Count(); + const sal_Int32 nCount = aCommandList.size(); aCommandSequence.realloc( nCount ); for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) { - const SvCommand& rCommand = (*this)[ nIndex ]; - aCommandSequence[nIndex].Name = rCommand.GetCommand(); + aCommandSequence[nIndex].Name = aCommandList[ nIndex ].GetCommand(); aCommandSequence[nIndex].Handle = -1; - aCommandSequence[nIndex].Value = uno::makeAny( ::rtl::OUString( rCommand.GetArgument() ) ); + aCommandSequence[nIndex].Value = uno::makeAny( ::rtl::OUString( aCommandList[ nIndex ].GetArgument() ) ); aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE; } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/restrictedpaths.cxx b/svl/source/misc/restrictedpaths.cxx index 8c6f136f3eee..30fc8c95738b 100644 --- a/svl/source/misc/restrictedpaths.cxx +++ b/svl/source/misc/restrictedpaths.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. @@ -212,3 +213,5 @@ namespace svt } } // namespace svt + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index b7b4f24141dd..6d4f4975869c 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.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. @@ -117,7 +118,7 @@ void ShareControlFile::OpenStream() ucb::InsertCommandArgument aInsertArg; aInsertArg.Data = xInput; aInsertArg.ReplaceExisting = sal_False; - aContent.executeCommand( rtl::OUString::createFromAscii( "insert" ), uno::makeAny( aInsertArg ) ); + aContent.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("insert")), uno::makeAny( aInsertArg ) ); // try to let the file be hidden if possible try { @@ -364,10 +365,11 @@ void ShareControlFile::RemoveFile() uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSimpleFileAccess( - xFactory->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SimpleFileAccess") ), + xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")) ), uno::UNO_QUERY_THROW ); xSimpleFileAccess->kill( m_aURL ); } } // namespace svt +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index 18f2788077a3..d7905f470290 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.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. @@ -95,7 +96,6 @@ public: inline bool isEOF() const; bool addMark(sal_uInt32 nPosition); - bool removeMark(sal_uInt32 nPosition); inline sal_uInt32 getReadPosition() const; @@ -1043,3 +1043,4 @@ SvDataPipe_Impl::SeekResult SvDataPipe_Impl::setReadPosition(sal_uInt32 return SEEK_OK; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/svldata.cxx b/svl/source/misc/svldata.cxx index f4eae26d2276..b76c1c002ce8 100644 --- a/svl/source/misc/svldata.cxx +++ b/svl/source/misc/svldata.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,7 +32,6 @@ #include <map> #include <tools/resmgr.hxx> #include <tools/shl.hxx> -#include <vos/process.hxx> #include <svl/svldata.hxx> namespace unnamed_svl_svldata {} @@ -89,3 +89,4 @@ ImpSvlData & ImpSvlData::GetSvlData() return *pSvlData; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 656000fceae3..ac70f8a6e467 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.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. @@ -946,3 +947,5 @@ INetURLObject::FSysStyle URIHelper::queryFSysStyle(UniString const & rFileUrl, - ucb::FileSystemNotation::UNKNOWN_NOTATION] [bAddConvenienceStyles]; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/brdcst.cxx b/svl/source/notify/brdcst.cxx index ad7da10ed4f4..7722814216a5 100644 --- a/svl/source/notify/brdcst.cxx +++ b/svl/source/notify/brdcst.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,9 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <svl/hint.hxx> #include <svl/smplhint.hxx> @@ -148,7 +148,7 @@ sal_Bool SfxBroadcaster::AddListener( SfxListener& rListener ) aListeners.Insert( pListener, aListeners.Count() ); else { - DBG_ERROR( "array overflow" ); + OSL_FAIL( "array overflow" ); return sal_False; } @@ -207,3 +207,5 @@ sal_Bool SfxBroadcaster::HasListeners() const } //-------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx index 046b584e4385..a11a0b87aa9c 100644 --- a/svl/source/notify/broadcast.cxx +++ b/svl/source/notify/broadcast.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,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <tools/debug.hxx> #include <svl/listener.hxx> @@ -146,3 +145,4 @@ void SvtBroadcaster::Forward( SvtBroadcaster& rBC, const SfxHint& rHint ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/hint.cxx b/svl/source/notify/hint.cxx index fd596d7663d8..268e5e337483 100644 --- a/svl/source/notify/hint.cxx +++ b/svl/source/notify/hint.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,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <svl/hint.hxx> @@ -45,3 +44,4 @@ SfxHint::~SfxHint() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/isethint.cxx b/svl/source/notify/isethint.cxx index 23ae3f19b154..f408044bdefb 100644 --- a/svl/source/notify/isethint.cxx +++ b/svl/source/notify/isethint.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,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif - #include <svl/isethint.hxx> #include <svl/itemset.hxx> @@ -73,3 +71,5 @@ SfxItemSetHint::~SfxItemSetHint() } //-------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx index 8a90a0ddfd3c..20fbc2993fbb 100644 --- a/svl/source/notify/listener.cxx +++ b/svl/source/notify/listener.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. @@ -159,3 +160,4 @@ rBC } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/listenerbase.cxx b/svl/source/notify/listenerbase.cxx index 4dedd24cbe0e..505d7f6e75c4 100644 --- a/svl/source/notify/listenerbase.cxx +++ b/svl/source/notify/listenerbase.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. @@ -74,3 +75,4 @@ SvtListenerBase::~SvtListenerBase() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/listenerbase.hxx b/svl/source/notify/listenerbase.hxx index 677cffe9b4bd..db661afbee94 100644 --- a/svl/source/notify/listenerbase.hxx +++ b/svl/source/notify/listenerbase.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. @@ -55,3 +56,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/listeneriter.cxx b/svl/source/notify/listeneriter.cxx index 2078393822cb..9b3e16d8c120 100644 --- a/svl/source/notify/listeneriter.cxx +++ b/svl/source/notify/listeneriter.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. @@ -188,3 +189,4 @@ SvtListener* SvtListenerIter::GetCurr() const // returns the current return pDelNext ? pDelNext->GetListener() : 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx index 36c6b665dd6d..2bdcb8852d15 100644 --- a/svl/source/notify/lstner.cxx +++ b/svl/source/notify/lstner.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,12 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif -#ifndef DEBUG_HXX #include <tools/debug.hxx> -#endif #include <svl/hint.hxx> #include <svl/brdcst.hxx> @@ -191,3 +188,4 @@ void SfxListener::Notify( SfxBroadcaster&, const SfxHint& ) #endif } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/notify/smplhint.cxx b/svl/source/notify/smplhint.cxx index 9191e50f383e..7aef9a7042bf 100644 --- a/svl/source/notify/smplhint.cxx +++ b/svl/source/notify/smplhint.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,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <svl/smplhint.hxx> @@ -45,3 +44,4 @@ SfxSimpleHint::SfxSimpleHint( sal_uLong nIdP ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 3a4949f45cbc..35f58e4ebee5 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.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,13 +28,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <tools/color.hxx> #include <tools/debug.hxx> #include <i18npool/mslangid.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <rtl/ustring.hxx> #include <com/sun/star/util/Date.hpp> @@ -406,7 +405,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber( rtl::OUString SAL_CALL SvNumberFormatterServiceObj::getImplementationName() throw(uno::RuntimeException) { - return rtl::OUString::createFromAscii("com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject")); } sal_Bool SAL_CALL SvNumberFormatterServiceObj::supportsService( const rtl::OUString& ServiceName ) @@ -420,7 +419,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatterServiceObj::getSupportedS { uno::Sequence<rtl::OUString> aRet(1); rtl::OUString* pArray = aRet.getArray(); - pArray[0] = rtl::OUString::createFromAscii(SERVICENAME_NUMBERFORMATTER); + pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME_NUMBERFORMATTER)); return aRet; } @@ -695,7 +694,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatForLocale( sal_Int32 nKey, const rtl::OUString SAL_CALL SvNumberFormatsObj::getImplementationName() throw(uno::RuntimeException) { - return rtl::OUString::createFromAscii("SvNumberFormatsObj"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SvNumberFormatsObj")); } sal_Bool SAL_CALL SvNumberFormatsObj::supportsService( const rtl::OUString& ServiceName ) @@ -709,7 +708,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatsObj::getSupportedServiceNam { uno::Sequence<rtl::OUString> aRet(1); rtl::OUString* pArray = aRet.getArray(); - pArray[0] = rtl::OUString::createFromAscii(SERVICENAME_NUMBERFORMATS); + pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME_NUMBERFORMATS)); return aRet; } @@ -850,7 +849,7 @@ void SAL_CALL SvNumberFormatObj::addPropertyChangeListener( const rtl::OUString& throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_ERROR("not implemented"); + OSL_FAIL("not implemented"); } void SAL_CALL SvNumberFormatObj::removePropertyChangeListener( const rtl::OUString&, @@ -858,7 +857,7 @@ void SAL_CALL SvNumberFormatObj::removePropertyChangeListener( const rtl::OUStri throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_ERROR("not implemented"); + OSL_FAIL("not implemented"); } void SAL_CALL SvNumberFormatObj::addVetoableChangeListener( const rtl::OUString&, @@ -866,7 +865,7 @@ void SAL_CALL SvNumberFormatObj::addVetoableChangeListener( const rtl::OUString& throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_ERROR("not implemented"); + OSL_FAIL("not implemented"); } void SAL_CALL SvNumberFormatObj::removeVetoableChangeListener( const rtl::OUString&, @@ -874,7 +873,7 @@ void SAL_CALL SvNumberFormatObj::removeVetoableChangeListener( const rtl::OUStri throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_ERROR("not implemented"); + OSL_FAIL("not implemented"); } // XPropertyAccess @@ -910,31 +909,31 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue uno::Sequence<beans::PropertyValue> aSeq(13); beans::PropertyValue* pArray = aSeq.getArray(); - pArray[0].Name = rtl::OUString::createFromAscii( PROPERTYNAME_FMTSTR ); + pArray[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_FMTSTR )); pArray[0].Value <<= rtl::OUString( aFmtStr ); - pArray[1].Name = rtl::OUString::createFromAscii( PROPERTYNAME_LOCALE ); + pArray[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_LOCALE )); pArray[1].Value <<= aLocale; - pArray[2].Name = rtl::OUString::createFromAscii( PROPERTYNAME_TYPE ); + pArray[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_TYPE )); pArray[2].Value <<= (sal_Int16)( pFormat->GetType() ); - pArray[3].Name = rtl::OUString::createFromAscii( PROPERTYNAME_COMMENT ); + pArray[3].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_COMMENT )); pArray[3].Value <<= rtl::OUString( aComment ); - pArray[4].Name = rtl::OUString::createFromAscii( PROPERTYNAME_STDFORM ); + pArray[4].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_STDFORM )); pArray[4].Value.setValue( &bStandard, getBooleanCppuType() ); - pArray[5].Name = rtl::OUString::createFromAscii( PROPERTYNAME_USERDEF ); + pArray[5].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_USERDEF )); pArray[5].Value.setValue( &bUserDef, getBooleanCppuType() ); - pArray[6].Name = rtl::OUString::createFromAscii( PROPERTYNAME_DECIMALS ); + pArray[6].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_DECIMALS )); pArray[6].Value <<= (sal_Int16)( nDecimals ); - pArray[7].Name = rtl::OUString::createFromAscii( PROPERTYNAME_LEADING ); + pArray[7].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_LEADING )); pArray[7].Value <<= (sal_Int16)( nLeading ); - pArray[8].Name = rtl::OUString::createFromAscii( PROPERTYNAME_NEGRED ); + pArray[8].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_NEGRED )); pArray[8].Value.setValue( &bRed, getBooleanCppuType() ); - pArray[9].Name = rtl::OUString::createFromAscii( PROPERTYNAME_THOUS ); + pArray[9].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_THOUS )); pArray[9].Value.setValue( &bThousand, getBooleanCppuType() ); - pArray[10].Name = rtl::OUString::createFromAscii( PROPERTYNAME_CURRSYM ); + pArray[10].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_CURRSYM )); pArray[10].Value <<= rtl::OUString( aSymbol ); - pArray[11].Name = rtl::OUString::createFromAscii( PROPERTYNAME_CURREXT ); + pArray[11].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_CURREXT )); pArray[11].Value <<= rtl::OUString( aExt ); - pArray[12].Name = rtl::OUString::createFromAscii( PROPERTYNAME_CURRABB ); + pArray[12].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( PROPERTYNAME_CURRABB )); pArray[12].Value <<= rtl::OUString( aAbb ); return aSeq; @@ -956,7 +955,7 @@ void SAL_CALL SvNumberFormatObj::setPropertyValues( const uno::Sequence<beans::P rtl::OUString SAL_CALL SvNumberFormatObj::getImplementationName() throw(uno::RuntimeException) { - return rtl::OUString::createFromAscii("SvNumberFormatObj"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SvNumberFormatObj")); } sal_Bool SAL_CALL SvNumberFormatObj::supportsService( const rtl::OUString& ServiceName ) @@ -970,7 +969,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatObj::getSupportedServiceName { uno::Sequence<rtl::OUString> aRet(1); rtl::OUString* pArray = aRet.getArray(); - pArray[0] = rtl::OUString::createFromAscii(SERVICENAME_NUMBERFORMAT); + pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME_NUMBERFORMAT)); return aRet; } @@ -1087,7 +1086,7 @@ void SAL_CALL SvNumberFormatSettingsObj::addPropertyChangeListener( const rtl::O throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_ERROR("not implemented"); + OSL_FAIL("not implemented"); } void SAL_CALL SvNumberFormatSettingsObj::removePropertyChangeListener( const rtl::OUString&, @@ -1095,7 +1094,7 @@ void SAL_CALL SvNumberFormatSettingsObj::removePropertyChangeListener( const rtl throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_ERROR("not implemented"); + OSL_FAIL("not implemented"); } void SAL_CALL SvNumberFormatSettingsObj::addVetoableChangeListener( const rtl::OUString&, @@ -1103,7 +1102,7 @@ void SAL_CALL SvNumberFormatSettingsObj::addVetoableChangeListener( const rtl::O throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_ERROR("not implemented"); + OSL_FAIL("not implemented"); } void SAL_CALL SvNumberFormatSettingsObj::removeVetoableChangeListener( const rtl::OUString&, @@ -1111,7 +1110,7 @@ void SAL_CALL SvNumberFormatSettingsObj::removeVetoableChangeListener( const rtl throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_ERROR("not implemented"); + OSL_FAIL("not implemented"); } // XServiceInfo @@ -1119,7 +1118,7 @@ void SAL_CALL SvNumberFormatSettingsObj::removeVetoableChangeListener( const rtl rtl::OUString SAL_CALL SvNumberFormatSettingsObj::getImplementationName() throw(uno::RuntimeException) { - return rtl::OUString::createFromAscii("SvNumberFormatSettingsObj"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SvNumberFormatSettingsObj")); } sal_Bool SAL_CALL SvNumberFormatSettingsObj::supportsService( const rtl::OUString& ServiceName ) @@ -1133,8 +1132,9 @@ uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatSettingsObj::getSupportedSer { uno::Sequence<rtl::OUString> aRet(1); rtl::OUString* pArray = aRet.getArray(); - pArray[0] = rtl::OUString::createFromAscii(SERVICENAME_NUMBERSETTINGS); + pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME_NUMBERSETTINGS)); return aRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/numfmuno.hxx b/svl/source/numbers/numfmuno.hxx index f3644cc4e7a5..1fdc30b4601c 100644 --- a/svl/source/numbers/numfmuno.hxx +++ b/svl/source/numbers/numfmuno.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. @@ -319,3 +320,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/numhead.cxx b/svl/source/numbers/numhead.cxx index 98ed17982444..dcb16ef94f77 100644 --- a/svl/source/numbers/numhead.cxx +++ b/svl/source/numbers/numhead.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,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <tools/debug.hxx> #include "numhead.hxx" @@ -70,7 +69,7 @@ sal_uLong SvNumReadHeader::BytesLeft() const if (nReadEnd <= nDataEnd) return nDataEnd-nReadEnd; - DBG_ERROR("Fehler bei SvNumReadHeader::BytesLeft"); + OSL_FAIL("Fehler bei SvNumReadHeader::BytesLeft"); return 0; } @@ -120,7 +119,7 @@ ImpSvNumMultipleReadHeader::ImpSvNumMultipleReadHeader(SvStream& rNewStream) : rStream >> nID; if (nID != SV_NUMID_SIZES) { - DBG_ERROR("SV_NUMID_SIZES nicht gefunden"); + OSL_FAIL("SV_NUMID_SIZES nicht gefunden"); } sal_uInt32 nSizeTableLen; rStream >> nSizeTableLen; @@ -155,7 +154,7 @@ void ImpSvNumMultipleReadHeader::Skip( SvStream& rStream ) rStream >> nID; if ( nID != SV_NUMID_SIZES ) { - DBG_ERROR("SV_NUMID_SIZES nicht gefunden"); + OSL_FAIL("SV_NUMID_SIZES nicht gefunden"); } sal_uInt32 nSizeTableLen; rStream >> nSizeTableLen; @@ -191,7 +190,7 @@ sal_uLong ImpSvNumMultipleReadHeader::BytesLeft() const if (nReadEnd <= nEntryEnd) return nEntryEnd-nReadEnd; - DBG_ERROR("Fehler bei ImpSvNumMultipleReadHeader::BytesLeft"); + OSL_FAIL("Fehler bei ImpSvNumMultipleReadHeader::BytesLeft"); return 0; } @@ -247,3 +246,4 @@ void ImpSvNumMultipleWriteHeader::StartEntry() nEntryStart = nPos; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/numhead.hxx b/svl/source/numbers/numhead.hxx index c268d1869b8a..8ccd91489a4c 100644 --- a/svl/source/numbers/numhead.hxx +++ b/svl/source/numbers/numhead.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. @@ -104,3 +105,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/numuno.cxx b/svl/source/numbers/numuno.cxx index 94f535c48b02..8b715ae19784 100644 --- a/svl/source/numbers/numuno.cxx +++ b/svl/source/numbers/numuno.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,16 +28,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #define _ZFORLIST_DECLARE_TABLE #include <tools/color.hxx> #include <tools/debug.hxx> -#include <vos/mutex.hxx> -#include <osl/mutex.hxx> -#include <rtl/uuid.h> +#include <comphelper/servicehelper.hxx> #include <svl/numuno.hxx> #include "numfmuno.hxx" @@ -132,21 +129,15 @@ sal_Int64 SAL_CALL SvNumberFormatsSupplierObj::getSomething( return 0; } +namespace +{ + class theSvNumberFormatsSupplierObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSvNumberFormatsSupplierObjUnoTunnelId > {}; +} + // static const uno::Sequence<sal_Int8>& SvNumberFormatsSupplierObj::getUnoTunnelId() { - static uno::Sequence<sal_Int8> * pSeq = 0; - if( !pSeq ) - { - osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); - if( !pSeq ) - { - static uno::Sequence< sal_Int8 > aSeq( 16 ); - rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); - pSeq = &aSeq; - } - } - return *pSeq; + return theSvNumberFormatsSupplierObjUnoTunnelId::get().getSeq(); } // static @@ -165,3 +156,4 @@ SvNumberFormatsSupplierObj* SvNumberFormatsSupplierObj::getImplementation( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx index 93e6051a21ce..1b5883553b32 100644 --- a/svl/source/numbers/supservs.cxx +++ b/svl/source/numbers/supservs.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. @@ -32,7 +33,7 @@ #include <comphelper/sharedmutex.hxx> #include <i18npool/mslangid.hxx> #include <tools/debug.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <tools/stream.hxx> #include <svl/strmadpt.hxx> #include <svl/instrm.hxx> @@ -42,10 +43,9 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::io; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::util; -using namespace ::vos; using namespace ::utl; -#define PERSISTENT_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatsSupplier"); +#define PERSISTENT_SERVICE_NAME ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier")); //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL SvNumberFormatsSupplierServiceObject_CreateInstance(const Reference< XMultiServiceFactory >& _rxFactory) @@ -117,7 +117,7 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence< #ifdef DBG_UTIL else { - DBG_ERROR("SvNumberFormatsSupplierServiceObject::initialize : unknown argument !"); + OSL_FAIL("SvNumberFormatsSupplierServiceObject::initialize : unknown argument !"); } #endif } @@ -130,7 +130,7 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence< //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL SvNumberFormatsSupplierServiceObject::getImplementationName( ) throw(RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject")); } //------------------------------------------------------------------------- @@ -227,3 +227,4 @@ void SvNumberFormatsSupplierServiceObject::implEnsureFormatter() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/supservs.hxx b/svl/source/numbers/supservs.hxx index 85c5456beb01..1402f11d993e 100644 --- a/svl/source/numbers/supservs.hxx +++ b/svl/source/numbers/supservs.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. @@ -100,3 +101,4 @@ protected: #endif // _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index ed845372b76e..d18ea9de19e9 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.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. @@ -84,7 +85,9 @@ ImpSvNumberInputScan::ImpSvNumberInputScan( SvNumberFormatter* pFormatterP ) pUpperMonthText( NULL ), pUpperAbbrevMonthText( NULL ), pUpperDayText( NULL ), - pUpperAbbrevDayText( NULL ) + pUpperAbbrevDayText( NULL ), + eScannedType( NUMBERFORMAT_UNDEFINED ), + eSetType( NUMBERFORMAT_UNDEFINED ) { pFormatter = pFormatterP; pNullDate = new Date(30,12,1899); @@ -113,17 +116,6 @@ ImpSvNumberInputScan::~ImpSvNumberInputScan() void ImpSvNumberInputScan::Reset() { -#if 0 -// ER 16.06.97 18:56 Vorbelegung erfolgt jetzt in NumberStringDivision, -// wozu immer alles loeschen wenn einiges wieder benutzt oder gar nicht -// gebraucht wird.. - for (sal_uInt16 i = 0; i < SV_MAX_ANZ_INPUT_STRINGS; i++) - { - sStrArray[i].Erase(); - nNums[i] = SV_MAX_ANZ_INPUT_STRINGS-1; - IsNum[i] = sal_False; - } -#endif nMonth = 0; nMonthPos = 0; nTimePos = 0; @@ -151,19 +143,7 @@ void ImpSvNumberInputScan::Reset() // static inline sal_Bool ImpSvNumberInputScan::MyIsdigit( sal_Unicode c ) { - // If the input string wouldn't be converted using TransformInput() we'd - // to use something similar to the following and to adapt many places. -#if 0 - // use faster isdigit() if possible - if ( c < 128 ) - return isdigit( (unsigned char) c ) != 0; - if ( c < 256 ) - return sal_False; - String aTmp( c ); - return pFormatter->GetCharClass()->isDigit( aTmp, 0 ); -#else return c < 128 && isdigit( (unsigned char) c ); -#endif } @@ -1042,7 +1022,7 @@ sal_Bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter, } break; default: - DBG_ERROR( "ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat" ); + OSL_FAIL( "ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat" ); DateFmt = YMD; bFormatTurn = sal_False; } @@ -1109,9 +1089,16 @@ input for the following reasons: switch (DateFmt) { case MDY: - case YMD: - pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) ); + case YMD: { + sal_uInt16 nDay = ImplGetDay(0); + sal_uInt16 nYear = ImplGetYear(0); + if (nDay == 0 || nDay > 32) { + pCal->setValue( CalendarFieldIndex::YEAR, nYear); + } + else + pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) ); break; + } case DMY: pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) ); break; @@ -1470,7 +1457,6 @@ sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString, const SvNumberformat* pFormat ) { xub_StrLen nPos = 0; - int nDayOfWeek; // First of all, eat leading blanks SkipBlanks(rString, nPos); @@ -1520,7 +1506,7 @@ sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString, } else { - nDayOfWeek = GetDayOfWeek( rString, nPos ); + int nDayOfWeek = GetDayOfWeek( rString, nPos ); if ( nDayOfWeek ) { // day of week is just parsed away eScannedType = NUMBERFORMAT_DATE; // !!! it IS a date !!! @@ -1550,6 +1536,13 @@ sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString, } } + // skip any trailing '-' or '/' chars + if (nPos < rString.Len()) + { + while (SkipChar ('-', rString, nPos) || SkipChar ('/', rString, nPos)) { + // do nothing + } + } if (nPos < rString.Len()) // not everything consumed { // Does input StartString equal StartString of format? @@ -2814,3 +2807,4 @@ sal_Bool ImpSvNumberInputScan::IsNumberFormat( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index 3dc7976f6a59..4af1ca91ae8a 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.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. @@ -286,3 +287,5 @@ private: #endif // _ZFORFIND_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index d4d0f8550907..ffdb583261f7 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.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,10 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif -// #include <math.h> #include <tools/debug.hxx> #include <unotools/charclass.hxx> #include <i18npool/mslangid.hxx> @@ -68,6 +66,8 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::i18n; using namespace ::com::sun::star::lang; +using ::rtl::OUString; + // Constants for type offsets per Country/Language (CL) #define ZF_STANDARD 0 @@ -89,7 +89,7 @@ using namespace ::com::sun::star::lang; #define UNKNOWN_SUBSTITUTE LANGUAGE_ENGLISH_US static sal_Bool bIndexTableInitialized = sal_False; -static sal_uInt32 __FAR_DATA theIndexTable[NF_INDEX_TABLE_ENTRIES]; +static sal_uInt32 theIndexTable[NF_INDEX_TABLE_ENTRIES]; // ==================================================================== @@ -428,7 +428,7 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) // a duplicate. Also won't mix up any LastInsertKey. ChangeIntl( eOldLanguage ); LanguageType eLge = eOldLanguage; // ConvertMode changes this - sal_Bool bCheck = sal_False; + bool bCheck = false; SvNumberformat* pNewEntry = new SvNumberformat( aString, pFormatScanner, pStringScanner, nCheckPos, eLge ); if ( nCheckPos != 0 ) @@ -444,9 +444,10 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) if ( !aFTable.Insert( nKey, pNewEntry ) ) delete pNewEntry; else - bCheck = sal_True; + bCheck = true; } DBG_ASSERT( bCheck, "SvNumberFormatter::ReplaceSystemCL: couldn't convert" ); + (void)bCheck; delete pOldEntry; } @@ -525,7 +526,7 @@ sal_Bool SvNumberFormatter::PutEntry(String& rString, sal_uInt32 nPos = CLOffset + pStdFormat->GetLastInsertKey(); if (nPos - CLOffset >= SV_COUNTRY_LANGUAGE_OFFSET) { - DBG_ERROR("SvNumberFormatter:: Zu viele Formate pro CL"); + OSL_FAIL("SvNumberFormatter:: Zu viele Formate pro CL"); delete p_Entry; } else if (!aFTable.Insert(nPos+1,p_Entry)) @@ -543,25 +544,36 @@ sal_Bool SvNumberFormatter::PutEntry(String& rString, return bCheck; } -sal_Bool SvNumberFormatter::PutandConvertEntry(String& rString, +bool SvNumberFormatter::PutEntry( + OUString& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, + LanguageType eLnge) +{ + // Wrapper to allow rtl::OUString to be used. + String aStr(rString); + bool bRet = PutEntry(aStr, nCheckPos, nType, nKey, eLnge); + rString = aStr; + return bRet; +} + +bool SvNumberFormatter::PutandConvertEntry(String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge) { - sal_Bool bRes; + bool bRes; if (eNewLnge == LANGUAGE_DONTKNOW) eNewLnge = IniLnge; pFormatScanner->SetConvertMode(eLnge, eNewLnge); bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge); - pFormatScanner->SetConvertMode(sal_False); + pFormatScanner->SetConvertMode(false); return bRes; } -sal_Bool SvNumberFormatter::PutandConvertEntrySystem(String& rString, +bool SvNumberFormatter::PutandConvertEntrySystem(String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, @@ -954,7 +966,7 @@ String SvNumberFormatter::GetKeyword( LanguageType eLnge, sal_uInt16 nIndex ) if ( nIndex < NF_KEYWORD_ENTRIES_COUNT ) return rTable[nIndex]; - DBG_ERROR("GetKeyword: invalid index"); + OSL_FAIL("GetKeyword: invalid index"); return String(); } @@ -1038,7 +1050,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable( SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(FIndex); if (!pFormat) { -// DBG_ERROR("SvNumberFormatter:: Unbekanntes altes Zahlformat (1)"); +// OSL_FAIL("SvNumberFormatter:: Unbekanntes altes Zahlformat (1)"); rLnge = IniLnge; eType = NUMBERFORMAT_ALL; eTypetmp = eType; @@ -1195,7 +1207,7 @@ sal_Bool SvNumberFormatter::IsNumberFormat(const String& sString, const SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index); if (!pFormat) { -// DBG_ERROR("SvNumberFormatter:: Unbekanntes altes Zahlformat (2)"); +// OSL_FAIL("SvNumberFormatter:: Unbekanntes altes Zahlformat (2)"); ChangeIntl(IniLnge); FType = NUMBERFORMAT_NUMBER; } @@ -1378,7 +1390,8 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType ) nDefaultFormat = CLOffset + ZF_STANDARD; } } - aDefaultFormatKeys.Insert( nSearch, (void*) nDefaultFormat ); + sal_uIntPtr nFormat = nDefaultFormat; + aDefaultFormatKeys.Insert( nSearch, (void*) nFormat ); } return nDefaultFormat; } @@ -1386,6 +1399,9 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType ) sal_uInt32 SvNumberFormatter::GetStandardFormat( short eType, LanguageType eLnge ) { + if (eLnge == LANGUAGE_DONTKNOW) + eLnge = IniLnge; + sal_uInt32 CLOffset = ImpGenerateCL(eLnge); switch(eType) { @@ -2578,7 +2594,6 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi // # ?/? aSingleFormatCode.Code = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "# ?/?" ) ); - String s25( RTL_CONSTASCII_USTRINGPARAM( "# ?/?" ) ); // # ?/? ImpInsertFormat( aSingleFormatCode, CLOffset + SetIndexTable( NF_FRACTION_1, ZF_STANDARD_FRACTION )); @@ -2606,6 +2621,18 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi if ( !bLoadingSO5 ) ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, sal_False ); + sal_uInt32 nPos = CLOffset + pStdFormat->GetLastInsertKey(); + + aSingleFormatCode.Code = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "# ?/4" ) ); + ImpInsertNewStandardFormat( aSingleFormatCode, nPos+1, SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS ); + nPos++; + + aSingleFormatCode.Code = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "# ?\?/100" ) ); + ImpInsertNewStandardFormat( aSingleFormatCode, nPos+1, SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS ); + nPos++; + + pStdFormat->SetLastInsertKey( (sal_uInt16)(nPos - CLOffset) ); + if (bOldConvertMode) pFormatScanner->SetConvertMode(sal_True); } @@ -2720,6 +2747,10 @@ void SvNumberFormatter::GenerateFormat(String& sString, utl::DigitGroupingIterator aGrouping( xLocaleData->getDigitGrouping()); const xub_StrLen nDigitsInFirstGroup = static_cast<xub_StrLen>(aGrouping.get()); const String& rThSep = GetNumThousandSep(); + + SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nIndex); + sal_Bool insertBrackets = pFormat->IsNegativeInBracket(); + if (nAnzLeading == 0) { if (!bThousand) @@ -2812,15 +2843,35 @@ void SvNumberFormatter::GenerateFormat(String& sString, sString += ';'; sString += sNegStr; } - if (IsRed && eType != NUMBERFORMAT_CURRENCY) + if ( (IsRed || insertBrackets ) && eType != NUMBERFORMAT_CURRENCY) { String sTmpStr = sString; + + if ( pFormat->HasPositiveBracketPlaceholder() ) + { + sTmpStr += '_'; + sTmpStr += ')'; + } sTmpStr += ';'; - sTmpStr += '['; - sTmpStr += pFormatScanner->GetRedString(); - sTmpStr += ']'; - sTmpStr += '-'; - sTmpStr +=sString; + + if (IsRed) + { + sTmpStr += '['; + sTmpStr += pFormatScanner->GetRedString(); + sTmpStr += ']'; + } + + if (insertBrackets) + { + sTmpStr += '('; + sTmpStr += sString; + sTmpStr += ')'; + } + else + { + sTmpStr += '-'; + sTmpStr +=sString; + } sString = sTmpStr; } } @@ -2940,7 +2991,7 @@ SvNumberFormatterIndexTable* SvNumberFormatter::MergeFormatter(SvNumberFormatter nNewKey = nPos+1; if (nPos - nCLOffset >= SV_COUNTRY_LANGUAGE_OFFSET) { - DBG_ERROR( + OSL_FAIL( "SvNumberFormatter:: Zu viele Formate pro CL"); delete pNewEntry; } @@ -3256,8 +3307,9 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat() pEntry->SetStandard(); } } + sal_uIntPtr nFormat = nDefaultCurrencyFormat; aDefaultFormatKeys.Insert( CLOffset + ZF_STANDARD_CURRENCY, - (void*) nDefaultCurrencyFormat ); + (void*) nFormat ); } return nDefaultCurrencyFormat; } @@ -3449,15 +3501,18 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( sal_Bool & bFoundBan void SvNumberFormatter::GetCompatibilityCurrency( String& rSymbol, String& rAbbrev ) const { ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::Currency2 > - xCurrencies = xLocaleData->getAllCurrencies(); + xCurrencies( xLocaleData->getAllCurrencies() ); + + const ::com::sun::star::i18n::Currency2 *pCurrencies = xCurrencies.getConstArray(); sal_Int32 nCurrencies = xCurrencies.getLength(); + sal_Int32 j; for ( j=0; j < nCurrencies; ++j ) { - if ( xCurrencies[j].UsedInCompatibleFormatCodes ) + if ( pCurrencies[j].UsedInCompatibleFormatCodes ) { - rSymbol = xCurrencies[j].Symbol; - rAbbrev = xCurrencies[j].BankSymbol; + rSymbol = pCurrencies[j].Symbol; + rAbbrev = pCurrencies[j].BankSymbol; break; } } @@ -3618,13 +3673,6 @@ void SvNumberFormatter::ImpInitCurrencyTable() { LanguageType eLang = MsLangId::convertLocaleToLanguage( pLocales[nLocale]); -#if OSL_DEBUG_LEVEL > 1 - LanguageType eReal = MsLangId::getRealLanguage( eLang ); - if ( eReal != eLang ) { - sal_Bool bBreak; - bBreak = sal_True; - } -#endif pLocaleData->setLocale( pLocales[nLocale] ); Sequence< Currency2 > aCurrSeq = pLocaleData->getAllCurrencies(); sal_Int32 nCurrencyCount = aCurrSeq.getLength(); @@ -3989,7 +4037,7 @@ void NfCurrencyEntry::CompletePositiveFormatString( String& rStr, } break; default: - DBG_ERROR("NfCurrencyEntry::CompletePositiveFormatString: unknown option"); + OSL_FAIL("NfCurrencyEntry::CompletePositiveFormatString: unknown option"); break; } } @@ -4111,7 +4159,7 @@ void NfCurrencyEntry::CompleteNegativeFormatString( String& rStr, } break; default: - DBG_ERROR("NfCurrencyEntry::CompleteNegativeFormatString: unknown option"); + OSL_FAIL("NfCurrencyEntry::CompleteNegativeFormatString: unknown option"); break; } } @@ -4142,7 +4190,7 @@ sal_uInt16 NfCurrencyEntry::GetEffectivePositiveFormat( sal_uInt16 case 3: // 1 $ break; default: - DBG_ERROR("NfCurrencyEntry::GetEffectivePositiveFormat: unknown option"); + OSL_FAIL("NfCurrencyEntry::GetEffectivePositiveFormat: unknown option"); break; } return nIntlFormat; @@ -4183,7 +4231,7 @@ sal_uInt16 lcl_MergeNegativeParenthesisFormat( sal_uInt16 nIntlFormat, sal_uInt1 nSign = 2; break; default: - DBG_ERROR("lcl_MergeNegativeParenthesisFormat: unknown option"); + OSL_FAIL("lcl_MergeNegativeParenthesisFormat: unknown option"); break; } @@ -4296,7 +4344,7 @@ sal_uInt16 NfCurrencyEntry::GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat, nIntlFormat = 8; // -1 $ break; default: - DBG_ERROR("NfCurrencyEntry::GetEffectiveNegativeFormat: unknown option"); + OSL_FAIL("NfCurrencyEntry::GetEffectiveNegativeFormat: unknown option"); break; } #endif @@ -4358,7 +4406,7 @@ sal_uInt16 NfCurrencyEntry::GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat, nIntlFormat, nCurrFormat ); break; default: - DBG_ERROR("NfCurrencyEntry::GetEffectiveNegativeFormat: unknown option"); + OSL_FAIL("NfCurrencyEntry::GetEffectiveNegativeFormat: unknown option"); break; } } @@ -4384,8 +4432,6 @@ sal_Char NfCurrencyEntry::GetEuroSymbol( rtl_TextEncoding eTextEncoding ) default: // default system #if WNT return '\x80'; -#elif OS2 - return '\xD5'; #elif UNX // return '\xA4'; // #56121# 0xA4 waere korrekt fuer iso-8859-15 return '\x80'; // aber Windoze-Code fuer die konvertierten TrueType-Fonts @@ -4399,3 +4445,4 @@ sal_Char NfCurrencyEntry::GetEuroSymbol( rtl_TextEncoding eTextEncoding ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 9b01c2ee91be..00ebf41a3dd7 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.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. @@ -30,10 +31,10 @@ #include <stdio.h> #include <ctype.h> #include <float.h> -// #include <math.h> #include <errno.h> #include <stdlib.h> #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <i18npool/mslangid.hxx> #include <rtl/math.hxx> #include <rtl/instance.hxx> @@ -58,6 +59,8 @@ #include <cmath> using namespace svt; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; namespace { struct Gregorian @@ -186,7 +189,6 @@ void ImpSvNumberformatInfo::Load(SvStream& rStream, sal_uInt16 nAnz) >> nCntPre >> nCntPost >> nCntExp; } - //============================================================================ // static @@ -242,7 +244,6 @@ sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang return nNatNum; } - // static sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, sal_Bool bDate ) { @@ -399,7 +400,6 @@ void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc, pColor = rSc.GetColor(sColorName); } - sal_Bool ImpSvNumFor::HasNewCurrency() const { for ( sal_uInt16 j=0; j<nAnzStrings; j++ ) @@ -410,7 +410,6 @@ sal_Bool ImpSvNumFor::HasNewCurrency() const return sal_False; } - sal_Bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const { @@ -430,7 +429,6 @@ sal_Bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol, return sal_False; } - void ImpSvNumFor::SaveNewCurrencyMap( SvStream& rStream ) const { sal_uInt16 j; @@ -460,7 +458,6 @@ void ImpSvNumFor::SaveNewCurrencyMap( SvStream& rStream ) const } } - void ImpSvNumFor::LoadNewCurrencyMap( SvStream& rStream ) { sal_uInt16 nCnt; @@ -475,7 +472,6 @@ void ImpSvNumFor::LoadNewCurrencyMap( SvStream& rStream ) } } - /***********************Funktionen SvNumberformat************************/ enum BracketFormatSymbolType @@ -518,17 +514,17 @@ enum BracketFormatSymbolType SvNumberformat::SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge ) : rScan(rSc), - eLnge(eLge), nNewStandardDefined(0), bStarFlag( sal_False ) { + maLocale.meLanguage = eLge; } void SvNumberformat::ImpCopyNumberformat( const SvNumberformat& rFormat ) { sFormatstring = rFormat.sFormatstring; eType = rFormat.eType; - eLnge = rFormat.eLnge; + maLocale = rFormat.maLocale; fLimit1 = rFormat.fLimit1; fLimit2 = rFormat.fLimit2; eOp1 = rFormat.eOp1; @@ -557,7 +553,6 @@ SvNumberformat::SvNumberformat( SvNumberformat& rFormat, ImpSvNumberformatScan& ImpCopyNumberformat( rFormat ); } - sal_Bool lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) { if ( nSymbolType > 0 ) @@ -600,7 +595,6 @@ sal_Bool lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType ) return sal_False; } - SvNumberformat::SvNumberformat(String& rString, ImpSvNumberformatScan* pSc, ImpSvNumberInputScan* pISc, @@ -613,7 +607,7 @@ SvNumberformat::SvNumberformat(String& rString, bStarFlag( sal_False ) { // If the group (AKA thousand) separator is a Non-Breaking Space (French) - // replace all occurences by a simple space. + // replace all occurrences by a simple space. // The tokens will be changed to the LocaleData separator again later on. const sal_Unicode cNBSp = 0xA0; const String& rThSep = GetFormatter().GetNumThousandSep(); @@ -627,11 +621,11 @@ SvNumberformat::SvNumberformat(String& rString, if (rScan.GetConvertMode()) { - eLnge = rScan.GetNewLnge(); - eLan = eLnge; // Wechsel auch zurueckgeben + maLocale.meLanguage = rScan.GetNewLnge(); + eLan = maLocale.meLanguage; // Wechsel auch zurueckgeben } else - eLnge = eLan; + maLocale.meLanguage = eLan; bStandard = bStan; bIsUsed = sal_False; fLimit1 = 0.0; @@ -807,17 +801,17 @@ SvNumberformat::SvNumberformat(String& rString, else { xub_StrLen nTmp = 2; - LanguageType eLang = ImpGetLanguageType( sStr, nTmp ); - if ( eLang == LANGUAGE_DONTKNOW ) + maLocale = ImpGetLocaleType( sStr, nTmp ); + if (maLocale.meLanguage == LANGUAGE_DONTKNOW) { bCancel = sal_True; // break for nCheckPos = nPosOld; } - else + else if (maLocale.meLanguage != 0) { - sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "$-" ) ); - sStr += String::CreateFromInt32( sal_Int32( eLang ), 16 ).ToUpperAscii(); - NumFor[nIndex].SetNatNumLang( eLang ); + sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM("$-") ); + sStr = sStr + maLocale.generateCode(); + NumFor[nIndex].SetNatNumLang(maLocale.meLanguage); } } } @@ -826,12 +820,19 @@ SvNumberformat::SvNumberformat(String& rString, if ( !bCancel ) { rString.Erase(nPosOld,nPos-nPosOld); - rString.Insert(sStr,nPosOld); - nPos = nPosOld + sStr.Len(); - rString.Insert(']', nPos); - rString.Insert('[', nPosOld); - nPos += 2; - nPosOld = nPos; // position before string + if (maLocale.meLanguage != 0) + { + rString.Insert(sStr,nPosOld); + nPos = nPosOld + sStr.Len(); + rString.Insert(']', nPos); + rString.Insert('[', nPosOld); + nPos += 2; + nPosOld = nPos; // position before string + } + else + { + nPos = nPosOld; // Excel LCID removed + } } } } while ( !bCancel && lcl_SvNumberformat_IsBracketedPrefix( eSymbolType ) ); @@ -956,7 +957,7 @@ SvNumberformat::SvNumberformat(String& rString, if ( bCondition && !nCheckPos ) { - if ( nIndex == 1 && NumFor[0].GetnAnz() == 0 && + if ( nIndex == 1 && NumFor[0].GetCount() == 0 && rString.GetChar(rString.Len()-1) != ';' ) { // No format code => GENERAL but not if specified empty String aAdd( pSc->GetStandardName() ); @@ -972,9 +973,9 @@ SvNumberformat::SvNumberformat(String& rString, } } } - else if ( nIndex == 1 && NumFor[nIndex].GetnAnz() == 0 && + else if ( nIndex == 1 && NumFor[nIndex].GetCount() == 0 && rString.GetChar(rString.Len()-1) != ';' && - (NumFor[0].GetnAnz() > 1 || (NumFor[0].GetnAnz() == 1 && + (NumFor[0].GetCount() > 1 || (NumFor[0].GetCount() == 1 && NumFor[0].Info().nTypeArray[0] != NF_KEY_GENERAL)) ) { // No trailing second subformat => GENERAL but not if specified empty // and not if first subformat is GENERAL @@ -992,7 +993,7 @@ SvNumberformat::SvNumberformat(String& rString, } } } - else if ( nIndex == 2 && NumFor[nIndex].GetnAnz() == 0 && + else if ( nIndex == 2 && NumFor[nIndex].GetCount() == 0 && rString.GetChar(rString.Len()-1) != ';' && eOp2 != NUMBERFORMAT_OP_NO ) { // No trailing third subformat => GENERAL but not if specified empty @@ -1017,7 +1018,7 @@ SvNumberformat::SvNumberformat(String& rString, SetComment( aComment ); // setzt sComment und sFormatstring rString = sFormatstring; // geaenderten sFormatstring uebernehmen } - if (NumFor[2].GetnAnz() == 0 && // kein 3. Teilstring + if (NumFor[2].GetCount() == 0 && // kein 3. Teilstring eOp1 == NUMBERFORMAT_OP_GT && eOp2 == NUMBERFORMAT_OP_NO && fLimit1 == 0.0 && fLimit2 == 0.0) eOp1 = NUMBERFORMAT_OP_GE; // 0 zum ersten Format dazu @@ -1078,7 +1079,6 @@ enum ScanState SsGetBracketed // any [...] not decided yet }; - // read a string until ']' and delete spaces in input // static xub_StrLen SvNumberformat::ImpGetNumber(String& rString, @@ -1105,12 +1105,83 @@ xub_StrLen SvNumberformat::ImpGetNumber(String& rString, return nPos - nStartPos; } +namespace { + +sal_Unicode toUniChar(sal_uInt8 n) +{ + sal_Char c; + if (n < 10) + c = '0' + n; + else + c = 'A' + n - 10; + return sal_Unicode(c); +} + +} + +OUString SvNumberformat::LocaleType::generateCode() const +{ + OUStringBuffer aBuf; +#if 0 + // TODO: We may re-enable this later. Don't remove it! --Kohei + if (mnNumeralShape) + { + sal_uInt8 nVal = mnNumeralShape; + for (sal_uInt8 i = 0; i < 2; ++i) + { + sal_uInt8 n = (nVal & 0xF0) >> 4; + aBuf.append(toUniChar(n)); + nVal = nVal << 4; + } + } + + if (mnNumeralShape || mnCalendarType) + { + sal_uInt8 nVal = mnCalendarType; + for (sal_uInt8 i = 0; i < 2; ++i) + { + sal_uInt8 n = (nVal & 0xF0) >> 4; + aBuf.append(toUniChar(n)); + nVal = nVal << 4; + } + } +#endif + + sal_uInt16 n16 = static_cast<sal_uInt16>(meLanguage); + for (sal_uInt8 i = 0; i < 4; ++i) + { + sal_uInt8 n = static_cast<sal_uInt8>((n16 & 0xF000) >> 12); + aBuf.append(toUniChar(n)); + n16 = n16 << 4; + } + + return aBuf.makeStringAndClear(); +} + +SvNumberformat::LocaleType::LocaleType() : + mnNumeralShape(0), + mnCalendarType(0), + meLanguage(LANGUAGE_DONTKNOW) +{ +} + +SvNumberformat::LocaleType::LocaleType(sal_uInt32 nRawNum) : + mnNumeralShape(0), + mnCalendarType(0), + meLanguage(LANGUAGE_DONTKNOW) +{ + meLanguage = static_cast<LanguageType>(nRawNum & 0x0000FFFF); + nRawNum = (nRawNum >> 16); + mnCalendarType = static_cast<sal_uInt8>(nRawNum & 0xFF); + nRawNum = (nRawNum >> 8); + mnNumeralShape = static_cast<sal_uInt8>(nRawNum & 0xFF); +} // static -LanguageType SvNumberformat::ImpGetLanguageType( const String& rString, - xub_StrLen& nPos ) +SvNumberformat::LocaleType SvNumberformat::ImpGetLocaleType( + const String& rString, xub_StrLen& nPos ) { - sal_Int32 nNum = 0; + sal_uInt32 nNum = 0; sal_Unicode cToken = 0; xub_StrLen nLen = rString.Len(); while ( nPos < nLen && ((cToken = rString.GetChar(nPos)) != ']') ) @@ -1134,10 +1205,9 @@ LanguageType SvNumberformat::ImpGetLanguageType( const String& rString, return LANGUAGE_DONTKNOW; ++nPos; } - return (nNum && (cToken == ']' || nPos == nLen)) ? (LanguageType)nNum : - LANGUAGE_DONTKNOW; -} + return (nNum && (cToken == ']' || nPos == nLen)) ? LocaleType(nNum) : LocaleType(); +} short SvNumberformat::ImpNextSymbol(String& rString, xub_StrLen& nPos, @@ -1220,6 +1290,16 @@ short SvNumberformat::ImpNextSymbol(String& rString, { if ( rString.GetChar(nPos) == '-' ) { // [$-xxx] locale + if ( rString.GetChar(nPos+2) == '0' && rString.GetChar(nPos+3) == '7' ) // calendar type code "07" = Thai + { + rString.InsertAscii( "[~buddhist]", nPos+9 ); + nLen += 11; + } + if ( rString.GetChar(nPos+1) == 'D' ) // numeral shape code "D" = Thai digits + { + rString.InsertAscii( "[NatNum1]", nPos+9 ); + nLen += 9; + } sSymbol.EraseAllChars('['); eSymbolType = BRACKET_SYMBOLTYPE_LOCALE; eState = SsGetPrefix; @@ -1241,8 +1321,8 @@ short SvNumberformat::ImpNextSymbol(String& rString, break; default: { - static const String aNatNum( RTL_CONSTASCII_USTRINGPARAM( "NATNUM" ) ); - static const String aDBNum( RTL_CONSTASCII_USTRINGPARAM( "DBNUM" ) ); + const String aNatNum(RTL_CONSTASCII_USTRINGPARAM("NATNUM")); + const String aDBNum(RTL_CONSTASCII_USTRINGPARAM("DBNUM")); String aUpperNatNum( rChrCls().toUpper( rString, nPos-1, aNatNum.Len() ) ); String aUpperDBNum( rChrCls().toUpper( rString, nPos-1, aDBNum.Len() ) ); sal_Unicode cUpper = aUpperNatNum.GetChar(0); @@ -1534,7 +1614,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream, String aStr( sFormatstring ); xub_StrLen nCheckPos = 0; SvNumberformat* pFormat = new SvNumberformat( aStr, &rScan, &rISc, - nCheckPos, eLnge, bStandard ); + nCheckPos, maLocale.meLanguage, bStandard ); DBG_ASSERT( !nCheckPos, "SvNumberformat::Load: NewCurrencyRescan nCheckPos" ); ImpCopyNumberformat( *pFormat ); delete pFormat; @@ -1584,7 +1664,7 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, ImpCopyNumberformat( *pFormat ); // aus Formatter/Scanner uebernommene Werte zuruecksetzen if ( bSystem ) - eLnge = LANGUAGE_SYSTEM; + maLocale.meLanguage = LANGUAGE_SYSTEM; // pColor zeigt noch auf Tabelle in temporaerem Formatter/Scanner for ( sal_uInt16 i = 0; i < 4; i++ ) { @@ -1595,7 +1675,6 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, } } - // static void SvNumberformat::LoadString( SvStream& rStream, String& rStr ) { @@ -1626,7 +1705,6 @@ void SvNumberformat::LoadString( SvStream& rStream, String& rStr ) } } - void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr ) const { String aFormatstring( sFormatstring ); @@ -1697,7 +1775,6 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr rHdr.EndEntry(); } - sal_Bool SvNumberformat::HasNewCurrency() const { for ( sal_uInt16 j=0; j<4; j++ ) @@ -1708,7 +1785,6 @@ sal_Bool SvNumberformat::HasNewCurrency() const return sal_False; } - sal_Bool SvNumberformat::GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const { @@ -1722,7 +1798,6 @@ sal_Bool SvNumberformat::GetNewCurrencySymbol( String& rSymbol, return sal_False; } - // static String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, sal_Bool bQuoteSymbol ) @@ -1772,13 +1847,11 @@ String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, return aTmp; } - void SvNumberformat::Build50Formatstring( String& rStr ) const { rStr = StripNewCurrencyDelimiters( sFormatstring, sal_True ); } - void SvNumberformat::ImpGetOutputStandard(double& fNumber, String& OutString) { sal_uInt16 nStandardPrec = rScan.GetStandardPrec(); @@ -1893,7 +1966,7 @@ sal_Bool SvNumberformat::GetOutputString(String& sString, sal_uInt16 nIx; if (eType & NUMBERFORMAT_TEXT) nIx = 0; - else if (NumFor[3].GetnAnz() > 0) + else if (NumFor[3].GetCount() > 0) nIx = 3; else { @@ -1905,7 +1978,7 @@ sal_Bool SvNumberformat::GetOutputString(String& sString, if (rInfo.eScannedType == NUMBERFORMAT_TEXT) { sal_Bool bRes = sal_False; - const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) @@ -1996,6 +2069,33 @@ void lcl_GetOutputStringScientific( fNumber, rtl_math_StringFormat_E, nPrec, rFormatter.GetNumDecimalSep().GetChar(0)); } +sal_Int32 lcl_GetForcedDenominator(ImpSvNumberformatInfo &rInfo, sal_uInt16 nAnz) +{ + sal_uInt16 i; + rtl::OUString aDiv; + for( i = 0; i < nAnz; i++ ) + { + if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRAC_FDIV ) + aDiv += rInfo.sStrArray[i]; + } + return aDiv.toInt32(); +} + +// TODO: More optimizations? +void lcl_ForcedDenominator(sal_uLong &nFrac, sal_uLong &nDiv, sal_uLong nForcedDiv) +{ + double fFrac = (double)nFrac / (double)nDiv; + double fMultiplier = (double)nForcedDiv / (double)nDiv; + nFrac = (sal_uLong)( (double)nFrac * fMultiplier ); + + double fFracNew = (double)nFrac / (double)nForcedDiv; + double fFracNew1 = (double)(nFrac + 1) / (double)nForcedDiv; + double fDiff = fFrac - fFracNew; + if( fDiff > ( fFracNew1 - fFrac ) ) + nFrac++; + nDiv = nForcedDiv; +} + } bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, String& rOutString) const @@ -2138,7 +2238,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, fNumber = -fNumber; // Vorzeichen eliminieren *ppColor = NumFor[nIx].GetColor(); const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); - const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); if (nAnz == 0 && rInfo.eScannedType == NUMBERFORMAT_UNDEFINED) return sal_False; // leer => nichts else if (nAnz == 0) // sonst Standard-Format @@ -2217,7 +2317,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, } if (rInfo.nCntExp == 0) { - DBG_ERROR("SvNumberformat:: Bruch, nCntExp == 0"); + OSL_FAIL("SvNumberformat:: Bruch, nCntExp == 0"); return sal_False; } sal_uLong nBasis = ((sal_uLong)floor( // 9, 99, 999 ,... @@ -2382,6 +2482,16 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, } } + if( sal_Int32 nForcedDiv = lcl_GetForcedDenominator(NumFor[nIx].Info(), nAnz) ) + { + lcl_ForcedDenominator(nFrac, nDiv, nForcedDiv); + if( nFrac >= nDiv ) + { + nFrac = nDiv = 0; + fNum = fNum + 1.0; + } + } + if (rInfo.nCntPre == 0) // unechter Bruch { double fNum1 = fNum * (double)nDiv + (double)nFrac; @@ -2669,7 +2779,7 @@ sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, nHour -= 12; } } - const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) @@ -2758,13 +2868,12 @@ sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber, return bRes; } - sal_Bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const { if ( GetCal().getUniqueID() != Gregorian::get() ) return sal_False; const ImpSvNumberformatInfo& rInfo = rNumFor.Info(); - const sal_uInt16 nAnz = rNumFor.GetnAnz(); + const sal_uInt16 nAnz = rNumFor.GetCount(); sal_uInt16 i; for ( i = 0; i < nAnz; i++ ) { @@ -2784,7 +2893,6 @@ sal_Bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const return sal_False; } - void SvNumberformat::SwitchToOtherCalendar( String& rOrgCalendar, double& fOrgDateTime ) const { @@ -2816,7 +2924,6 @@ void SvNumberformat::SwitchToOtherCalendar( String& rOrgCalendar, } } - void SvNumberformat::SwitchToGregorianCalendar( const String& rOrgCalendar, double fOrgDateTime ) const { @@ -2829,7 +2936,6 @@ void SvNumberformat::SwitchToGregorianCalendar( const String& rOrgCalendar, } } - sal_Bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ) { using namespace ::com::sun::star::i18n; @@ -2856,12 +2962,11 @@ sal_Bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, d return sal_False; } - sal_Bool SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const { const ImpSvNumberformatInfo& rInfo = rNumFor.Info(); - const sal_uInt16 nAnz = rNumFor.GetnAnz(); + const sal_uInt16 nAnz = rNumFor.GetCount(); for ( sal_uInt16 i = 0; i < nAnz; i++ ) { if ( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_CALENDAR ) @@ -2880,7 +2985,6 @@ sal_Bool SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, return sal_False; } - // static void SvNumberformat::ImpAppendEraG( String& OutString, const CalendarWrapper& rCal, sal_Int16 nNatNum ) @@ -2905,7 +3009,6 @@ void SvNumberformat::ImpAppendEraG( String& OutString, OutString += rCal.getDisplayString( CalendarDisplayCode::SHORT_ERA, nNatNum ); } - sal_Bool SvNumberformat::ImpGetDateOutput(double fNumber, sal_uInt16 nIx, String& OutString) @@ -2924,7 +3027,7 @@ sal_Bool SvNumberformat::ImpGetDateOutput(double fNumber, if ( ImpFallBackToGregorianCalendar( aOrgCalendar, fOrgDateTime ) ) bOtherCalendar = sal_False; const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); - const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); sal_Int16 nNatNum = NumFor[nIx].GetNatNum().GetNatNum(); for (sal_uInt16 i = 0; i < nAnz; i++) { @@ -3198,7 +3301,7 @@ sal_Bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, nHour -= 12; } } - const sal_uInt16 nAnz = NumFor[nIx].GetnAnz(); + const sal_uInt16 nAnz = NumFor[nIx].GetCount(); for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) @@ -3445,11 +3548,11 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, sal_uInt16 i, j; xub_StrLen k; String sStr; - long nPrecExp; sal_Bool bInteger = sal_False; if ( rInfo.nThousand != FLAG_STANDARD_IN_FORMAT ) { // special formatting only if no GENERAL keyword in format code const sal_uInt16 nThousand = rInfo.nThousand; + long nPrecExp; for (i = 0; i < nThousand; i++) { if (fNumber > _D_MIN_M_BY_1000) @@ -3504,7 +3607,7 @@ sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber, // von hinten nach vorn // editieren: k = sStr.Len(); // hinter letzter Ziffer - j = NumFor[nIx].GetnAnz()-1; // letztes Symbol + j = NumFor[nIx].GetCount()-1; // letztes Symbol // Nachkommastellen: if (rInfo.nCntPost > 0) { @@ -3658,7 +3761,7 @@ sal_Bool SvNumberformat::ImpNumberFillWithThousands( // no other digit symbol follows (which was already detected // during scan of format code, otherwise there would be no // division), else do insert. Same in ImpNumberFill() below. - if ( !bDoThousands && j < NumFor[nIx].GetnAnz()-1 ) + if ( !bDoThousands && j < NumFor[nIx].GetCount()-1 ) bDoThousands = ((j == 0) || (rInfo.nTypeArray[j-1] != NF_SYMBOLTYPE_DIGIT && rInfo.nTypeArray[j-1] != NF_SYMBOLTYPE_THSEP) || @@ -3817,7 +3920,7 @@ sal_Bool SvNumberformat::ImpNumberFill( String& sStr, // number string // if divided and regex [0#,],[^0#] and no other digit symbol // follows (which was already detected during scan of format // code, otherwise there would be no division), else do insert. - if ( !bDoThousands && j < NumFor[nIx].GetnAnz()-1 ) + if ( !bDoThousands && j < NumFor[nIx].GetCount()-1 ) bDoThousands = ((j == 0) || (rInfo.nTypeArray[j-1] != NF_SYMBOLTYPE_DIGIT && rInfo.nTypeArray[j-1] != NF_SYMBOLTYPE_THSEP) || @@ -3863,6 +3966,8 @@ sal_Bool SvNumberformat::ImpNumberFill( String& sStr, // number string sStr.Insert(sNum, k); } break; + case NF_SYMBOLTYPE_FRAC_FDIV: // Do Nothing + break; default: sStr.Insert(rInfo.sStrArray[j],k); @@ -3913,7 +4018,7 @@ void SvNumberformat::GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType, nAnzLeading = 0; sal_Bool bStop = sal_False; sal_uInt16 i = 0; - const sal_uInt16 nAnz = NumFor[nNumFor].GetnAnz(); + const sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); while (!bStop && i < nAnz) { short nType = rInfo.nTypeArray[i]; @@ -3937,7 +4042,7 @@ const String* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nP { if ( nNumFor > 3 ) return NULL; - sal_uInt16 nAnz = NumFor[nNumFor].GetnAnz(); + sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); if ( !nAnz ) return NULL; if ( nPos == 0xFFFF ) @@ -3974,13 +4079,12 @@ const String* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nP return &NumFor[nNumFor].Info().sStrArray[nPos]; } - short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, sal_Bool bString /* = sal_False */ ) const { if ( nNumFor > 3 ) return 0; - sal_uInt16 nAnz = NumFor[nNumFor].GetnAnz(); + sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); if ( !nAnz ) return 0; if ( nPos == 0xFFFF ) @@ -4016,7 +4120,6 @@ short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, return NumFor[nNumFor].Info().nTypeArray[nPos]; } - sal_Bool SvNumberformat::IsNegativeWithoutSign() const { if ( IsNegativeRealNegative() ) @@ -4028,13 +4131,29 @@ sal_Bool SvNumberformat::IsNegativeWithoutSign() const return sal_False; } +sal_Bool SvNumberformat::IsNegativeInBracket() const +{ + sal_uInt16 nAnz = NumFor[1].GetCount(); + if (!nAnz) + return sal_False; + + String *tmpStr = NumFor[1].Info().sStrArray; + return (tmpStr[0] == '(' && tmpStr[nAnz-1] == ')' ); +} + +sal_Bool SvNumberformat::HasPositiveBracketPlaceholder() const +{ + sal_uInt16 nAnz = NumFor[0].GetCount(); + String *tmpStr = NumFor[0].Info().sStrArray; + return (tmpStr[nAnz-1].EqualsAscii( "_)" )); +} DateFormat SvNumberformat::GetDateOrder() const { if ( (eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE ) { short const * const pType = NumFor[0].Info().nTypeArray; - sal_uInt16 nAnz = NumFor[0].GetnAnz(); + sal_uInt16 nAnz = NumFor[0].GetCount(); for ( sal_uInt16 j=0; j<nAnz; j++ ) { switch ( pType[j] ) @@ -4060,22 +4179,21 @@ DateFormat SvNumberformat::GetDateOrder() const } else { - DBG_ERROR( "SvNumberformat::GetDateOrder: no date" ); + OSL_FAIL( "SvNumberformat::GetDateOrder: no date" ); } return rLoc().getDateFormat(); } - sal_uInt32 SvNumberformat::GetExactDateOrder() const { sal_uInt32 nRet = 0; if ( (eType & NUMBERFORMAT_DATE) != NUMBERFORMAT_DATE ) { - DBG_ERROR( "SvNumberformat::GetExactDateOrder: no date" ); + OSL_FAIL( "SvNumberformat::GetExactDateOrder: no date" ); return nRet; } short const * const pType = NumFor[0].Info().nTypeArray; - sal_uInt16 nAnz = NumFor[0].GetnAnz(); + sal_uInt16 nAnz = NumFor[0].GetCount(); int nShift = 0; for ( sal_uInt16 j=0; j<nAnz && nShift < 3; j++ ) { @@ -4108,7 +4226,6 @@ sal_uInt32 SvNumberformat::GetExactDateOrder() const return nRet; } - void SvNumberformat::GetConditions( SvNumberformatLimitOps& rOper1, double& rVal1, SvNumberformatLimitOps& rOper2, double& rVal2 ) const { @@ -4118,7 +4235,6 @@ void SvNumberformat::GetConditions( SvNumberformatLimitOps& rOper1, double& rVal rVal2 = fLimit2; } - Color* SvNumberformat::GetColor( sal_uInt16 nNumFor ) const { if ( nNumFor > 3 ) @@ -4127,7 +4243,6 @@ Color* SvNumberformat::GetColor( sal_uInt16 nNumFor ) const return NumFor[nNumFor].GetColor(); } - void lcl_SvNumberformat_AddLimitStringImpl( String& rStr, SvNumberformatLimitOps eOp, double fLimit, const String& rDecSep ) { @@ -4154,7 +4269,7 @@ void lcl_SvNumberformat_AddLimitStringImpl( String& rStr, rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "[>=" ) ); break; default: - OSL_ASSERT( "unsupported number format" ); + OSL_FAIL( "unsupported number format" ); break; } rStr += String( ::rtl::math::doubleToUString( fLimit, @@ -4164,7 +4279,6 @@ void lcl_SvNumberformat_AddLimitStringImpl( String& rStr, } } - String SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, const LocaleDataWrapper& rLocWrp, sal_Bool bDontQuote ) const @@ -4172,9 +4286,9 @@ String SvNumberformat::GetMappedFormatstring( String aStr; sal_Bool bDefault[4]; // 1 subformat matches all if no condition specified, - bDefault[0] = ( NumFor[1].GetnAnz() == 0 && eOp1 == NUMBERFORMAT_OP_NO ); + bDefault[0] = ( NumFor[1].GetCount() == 0 && eOp1 == NUMBERFORMAT_OP_NO ); // with 2 subformats [>=0];[<0] is implied if no condition specified - bDefault[1] = ( !bDefault[0] && NumFor[2].GetnAnz() == 0 && + bDefault[1] = ( !bDefault[0] && NumFor[2].GetCount() == 0 && eOp1 == NUMBERFORMAT_OP_GE && fLimit1 == 0.0 && eOp2 == NUMBERFORMAT_OP_NO && fLimit2 == 0.0 ); // with 3 or more subformats [>0];[<0];[=0] is implied if no condition specified, @@ -4190,7 +4304,7 @@ String SvNumberformat::GetMappedFormatstring( if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 == NUMBERFORMAT_OP_NO ) bDefault[0] = bDefault[1] = sal_True; // [];x else if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 != NUMBERFORMAT_OP_NO && - NumFor[2].GetnAnz() == 0 ) + NumFor[2].GetCount() == 0 ) bDefault[0] = bDefault[1] = bDefault[2] = bDefault[3] = sal_True; // [];[];; // nothing to do if conditions specified for every subformat } @@ -4198,7 +4312,7 @@ String SvNumberformat::GetMappedFormatstring( bDefault[0] = sal_False; // a single unconditional subformat is never delimited else { - if ( bDefault[2] && NumFor[2].GetnAnz() == 0 && NumFor[1].GetnAnz() > 0 ) + if ( bDefault[2] && NumFor[2].GetCount() == 0 && NumFor[1].GetCount() > 0 ) bDefault[3] = sal_True; // special cases x;x;; and ;x;; for ( int i=0; i<3 && !bDefault[i]; ++i ) bDefault[i] = sal_True; @@ -4211,6 +4325,7 @@ String SvNumberformat::GetMappedFormatstring( nSem++; String aPrefix; + bool LCIDInserted = false; if ( !bDefaults ) { @@ -4244,16 +4359,8 @@ String SvNumberformat::GetMappedFormatstring( } const SvNumberNatNum& rNum = NumFor[n].GetNatNum(); - // The Thai T NatNum modifier during Xcl export. - if (rNum.IsSet() && rNum.GetNatNum() == 1 && - rKeywords[NF_KEY_THAI_T].EqualsAscii( "T") && - MsLangId::getRealLanguage( rNum.GetLang()) == - LANGUAGE_THAI) - { - aPrefix += 't'; // must be lowercase, otherwise taken as literal - } - sal_uInt16 nAnz = NumFor[n].GetnAnz(); + sal_uInt16 nAnz = NumFor[n].GetCount(); if ( nSem && (nAnz || aPrefix.Len()) ) { for ( ; nSem; --nSem ) @@ -4311,6 +4418,25 @@ String SvNumberformat::GetMappedFormatstring( aStr += '"'; } break; + case NF_SYMBOLTYPE_CALDEL : + if ( pStr[j+1].EqualsAscii("buddhist") ) + { + //aStr.InsertAscii( "[$-", aStr.Len() ); + aStr.InsertAscii( "[$-", 0 ); + if ( rNum.IsSet() && rNum.GetNatNum() == 1 && + MsLangId::getRealLanguage( rNum.GetLang() ) == + LANGUAGE_THAI ) + { + aStr.InsertAscii( "D07041E]", 3 ); // date in Thai digit, Buddhist era + } + else + { + aStr.InsertAscii( "107041E]", 3 ); // date in Arabic digit, Buddhist era + } + j = j+2; + } + LCIDInserted = true; + break; default: aStr += pStr[j]; } @@ -4318,6 +4444,15 @@ String SvNumberformat::GetMappedFormatstring( } } } + // The Thai T NatNum modifier during Xcl export. + if (rNum.IsSet() && rNum.GetNatNum() == 1 && + rKeywords[NF_KEY_THAI_T].EqualsAscii( "T") && + MsLangId::getRealLanguage( rNum.GetLang()) == + LANGUAGE_THAI && !LCIDInserted ) + { + + aStr.InsertAscii( "[$-D00041E]", 0 ); // number in Thai digit + } } for ( ; nSub<4 && bDefault[nSub]; ++nSub ) { // append empty subformats @@ -4326,7 +4461,6 @@ String SvNumberformat::GetMappedFormatstring( return aStr; } - String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum& rNum, sal_Int32 nVal, sal_uInt16 nMinDigits ) const { @@ -4362,7 +4496,6 @@ String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum& rNum, return aStr; } - void SvNumberformat::ImpTransliterateImpl( String& rStr, const SvNumberNatNum& rNum ) const { @@ -4372,7 +4505,6 @@ void SvNumberformat::ImpTransliterateImpl( String& rStr, aLocale, rNum.GetNatNum() ); } - void SvNumberformat::GetNatNumXml( com::sun::star::i18n::NativeNumberXmlAttributes& rAttr, sal_uInt16 nNumFor ) const @@ -4418,7 +4550,6 @@ sal_Bool SvNumberformat::HasStringNegativeSign( const String& rStr ) return sal_False; } - // static void SvNumberformat::SetComment( const String& rStr, String& rFormat, String& rComment ) @@ -4450,7 +4581,6 @@ void SvNumberformat::SetComment( const String& rStr, String& rFormat, } } - // static void SvNumberformat::EraseCommentBraces( String& rStr ) { @@ -4471,7 +4601,6 @@ void SvNumberformat::EraseCommentBraces( String& rStr ) rStr.Erase( --nLen, 1 ); } - // static void SvNumberformat::EraseComment( String& rStr ) { @@ -4508,7 +4637,6 @@ void SvNumberformat::EraseComment( String& rStr ) rStr.Erase( nPos ); } - // static sal_Bool SvNumberformat::IsInQuote( const String& rStr, xub_StrLen nPos, sal_Unicode cQuote, sal_Unicode cEscIn, sal_Unicode cEscOut ) @@ -4542,7 +4670,6 @@ sal_Bool SvNumberformat::IsInQuote( const String& rStr, xub_StrLen nPos, return bQuoted; } - // static xub_StrLen SvNumberformat::GetQuoteEnd( const String& rStr, xub_StrLen nPos, sal_Unicode cQuote, sal_Unicode cEscIn, sal_Unicode cEscOut ) @@ -4568,11 +4695,10 @@ xub_StrLen SvNumberformat::GetQuoteEnd( const String& rStr, xub_StrLen nPos, return nLen; // String Ende } - sal_uInt16 SvNumberformat::ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const { sal_uInt16 nCnt = 0; - sal_uInt16 nAnz = NumFor[nNumFor].GetnAnz(); + sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); short const * const pType = NumFor[nNumFor].Info().nTypeArray; for ( sal_uInt16 j=0; j<nAnz; ++j ) { @@ -4591,3 +4717,4 @@ sal_uInt16 SvNumberformat::ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) return nCnt; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 83dbd512a4e2..9eee6a55c823 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.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,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <stdlib.h> #include <tools/debug.hxx> @@ -124,7 +123,6 @@ ImpSvNumberformatScan::~ImpSvNumberformatScan() Reset(); } - void ImpSvNumberformatScan::ChangeIntl() { bKeywordsNeedInit = sal_True; @@ -134,7 +132,6 @@ void ImpSvNumberformatScan::ChangeIntl() sKeyword[NF_KEY_FALSE].Erase(); } - void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const { switch ( eIdx ) @@ -146,7 +143,7 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const if ( !sKeyword[NF_KEY_TRUE].Len() ) { DBG_ERRORFILE( "InitSpecialKeyword: TRUE_WORD?" ); - ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "sal_True" ) ); + ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "TRUE" ) ); } break; case NF_KEY_FALSE : @@ -156,7 +153,7 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const if ( !sKeyword[NF_KEY_FALSE].Len() ) { DBG_ERRORFILE( "InitSpecialKeyword: FALSE_WORD?" ); - ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "sal_False" ) ); + ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "FALSE" ) ); } break; default: @@ -164,7 +161,6 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const } } - void ImpSvNumberformatScan::InitCompatCur() const { ImpSvNumberformatScan* pThis = (ImpSvNumberformatScan*)this; @@ -175,7 +171,6 @@ void ImpSvNumberformatScan::InitCompatCur() const bCompatCurNeedInit = sal_False; } - void ImpSvNumberformatScan::InitKeywords() const { if ( !bKeywordsNeedInit ) @@ -184,7 +179,6 @@ void ImpSvNumberformatScan::InitKeywords() const bKeywordsNeedInit = sal_False; } - /** Extract the name of General, Standard, Whatever, ignoring leading modifiers such as [NatNum1]. */ static String lcl_extractStandardGeneralName( const ::rtl::OUString & rCode ) @@ -228,7 +222,6 @@ static String lcl_extractStandardGeneralName( const ::rtl::OUString & rCode ) return aStr; } - void ImpSvNumberformatScan::SetDependentKeywords() { using namespace ::com::sun::star; @@ -456,7 +449,6 @@ void ImpSvNumberformatScan::SetDependentKeywords() InitCompatCur(); } - void ImpSvNumberformatScan::ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear) { if ( pNullDate ) @@ -536,7 +528,6 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr) return pResult; } - short ImpSvNumberformatScan::GetKeyWord( const String& sSymbol, xub_StrLen nPos ) { String sString = pFormatter->GetCharClass()->toUpper( sSymbol, nPos, sSymbol.Len() - nPos ); @@ -957,7 +948,6 @@ void ImpSvNumberformatScan::SkipStrings(sal_uInt16& i, xub_StrLen& nPos) } } - sal_uInt16 ImpSvNumberformatScan::PreviousKeyword(sal_uInt16 i) { short res = 0; @@ -1089,7 +1079,6 @@ void ImpSvNumberformatScan::Reset() nNatNumModifier = 0; } - sal_Bool ImpSvNumberformatScan::Is100SecZero( sal_uInt16 i, sal_Bool bHadDecSep ) { sal_uInt16 nIndexPre = PreviousKeyword( i ); @@ -1099,7 +1088,6 @@ sal_Bool ImpSvNumberformatScan::Is100SecZero( sal_uInt16 i, sal_Bool bHadDecSep // SS"any"00 take "any" as a valid decimal separator } - xub_StrLen ImpSvNumberformatScan::ScanType(const String&) { const LocaleDataWrapper* pLoc = pFormatter->GetLocaleData(); @@ -1408,16 +1396,16 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&) return 0; // Alles ok } - bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType eType, const String& rStr ) { if (nAnzStrings >= NF_MAX_FORMAT_SYMBOLS || nPos > nAnzStrings) return false; - ++nAnzResStrings; if (nPos > 0 && nTypeArray[nPos-1] == NF_SYMBOLTYPE_EMPTY) --nPos; // reuse position else { + if ((size_t) (nAnzStrings + 1) >= NF_MAX_FORMAT_SYMBOLS) + return false; ++nAnzStrings; for (size_t i = nAnzStrings; i > nPos; --i) { @@ -1425,12 +1413,12 @@ bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType e sStrArray[i] = sStrArray[i-1]; } } + ++nAnzResStrings; nTypeArray[nPos] = static_cast<short>(eType); sStrArray[nPos] = rStr; return true; } - int ImpSvNumberformatScan::FinalScanGetCalendar( xub_StrLen& nPos, sal_uInt16& i, sal_uInt16& rAnzResStrings ) { @@ -1559,9 +1547,10 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) case NUMBERFORMAT_SCIENTIFIC: case NUMBERFORMAT_FRACTION: { - sal_Unicode cThousandFill = ' '; while (i < nAnzStrings) { + // TODO: rechecking eScannedType is unnecessary. + // This switch-case is for eScannedType == NUMBERFORMAT_FRACTION anyway if (eScannedType == NUMBERFORMAT_FRACTION && // special case nTypeArray[i] == NF_SYMBOLTYPE_DEL && // # ### #/# StringEqualsChar( sOldThousandSep, ' ' ) && // e.g. France or Sweden @@ -1572,7 +1561,6 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) nTypeArray[i] = NF_SYMBOLTYPE_STRING; // del->string } // kein Taus.p. - if (nTypeArray[i] == NF_SYMBOLTYPE_BLANK || nTypeArray[i] == NF_SYMBOLTYPE_STAR || nTypeArray[i] == NF_KEY_CCC || // CCC @@ -1623,6 +1611,27 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) bThaiT = true; sStrArray[i] = sKeyword[nTypeArray[i]]; } + else if (sStrArray[i].GetChar(0) >= '0' && + sStrArray[i].GetChar(0) <= '9') + { + rtl::OUString sDiv; + sal_uInt16 j = i; + while(j < nAnzStrings) + sDiv += sStrArray[j++]; + if (rtl::OUString::valueOf(sDiv.toInt32()) == sDiv) + { + /* Found a Divisor */ + while (i < j) + nTypeArray[i++] = NF_SYMBOLTYPE_FRAC_FDIV; + i = j - 1; // Stop the loop + if (nCntPost) + nCounter = nCntPost; + else if (nCntPre) + nCounter = nCntPre; + if (!nCntPre) + nCntPre++; + } + } else nTypeArray[i] = NF_SYMBOLTYPE_STRING; nPos = nPos + sStrArray[i].Len(); @@ -1735,10 +1744,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) { nPos = nPos + sStrArray[i].Len(); if (!bThousand) // only once - { bThousand = sal_True; - cThousandFill = sStrArray[i+1].GetChar(0); - } // Eat it, will be reinserted at proper // grouping positions further down. nTypeArray[i] = NF_SYMBOLTYPE_EMPTY; @@ -2749,7 +2755,6 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment ) return 0; } - xub_StrLen ImpSvNumberformatScan::RemoveQuotes( String& rStr ) { if ( rStr.Len() > 1 ) @@ -2771,7 +2776,6 @@ xub_StrLen ImpSvNumberformatScan::RemoveQuotes( String& rStr ) return 0; } - xub_StrLen ImpSvNumberformatScan::ScanFormat( String& rString, String& rComment ) { xub_StrLen res = Symbol_Division(rString); //lexikalische Analyse @@ -2806,4 +2810,4 @@ void ImpSvNumberformatScan::CopyInfo(ImpSvNumberformatInfo* pInfo, sal_uInt16 nA pInfo->nCntExp = nCntExp; } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index a1372866a46e..3aa279c3ee46 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.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. @@ -273,3 +274,5 @@ private: // ---- privater Teil #endif // _ZFORSCAN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 6e92d390eea9..6e922ea29cd7 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.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. @@ -124,7 +125,7 @@ static vector< ::rtl::OUString > getInfoFromInd( ::rtl::OUString aInd ) && ( pLine[i] < 'a' || pLine[i] > 'f' ) && ( pLine[i] < 'A' || pLine[i] > 'F' ) ) ) { - OSL_ENSURE( sal_False, "Wrong index syntax!\n" ); + OSL_FAIL( "Wrong index syntax!\n" ); return aResult; } @@ -139,7 +140,7 @@ static vector< ::rtl::OUString > getInfoFromInd( ::rtl::OUString aInd ) } while( pLine[0] == '_' && pLine[1] == '_' ); if( *pLine ) - OSL_ENSURE( sal_False, "Wrong index syntax!\n" ); + OSL_FAIL( "Wrong index syntax!\n" ); return aResult; } @@ -149,7 +150,7 @@ static vector< ::rtl::OUString > getInfoFromInd( ::rtl::OUString aInd ) static sal_Bool shorterUrl( ::rtl::OUString& aURL ) { sal_Int32 aInd = aURL.lastIndexOf( sal_Unicode( '/' ) ); - if( aInd > 0 && aURL.indexOf( ::rtl::OUString::createFromAscii( "://" ) ) != aInd-2 ) + if( aInd > 0 && aURL.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("://")) ) != aInd-2 ) { aURL = aURL.copy( 0, aInd ); return sal_True; @@ -221,16 +222,16 @@ PassMap StorageItem::getInfo() { PassMap aResult; - Sequence< ::rtl::OUString > aNodeNames = ConfigItem::GetNodeNames( ::rtl::OUString::createFromAscii("Store") ); + Sequence< ::rtl::OUString > aNodeNames = ConfigItem::GetNodeNames( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Store")) ); sal_Int32 aNodeCount = aNodeNames.getLength(); Sequence< ::rtl::OUString > aPropNames( aNodeCount ); sal_Int32 aNodeInd; for( aNodeInd = 0; aNodeInd < aNodeCount; ++aNodeInd ) { - aPropNames[aNodeInd] = ::rtl::OUString::createFromAscii( "Store/Passwordstorage['" ); + aPropNames[aNodeInd] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Store/Passwordstorage['")); aPropNames[aNodeInd] += aNodeNames[aNodeInd]; - aPropNames[aNodeInd] += ::rtl::OUString::createFromAscii( "']/Password" ); + aPropNames[aNodeInd] += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("']/Password")); } Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aPropNames ); @@ -265,7 +266,7 @@ PassMap StorageItem::getInfo() } } else - OSL_ENSURE( sal_False, "Wrong index sintax!\n" ); + OSL_FAIL( "Wrong index sintax!\n" ); } return aResult; @@ -278,7 +279,7 @@ void StorageItem::setUseStorage( sal_Bool bUse ) Sequence< ::rtl::OUString > sendNames(1); Sequence< uno::Any > sendVals(1); - sendNames[0] = ::rtl::OUString::createFromAscii( "UseStorage" ); + sendNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseStorage")); sendVals[0] <<= bUse; @@ -291,7 +292,7 @@ void StorageItem::setUseStorage( sal_Bool bUse ) sal_Bool StorageItem::useStorage() { Sequence< ::rtl::OUString > aNodeNames( 1 ); - aNodeNames[0] = ::rtl::OUString::createFromAscii( "UseStorage" ); + aNodeNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseStorage")); Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aNodeNames ); @@ -318,8 +319,8 @@ sal_Bool StorageItem::getEncodedMP( ::rtl::OUString& aResult ) } Sequence< ::rtl::OUString > aNodeNames( 2 ); - aNodeNames[0] = ::rtl::OUString::createFromAscii( "HasMaster" ); - aNodeNames[1] = ::rtl::OUString::createFromAscii( "Master" ); + aNodeNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasMaster")); + aNodeNames[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Master")); Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aNodeNames ); @@ -344,8 +345,8 @@ void StorageItem::setEncodedMP( const ::rtl::OUString& aEncoded, sal_Bool bAccep Sequence< ::rtl::OUString > sendNames(2); Sequence< uno::Any > sendVals(2); - sendNames[0] = ::rtl::OUString::createFromAscii( "HasMaster" ); - sendNames[1] = ::rtl::OUString::createFromAscii( "Master" ); + sendNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasMaster")); + sendNames[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Master")); sal_Bool bHasMaster = ( aEncoded.getLength() > 0 || bAcceptEmpty ); sendVals[0] <<= bHasMaster; @@ -369,11 +370,11 @@ void StorageItem::remove( const ::rtl::OUString& aURL, const ::rtl::OUString& aN Sequence< ::rtl::OUString > sendSeq(1); sendSeq[0] = createIndex( forIndex ); - // sendSeq[0] = ::rtl::OUString::createFromAscii( "Store/Passwordstorage['" ); + // sendSeq[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Store/Passwordstorage['")); // sendSeq[0] += createIndex( forIndex ); - // sendSeq[0] += ::rtl::OUString::createFromAscii( "']" ); + // sendSeq[0] += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("']")); - ConfigItem::ClearNodeElements( ::rtl::OUString::createFromAscii( "Store" ), sendSeq ); + ConfigItem::ClearNodeElements( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Store")), sendSeq ); } //------------------------------------------------------------------------- @@ -382,7 +383,7 @@ void StorageItem::clear() { Sequence< ::rtl::OUString > sendSeq(1); - ConfigItem::ClearNodeSet( ::rtl::OUString::createFromAscii( "Store" ) ); + ConfigItem::ClearNodeSet( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Store")) ); } //------------------------------------------------------------------------- @@ -391,7 +392,7 @@ void StorageItem::update( const ::rtl::OUString& aURL, const NamePassRecord& aRe { if ( !aRecord.HasPasswords( PERSISTENT_RECORD ) ) { - OSL_ASSERT( "Unexpected storing of a record!" ); + OSL_FAIL( "Unexpected storing of a record!" ); return; } @@ -401,14 +402,14 @@ void StorageItem::update( const ::rtl::OUString& aURL, const NamePassRecord& aRe Sequence< beans::PropertyValue > sendSeq(1); - sendSeq[0].Name = ::rtl::OUString::createFromAscii( "Store/Passwordstorage['" ); + sendSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Store/Passwordstorage['")); sendSeq[0].Name += createIndex( forIndex ); - sendSeq[0].Name += ::rtl::OUString::createFromAscii( "']/Password" ); + sendSeq[0].Name += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("']/Password")); sendSeq[0].Value <<= aRecord.GetPersPasswords(); ConfigItem::SetModified(); - ConfigItem::SetSetProperties( ::rtl::OUString::createFromAscii( "Store" ), sendSeq ); + ConfigItem::SetSetProperties( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Store")), sendSeq ); } //------------------------------------------------------------------------- @@ -439,7 +440,7 @@ PasswordContainer::PasswordContainer( const Reference<XMultiServiceFactory>& xSe mComponent = Reference< XComponent >( xServiceFactory, UNO_QUERY ); mComponent->addEventListener( this ); - m_pStorageFile = new StorageItem( this, ::rtl::OUString::createFromAscii( "Office.Common/Passwords" ) ); + m_pStorageFile = new StorageItem( this, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Passwords")) ); if( m_pStorageFile ) if( m_pStorageFile->useStorage() ) m_aContainer = m_pStorageFile->getInfo(); @@ -525,13 +526,13 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr } else { - OSL_ENSURE( sal_False, "No master password provided!\n" ); + OSL_FAIL( "No master password provided!\n" ); // throw special exception } // problems with decoding - OSL_ENSURE( sal_False, "Problem with decoding\n" ); - throw RuntimeException( ::rtl::OUString::createFromAscii( "Can't decode!" ), Reference< XInterface >() ); + OSL_FAIL( "Problem with decoding\n" ); + throw RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't decode!")), Reference< XInterface >() ); } @@ -605,20 +606,20 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr } else { - OSL_ENSURE( sal_False, "No master password provided!\n" ); + OSL_FAIL( "No master password provided!\n" ); // throw special exception } // problems with encoding - OSL_ENSURE( sal_False, "Problem with encoding\n" ); - throw RuntimeException( ::rtl::OUString::createFromAscii( "Can't encode!" ), Reference< XInterface >() ); + OSL_FAIL( "Problem with encoding\n" ); + throw RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Can't encode!")), Reference< XInterface >() ); } //------------------------------------------------------------------------- void PasswordContainer::UpdateVector( const ::rtl::OUString& aURL, list< NamePassRecord >& toUpdate, NamePassRecord& aRecord, sal_Bool writeFile ) throw(RuntimeException) { - for( list< NamePassRecord >::iterator aNPIter = toUpdate.begin(); aNPIter != toUpdate.end(); aNPIter++ ) + for( list< NamePassRecord >::iterator aNPIter = toUpdate.begin(); aNPIter != toUpdate.end(); ++aNPIter ) if( aNPIter->GetUserName().equals( aRecord.GetUserName() ) ) { if( aRecord.HasPasswords( MEMORY_RECORD ) ) @@ -683,7 +684,7 @@ Sequence< UserRecord > PasswordContainer::CopyToUserRecordSequence( const list< for( list< NamePassRecord >::const_iterator aNPIter = original.begin(); aNPIter != original.end(); - aNPIter++, nInd++ ) + ++aNPIter, ++nInd ) { aResult[nInd] = CopyToUserRecord( *aNPIter, bTryToDecode, aHandler ); } @@ -722,7 +723,7 @@ void PasswordContainer::PrivateAdd( const ::rtl::OUString& Url, const ::rtl::OUS aRecord.SetMemPasswords( aStorePass ); else { - OSL_ASSERT( "Unexpected persistence status!" ); + OSL_FAIL( "Unexpected persistence status!" ); return; } @@ -767,7 +768,7 @@ Sequence< UserRecord > PasswordContainer::FindUsr( const list< NamePassRecord >& sal_uInt32 nInd = 0; for( list< NamePassRecord >::const_iterator aNPIter = userlist.begin(); aNPIter != userlist.end(); - aNPIter++, nInd++ ) + ++aNPIter, ++nInd ) { if( aNPIter->GetUserName().equals( aName ) ) { @@ -842,7 +843,7 @@ UrlRecord PasswordContainer::find( { ::rtl::OUString tmpUrl( aUrl ); if ( tmpUrl.getStr()[tmpUrl.getLength() - 1] != (sal_Unicode)'/' ) - tmpUrl += ::rtl::OUString::createFromAscii( "/" ); + tmpUrl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); aIter = m_aContainer.lower_bound( tmpUrl ); if( aIter != m_aContainer.end() && aIter->first.match( tmpUrl ) ) @@ -905,7 +906,7 @@ UrlRecord PasswordContainer::find( { PasswordRequestMode aRMode = PasswordRequestMode_PASSWORD_ENTER; if( !m_pStorageFile || !m_pStorageFile->useStorage() ) - throw NoMasterException( ::rtl::OUString::createFromAscii( "Password storing is not active!" ), Reference< XInterface >(), aRMode ); + throw NoMasterException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Password storing is not active!")), Reference< XInterface >(), aRMode ); if( !m_aMasterPasswd.getLength() && aHandler.is() ) { @@ -954,7 +955,7 @@ UrlRecord PasswordContainer::find( } if ( !m_aMasterPasswd.getLength() ) - throw NoMasterException( ::rtl::OUString::createFromAscii( "No master password!" ), Reference< XInterface >(), aRMode ); + throw NoMasterException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No master password!")), Reference< XInterface >(), aRMode ); return m_aMasterPasswd; } @@ -976,14 +977,14 @@ void SAL_CALL PasswordContainer::remove( const ::rtl::OUString& aURL, const ::rt if( aInd > 0 && aUrl.getLength()-1 == aInd ) aUrl = aUrl.copy( 0, aUrl.getLength() - 1 ); else - aUrl += ::rtl::OUString::createFromAscii( "/" ); + aUrl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); aIter = m_aContainer.find( aUrl ); } if( aIter != m_aContainer.end() ) { - for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); aNPIter++ ) + for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); ++aNPIter ) if( aNPIter->GetUserName().equals( aName ) ) { if( aNPIter->HasPasswords( PERSISTENT_RECORD ) && m_pStorageFile ) @@ -1018,14 +1019,14 @@ void SAL_CALL PasswordContainer::removePersistent( const ::rtl::OUString& aURL, if( aInd > 0 && aUrl.getLength()-1 == aInd ) aUrl = aUrl.copy( 0, aUrl.getLength() - 1 ); else - aUrl += ::rtl::OUString::createFromAscii( "/" ); + aUrl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); aIter = m_aContainer.find( aUrl ); } if( aIter != m_aContainer.end() ) { - for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); aNPIter++ ) + for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); ++aNPIter ) if( aNPIter->GetUserName().equals( aName ) ) { if( aNPIter->HasPasswords( PERSISTENT_RECORD ) ) @@ -1073,21 +1074,21 @@ void SAL_CALL PasswordContainer::removeAllPersistent() throw(RuntimeException) if( !aNPIter->HasPasswords( MEMORY_RECORD ) ) { list< NamePassRecord >::iterator aIterToDelete( aNPIter ); - aNPIter++; + ++aNPIter; aIter->second.erase( aIterToDelete ); } else - aNPIter++; + ++aNPIter; } if( aIter->second.begin() == aIter->second.end() ) { PassMap::iterator aIterToDelete( aIter ); - aIter++; + ++aIter; m_aContainer.erase( aIterToDelete ); } else - aIter++; + ++aIter; } } //------------------------------------------------------------------------- @@ -1097,10 +1098,10 @@ Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent( const Refere Sequence< UrlRecord > aResult; ::osl::MutexGuard aGuard( mMutex ); - for( PassMap::iterator aIter = m_aContainer.begin(); aIter != m_aContainer.end(); aIter++ ) + for( PassMap::iterator aIter = m_aContainer.begin(); aIter != m_aContainer.end(); ++aIter ) { Sequence< UserRecord > aUsers; - for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); aNPIter++ ) + for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); ++aNPIter ) if( aNPIter->HasPasswords( PERSISTENT_RECORD ) ) { sal_Int32 oldLen = aUsers.getLength(); @@ -1395,7 +1396,7 @@ void PasswordContainer::Notify() PassMap::iterator aIter; // remove the cached persistent values in the memory - for( aIter = m_aContainer.begin(); aIter != m_aContainer.end(); aIter++ ) + for( aIter = m_aContainer.begin(); aIter != m_aContainer.end(); ++aIter ) { for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); ) { @@ -1410,11 +1411,11 @@ void PasswordContainer::Notify() if( !aNPIter->HasPasswords( MEMORY_RECORD ) ) { list< NamePassRecord >::iterator aIterToDelete( aNPIter ); - aNPIter++; + ++aNPIter; aIter->second.erase( aIterToDelete ); } else - aNPIter++; + ++aNPIter; } } @@ -1422,11 +1423,11 @@ void PasswordContainer::Notify() if( m_pStorageFile ) addon = m_pStorageFile->getInfo(); - for( aIter = addon.begin(); aIter != addon.end(); aIter++ ) + for( aIter = addon.begin(); aIter != addon.end(); ++aIter ) { PassMap::iterator aSearchIter = m_aContainer.find( aIter->first ); if( aSearchIter != m_aContainer.end() ) - for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); aNPIter++ ) + for( list< NamePassRecord >::iterator aNPIter = aIter->second.begin(); aNPIter != aIter->second.end(); ++aNPIter ) UpdateVector( aSearchIter->first, aSearchIter->second, *aNPIter, sal_False ); else m_aContainer.insert( PairUrlRecord( aIter->first, aIter->second ) ); @@ -1462,7 +1463,7 @@ Sequence< ::rtl::OUString > SAL_CALL PasswordContainer::getSupportedServiceNames Sequence< ::rtl::OUString > SAL_CALL PasswordContainer::impl_getStaticSupportedServiceNames( ) throw(uno::RuntimeException) { Sequence< ::rtl::OUString > aRet(1); - *aRet.getArray() = ::rtl::OUString::createFromAscii("com.sun.star.task.PasswordContainer"); + *aRet.getArray() = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.PasswordContainer")); return aRet; } @@ -1470,7 +1471,7 @@ Sequence< ::rtl::OUString > SAL_CALL PasswordContainer::impl_getStaticSupportedS ::rtl::OUString SAL_CALL PasswordContainer::impl_getStaticImplementationName() throw(uno::RuntimeException) { - return ::rtl::OUString::createFromAscii("stardiv.svl.PasswordContainer"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("stardiv.svl.PasswordContainer")); } //------------------------------------------------------------------------- @@ -1565,3 +1566,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( } } // extern "C" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx index fc70088bf371..66efc892cd65 100644 --- a/svl/source/passwordcontainer/syscreds.cxx +++ b/svl/source/passwordcontainer/syscreds.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. @@ -32,14 +33,14 @@ using namespace com::sun::star; SysCredentialsConfigItem::SysCredentialsConfigItem( SysCredentialsConfig * pOwner ) -: utl::ConfigItem( rtl::OUString::createFromAscii( "Office.Common/Passwords" ), +: utl::ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Passwords")), CONFIG_MODE_IMMEDIATE_UPDATE ), m_bInited( false ), m_pOwner( pOwner ) { uno::Sequence< ::rtl::OUString > aNode( 1 ); - aNode[ 0 ] = rtl::OUString::createFromAscii( - "Office.Common/Passwords/AuthenticateUsingSystemCredentials" ); + aNode[ 0 ] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Office.Common/Passwords/AuthenticateUsingSystemCredentials" )); EnableNotification( aNode ); } @@ -69,8 +70,8 @@ SysCredentialsConfigItem::getSystemCredentialsURLs() { // read config item uno::Sequence< ::rtl::OUString > aPropNames( 1 ); - aPropNames[ 0 ] = rtl::OUString::createFromAscii( - "AuthenticateUsingSystemCredentials" ); + aPropNames[ 0 ] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "AuthenticateUsingSystemCredentials" )); uno::Sequence< uno::Any > aAnyValues( utl::ConfigItem::GetProperties( aPropNames ) ); @@ -99,8 +100,8 @@ void SysCredentialsConfigItem::setSystemCredentialsURLs( uno::Sequence< rtl::OUString > aPropNames( 1 ); uno::Sequence< uno::Any > aPropValues( 1 ); aPropNames[ 0 ] - = ::rtl::OUString::createFromAscii( - "AuthenticateUsingSystemCredentials" ); + = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "AuthenticateUsingSystemCredentials" )); aPropValues[ 0 ] <<= seqURLList; utl::ConfigItem::SetModified(); @@ -122,7 +123,7 @@ namespace if( aInd > 0 ) { sal_Int32 aPrevInd = aURL.lastIndexOf( sal_Unicode( '/' ), aInd ); - if ( aURL.indexOf( ::rtl::OUString::createFromAscii( "://" ) ) + if ( aURL.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("://")) ) != aPrevInd - 2 || aInd != aURL.getLength() - 1 ) { @@ -156,7 +157,7 @@ namespace { ::rtl::OUString tmpUrl( aUrl ); if ( tmpUrl.getStr()[tmpUrl.getLength() - 1] != (sal_Unicode)'/' ) - tmpUrl += ::rtl::OUString::createFromAscii( "/" ); + tmpUrl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); aIter = rContainer.lower_bound( tmpUrl ); if( aIter != rContainer.end() && aIter->match( tmpUrl ) ) @@ -298,3 +299,5 @@ void SysCredentialsConfig::persistentConfigChanged() ::osl::MutexGuard aGuard( m_aMutex ); m_bCfgInited = false; // re-init on demand. } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/passwordcontainer/syscreds.hxx b/svl/source/passwordcontainer/syscreds.hxx index 247ad31a00e5..f4b13bd80b64 100644 --- a/svl/source/passwordcontainer/syscreds.hxx +++ b/svl/source/passwordcontainer/syscreds.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. @@ -90,3 +91,5 @@ class SysCredentialsConfig }; #endif // INCLUDED_SVTOOLS_SYSCREDS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx index ec1adf1fd300..3f6ffafd0028 100644 --- a/svl/source/svdde/ddecli.cxx +++ b/svl/source/svdde/ddecli.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. @@ -30,18 +31,14 @@ #define UNICODE #include <string.h> // memset +#include <algorithm> #include "ddeimp.hxx" #include <svl/svdde.hxx> #include <osl/thread.h> #include <tools/debug.hxx> #include <tools/solarmutex.hxx> -#include <vos/mutex.hxx> - -// static DWORD hDdeInst = NULL; -// static short nInstance = 0; - -// DdeConnections* DdeConnection::pConnections = NULL; +#include <osl/mutex.hxx> DdeInstData* ImpInitInstData() { @@ -73,30 +70,34 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( HDDEDATA hData, DWORD nInfo1, DWORD ) { HDDEDATA nRet = DDE_FNOTPROCESSED; - DdeConnections& rAll = (DdeConnections&)DdeConnection::GetConnections(); + const std::vector<DdeConnection*> &rAll = DdeConnection::GetConnections(); DdeConnection* self = 0; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - for ( self = rAll.First(); self; self = rAll.Next() ) + for ( size_t i = 0; i < rAll.size(); ++i) + { + self = rAll[i]; + if ( self->pImp->hConv == hConv ) break; + } if( self ) { - DdeTransaction* t; sal_Bool bFound = sal_False; - for( t = self->aTransactions.First(); t; t = self->aTransactions.Next() ) + std::vector<DdeTransaction*>::iterator iter; + for( iter = self->aTransactions.begin(); iter != self->aTransactions.end(); ++iter ) { switch( nCode ) { case XTYP_XACT_COMPLETE: - if( (DWORD)t->nId == nInfo1 ) + if( (DWORD)(*iter)->nId == nInfo1 ) { - nCode = t->nType & (XCLASS_MASK | XTYP_MASK); - t->bBusy = sal_False; - t->Done( 0 != hData ); + nCode = (*iter)->nType & (XCLASS_MASK | XTYP_MASK); + (*iter)->bBusy = sal_False; + (*iter)->Done( 0 != hData ); bFound = sal_True; } break; @@ -106,27 +107,27 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( self->pImp->nStatus = self->pImp->hConv ? DMLERR_NO_ERROR : DdeGetLastError( pInst->hDdeInstCli ); - t = 0; + iter = self->aTransactions.end(); nRet = 0; bFound = sal_True; break; case XTYP_ADVDATA: - bFound = sal_Bool( *t->pName == hText2 ); + bFound = sal_Bool( *(*iter)->pName == hText2 ); break; } if( bFound ) break; } - if( t ) + if( iter != self->aTransactions.end() ) { switch( nCode ) { case XTYP_ADVDATA: if( !hData ) { - ((DdeLink*) t)->Notify(); + static_cast<DdeLink*>(*iter)->Notify(); nRet = (HDDEDATA)DDE_FACK; break; } @@ -142,7 +143,7 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( d.pImp->hData = hData; d.pImp->nFmt = DdeData::GetInternalFormat( nCbType ); d.Lock(); - t->Data( &d ); + (*iter)->Data( &d ); nRet = (HDDEDATA)DDE_FACK; break; } @@ -172,7 +173,6 @@ DdeConnection::DdeConnection( const String& rService, const String& rTopic ) CBF_FAIL_ALLSVRXACTIONS | CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS, 0L ); - pInst->pConnections = new DdeConnections; } pService = new DdeString( pInst->hDdeInstCli, rService ); @@ -185,8 +185,7 @@ DdeConnection::DdeConnection( const String& rService, const String& rTopic ) pImp->nStatus = DdeGetLastError( pInst->hDdeInstCli ); } - if ( pInst->pConnections ) - pInst->pConnections->Insert( this ); + pInst->aConnections.push_back( this ); } // --- DdeConnection::~DdeConnection() ----------------------------- @@ -201,8 +200,12 @@ DdeConnection::~DdeConnection() DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - if ( pInst->pConnections ) - pInst->pConnections->Remove( this ); + + std::vector<DdeConnection*>::iterator it(std::find(pInst->aConnections.begin(), + pInst->aConnections.end(), + this)); + if (it != pInst->aConnections.end()) + pInst->aConnections.erase(it); pInst->nInstanceCli--; pInst->nRefCount--; @@ -211,8 +214,6 @@ DdeConnection::~DdeConnection() if( DdeUninitialize( pInst->hDdeInstCli ) ) { pInst->hDdeInstCli = NULL; - delete pInst->pConnections; - pInst->pConnections = NULL; if( pInst->nRefCount == 0 ) ImpDeinitInstData(); } @@ -225,11 +226,7 @@ DdeConnection::~DdeConnection() sal_Bool DdeConnection::IsConnected() { CONVINFO c; -#ifdef OS2 - c.nSize = sizeof( c ); -#else c.cb = sizeof( c ); -#endif if ( DdeQueryConvInfo( pImp->hConv, QID_SYNC, &c ) ) return sal_True; else @@ -262,11 +259,11 @@ long DdeConnection::GetConvId() return (long)pImp->hConv; } -const DdeConnections& DdeConnection::GetConnections() +const std::vector<DdeConnection*>& DdeConnection::GetConnections() { DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - return *(pInst->pConnections); + return pInst->aConnections; } // --- DdeTransaction::DdeTransaction() ---------------------------- @@ -282,7 +279,7 @@ DdeTransaction::DdeTransaction( DdeConnection& d, const String& rItemName, nType = 0; bBusy = sal_False; - rDde.aTransactions.Insert( this ); + rDde.aTransactions.push_back( this ); } // --- DdeTransaction::~DdeTransaction() --------------------------- @@ -296,7 +293,8 @@ DdeTransaction::~DdeTransaction() } delete pName; - rDde.aTransactions.Remove( this ); + rDde.aTransactions.erase(std::remove(rDde.aTransactions.begin(), + rDde.aTransactions.end(),this)); } // --- DdeTransaction::Execute() ----------------------------------- @@ -362,7 +360,7 @@ const String& DdeTransaction::GetName() const // --- DdeTransaction::Data() -------------------------------------- -void __EXPORT DdeTransaction::Data( const DdeData* p ) +void DdeTransaction::Data( const DdeData* p ) { if ( ::tools::SolarMutex::Acquire() ) { @@ -373,7 +371,7 @@ void __EXPORT DdeTransaction::Data( const DdeData* p ) // --- DdeTransaction::Done() -------------------------------------- -void __EXPORT DdeTransaction::Done( sal_Bool bDataValid ) +void DdeTransaction::Done( sal_Bool bDataValid ) { aDone.Call( (void*)bDataValid ); } @@ -395,7 +393,7 @@ DdeLink::~DdeLink() // --- DdeLink::Notify() ----------------------------------------- -void __EXPORT DdeLink::Notify() +void DdeLink::Notify() { aNotify.Call( NULL ); } @@ -471,3 +469,5 @@ long DdeConnection::GetError() { return pImp->nStatus; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx index 7f78f4d4398a..0364c1bcf7e1 100644 --- a/svl/source/svdde/ddedata.cxx +++ b/svl/source/svdde/ddedata.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. @@ -160,23 +161,11 @@ sal_uLong DdeData::GetExternalFormat( sal_uLong nFmt ) default: { -#if defined(WNT) || defined( PM2 ) - String aName( SotExchange::GetFormatName( nFmt ) ); - #if defined(WNT) - + String aName( SotExchange::GetFormatName( nFmt ) ); if( aName.Len() ) nFmt = RegisterClipboardFormat( reinterpret_cast<LPCWSTR>(aName.GetBuffer()) ); #endif -#if defined( PM2 ) - - if( aName.Len() ) - { - HATOMTBL hSysTable = WinQuerySystemAtomTable(); - nFmt = (sal_uLong)WinAddAtom( hSysTable, (PSZ)aName.GetBuffer() ); - } -#endif -#endif } } return nFmt; @@ -208,19 +197,9 @@ sal_uLong DdeData::GetInternalFormat( sal_uLong nFmt ) nFmt = SotExchange::RegisterFormatName( String(reinterpret_cast<const sal_Unicode*>(szName)) ); } #endif -#if defined(PM2) - if( nFmt > CF_PALETTE ) - { - char szName[ 256 ]; - - HATOMTBL hSysTable = WinQuerySystemAtomTable(); - WinQueryAtomName( hSysTable, (ATOM)nFmt, (PSZ)szName, - sizeof( szName ) ); - nFmt = SotExchange::RegisterFormatName( String( szName ) ); - } -#endif break; } return nFmt; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx index cef0bb386201..bf9bb50fde1f 100644 --- a/svl/source/svdde/ddeimp.hxx +++ b/svl/source/svdde/ddeimp.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,44 +29,17 @@ #ifndef _DDEIMP_HXX #define _DDEIMP_HXX -#ifdef OS2 - -#include "ddemlos2.h" - -#define WORD sal_uInt16 -#define DWORD sal_uLong -#define LPBYTE sal_uInt8* -#define LPWORD sal_uInt16* -#define LPDWORD sal_uLong* -#define LPCTSTR PCSZ - -#else - -#include <tools/prewin.h> +#include <windows.h> #include <ddeml.h> -#include <tools/postwin.h> #include "ddewrap.hxx" -/* -extern "C" -{ -#define sal_Bool WIN_BOOL -#define sal_uInt8 WIN_BYTE -#undef sal_Bool -#undef sal_uInt8 -}; -*/ - -#endif #include <tools/string.hxx> -#include <tools/list.hxx> #include <tools/shl.hxx> +#include <vector> class DdeService; class DdeTopic; class DdeItem; -class DdeTopics; -class DdeItems; // ---------------- // - Conversation - @@ -77,7 +51,7 @@ struct Conversation DdeTopic* pTopic; }; -DECLARE_LIST( ConvList, Conversation* ); +typedef ::std::vector< Conversation* > ConvList; // --------------- // - DdeInternal - @@ -94,12 +68,12 @@ public: static HDDEDATA CALLBACK InfCallback ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD ); #else -#if defined ( MTW ) || ( defined ( GCC ) && defined ( OS2 )) || defined( ICC ) - static HDDEDATA CALLBACK __EXPORT CliCallback +#if defined( ICC ) + static HDDEDATA CALLBACK CliCallback ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD ); - static HDDEDATA CALLBACK __EXPORT SvrCallback + static HDDEDATA CALLBACK SvrCallback ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD ); - static HDDEDATA CALLBACK __EXPORT InfCallback + static HDDEDATA CALLBACK InfCallback ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD ); #else static HDDEDATA CALLBACK _export CliCallback @@ -146,20 +120,20 @@ struct DdeDataImp sal_uLong nFmt; }; -class DdeConnections; +class DdeConnection; class DdeServices; struct DdeInstData { sal_uInt16 nRefCount; - DdeConnections* pConnections; + std::vector<DdeConnection*> aConnections; // Server long hCurConvSvr; - sal_uLong hDdeInstSvr; + DWORD hDdeInstSvr; short nInstanceSvr; DdeServices* pServicesSvr; // Client - sal_uLong hDdeInstCli; + DWORD hDdeInstCli; short nInstanceCli; }; @@ -175,3 +149,5 @@ DdeInstData* ImpInitInstData(); void ImpDeinitInstData(); #endif // _DDEIMP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddeinf.cxx b/svl/source/svdde/ddeinf.cxx index c8c015071a9b..3c4f7a4fcaa2 100644 --- a/svl/source/svdde/ddeinf.cxx +++ b/svl/source/svdde/ddeinf.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,8 +41,8 @@ HDDEDATA CALLBACK DdeInternal::InfCallback( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD ) #else -#if defined ( MTW ) || ( defined ( GCC ) && defined ( OS2 )) || defined( ICC ) -HDDEDATA CALLBACK __EXPORT DdeInternal::InfCallback( +#if defined( ICC ) +HDDEDATA CALLBACK DdeInternal::InfCallback( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD ) #else HDDEDATA CALLBACK _export DdeInternal::InfCallback( @@ -52,139 +53,4 @@ HDDEDATA CALLBACK _export DdeInternal::InfCallback( return (HDDEDATA)DDE_FNOTPROCESSED; } -// --- DdeServiceList::DdeServiceList() ---------------------------- - -DdeServiceList::DdeServiceList( const String* pTopic ) -{ - DWORD hDdeInst = NULL; - HCONVLIST hConvList = NULL; - HCONV hConv = NULL; - UINT nStatus = DMLERR_NO_ERROR; - HSZ hTopic = NULL; - -#ifndef OS2 // YD FIXME - - nStatus = DdeInitialize( &hDdeInst, (PFNCALLBACK) DdeInternal::InfCallback, - APPCLASS_STANDARD | APPCMD_CLIENTONLY | - CBF_FAIL_ALLSVRXACTIONS | - CBF_SKIP_ALLNOTIFICATIONS, 0L ); - - if ( nStatus == DMLERR_NO_ERROR ) - { - if ( pTopic ) - { - LPCTSTR p = reinterpret_cast<LPCTSTR>(pTopic->GetBuffer()); -#ifdef __MINGW32__ - hTopic = DdeCreateStringHandle( hDdeInst, const_cast<LPTSTR>(p), CP_WINUNICODE ); -#else - hTopic = DdeCreateStringHandle( hDdeInst, p, CP_WINUNICODE ); -#endif - } - - hConvList = DdeConnectList( hDdeInst, NULL, hTopic, NULL, NULL ); - nStatus = DdeGetLastError( hDdeInst ); - } - - if ( nStatus == DMLERR_NO_ERROR ) - { - while ( ( hConv = DdeQueryNextServer( hConvList, hConv ) ) != NULL) - { - CONVINFO aInf; - TCHAR buf[256], *p; - HSZ h; -#ifdef OS2 - aInf.nSize = sizeof( aInf ); -#else - aInf.cb = sizeof( aInf ); -#endif - if( DdeQueryConvInfo( hConv, QID_SYNC, &aInf)) - { - h = aInf.hszServiceReq; - if ( !h ) -#ifndef OS2 - h = aInf.hszSvcPartner; -#else - h = aInf.hszPartner; -#endif - DdeQueryString( hDdeInst, h, buf, sizeof(buf) / sizeof(TCHAR), CP_WINUNICODE ); - p = buf + lstrlen( buf ); - *p++ = '|'; *p = 0; - DdeQueryString( hDdeInst, aInf.hszTopic, p, sizeof(buf)/sizeof(TCHAR)-lstrlen( buf ), - CP_WINUNICODE ); - aServices.Insert( new String( reinterpret_cast<const sal_Unicode*>(buf) ) ); - } - } - DdeDisconnectList( hConvList ); - } - - if ( hTopic) - DdeFreeStringHandle( hDdeInst, hTopic ); - if ( hDdeInst ) - DdeUninitialize( hDdeInst ); - -#endif - -} - -// --- DdeServiceList::~DdeServiceList() --------------------------- - -DdeServiceList::~DdeServiceList() -{ - String* s; - while ( ( s = aServices.First() ) != NULL ) - { - aServices.Remove( s ); - delete s; - } -} - -// --- DdeTopicList::DdeTopicList() -------------------------------- - -DdeTopicList::DdeTopicList( const String& rService ) -{ - DdeConnection aSys( rService, String( reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC) ) ); - - if ( !aSys.GetError() ) - { - DdeRequest aReq( aSys, String( reinterpret_cast<const sal_Unicode*>(SZDDESYS_ITEM_TOPICS) ), 500 ); - aReq.SetDataHdl( LINK( this, DdeTopicList, Data ) ); - aReq.Execute(); - } -} - -// --- DdeTopicList::~DdeTopicList() ------------------------------- - -DdeTopicList::~DdeTopicList() -{ - String* s; - while ( ( s = aTopics.First() ) != NULL ) - { - aTopics.Remove( s ); - delete s; - } -} - -// --- DdeTopicList::Data() -------------------------------------------- - -IMPL_LINK( DdeTopicList, Data, DdeData*, pData ) -{ - char* p = (char*) (const void *) *pData; - char* q = p; - short i; - char buf[256]; - - while ( *p && *p != '\r' && *p != '\n' ) - { - q = buf; i = 0; - while ( i < 255 && *p && *p != '\r' && *p != '\n' && *p != '\t' ) - *q++ = *p++, i++; - *q = 0; - while ( *p && *p != '\r' && *p != '\n' && *p != '\t' ) - p++; - aTopics.Insert( new String( String::CreateFromAscii(buf) ) ); - if ( *p == '\t' ) - p++; - } - return 0; -} - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddestrg.cxx b/svl/source/svdde/ddestrg.cxx index 007c9f56c544..0b6186f4ef5c 100644 --- a/svl/source/svdde/ddestrg.cxx +++ b/svl/source/svdde/ddestrg.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. @@ -72,3 +73,5 @@ DdeString::operator HSZ() { return hString; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index 3d3c5029c6a7..99b8cce0ae71 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.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. @@ -30,16 +31,12 @@ #define UNICODE #include "ddeimp.hxx" +#include <algorithm> #include <svl/svdde.hxx> #include <svl/svarray.hxx> #include <tools/debug.hxx> #include <osl/thread.h> -//static long hCurConv = 0; -//static DWORD hDdeInst = NULL; -//static short nInstance = 0; -//static DdeServices* pServices; - enum DdeItemType { DDEITEM, @@ -64,8 +61,8 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback( WORD nCode, WORD nCbType, HCONV hConv, HSZ hText1, HSZ hText2, HDDEDATA hData, DWORD, DWORD ) #else -#if defined ( MTW ) || ( defined ( GCC ) && defined ( OS2 )) || defined( ICC ) -HDDEDATA CALLBACK __EXPORT DdeInternal::SvrCallback( +#if defined( ICC ) +HDDEDATA CALLBACK DdeInternal::SvrCallback( WORD nCode, WORD nCbType, HCONV hConv, HSZ hText1, HSZ hText2, HDDEDATA hData, DWORD, DWORD ) #else @@ -125,10 +122,10 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( { if ( !hText2 || ( *pService->pName == hText2 ) ) { - for( pTopic = pService->aTopics.First(); pTopic; - pTopic = pService->aTopics.Next() ) + std::vector<DdeTopic*>::const_iterator iter; + for (iter = pService->aTopics.begin(); iter != pService->aTopics.end(); ++iter) { - if ( !hText1 || (*pTopic->pName == hText1) ) + if ( !hText1 || iter->pName == hText1 ) nTopics++; } } @@ -213,7 +210,7 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( pC = new Conversation; pC->hConv = hConv; pC->pTopic = pTopic; - pService->pConv->Insert( pC ); + pService->pConv->push_back( pC ); } } return (HDDEDATA)NULL; @@ -221,9 +218,9 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( for ( pService = rAll.First(); pService; pService = rAll.Next() ) { - for( pC = pService->pConv->First(); pC; - pC = pService->pConv->Next() ) + for ( size_t i = 0, n = pService->pConv->size(); i < n; ++i ) { + pC = (*pService->pConv)[ i ]; if ( pC->hConv == hConv ) goto found; } @@ -235,8 +232,17 @@ found: if ( nCode == XTYP_DISCONNECT) { pC->pTopic->_Disconnect( (long) hConv ); - pService->pConv->Remove( pC ); - delete pC; + for ( ConvList::iterator it = pService->pConv->begin(); + it < pService->pConv->end(); + ++it + ) { + if ( *it == pC ) + { + delete *it; + pService->pConv->erase( it ); + break; + } + } return (HDDEDATA)NULL; } @@ -325,25 +331,38 @@ found: if( !pItem->pImpData && pTopic->StartAdviseLoop() ) { // dann wurde das Item ausgewechselt - pTopic->aItems.Remove( pItem ); - DdeItem* pTmp; - for( pTmp = pTopic->aItems.First(); pTmp; - pTmp = pTopic->aItems.Next() ) - if( *pTmp->pName == hText2 ) + std::vector<DdeItem*>::iterator it(std::find(pTopic->aItems.begin(), + pTopic->aItems.end(), + pItem)); + if (it != pTopic->aItems.end()) + pTopic->aItems.erase(it); + + std::vector<DdeItem*>::iterator iter; + for( iter = pTopic->aItems.begin(); + iter != pTopic->aItems.end(); + ++iter ) + { + if( *(*iter)->pName == hText2 ) { // es wurde tatsaechlich ausgewechselt delete pItem; pItem = 0; break; } + } + if( pItem ) // es wurde doch nicht ausgewechselt, also wieder rein - pTopic->aItems.Insert( pItem ); + pTopic->aItems.push_back(pItem); else - pItem = pTmp; + pItem = iter != pTopic->aItems.end() ? *iter : NULL; + } + + if (pItem) + { + pItem->IncMonitor( (long)hConv ); + pInst->hCurConvSvr = NULL; } - pItem->IncMonitor( (long)hConv ); - pInst->hCurConvSvr = NULL; } return (HDDEDATA)sal_True; @@ -398,17 +417,17 @@ DdeService* DdeInternal::FindService( HSZ hService ) DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic ) { - DdeTopic* s; - DdeTopics& rTopics = rService.aTopics; + std::vector<DdeTopic*>::iterator iter; + std::vector<DdeTopic*> &rTopics = rService.aTopics; int bWeiter = sal_False; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); do { // middle check loop - for ( s = rTopics.First(); s; s = rTopics.Next() ) + for ( iter = rTopics.begin(); iter != rTopics.end(); ++iter ) { - if ( *s->pName == hTopic ) - return s; + if ( *(*iter)->pName == hTopic ) + return *iter; } bWeiter = !bWeiter; @@ -429,17 +448,17 @@ DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic ) DdeItem* DdeInternal::FindItem( DdeTopic& rTopic, HSZ hItem ) { - DdeItem* s; - DdeItems& rItems = rTopic.aItems; + std::vector<DdeItem*>::iterator iter; + std::vector<DdeItem*> &rItems = rTopic.aItems; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); int bWeiter = sal_False; do { // middle check loop - for ( s = rItems.First(); s; s = rItems.Next() ) - if ( *s->pName == hItem ) - return s; + for ( iter = rItems.begin(); iter != rItems.end(); ++iter ) + if ( *(*iter)->pName == hItem ) + return *iter; bWeiter = !bWeiter; if( !bWeiter ) @@ -554,28 +573,30 @@ DdeServices& DdeService::GetServices() void DdeService::AddTopic( const DdeTopic& rTopic ) { RemoveTopic( rTopic ); - aTopics.Insert( (DdeTopic*) &rTopic ); + aTopics.push_back((DdeTopic *) &rTopic); } // --- DdeService::RemoveTopic() ----------------------------------- void DdeService::RemoveTopic( const DdeTopic& rTopic ) { - DdeTopic* t; - for ( t = aTopics.First(); t; t = aTopics.Next() ) + std::vector<DdeTopic*>::iterator iter; + for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter ) { - if ( !DdeCmpStringHandles (*t->pName, *rTopic.pName ) ) + if ( !DdeCmpStringHandles (*(*iter)->pName, *rTopic.pName ) ) { - aTopics.Remove( t ); + aTopics.erase(iter); // JP 27.07.95: und alle Conversions loeschen !!! // (sonst wird auf geloeschten Topics gearbeitet!!) - for( sal_uLong n = pConv->Count(); n; ) + for( size_t n = pConv->size(); n; ) { - Conversation* pC = pConv->GetObject( --n ); + Conversation* pC = (*pConv)[ --n ]; if( pC->pTopic == &rTopic ) { - pConv->Remove( pC ); - delete pC; + ConvList::iterator it = pConv->begin(); + ::std::advance( it, n ); + delete *it; + pConv->erase( it ); } } break; @@ -587,7 +608,10 @@ void DdeService::RemoveTopic( const DdeTopic& rTopic ) sal_Bool DdeService::HasCbFormat( sal_uInt16 nFmt ) { - return sal_Bool( aFormats.GetPos( nFmt ) != LIST_ENTRY_NOTFOUND ); + for ( size_t i = 0, n = aFormats.size(); i < n; ++i ) + if ( aFormats[ i ] == nFmt ) + return true; + return false; } // --- DdeService::HasFormat() ------------------------------------- @@ -602,15 +626,23 @@ sal_Bool DdeService::HasFormat( sal_uLong nFmt ) void DdeService::AddFormat( sal_uLong nFmt ) { nFmt = DdeData::GetExternalFormat( nFmt ); - aFormats.Remove( nFmt ); - aFormats.Insert( nFmt ); + for ( size_t i = 0, n = aFormats.size(); i < n; ++i ) + if ( aFormats[ i ] == nFmt ) + return; + aFormats.push_back( nFmt ); } // --- DdeService::RemoveFormat() ---------------------------------- void DdeService::RemoveFormat( sal_uLong nFmt ) { - aFormats.Remove( DdeData::GetExternalFormat( nFmt ) ); + nFmt = DdeData::GetExternalFormat( nFmt ); + for ( DdeFormats::iterator it = aFormats.begin(); it < aFormats.end(); ++it ) { + if ( *it == nFmt ) { + aFormats.erase( it ); + break; + } + } } // --- DdeTopic::DdeTopic() ---------------------------------------- @@ -626,13 +658,13 @@ DdeTopic::DdeTopic( const String& rName ) DdeTopic::~DdeTopic() { - DdeItem* t; - while( ( t = aItems.First() ) != NULL ) + std::vector<DdeItem*>::iterator iter; + for (iter = aItems.begin(); iter != aItems.end(); ++iter) { - aItems.Remove( t ); - t->pMyTopic = 0; - delete t; + (*iter)->pMyTopic = 0; + delete *iter; } + delete pName; } @@ -661,7 +693,7 @@ DdeItem* DdeTopic::AddItem( const DdeItem& r ) s = new DdeItem( r ); if ( s ) { - aItems.Insert( s ); + aItems.push_back( s ); s->pMyTopic = this; } return s; @@ -673,7 +705,7 @@ void DdeTopic::InsertItem( DdeItem* pNew ) { if( pNew ) { - aItems.Insert( pNew ); + aItems.push_back( pNew ); pNew->pMyTopic = this; } } @@ -682,18 +714,18 @@ void DdeTopic::InsertItem( DdeItem* pNew ) void DdeTopic::RemoveItem( const DdeItem& r ) { - DdeItem* s; - for ( s = aItems.First(); s; s = aItems.Next() ) + std::vector<DdeItem*>::iterator iter; + for (iter = aItems.begin(); iter != aItems.end(); ++iter) { - if ( !DdeCmpStringHandles (*s->pName, *r.pName ) ) + if ( !DdeCmpStringHandles (*(*iter)->pName, *r.pName ) ) break; } - if ( s ) + if ( iter != aItems.end() ) { - aItems.Remove( s ); - s->pMyTopic = 0; - delete s; + (*iter)->pMyTopic = 0; + delete *iter; + aItems.erase(iter); } } @@ -701,47 +733,47 @@ void DdeTopic::RemoveItem( const DdeItem& r ) void DdeTopic::NotifyClient( const String& rItem ) { - DdeItem* pItem; + std::vector<DdeItem*>::iterator iter; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - for ( pItem = aItems.First(); pItem; pItem = aItems.Next() ) + for ( iter = aItems.begin(); iter != aItems.end(); ++iter) { - if ( pItem->GetName() == rItem ) + if ( (*iter)->GetName() == rItem && (*iter)->pImpData) { - if ( pItem->pImpData ) - DdePostAdvise( pInst->hDdeInstSvr, *pName, *pItem->pName ); + DdePostAdvise( pInst->hDdeInstSvr, *pName, *(*iter)->pName ); + break; } - break; } } // --- DdeTopic::Connect() ----------------------------------------- -void __EXPORT DdeTopic::Connect( long nId ) +void DdeTopic::Connect( long nId ) { aConnectLink.Call( (void*)nId ); } // --- DdeTopic::Disconnect() -------------------------------------- -void __EXPORT DdeTopic::Disconnect( long nId ) +void DdeTopic::Disconnect( long nId ) { aDisconnectLink.Call( (void*)nId ); } // --- DdeTopic::_Disconnect() -------------------------------------- -void __EXPORT DdeTopic::_Disconnect( long nId ) +void DdeTopic::_Disconnect( long nId ) { - for( DdeItem* pItem = aItems.First(); pItem; pItem = aItems.Next() ) - pItem->DecMonitor( nId ); + std::vector<DdeItem*>::iterator iter; + for (iter = aItems.begin(); iter != aItems.end(); ++iter) + (*iter)->DecMonitor( nId ); Disconnect( nId ); } // --- DdeTopic::Get() --------------------------------------------- -DdeData* __EXPORT DdeTopic::Get( sal_uLong nFmt ) +DdeData* DdeTopic::Get( sal_uLong nFmt ) { if ( aGetLink.IsSet() ) return (DdeData*)aGetLink.Call( (void*)nFmt ); @@ -751,7 +783,7 @@ DdeData* __EXPORT DdeTopic::Get( sal_uLong nFmt ) // --- DdeTopic::Put() --------------------------------------------- -sal_Bool __EXPORT DdeTopic::Put( const DdeData* r ) +sal_Bool DdeTopic::Put( const DdeData* r ) { if ( aPutLink.IsSet() ) return (sal_Bool)aPutLink.Call( (void*) r ); @@ -761,7 +793,7 @@ sal_Bool __EXPORT DdeTopic::Put( const DdeData* r ) // --- DdeTopic::Execute() ----------------------------------------- -sal_Bool __EXPORT DdeTopic::Execute( const String* r ) +sal_Bool DdeTopic::Execute( const String* r ) { if ( aExecLink.IsSet() ) return (sal_Bool)aExecLink.Call( (void*)r ); @@ -833,7 +865,8 @@ DdeItem::DdeItem( const DdeItem& r) DdeItem::~DdeItem() { if( pMyTopic ) - pMyTopic->aItems.Remove( this ); + pMyTopic->aItems.erase(std::remove(pMyTopic->aItems.begin(), + pMyTopic->aItems.end(),this)); delete pName; delete pImpData; } @@ -968,18 +1001,18 @@ void DdeGetPutItem::AdviseLoop( sal_Bool ) String DdeService::SysItems() { String s; - DdeTopic* t; - for ( t = aTopics.First(); t; t = aTopics.Next() ) + std::vector<DdeTopic*>::iterator iter; + std::vector<DdeItem*>::iterator iterItem; + for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter ) { - if ( t->GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC) ) + if ( (*iter)->GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC) ) { short n = 0; - DdeItem* pi; - for ( pi = t->aItems.First(); pi; pi = t->aItems.Next(), n++ ) + for ( iterItem = (*iter)->aItems.begin(); iterItem != (*iter)->aItems.end(); ++iterItem, n++ ) { if ( n ) s += '\t'; - s += pi->GetName(); + s += (*iterItem)->GetName(); } s += String::CreateFromAscii("\r\n"); } @@ -993,14 +1026,14 @@ String DdeService::SysItems() String DdeService::Topics() { String s; - DdeTopic* t; + std::vector<DdeTopic*>::iterator iter; short n = 0; - for ( t = aTopics.First(); t; t = aTopics.Next(), n++ ) + for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter, n++ ) { if ( n ) s += '\t'; - s += t->GetName(); + s += (*iter)->GetName(); } s += String::CreateFromAscii("\r\n"); @@ -1017,8 +1050,9 @@ String DdeService::Formats() LPCTSTR p; short n = 0; - for ( f = aFormats.First(); f; f = aFormats.Next(), n++ ) + for ( size_t i = 0; i < aFormats.size(); ++i, n++ ) { + f = aFormats[ i ]; if ( n ) s += '\t'; p = buf; @@ -1031,28 +1065,8 @@ String DdeService::Formats() case CF_BITMAP: p = reinterpret_cast<LPCTSTR>(String::CreateFromAscii("BITMAP").GetBuffer()); break; -#ifdef OS2 - case CF_DSPTEXT: - p = String::CreateFromAscii("TEXT").GetBuffer(); - break; - case CF_DSPBITMAP: - p = String::CreateFromAscii("BITMAP").GetBuffer(); - break; - case CF_METAFILE: - p = String::CreateFromAscii("METAFILE").GetBuffer(); - break; - case CF_DSPMETAFILE: - p = String::CreateFromAscii("METAFILE").GetBuffer(); - break; - case CF_PALETTE: - p = String::CreateFromAscii("PALETTE").GetBuffer(); - break; - default: - p= String::CreateFromAscii("PRIVATE").GetBuffer(); -#else default: GetClipboardFormatName( (UINT)f, buf, sizeof(buf) / sizeof(TCHAR) ); -#endif } s += String( reinterpret_cast<const sal_Unicode*>(p) ); } @@ -1070,14 +1084,14 @@ String DdeService::Status() // --- DdeService::IsBusy() ---------------------------------------- -sal_Bool __EXPORT DdeService::IsBusy() +sal_Bool DdeService::IsBusy() { return sal_False; } // --- DdeService::GetHelp() ---------------------------------------- -String __EXPORT DdeService::GetHelp() +String DdeService::GetHelp() { return String(); } @@ -1102,3 +1116,4 @@ sal_Bool DdeService::SysTopicExecute( const String* ) return sal_False; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddewrap.cxx b/svl/source/svdde/ddewrap.cxx index 7e75fef55898..8673dfbab4d1 100644 --- a/svl/source/svdde/ddewrap.cxx +++ b/svl/source/svdde/ddewrap.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. @@ -98,3 +99,4 @@ DEFINE_WAPI_FUNC( DdeCreateStringHandleW ); DEFINE_WAPI_FUNC( DdeQueryStringW ); DEFINE_WAPI_FUNC( DdeInitializeW ); +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svdde/ddewrap.hxx b/svl/source/svdde/ddewrap.hxx index 77d012ccbba5..75945383a55b 100644 --- a/svl/source/svdde/ddewrap.hxx +++ b/svl/source/svdde/ddewrap.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef _SVTOOLS_SVDDE_DDEWRAP_HXX_ #define _SVTOOLS_SVDDE_DDEWRAP_HXX_ @@ -22,3 +23,5 @@ DECLARE_WAPI_FUNC( DdeInitializeW ); #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/svsql/converter.cxx b/svl/source/svsql/converter.cxx index 2f6fa9f8c389..6be7854137bb 100644 --- a/svl/source/svsql/converter.cxx +++ b/svl/source/svsql/converter.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,3 +41,4 @@ sal_Int32 SvDbaseConverter::ConvertPrecisionToOdbc(sal_Int32 _nLen, sal_Int32 _n } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index fae0250e9002..a84bbcfb5bb1 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.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. @@ -132,7 +133,7 @@ XubString SfxUndoAction::GetRepeatComment(SfxRepeatTarget&) const void SfxUndoAction::Undo() { // die sind nur konzeptuell pure virtual - DBG_ERROR( "pure virtual function called: SfxUndoAction::Undo()" ); + OSL_FAIL( "pure virtual function called: SfxUndoAction::Undo()" ); } //------------------------------------------------------------------------ @@ -148,7 +149,7 @@ void SfxUndoAction::UndoWithContext( SfxUndoContext& i_context ) void SfxUndoAction::Redo() { // die sind nur konzeptuell pure virtual - DBG_ERROR( "pure virtual function called: SfxUndoAction::Redo()" ); + OSL_FAIL( "pure virtual function called: SfxUndoAction::Redo()" ); } //------------------------------------------------------------------------ @@ -164,7 +165,7 @@ void SfxUndoAction::RedoWithContext( SfxUndoContext& i_context ) void SfxUndoAction::Repeat(SfxRepeatTarget&) { // die sind nur konzeptuell pure virtual - DBG_ERROR( "pure virtual function called: SfxUndoAction::Repeat()" ); + OSL_FAIL( "pure virtual function called: SfxUndoAction::Repeat()" ); } //------------------------------------------------------------------------ @@ -1108,7 +1109,7 @@ size_t SfxUndoManager::ImplLeaveListAction( const bool i_merge, UndoManagerGuard if( !ImplIsInListAction_Lock() ) { - DBG_ERROR( "svl::SfxUndoManager::ImplLeaveListAction, called without calling EnterListAction()!" ); + OSL_TRACE( "svl::SfxUndoManager::ImplLeaveListAction, called without calling EnterListAction()!" ); return 0; } @@ -1497,3 +1498,5 @@ sal_uInt16 SfxLinkUndoAction::GetId() const { return pAction ? pAction->GetId() : 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/uno/pathservice.cxx b/svl/source/uno/pathservice.cxx index 1a3be47713a1..5317176f51b5 100644 --- a/svl/source/uno/pathservice.cxx +++ b/svl/source/uno/pathservice.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. @@ -51,7 +52,7 @@ public: virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException) { - return OUString::createFromAscii("com.sun.star.comp.svl.PathService"); + return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.svl.PathService")); } virtual sal_Bool SAL_CALL supportsService ( @@ -65,7 +66,7 @@ public: throw(css::uno::RuntimeException) { css::uno::Sequence< OUString > aRet(1); - aRet.getArray()[0] = OUString::createFromAscii("com.sun.star.config.SpecialConfigManager"); + aRet.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.config.SpecialConfigManager")); return aRet; } @@ -101,3 +102,5 @@ css::uno::Reference< css::uno::XInterface > PathService_CreateInstance ( } // ----------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index 8edbccc2d435..5caca580694f 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.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. @@ -73,7 +74,7 @@ SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( { Sequence< OUString > aServiceNames(1); aServiceNames.getArray()[0] = - OUString::createFromAscii( "com.sun.star.util.NumberFormatsSupplier" ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier")); xFactory = ::cppu::createSingleFactory( reinterpret_cast< css::lang::XMultiServiceFactory* >(_pServiceManager), @@ -87,7 +88,7 @@ SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( { Sequence< OUString > aServiceNames(1); aServiceNames.getArray()[0] = - OUString::createFromAscii( "com.sun.star.util.NumberFormatter" ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter")); xFactory = ::cppu::createSingleFactory( reinterpret_cast< css::lang::XMultiServiceFactory* >(_pServiceManager), @@ -100,7 +101,7 @@ SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( { Sequence< OUString > aServiceNames(1); aServiceNames.getArray()[0] = - OUString::createFromAscii( "com.sun.star.config.SpecialConfigManager" ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.config.SpecialConfigManager")); xFactory = ::cppu::createSingleFactory ( reinterpret_cast< css::lang::XMultiServiceFactory* >( _pServiceManager ), OUString::createFromAscii( pImplementationName ), @@ -118,3 +119,4 @@ SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( } // "C" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/unx/inc/convert.hxx b/svl/unx/inc/convert.hxx index c2184d5328f0..751d25dfe083 100644 --- a/svl/unx/inc/convert.hxx +++ b/svl/unx/inc/convert.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. @@ -61,3 +62,5 @@ public: }; #endif // _CONVERT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx index e769ee73b9cb..7ec1a3b929ac 100644 --- a/svl/unx/source/svdde/ddedummy.cxx +++ b/svl/unx/source/svdde/ddedummy.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. @@ -336,3 +337,5 @@ DdeHotLink::DdeHotLink( DdeConnection& rConnection, const String& rString, long DdeLink( rConnection, rString, l ) { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |