diff options
author | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-11-10 13:50:33 +0800 |
---|---|---|
committer | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-11-10 13:50:33 +0800 |
commit | 3491b4ac4fe34cacea5f4d0a4594d4a88cbbe7b2 (patch) | |
tree | 8dc60b794b88dd87c965d149c93fa3ac81e3096c /svl | |
parent | 66e7dc1197e76e686ba731382d032a9a72849959 (diff) | |
parent | 95f71183414a50d12cd4bbacf47d711672e63268 (diff) |
removetooltypes01: #i112600# resync to DEV300_m92; remove tooltypes from xmloff, linguistic, vcl, svtools, accessibility, fpicker, uui and framework
Diffstat (limited to 'svl')
45 files changed, 716 insertions, 1072 deletions
diff --git a/svl/inc/lngmisc.hxx b/svl/inc/lngmisc.hxx index cf8a498dc206..9dbe2d4740d0 100644 --- a/svl/inc/lngmisc.hxx +++ b/svl/inc/lngmisc.hxx @@ -32,6 +32,7 @@ #include <tools/solar.h> #include <sal/types.h> #include <rtl/ustring.hxx> +#include <tools/string.hxx> /////////////////////////////////////////////////////////////////////////// @@ -68,6 +69,8 @@ SVL_DLLPUBLIC sal_Bool RemoveControlChars( rtl::OUString &rTxt ); SVL_DLLPUBLIC sal_Bool ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' ); +SVL_DLLPUBLIC String GetThesaurusReplaceText( const String &rText ); + } // namespace linguistic #endif diff --git a/svl/inc/pickerhelper.hxx b/svl/inc/pickerhelper.hxx deleted file mode 100644 index 307031b578d1..000000000000 --- a/svl/inc/pickerhelper.hxx +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _PICKERHELPER_HXX -#define _PICKERHELPER_HXX - -#include "svl/svldllapi.h" -#include "sal/types.h" -#include "com/sun/star/uno/Reference.hxx" - -namespace com -{ - namespace sun - { - namespace star - { - namespace ui - { - namespace dialogs - { - class XFilePicker; - class XFolderPicker; - } - } - } - } -} - - -namespace svt -{ - - SVL_DLLPUBLIC void SetDialogHelpId( - ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > _mxFileDlg, - sal_Int32 _nHelpId ); - - SVL_DLLPUBLIC void SetDialogHelpId( - ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFolderPicker > _mxFileDlg, - sal_Int32 _nHelpId ); - -} - -//----------------------------------------------------------------------------- - -#endif diff --git a/svl/inc/poolcach.hxx b/svl/inc/poolcach.hxx index 1d534955ed92..182c9739f0cf 100644 --- a/svl/inc/poolcach.hxx +++ b/svl/inc/poolcach.hxx @@ -29,13 +29,24 @@ #include "svl/svldllapi.h" #include <tools/solar.h> +#include <vector> + +//------------------------------------------------------------------------ -class SfxItemModifyArr_Impl; class SfxItemPool; class SfxItemSet; class SfxPoolItem; class SfxSetItem; +struct SfxItemModifyImpl +{ + const SfxSetItem *pOrigItem; + SfxSetItem *pPoolItem; +}; + +typedef std::vector<SfxItemModifyImpl> SfxItemModifyArr_Impl; + + class SVL_DLLPUBLIC SfxItemPoolCache { SfxItemPool *pPool; diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx index c97aa85497cb..3ca4bf3129b7 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.hxx @@ -104,7 +104,7 @@ class SVL_DLLPUBLIC SfxItemPool */ { - SVL_DLLPRIVATE void readTheItems(SvStream & rStream, sal_uInt16 nCount, sal_uInt16 nVersion, + SVL_DLLPRIVATE void readTheItems(SvStream & rStream, sal_uInt32 nCount, sal_uInt16 nVersion, SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** pArr); UniString aName; @@ -208,9 +208,9 @@ public: const SfxPoolItem &rItem, int bDirect = sal_False ) const; - sal_uInt16 GetSurrogate(const SfxPoolItem *) const; - const SfxPoolItem * GetItem(sal_uInt16 nWhich, sal_uInt16 nSurrogate) const; - sal_uInt16 GetItemCount(sal_uInt16 nWhich) const; + sal_uInt32 GetSurrogate(const SfxPoolItem *) const; + const SfxPoolItem * GetItem2(sal_uInt16 nWhich, sal_uInt32 nSurrogate) const; + sal_uInt32 GetItemCount2(sal_uInt16 nWhich) const; const SfxPoolItem* LoadSurrogate(SvStream& rStream, sal_uInt16 &rWhich, sal_uInt16 nSlotId, const SfxItemPool* pRefPool = 0 ); diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx index 23bfcc23f3cd..0a8b63e1b155 100644 --- a/svl/inc/svl/poolitem.hxx +++ b/svl/inc/svl/poolitem.hxx @@ -50,8 +50,9 @@ class IntlWrapper; namespace com { namespace sun { namespace star { namespace uno { class Any; } } } } -#define SFX_ITEMS_DIRECT 0xffff -#define SFX_ITEMS_NULL 0xfff0 // anstelle StoreSurrogate +static const sal_uInt32 SFX_ITEMS_DIRECT= 0xffffffff; +static const sal_uInt32 SFX_ITEMS_NULL= 0xfffffff0; // instead StoreSurrogate +static const sal_uInt32 SFX_ITEMS_DEFAULT= 0xfffffffe; #define SFX_ITEMS_POOLDEFAULT 0xffff #define SFX_ITEMS_STATICDEFAULT 0xfffe diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index b905e7128baf..19ee3a9e5077 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -39,12 +39,6 @@ * enthaelt. (Sie werden im Speicher verschoben, koennen also * z.B. keine String sein) * -* SV_DECL_OBJARR(nm, AE, IS, GS) -* SV_IMPL_OBJARR( nm, AE ) -* definiere/implementiere ein Array das Objecte enthaelt. -* (Hier koennen es auch Strings sein) -* -* * SV_DECL_PTRARR(nm, AE, IS, GS) * SV_IMPL_PTRARR(nm, AE) * definiere/implementiere ein Array das Pointer haelt. Diese @@ -86,10 +80,6 @@ * Basiert auf einem VARARR. * Sortierung mit Hilfe der Object-operatoren "<" und "==" * -* JP 23.12.94 neu: -* SV_DECL_PTRARR_STACK(nm, AE, IS, GS) -* ein Stack mit einem PtrArray als Grundlage. -* * JP 09.10.96: vordefinierte Arrays: * VarArr: SvBools, SvULongs, SvUShorts, SvLongs, SvShorts * PtrArr: SvStrings, SvStringsDtor @@ -207,8 +197,6 @@ public:\ #define _SV_DECL_VARARR(nm, AE, IS, GS ) \ _SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE & ) -#define _SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \ -_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE ) #define SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ _SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ @@ -219,15 +207,10 @@ nm& operator=( const nm& );\ #define SV_DECL_VARARR(nm, AE, IS, GS ) \ SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, ) -#define SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \ -SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, ) #define SV_DECL_VARARR_VISIBILITY(nm, AE, IS, GS, vis ) \ SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, vis ) -#define SV_DECL_VARARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis ) \ -SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, vis ) - #define SV_IMPL_VARARR_GEN( nm, AE, AERef )\ nm::nm( sal_uInt16 nInit, sal_uInt8 )\ : pData (0),\ @@ -329,192 +312,6 @@ _SVVARARR_IMPL_GET_OP_INLINE(nm, AE )\ #define SV_IMPL_VARARR( nm, AE ) \ SV_IMPL_VARARR_GEN( nm, AE, AE & ) -#define SV_IMPL_VARARR_PLAIN( nm, AE ) \ -SV_IMPL_VARARR_GEN( nm, AE, AE ) - -#if defined(PRODUCT) - -#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem )\ -ArrElem& operator[](sal_uInt16 nP) const { return *(pData+nP); }\ -\ -void Insert( const nm *pI, sal_uInt16 nP,\ - sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX )\ -{\ - if( USHRT_MAX == nE ) \ - nE = pI->nA; \ - if( nS < nE ) \ - Insert( (const ArrElem*)pI->pData+nS, (sal_uInt16)nE-nS, nP );\ -} - -#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem ) - -#else - -#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem ) \ -ArrElem& operator[](sal_uInt16 nP) const;\ -void Insert( const nm *pI, sal_uInt16 nP,\ - sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ); - -#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem )\ -ArrElem& nm::operator[](sal_uInt16 nP) const\ -{\ - DBG_ASSERT( 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]");\ - if( USHRT_MAX == nE ) \ - nE = pI->nA; \ - if( nStt < nE ) \ - Insert( (const ArrElem*)pI->pData+nStt, (sal_uInt16)nE-nStt, nP );\ -} - -#endif - -#define _SV_DECL_OBJARR(nm, AE, IS, GS)\ -typedef sal_Bool (*FnForEach_##nm)( const AE&, void* );\ -class nm\ -{\ -protected:\ - AE *pData;\ - sal_uInt16 nFree;\ - sal_uInt16 nA;\ -\ - void _resize(size_t n);\ - void _destroy();\ -\ -public:\ - nm( sal_uInt16= IS, sal_uInt8= GS );\ - ~nm() { _destroy(); }\ -\ - _SVOBJARR_DEF_GET_OP_INLINE(nm,AE)\ - AE& GetObject(sal_uInt16 nP) const { return (*this)[nP]; } \ -\ - void Insert( const AE &aE, sal_uInt16 nP );\ - void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP );\ - void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );\ - sal_uInt16 Count() const { return nA; }\ - const AE* GetData() const { return (const AE*)pData; }\ -\ - void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ - {\ - _ForEach( 0, nA, fnForEach, pArgs );\ - }\ - void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ - CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ - {\ - _ForEach( nS, nE, fnForEach, pArgs );\ - }\ -\ - void _ForEach( sal_uInt16 nStt, sal_uInt16 nE, \ - CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\ -\ - -#define SV_DECL_OBJARR(nm, AE, IS, GS)\ -_SV_DECL_OBJARR(nm, AE, IS, GS)\ -private:\ -nm( const nm& );\ -nm& operator=( const nm& );\ -}; - -#define SV_IMPL_OBJARR( nm, AE )\ -nm::nm( sal_uInt16 nInit, sal_uInt8 )\ - : pData (0),\ - nFree (nInit),\ - nA (0)\ -{\ - if( nInit )\ - {\ - pData = (AE*)(rtl_allocateMemory(sizeof(AE) * nInit));\ - DBG_ASSERT( pData, "CTOR, allocate");\ - }\ -}\ -\ -void nm::_destroy()\ -{\ - if(pData)\ - {\ - AE* pTmp=pData;\ - for(sal_uInt16 n=0; n < nA; n++,pTmp++ )\ - {\ - pTmp->~AE();\ - }\ - rtl_freeMemory(pData);\ - pData = 0;\ - }\ -}\ -\ -void nm::_resize (size_t n)\ -{\ - sal_uInt16 nL = ((n < USHRT_MAX) ? sal_uInt16(n) : USHRT_MAX);\ - AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\ - if ((pE != 0) || (nL == 0))\ - {\ - pData = pE;\ - nFree = nL - nA;\ - }\ -}\ -\ -void nm::Insert( const AE &aE, sal_uInt16 nP )\ -{\ - DBG_ASSERT( nP <= nA && nA < USHRT_MAX,"Ins 1");\ - if (nFree < 1)\ - _resize (nA + ((nA > 1) ? nA : 1));\ - if( pData && nP < nA )\ - memmove( pData+nP+1, pData+nP, (nA-nP) * sizeof( AE ));\ - AE* pTmp = pData+nP;\ - new( (DummyType*) pTmp ) AE( (AE&)aE );\ - ++nA; --nFree;\ -}\ -\ -void nm::Insert( const AE* pE, sal_uInt16 nL, sal_uInt16 nP )\ -{\ - DBG_ASSERT(nP<=nA && ((long)nA+nL) < USHRT_MAX, "Ins n");\ - if (nFree < nL)\ - _resize (nA + ((nA > nL) ? nA : nL));\ - if( pData && nP < nA )\ - memmove( pData+nP+nL, pData+nP, (nA-nP) * sizeof( AE ));\ - if( pE )\ - {\ - AE* pTmp = pData+nP;\ - for( sal_uInt16 n = 0; n < nL; n++, pTmp++, pE++)\ - {\ - new( (DummyType*) pTmp ) AE( (AE&)*pE );\ - }\ - }\ - nA = nA + nL; nFree = nFree - nL;\ -}\ -\ -void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\ -{\ - if( !nL )\ - return;\ - DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ - AE* pTmp=pData+nP;\ - sal_uInt16 nCtr = nP;\ - for(sal_uInt16 n=0; n < nL; n++,pTmp++,nCtr++)\ - {\ - if( nCtr < nA )\ - pTmp->~AE();\ - }\ - if( pData && nP+1 < nA )\ - memmove( pData+nP, pData+nP+nL, (nA-nP-nL) * sizeof( AE ));\ - nA = nA - nL; nFree = nFree + nL;\ - if (nFree > nA) \ - _resize (nA);\ -}\ -\ -void nm::_ForEach( sal_uInt16 nStt, sal_uInt16 nE, \ - CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\ -{\ - if( nStt >= nE || nE > nA )\ - return;\ - for( ; nStt < nE && (*fnCall)( *(pData+nStt), pArgs ); nStt++)\ - ;\ -}\ -\ -_SVOBJARR_IMPL_GET_OP_INLINE(nm, AE)\ #define _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AERef, vis )\ _SV_DECL_VARARR_GEN( nm, AE, IS, GS, AERef, vis)\ @@ -523,8 +320,6 @@ sal_uInt16 GetPos( const AERef aE ) const;\ #define _SV_DECL_PTRARR_DEF( nm, AE, IS, GS, vis )\ _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE &, vis ) -#define _SV_DECL_PTRARR_DEF_PLAIN( nm, AE, IS, GS, vis )\ -_SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE, vis ) #define SV_DECL_PTRARR_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\ typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\ @@ -580,13 +375,9 @@ private:\ #define SV_DECL_PTRARR(nm, AE, IS, GS )\ SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, ) -#define SV_DECL_PTRARR_PLAIN(nm, AE, IS, GS )\ -SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, ) #define SV_DECL_PTRARR_VISIBILITY(nm, AE, IS, GS, vis )\ SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis ) -#define SV_DECL_PTRARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\ -SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis ) #define SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\ typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\ @@ -643,13 +434,9 @@ private:\ #define SV_DECL_PTRARR_DEL(nm, AE, IS, GS )\ SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, ) -#define SV_DECL_PTRARR_DEL_PLAIN(nm, AE, IS, GS )\ -SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, ) #define SV_DECL_PTRARR_DEL_VISIBILITY(nm, AE, IS, GS, vis )\ SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis) -#define SV_DECL_PTRARR_DEL_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\ -SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis) #define SV_IMPL_PTRARR_GEN(nm, AE, Base)\ void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )\ @@ -664,12 +451,9 @@ void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )\ #define SV_IMPL_PTRARR(nm, AE )\ SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarr ) -#define SV_IMPL_PTRARR_PLAIN(nm, AE )\ -SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarrPlain ) typedef void* VoidPtr; _SV_DECL_PTRARR_DEF( SvPtrarr, VoidPtr, 0, 1, SVL_DLLPUBLIC ) -_SV_DECL_PTRARR_DEF_PLAIN( SvPtrarrPlain, VoidPtr, 0, 1, SVL_DLLPUBLIC ) // SORTARR - Begin @@ -983,69 +767,21 @@ SV_IMPL_VARARR(nm##_SAR, AE)\ _SV_IMPL_SORTAR_ALG( nm,AE )\ _SV_SEEK_OBJECT( nm,AE ) -#define SV_DECL_PTRARR_STACK(nm, AE, IS, GS)\ -class nm: private SvPtrarr \ -{\ -public:\ - nm( sal_uInt16 nIni=IS, sal_uInt8 nG=GS )\ - : SvPtrarr(nIni,nG) {}\ - void Insert( const nm *pI, sal_uInt16 nP,\ - sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ) {\ - SvPtrarr::Insert( pI, nP, nS, nE ); \ - }\ - void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 ) {\ - SvPtrarr::Remove( nP, nL ); \ - }\ - void Push( const AE &aE ) {\ - SvPtrarr::Insert( (const VoidPtr &)aE, SvPtrarr::Count() );\ - }\ - sal_uInt16 Count() const { return SvPtrarr::Count(); }\ - AE operator[](sal_uInt16 nP) const {\ - return (AE)SvPtrarr::operator[]( nP );\ - }\ - AE GetObject(sal_uInt16 nP) const {\ - return (AE)SvPtrarr::GetObject( nP );\ - }\ - AE Pop(){\ - AE pRet = 0;\ - if( SvPtrarr::Count() ){\ - pRet = GetObject( SvPtrarr::Count()-1 );\ - SvPtrarr::Remove(Count()-1);\ - }\ - return pRet;\ - }\ - AE Top() const {\ - AE pRet = 0;\ - if( SvPtrarr::Count() )\ - pRet = GetObject( SvPtrarr::Count()-1 ); \ - return pRet;\ - }\ -}; - #if defined (C40) || defined (C41) || defined (C42) || defined(C50) || defined(C52) #define C40_INSERT( c, p, n) Insert( (c const *) p, n ) -#define C40_PUSH( c, p) Push( (c const *) p ) #define C40_PTR_INSERT( c, p) Insert( (c const *) p ) -#define C40_REMOVE( c, p ) Remove( (c const *) p ) #define C40_REPLACE( c, p, n) Replace( (c const *) p, n ) -#define C40_PTR_REPLACE( c, p) Replace( (c const *) p ) #define C40_GETPOS( c, r) GetPos( (c const *)r ) #else #if defined WTC || defined ICC || defined HPUX || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400) #define C40_INSERT( c, p, n ) Insert( (c const *&) p, n ) -#define C40_PUSH( c, p) Push( (c const *&) p ) #define C40_PTR_INSERT( c, p ) Insert( (c const *&) p ) -#define C40_REMOVE( c, p ) Remove( (c const *&) p ) #define C40_REPLACE( c, p, n ) Replace( (c const *&) p, n ) -#define C40_PTR_REPLACE( c, p ) Replace( (c const *&) p ) #define C40_GETPOS( c, r) GetPos( (c const *&) r ) #else #define C40_INSERT( c, p, n ) Insert( p, n ) -#define C40_PUSH( c, p) Push( p ) #define C40_PTR_INSERT( c, p ) Insert( p ) -#define C40_REMOVE( c, p) Remove( p ) #define C40_REPLACE( c, p, n ) Replace( p, n ) -#define C40_PTR_REPLACE( c, p ) Replace( p ) #define C40_GETPOS( c, r) GetPos( r ) #endif #endif diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx index 58dc7c09abe3..e3377b732ad8 100644 --- a/svl/inc/svl/svstdarr.hxx +++ b/svl/inc/svl/svstdarr.hxx @@ -42,20 +42,11 @@ #include "svl/svldllapi.h" #include <svl/svarray.hxx> +#include <deque> -//#ifdef _SVSTDARR_BOOLS -#ifndef _SVSTDARR_BOOLS_DECL -SV_DECL_VARARR_VISIBILITY( SvBools, sal_Bool, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_BOOLS_DECL -#endif -//#endif +typedef std::deque< sal_Bool > SvBools; -//#ifdef _SVSTDARR_BYTES -#ifndef _SVSTDARR_BYTES_DECL -SV_DECL_VARARR_VISIBILITY( SvBytes, sal_uInt8, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_BYTES_DECL -#endif -//#endif +typedef std::deque< sal_uInt8 > SvBytes; //#ifdef _SVSTDARR_ULONGS #ifndef _SVSTDARR_ULONGS_DECL @@ -139,12 +130,7 @@ SV_DECL_VARARR_SORT_VISIBILITY( SvLongsSort, long, 1, 1, SVL_DLLPUBLIC ) #endif //#endif -//#ifdef _SVSTDARR_SHORTS -#ifndef _SVSTDARR_SHORTS_DECL -SV_DECL_VARARR_VISIBILITY( SvShorts, short, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_SHORTS_DECL -#endif -//#endif +typedef std::deque< short > SvShorts; /* form here all Arrays for Strings, ByteString and then @@ -255,17 +241,5 @@ SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1, #endif //#endif -//#ifdef _SVSTDARR_XUB_STRLEN -#ifndef _SVSTDARR_XUB_STRLEN_DECL -SV_DECL_VARARR_VISIBILITY( SvXub_StrLens, xub_StrLen, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_XUB_STRLEN_DECL -#endif -//#endif - -//#ifdef _SVSTDARR_XUB_STRLENSORT -#ifndef _SVSTDARR_XUB_STRLENSORT_DECL -SV_DECL_VARARR_SORT_VISIBILITY( SvXub_StrLensSort, xub_StrLen, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_XUB_STRLENSORT_DECL -#endif -//#endif +typedef std::deque< xub_StrLen > SvXub_StrLens; diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 41aff1bd2974..be022c711de1 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -520,6 +520,15 @@ public: String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); + /** Format a string according to a format code string to be scanned. + @return + <sal_False/> if format code contains an error + <sal_True/> else, in which case the string and color are returned. + */ + sal_Bool GetPreviewString( const String& sFormatString, const String& sPreviewString, + String& sOutString, Color** ppColor, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + /** Test whether the format code string is already present in container @return NUMBERFORMAT_ENTRY_NOT_FOUND if not found, else the format index. diff --git a/svl/prj/build.lst b/svl/prj/build.lst index f2d4bf324d01..d5897d9e9883 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -19,4 +19,8 @@ sl svl\util nmake - all svl_util svl_usdde.u svl_psd sl svl\source\fsstor nmake - all svl_fsstor svl_inc NULL sl svl\source\passwordcontainer nmake - all svl_passcont svl_inc NULL +# complex test for ConfigItems are marked as defect +# sl svl\qa\complex\ConfigItems\helper nmake - all svl_qa_complex_help svl_util svl_passcont NULL +# sl svl\qa\complex\ConfigItems nmake - all svl_qa_complex svl_qa_complex_help svl_util svl_passcont NULL +sl svl\qa\complex\passwordcontainer nmake - all svl_qa_complex svl_util svl_passcont NULL diff --git a/svl/prj/d.lst b/svl/prj/d.lst index a5c2564e81cd..d79346c16087 100644 --- a/svl/prj/d.lst +++ b/svl/prj/d.lst @@ -20,3 +20,6 @@ dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\b *.xml %_DEST%\xml%_EXT%\*.xml +..\%__SRC%\misc\fsstorage.component %_DEST%\xml%_EXT%\fsstorage.component +..\%__SRC%\misc\passwordcontainer.component %_DEST%\xml%_EXT%\passwordcontainer.component +..\%__SRC%\misc\svl.component %_DEST%\xml%_EXT%\svl.component diff --git a/svl/qa/complex/ConfigItems/CheckConfigItems.java b/svl/qa/complex/ConfigItems/CheckConfigItems.java index 4afa2bf33f55..78141b6b20d4 100644 --- a/svl/qa/complex/ConfigItems/CheckConfigItems.java +++ b/svl/qa/complex/ConfigItems/CheckConfigItems.java @@ -27,20 +27,25 @@ package complex.ConfigItems; -import com.sun.star.beans.*; -import com.sun.star.lang.*; -import com.sun.star.uno.*; -import com.sun.star.task.*; +import com.sun.star.beans.NamedValue; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.task.XJob; +import com.sun.star.uno.UnoRuntime; -import complexlib.*; -import java.lang.*; -import java.util.*; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +// import static org.junit.Assert.*; //----------------------------------------------- /** @short todo document me + * @deprecated this tests seems no longer work as expected. */ -public class CheckConfigItems extends ComplexTestCase +public class CheckConfigItems { //------------------------------------------- // some const @@ -64,43 +69,44 @@ public class CheckConfigItems extends ComplexTestCase @return All test methods. @todo Think about selection of tests from outside ... */ - public String[] getTestMethodNames() - { - return new String[] - { - "checkPicklist", - "checkURLHistory", - "checkHelpBookmarks", - "checkPrintOptions", - "checkAccessibilityOptions", - "checkUserOptions" - }; - } +// public String[] getTestMethodNames() +// { +// return new String[] +// { +// "checkPicklist", +// "checkURLHistory", +// "checkHelpBookmarks", +// "checkPrintOptions", +// "checkAccessibilityOptions", +// "checkUserOptions" +// }; +// } //------------------------------------------- /** @short Create the environment for following tests. - @descr Use either a component loader from desktop or + * @throws java.lang.Exception + * @descr Use either a component loader from desktop or from frame */ - public void before() + @Before public void before() throws java.lang.Exception { // get uno service manager from global test environment - m_xSmgr = (XMultiServiceFactory)param.getMSF(); + m_xSmgr = getMSF(); // TODO register helper service // create module manager - m_xTest = (XJob)UnoRuntime.queryInterface( - XJob.class, - m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest")); + m_xTest = UnoRuntime.queryInterface(XJob.class, m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest")); } //------------------------------------------- - /** @short close the environment. + /** + * @throws java.lang.Exception + * @short close the environment. */ - public void after() + @After public void after() throws java.lang.Exception { // TODO deregister helper service @@ -110,54 +116,66 @@ public class CheckConfigItems extends ComplexTestCase } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkPicklist() + @Test public void checkPicklist() throws java.lang.Exception { impl_triggerTest("checkPicklist"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkURLHistory() + @Test public void checkURLHistory() throws java.lang.Exception { impl_triggerTest("checkURLHistory"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkHelpBookmarks() + @Test public void checkHelpBookmarks() throws java.lang.Exception { impl_triggerTest("checkHelpBookmarks"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkPrintOptions() - throws java.lang.Exception - { - impl_triggerTest("checkPrintOptions"); - } +// @Test public void checkPrintOptions() +// throws java.lang.Exception +// { +// impl_triggerTest("checkPrintOptions"); +// } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkAccessibilityOptions() + @Test public void checkAccessibilityOptions() throws java.lang.Exception { impl_triggerTest("checkAccessibilityOptions"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkUserOptions() + @Test public void checkUserOptions() throws java.lang.Exception { impl_triggerTest("checkUserOptions"); @@ -175,4 +193,27 @@ public class CheckConfigItems extends ComplexTestCase lArgs[0].Value = sTest; m_xTest.execute(lArgs); } + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx index f9840605a6d5..b342eff7ff76 100644 --- a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx @@ -26,8 +26,8 @@ ************************************************************************/ #include "HistoryOptTest.hxx" -#include "AccessibilityOptTest.hxx" -#include "PrintOptTest.hxx" +// #include "AccessibilityOptTest.hxx" +// #include "PrintOptTest.hxx" #include "UserOptTest.hxx" #include <com/sun/star/uno/XComponentContext.hpp> @@ -50,8 +50,8 @@ static const ::rtl::OUString PROP_TEST = ::rtl::OUString::creat 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_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"); //============================================================================= @@ -136,16 +136,16 @@ css::uno::Any SAL_CALL ConfigItemTest::execute(const css::uno::Sequence< css::be HistoryOptTest aOptTest; aOptTest.checkHelpBookmarks(); } - else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS)) - { - AccessibilityOptTest aOptTest; - aOptTest.impl_checkAccessibilityOptions(); - } - else if (sTest.equals(TEST_PRINTOPTIONS)) - { - PrintOptTest aOptTest; - aOptTest.impl_checkPrint(); - } +// else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS)) +// { +// AccessibilityOptTest aOptTest; +// aOptTest.impl_checkAccessibilityOptions(); +// } +// else if (sTest.equals(TEST_PRINTOPTIONS)) +// { +// PrintOptTest aOptTest; +// aOptTest.impl_checkPrint(); +// } else if (sTest.equals(TEST_USEROPTIONS)) { UserOptTest aOptTest; diff --git a/svl/qa/complex/ConfigItems/helper/makefile.mk b/svl/qa/complex/ConfigItems/helper/makefile.mk index 13ea12106792..95f2e456fab3 100644 --- a/svl/qa/complex/ConfigItems/helper/makefile.mk +++ b/svl/qa/complex/ConfigItems/helper/makefile.mk @@ -24,7 +24,7 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ=..$/..$/..$/.. +PRJ=../../../.. PRJNAME= svl TARGET= ConfigItemTest @@ -38,26 +38,27 @@ NO_BSYMBOLIC= TRUE # --- Generate ----------------------------------------------------- -INCPOST += $(PRJ)$/source$/inc +INCPOST += $(PRJ)/source/inc # --- light services library ---------------------------------------------------- SHL1TARGET= svt_$(TARGET) SHL1OBJS= \ - $(SLO)$/UserOptTest.obj \ - $(SLO)$/PrintOptTest.obj \ - $(SLO)$/AccessibilityOptTest.obj \ - $(SLO)$/HistoryOptTest.obj \ - $(SLO)$/ConfigItemTest.obj + $(SLO)/UserOptTest.obj \ + $(SLO)/HistoryOptTest.obj \ + $(SLO)/ConfigItemTest.obj + +# $(SLO)/PrintOptTest.obj +# $(SLO)/AccessibilityOptTest.obj SHL1STDLIBS= \ - $(SVLIB) \ - $(SVLLIB) \ - $(UNOTOOLSLIB) \ - $(COMPHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ + $(SVLIB) \ + $(SVLLIB) \ + $(UNOTOOLSLIB) \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ $(SALLIB) SHL1DEF= $(MISC)$/$(SHL1TARGET).def diff --git a/svl/qa/complex/ConfigItems/makefile.mk b/svl/qa/complex/ConfigItems/makefile.mk index 6838cc79a660..b4241f24dfee 100644 --- a/svl/qa/complex/ConfigItems/makefile.mk +++ b/svl/qa/complex/ConfigItems/makefile.mk @@ -24,60 +24,38 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = CheckConfigItems -PRJNAME = svl -PACKAGE = complex$/ConfigItems - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \ - OOoRunner.jar - -JAVAFILES = CheckConfigItems.java - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -SUBDIRS = helper - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -# --- Parameters for the test -------------------------------------- +PRJ = ../../.. +PRJNAME = svl +TARGET = qa_complex_ConfigItems -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/ConfigItems -# test base is java complex -CT_TESTBASE = -TestBase java_complex +# here store only Files which contain a @Test +JAVATESTFILES = \ + CheckConfigItems.java -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# put here all other files +JAVAFILES = $(JAVATESTFILES) -# start the runner application -CT_APP = org.openoffice.Runner +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# --- Targets ------------------------------------------------------ +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -.INCLUDE : target.mk +.END -RUN: run +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -run: - java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +ALLTAR : javatest +.END diff --git a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java index bf6159ee38c5..8e886f0b8269 100644 --- a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java +++ b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java @@ -36,12 +36,16 @@ public class MasterPasswdHandler extends WeakBase XInteractionSupplyAuthentication xAuthentication = null; for( int i = 0; i < xContinuations.length; ++i ) { - xAuthentication = (XInteractionSupplyAuthentication)UnoRuntime.queryInterface( XInteractionSupplyAuthentication.class, xContinuations[i]); + xAuthentication = UnoRuntime.queryInterface(XInteractionSupplyAuthentication.class, xContinuations[i]); if( xAuthentication != null ) + { break; + } } if( xAuthentication.canSetPassword() ) - xAuthentication.setPassword( "abcdefghijklmnopqrstuvwxyz123456" ); + { + xAuthentication.setPassword("abcdefghijklmnopqrstuvwxyz123456"); + } xAuthentication.select(); } } else { diff --git a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java index 2e3bada4d1bc..ac5c79d134dc 100644 --- a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java +++ b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java @@ -27,47 +27,78 @@ package complex.passwordcontainer; -import complexlib.ComplexTestCase; import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; -public class PasswordContainerUnitTest extends ComplexTestCase { +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public class PasswordContainerUnitTest { private XMultiServiceFactory m_xMSF = null; - public String[] getTestMethodNames() { - return new String[] { - "ExecuteTest01", - "ExecuteTest02", - "ExecuteTest03"}; - } - public String getTestObjectName() { - return "PasswordContainerUnitTest"; - } +//// public String[] getTestMethodNames() { +//// return new String[] { +//// "ExecuteTest01", +//// "ExecuteTest02", +//// "ExecuteTest03"}; +//// } +// public String getTestObjectName() { +// return "PasswordContainerUnitTest"; +// } - public void before() { + @Before public void before() { try { - m_xMSF = (XMultiServiceFactory) param.getMSF(); + m_xMSF = getMSF(); } catch (Exception e) { - failed ("Cannot create service factory!"); + fail ("Cannot create service factory!"); } if (m_xMSF == null) { - failed ("Cannot create service factory!"); + fail ("Cannot create service factory!"); } } - public void after() { + @After public void after() { m_xMSF = null; } - public void ExecuteTest01() { - PasswordContainerTest aTest = new Test01(m_xMSF, log); - assure("Test01 failed!", aTest.test()); + @Test public void ExecuteTest01() + { + PasswordContainerTest aTest = new Test01(m_xMSF); + assertTrue("Test01 failed!", aTest.test()); } - public void ExecuteTest02() { - PasswordContainerTest aTest = new Test02(m_xMSF, log); - assure("Test02 failed!", aTest.test()); + @Test public void ExecuteTest02() { + PasswordContainerTest aTest = new Test02(m_xMSF); + assertTrue("Test02 failed!", aTest.test()); } - public void ExecuteTest03() { - PasswordContainerTest aTest = new Test03(m_xMSF, log); - assure("Test03 failed!", aTest.test()); + @Test public void ExecuteTest03() { + PasswordContainerTest aTest = new Test03(m_xMSF); + assertTrue("Test03 failed!", aTest.test()); } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/svl/qa/complex/passwordcontainer/Test01.java b/svl/qa/complex/passwordcontainer/Test01.java index 1ca17c922669..9367fea4eb7b 100644 --- a/svl/qa/complex/passwordcontainer/Test01.java +++ b/svl/qa/complex/passwordcontainer/Test01.java @@ -36,17 +36,17 @@ import com.sun.star.task.XMasterPasswordHandling; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; +// import share.LogWriter; public class Test01 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test01 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test01: "); + m_aTestHelper = new TestHelper ( "Test01: "); } public boolean test() { @@ -68,9 +68,9 @@ public class Test01 implements PasswordContainerTest { } try { Object oPasswordContainer = m_xMSF.createInstance( "com.sun.star.task.PasswordContainer" ); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance( "com.sun.star.task.InteractionHandler" ); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler( xHandler ); // add a set of users and passwords for the same URL for runtime diff --git a/svl/qa/complex/passwordcontainer/Test02.java b/svl/qa/complex/passwordcontainer/Test02.java index b77b0fe9bf48..3d0123de3179 100644 --- a/svl/qa/complex/passwordcontainer/Test02.java +++ b/svl/qa/complex/passwordcontainer/Test02.java @@ -36,17 +36,16 @@ import com.sun.star.task.UserRecord; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; public class Test02 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test02 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test02 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test02: "); + m_aTestHelper = new TestHelper ( "Test02: "); } public boolean test() { @@ -69,11 +68,11 @@ public class Test02 implements PasswordContainerTest { try { Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer"); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler"); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler); - XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); + XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); // allow the storing of the passwords xMHandling.allowPersistentStoring(true); diff --git a/svl/qa/complex/passwordcontainer/Test03.java b/svl/qa/complex/passwordcontainer/Test03.java index 9e38a55893e0..cf2b3d45cbb0 100644 --- a/svl/qa/complex/passwordcontainer/Test03.java +++ b/svl/qa/complex/passwordcontainer/Test03.java @@ -36,17 +36,17 @@ import com.sun.star.task.XInteractionHandler; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; + public class Test03 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test03 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test03 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test03: "); + m_aTestHelper = new TestHelper ( "Test03: "); } public boolean test() { @@ -68,11 +68,11 @@ public class Test03 implements PasswordContainerTest { try { Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer"); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler"); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler); - XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); + XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); // allow the storing of the passwords xMHandling.allowPersistentStoring(true); diff --git a/svl/qa/complex/passwordcontainer/TestHelper.java b/svl/qa/complex/passwordcontainer/TestHelper.java index 1971b61098f5..c91401e74c91 100644 --- a/svl/qa/complex/passwordcontainer/TestHelper.java +++ b/svl/qa/complex/passwordcontainer/TestHelper.java @@ -29,23 +29,23 @@ package complex.passwordcontainer; import com.sun.star.task.UserRecord; -import share.LogWriter; +// import share.LogWriter; public class TestHelper { - LogWriter m_aLogWriter; + // LogWriter m_aLogWriter; String m_sTestPrefix; - public TestHelper( LogWriter aLogWriter, String sTestPrefix ) { - m_aLogWriter = aLogWriter; + public TestHelper( String sTestPrefix ) { + // m_aLogWriter = aLogWriter; m_sTestPrefix = sTestPrefix; } public void Error( String sError ) { - m_aLogWriter.println( m_sTestPrefix + "Error: " + sError ); + System.out.println( m_sTestPrefix + "Error: " + sError ); } public void Message( String sMessage ) { - m_aLogWriter.println( m_sTestPrefix + sMessage ); + System.out.println( m_sTestPrefix + sMessage ); } public boolean sameLists(UserRecord aUserList1[], UserRecord aUserList2[]) { @@ -60,7 +60,9 @@ public class TestHelper { int j; for(j = 0; j < aUserList2.length; j++) { if(!aUserList1[i].UserName.equals(aUserList2[j].UserName)) + { continue; + } if(aUserList1[i].Passwords[0].equals(aUserList2[j].Passwords[0])) { break; } diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk index 57fd4d560f8d..625404682761 100644 --- a/svl/qa/complex/passwordcontainer/makefile.mk +++ b/svl/qa/complex/passwordcontainer/makefile.mk @@ -25,63 +25,110 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = PasswordContainerUnitTest -PRJNAME=svl -PACKAGE = complex$/passwordcontainer - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar - -JAVAFILES =\ - PasswordContainerUnitTest.java\ - PasswordContainerTest.java\ - TestHelper.java\ - Test01.java\ - Test02.java\ - Test03.java\ - MasterPasswdHandler.java - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -#----- make a jar from compiled files ------------------------------ +PRJ = ../../.. +PRJNAME = svl +TARGET = qa_complex_passwordcontainer -MAXLINELENGTH = 100000 +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/passwordcontainer -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +# here store only Files which contain a @Test +JAVATESTFILES = \ + PasswordContainerUnitTest.java -# --- Parameters for the test -------------------------------------- -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + PasswordContainerTest.java\ + Test01.java\ + Test02.java\ + Test03.java\ + TestHelper.java\ + MasterPasswdHandler.java -# test base is java complex -CT_TESTBASE = -TestBase java_complex -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# start the runner application -CT_APP = org.openoffice.Runner +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# --- Targets ------------------------------------------------------ +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -RUN: run +ALLTAR : javatest -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +.END +# +# +# +# +# PRJ = ..$/..$/.. +# TARGET = PasswordContainerUnitTest +# PRJNAME=svl +# PACKAGE = complex$/passwordcontainer +# +# # --- Settings ----------------------------------------------------- +# .INCLUDE: settings.mk +# +# +# #----- compile .java files ----------------------------------------- +# +# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +# +# JAVAFILES =\ +# PasswordContainerUnitTest.java\ +# PasswordContainerTest.java\ +# TestHelper.java\ +# Test01.java\ +# Test02.java\ +# Test03.java\ +# MasterPasswdHandler.java +# +# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +# +# #----- make a jar from compiled files ------------------------------ +# +# MAXLINELENGTH = 100000 +# +# JARCLASSDIRS = $(PACKAGE) +# JARTARGET = $(TARGET).jar +# JARCOMPRESS = TRUE +# +# # --- Parameters for the test -------------------------------------- +# +# # start an office if the parameter is set for the makefile +# .IF "$(OFFICE)" == "" +# CT_APPEXECCOMMAND = +# .ELSE +# CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" +# .ENDIF +# +# # test base is java complex +# CT_TESTBASE = -TestBase java_complex +# +# # test looks something like the.full.package.TestName +# CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# +# # start the runner application +# CT_APP = org.openoffice.Runner +# +# # --- Targets ------------------------------------------------------ +# +# .INCLUDE: target.mk +# +# RUN: run +# +# run: +# +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +# +# diff --git a/svl/source/filepicker/makefile.mk b/svl/source/filepicker/makefile.mk index a4c97ea41aa1..b3c2a829cf54 100644 --- a/svl/source/filepicker/makefile.mk +++ b/svl/source/filepicker/makefile.mk @@ -38,7 +38,6 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------------- SLOFILES =\ - $(SLO)$/pickerhelper.obj \ $(SLO)$/pickerhistory.obj # --- Targets ------------------------------------------------------- diff --git a/svl/source/filepicker/pickerhelper.cxx b/svl/source/filepicker/pickerhelper.cxx deleted file mode 100644 index 72096c1bc56a..000000000000 --- a/svl/source/filepicker/pickerhelper.cxx +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#include "pickerhelper.hxx" -#include "rtl/ustring.hxx" -#include "com/sun/star/ui/dialogs/XFilePicker.hpp" -#include "com/sun/star/ui/dialogs/XFolderPicker.hpp" -#include "com/sun/star/beans/XPropertySet.hpp" -#include "com/sun/star/beans/XPropertySetInfo.hpp" -#include "com/sun/star/uno/Any.hxx" -#include "tools/debug.hxx" - -namespace css = com::sun::star; - -using css::uno::Reference; -using rtl::OUString; - -namespace svt -{ - void SetDialogHelpId( - Reference < css::ui::dialogs::XFilePicker > _mxFileDlg, sal_Int32 _nHelpId ) - { - try - { - // does the dialog haver a help URL property? - Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY ); - Reference< css::beans::XPropertySetInfo > xInfo; - if( xDialogProps.is() ) - xInfo = xDialogProps->getPropertySetInfo( ); - - const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) ); - - if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) ) - { // yep - OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sId += OUString::valueOf( _nHelpId ); - xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); - } - } - catch( const css::uno::Exception& ) - { - DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" ); - } - } - - void SetDialogHelpId( - Reference< css::ui::dialogs::XFolderPicker > _mxFileDlg, sal_Int32 _nHelpId ) - { - try - { - // does the dialog haver a help URL property? - Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY ); - Reference< css::beans::XPropertySetInfo > xInfo; - if( xDialogProps.is() ) - xInfo = xDialogProps->getPropertySetInfo( ); - - const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) ); - - if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) ) - { // yep - OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sId += OUString::valueOf( _nHelpId ); - xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); - } - } - catch( const css::uno::Exception& ) - { - DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" ); - } - } -} - diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index 298b6f555e2a..62fc88f6053a 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -240,30 +240,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) - { - uno::Reference< registry::XRegistryKey > xRegistryKey ( - reinterpret_cast< registry::XRegistryKey*>(pRegistryKey)); - - uno::Reference< registry::XRegistryKey > xNewKey; - xNewKey = xRegistryKey->createKey( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - FSStorageFactory::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES"))); - - const uno::Sequence< ::rtl::OUString > aServices ( - FSStorageFactory::impl_staticGetSupportedServiceNames()); - for( sal_Int32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component new file mode 100644 index 000000000000..3ef0be825972 --- /dev/null +++ b/svl/source/fsstor/fsstorage.component @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.embed.FileSystemStorageFactory"> + <service name="com.sun.star.comp.embed.FileSystemStorageFactory"/> + <service name="com.sun.star.embed.FileSystemStorageFactory"/> + </implementation> +</component> diff --git a/svl/source/fsstor/makefile.mk b/svl/source/fsstor/makefile.mk index dc91814772f9..1dd5d2307037 100644 --- a/svl/source/fsstor/makefile.mk +++ b/svl/source/fsstor/makefile.mk @@ -64,3 +64,11 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/fsstorage.component + +$(MISC)/fsstorage.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fsstorage.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fsstorage.component diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index 19dea8850be0..a0c977237d8b 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.hxx @@ -25,7 +25,8 @@ * ************************************************************************/ #include <svl/brdcst.hxx> - +#include <boost/shared_ptr.hpp> +#include <deque> #ifndef DELETEZ #define DELETEZ(pPtr) { delete pPtr; pPtr = 0; } @@ -53,16 +54,17 @@ struct SfxPoolVersion_Impl {} }; -SV_DECL_PTRARR( SfxPoolItemArrayBase_Impl, SfxPoolItem*, 0, 5 ) -SV_DECL_PTRARR_DEL( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl*, 0, 2 ) +typedef std::deque<SfxPoolItem*> SfxPoolItemArrayBase_Impl; + +typedef boost::shared_ptr< SfxPoolVersion_Impl > SfxPoolVersion_ImplPtr; +typedef std::deque< SfxPoolVersion_ImplPtr > SfxPoolVersionArr_Impl; struct SfxPoolItemArray_Impl: public SfxPoolItemArrayBase_Impl { - sal_uInt16 nFirstFree; + size_t nFirstFree; - SfxPoolItemArray_Impl (sal_uInt16 nInitSize = 0) - : SfxPoolItemArrayBase_Impl( nInitSize ), - nFirstFree( 0 ) + SfxPoolItemArray_Impl () + : nFirstFree( 0 ) {} }; @@ -96,7 +98,8 @@ struct SfxItemPool_Impl void DeleteItems() { - delete[] ppPoolItems; ppPoolItems = 0; + delete[] ppPoolItems; + ppPoolItems = 0; } }; diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index d692ca4e896a..a3ae4c0a7c7e 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -38,14 +38,6 @@ #include <svl/brdcst.hxx> #include <svl/smplhint.hxx> #include "poolio.hxx" -#include <algorithm> - -// STATIC DATA ----------------------------------------------------------- - - -//======================================================================== - -SV_IMPL_PTRARR( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl* ); //======================================================================== @@ -275,13 +267,12 @@ SfxItemPool::SfxItemPool (*( ppPoolDefaults + n ))->SetKind( SFX_ITEMS_POOLDEFAULT ); } - // Version-Map kopieren - sal_uInt16 nVerCount = rPool.pImp->aVersions.Count(); - for ( sal_uInt16 nVer = 0; nVer < nVerCount; ++nVer ) + // Copy Version-Map + for ( size_t nVer = 0; nVer < rPool.pImp->aVersions.size(); ++nVer ) { - const SfxPoolVersion_Impl *pOld = rPool.pImp->aVersions.GetObject(nVer); - const SfxPoolVersion_Impl *pNew = new SfxPoolVersion_Impl( *pOld ); - pImp->aVersions.Insert( pNew, nVer ); + const SfxPoolVersion_ImplPtr pOld = rPool.pImp->aVersions[nVer]; + SfxPoolVersion_ImplPtr pNew = SfxPoolVersion_ImplPtr( new SfxPoolVersion_Impl( *pOld ) ); + pImp->aVersions.push_back( pNew ); } // Verkettung wiederherstellen @@ -454,9 +445,8 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) pSecondary->pImp->ppPoolItems + n; if ( *ppItemArr ) { - SfxPoolItem** ppHtArr = - (SfxPoolItem**)(*ppItemArr)->GetData(); - for( sal_uInt16 i = (*ppItemArr)->Count(); i; ++ppHtArr, --i ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for( size_t i = (*ppItemArr)->size(); i; ++ppHtArr, --i ) if ( !(*ppHtArr) ) { DBG_ERROR( "old secondary pool must be empty" ); @@ -582,8 +572,8 @@ void SfxItemPool::Delete() { if ( *ppItemArr ) { - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -614,8 +604,8 @@ void SfxItemPool::Delete() { if ( *ppItemArr ) { - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -663,8 +653,8 @@ void SfxItemPool::Cleanup() ((*ppDefaultItem && (*ppDefaultItem)->ISA(SfxSetItem)) || (*ppStaticDefaultItem)->ISA(SfxSetItem)) ) { - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if ( *ppHtArr && !(*ppHtArr)->GetRefCount() ) { DELETEZ(*ppHtArr); @@ -681,8 +671,8 @@ void SfxItemPool::Cleanup() { if ( *ppItemArr ) { - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for ( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if ( *ppHtArr && !(*ppHtArr)->GetRefCount() ) DELETEZ( *ppHtArr ); } @@ -782,15 +772,16 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich if( !*ppItemArr ) *ppItemArr = new SfxPoolItemArray_Impl; - SfxPoolItem **ppFree = 0; - SfxPoolItem** ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData(); + SfxPoolItemArrayBase_Impl::iterator ppFree; + sal_Bool ppFreeIsSet = sal_False; + SfxPoolItemArrayBase_Impl::iterator ppHtArray = (*ppItemArr)->begin(); if ( IsItemFlag_Impl( nIndex, SFX_ITEM_POOLABLE ) ) { // wenn es ueberhaupt gepoolt ist, koennte es schon drin sein if ( IsPooledItem(&rItem) ) { // 1. Schleife: teste ob der Pointer vorhanden ist. - for( sal_uInt16 n = (*ppItemArr)->Count(); n; ++ppHtArray, --n ) + for( size_t n = (*ppItemArr)->size(); n; ++ppHtArray, --n ) if( &rItem == (*ppHtArray) ) { AddRef( **ppHtArray ); @@ -799,8 +790,8 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich } // 2. Schleife: dann muessen eben die Attribute verglichen werden - sal_uInt16 n; - for ( n = (*ppItemArr)->Count(), ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData(); + size_t n; + for ( n = (*ppItemArr)->size(), ppHtArray = (*ppItemArr)->begin(); n; ++ppHtArray, --n ) { if ( *ppHtArray ) @@ -812,22 +803,26 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich } } else - if ( !ppFree ) + if ( ppFreeIsSet == sal_False ) + { ppFree = ppHtArray; + ppFreeIsSet = sal_True; + } } } else { // freien Platz suchen - SfxPoolItem** ppHtArr; - sal_uInt16 n, nCount = (*ppItemArr)->Count(); + SfxPoolItemArrayBase_Impl::iterator ppHtArr; + size_t n, nCount = (*ppItemArr)->size(); for ( n = (*ppItemArr)->nFirstFree, - ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData() + n; + ppHtArr = (*ppItemArr)->begin() + n; n < nCount; ++ppHtArr, ++n ) if ( !*ppHtArr ) { ppFree = ppHtArr; + ppFreeIsSet = sal_True; break; } @@ -853,9 +848,9 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich #endif #endif AddRef( *pNewItem, pImp->nInitRefCount ); - const SfxPoolItem* pTemp = pNewItem; - if ( !ppFree ) - (*ppItemArr)->Insert( pTemp, (*ppItemArr)->Count() ); + SfxPoolItem* pTemp = pNewItem; + if ( ppFreeIsSet == sal_False ) + (*ppItemArr)->push_back( pTemp ); else { DBG_ASSERT( *ppFree == 0, "using surrogate in use" ); @@ -915,8 +910,8 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) // Item im eigenen Pool suchen SfxPoolItemArray_Impl** ppItemArr = (pImp->ppPoolItems + nIndex); SFX_ASSERT( *ppItemArr, rItem.Which(), "removing Item not in Pool" ); - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for( sal_uInt16 n = (*ppItemArr)->Count(); n; ++ppHtArr, --n ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for( size_t n = (*ppItemArr)->size(); n; ++ppHtArr, --n ) if( *ppHtArr == &rItem ) { if ( (*ppHtArr)->GetRefCount() ) //! @@ -928,7 +923,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) } // ggf. kleinstmoegliche freie Position merken - sal_uInt16 nPos = (*ppItemArr)->Count() - n; + size_t nPos = (*ppItemArr)->size() - n; if ( (*ppItemArr)->nFirstFree > nPos ) (*ppItemArr)->nFirstFree = nPos; @@ -1009,24 +1004,24 @@ void SfxItemPool::FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const // ----------------------------------------------------------------------- -const SfxPoolItem *SfxItemPool::GetItem(sal_uInt16 nWhich, sal_uInt16 nOfst) const +const SfxPoolItem *SfxItemPool::GetItem2(sal_uInt16 nWhich, sal_uInt32 nOfst) const { DBG_CHKTHIS(SfxItemPool, 0); if ( !IsInRange(nWhich) ) { if ( pSecondary ) - return pSecondary->GetItem( nWhich, nOfst ); + return pSecondary->GetItem2( nWhich, nOfst ); SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" ); return 0; } // dflt-Attribut? - if ( nOfst == SFX_ITEMS_STATICDEFAULT ) + if ( nOfst == SFX_ITEMS_DEFAULT ) return *(ppStaticDefaults + GetIndex_Impl(nWhich)); SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(nWhich)); - if( pItemArr && nOfst < pItemArr->Count() ) + if( pItemArr && nOfst < pItemArr->size() ) return (*pItemArr)[nOfst]; return 0; @@ -1034,21 +1029,21 @@ const SfxPoolItem *SfxItemPool::GetItem(sal_uInt16 nWhich, sal_uInt16 nOfst) con // ----------------------------------------------------------------------- -sal_uInt16 SfxItemPool::GetItemCount(sal_uInt16 nWhich) const +sal_uInt32 SfxItemPool::GetItemCount2(sal_uInt16 nWhich) const { DBG_CHKTHIS(SfxItemPool, 0); if ( !IsInRange(nWhich) ) { if ( pSecondary ) - return pSecondary->GetItemCount( nWhich ); + return pSecondary->GetItemCount2( nWhich ); SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" ); return 0; } SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(nWhich)); if ( pItemArr ) - return pItemArr->Count(); + return pItemArr->size(); return 0; } diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx index adeef1d75a93..f07c19788764 100644 --- a/svl/source/items/poolcach.cxx +++ b/svl/source/items/poolcach.cxx @@ -41,18 +41,6 @@ DBG_NAME(SfxItemPoolCache) - -//------------------------------------------------------------------------ - -struct SfxItemModifyImpl -{ - const SfxSetItem *pOrigItem; - SfxSetItem *pPoolItem; -}; - -SV_DECL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl, 8, 8 ) -SV_IMPL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl); - //------------------------------------------------------------------------ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool, @@ -84,7 +72,7 @@ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool, SfxItemPoolCache::~SfxItemPoolCache() { DBG_DTOR(SfxItemPoolCache, 0); - for ( sal_uInt16 nPos = 0; nPos < pCache->Count(); ++nPos ) { + for ( size_t nPos = 0; nPos < pCache->size(); ++nPos ) { pPool->Remove( *(*pCache)[nPos].pPoolItem ); pPool->Remove( *(*pCache)[nPos].pOrigItem ); } @@ -103,8 +91,8 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, sal_Bo DBG_ASSERT( IsDefaultItem( &rOrigItem ) || IsPooledItem( &rOrigItem ), "original not in pool" ); - // Suchen, ob diese Transformations schon einmal vorkam - for ( sal_uInt16 nPos = 0; nPos < pCache->Count(); ++nPos ) + // Find whether this Transformations ever occurred + for ( size_t nPos = 0; nPos < pCache->size(); ++nPos ) { SfxItemModifyImpl &rMapEntry = (*pCache)[nPos]; if ( rMapEntry.pOrigItem == &rOrigItem ) @@ -143,7 +131,7 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, sal_Bo SfxItemModifyImpl aModify; aModify.pOrigItem = &rOrigItem; aModify.pPoolItem = (SfxSetItem*) pNewPoolItem; - pCache->Insert( aModify, pCache->Count() ); + pCache->push_back( aModify ); DBG_ASSERT( !pItemToPut || &pNewPoolItem->GetItemSet().Get( pItemToPut->Which() ) == pItemToPut, diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index 19efb02c4cef..054eb984d2fd 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -178,10 +178,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const // Version-Maps { SfxMultiVarRecordWriter aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP, 0 ); - for ( sal_uInt16 nVerNo = 0; nVerNo < pImp->aVersions.Count(); ++nVerNo ) + for ( size_t nVerNo = 0; nVerNo < pImp->aVersions.size(); ++nVerNo ) { aVerRec.NewContent(); - SfxPoolVersion_Impl *pVer = pImp->aVersions[nVerNo]; + SfxPoolVersion_ImplPtr pVer = pImp->aVersions[nVerNo]; rStream << pVer->_nVer << pVer->_nStart << pVer->_nEnd; sal_uInt16 nCount = pVer->_nEnd - pVer->_nStart + 1; sal_uInt16 nNewWhich = 0; @@ -207,7 +207,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const SfxPoolItemArray_Impl **pArr = pImp->ppPoolItems; SfxPoolItem **ppDefItem = ppStaticDefaults; const sal_uInt16 nSize = GetSize_Impl(); - for ( sal_uInt16 i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem ) + for ( size_t i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem ) { // Version des Items feststellen sal_uInt16 nItemVersion = (*ppDefItem)->GetVersion( _nFileFormatVersion ); @@ -229,16 +229,16 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const aWhichIdsRec.NewContent(nSlotId, 0); rStream << (*ppDefItem)->Which(); rStream << nItemVersion; - const sal_uInt16 nCount = (*pArr)->Count(); - DBG_ASSERT(nCount, "ItemArr ist leer"); + const sal_uInt32 nCount = ::std::min<size_t>( (*pArr)->size(), SAL_MAX_UINT32 ); + DBG_ASSERT(nCount, "ItemArr is empty"); rStream << nCount; // Items an sich schreiben SfxMultiMixRecordWriter aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS, 0 ); - for ( sal_uInt16 j = 0; j < nCount; ++j ) + for ( size_t j = 0; j < nCount; ++j ) { // Item selbst besorgen - const SfxPoolItem *pItem = (*pArr)->GetObject(j); + const SfxPoolItem *pItem = (*pArr)->operator[](j); if ( pItem && pItem->GetRefCount() ) //! siehe anderes MI-REF { aItemsRec.NewContent(j, 'X' ); @@ -353,8 +353,8 @@ void SfxItemPool::LoadCompleted() if ( *ppItemArr ) { // "uber alle Items mit dieser Which-Id iterieren - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -382,15 +382,15 @@ void SfxItemPool::LoadCompleted() //============================================================================ // This had to be moved to a method of its own to keep Solaris GCC happy: void SfxItemPool::readTheItems ( - SvStream & rStream, sal_uInt16 nItemCount, sal_uInt16 nVersion, + SvStream & rStream, sal_uInt32 nItemCount, sal_uInt16 nVersion, SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** ppArr) { SfxMultiRecordReader aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS ); - SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl( nItemCount ); + SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl(); SfxPoolItem *pItem = 0; - sal_uInt16 n, nLastSurrogate = sal_uInt16(-1); + sal_uIntPtr n, nLastSurrogate = sal_uIntPtr(-1); while (aItemsRec.GetContent()) { // n"achstes Surrogat holen @@ -400,7 +400,7 @@ void SfxItemPool::readTheItems ( // fehlende auff"ullen for ( pItem = 0, n = nLastSurrogate+1; n < nSurrogate; ++n ) - pNewArr->C40_INSERT(SfxPoolItem, pItem, n); + pNewArr->push_back( (SfxPoolItem*) pItem ); nLastSurrogate = nSurrogate; // Ref-Count und Item laden @@ -408,7 +408,7 @@ void SfxItemPool::readTheItems ( rStream >> nRef; pItem = pDefItem->Create(rStream, nVersion); - pNewArr->C40_INSERT(SfxPoolItem, pItem, nSurrogate); + pNewArr->push_back( (SfxPoolItem*) pItem ); if ( !bPersistentRefCounts ) // bis <SfxItemPool::LoadCompleted()> festhalten @@ -424,33 +424,32 @@ void SfxItemPool::readTheItems ( // fehlende auff"ullen for ( pItem = 0, n = nLastSurrogate+1; n < nItemCount; ++n ) - pNewArr->C40_INSERT(SfxPoolItem, pItem, n); + pNewArr->push_back( (SfxPoolItem*) pItem ); SfxPoolItemArray_Impl *pOldArr = *ppArr; *ppArr = pNewArr; // die Items merken, die schon im Pool sind - int bEmpty = sal_True; + bool bEmpty = true; if ( 0 != pOldArr ) - for ( n = 0; bEmpty && n < pOldArr->Count(); ++n ) - bEmpty = pOldArr->GetObject(n) == 0; + for ( n = 0; bEmpty && n < pOldArr->size(); ++n ) + bEmpty = pOldArr->operator[](n) == 0; DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" ); if ( !bEmpty ) { // f"ur alle alten suchen, ob ein gleiches neues existiert - for ( sal_uInt16 nOld = 0; nOld < pOldArr->Count(); ++nOld ) + for ( size_t nOld = 0; nOld < pOldArr->size(); ++nOld ) { SfxPoolItem *pOldItem = (*pOldArr)[nOld]; if ( pOldItem ) { - sal_uInt16 nFree = USHRT_MAX; - int bFound = sal_False; - sal_uInt16 nCount = (*ppArr)->Count(); - for ( sal_uInt16 nNew = nCount; !bFound && nNew--; ) + sal_uInt32 nFree = SAL_MAX_UINT32; + bool bFound = false; + for ( size_t nNew = (*ppArr)->size(); nNew--; ) { // geladenes Item SfxPoolItem *&rpNewItem = - (SfxPoolItem*&)(*ppArr)->GetData()[nNew]; + (SfxPoolItem*&)(*ppArr)->operator[](nNew); // surrogat unbenutzt? if ( !rpNewItem ) @@ -464,17 +463,18 @@ void SfxItemPool::readTheItems ( SetRefCount( *rpNewItem, 0 ); delete rpNewItem; rpNewItem = pOldItem; - bFound = sal_True; + bFound = true; + break; } } // vorhervorhandene, nicht geladene uebernehmen if ( !bFound ) { - if ( nFree != USHRT_MAX ) - (SfxPoolItem*&)(*ppArr)->GetData()[nFree] = pOldItem; + if ( nFree != SAL_MAX_UINT32 ) + (SfxPoolItem*&)(*ppArr)->operator[](nFree) = pOldItem; else - (*ppArr)->C40_INSERT( SfxPoolItem, pOldItem, nCount ); + (*ppArr)->push_back( (SfxPoolItem*) pOldItem ); } } } @@ -495,14 +495,14 @@ SvStream &SfxItemPool::Load(SvStream &rStream) // "uber alle Which-Werte iterieren SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems; - for( sal_uInt16 nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr ) + for( size_t nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr ) { // ist "uberhaupt ein Item mit dem Which-Wert da? if ( *ppItemArr ) { // "uber alle Items mit dieser Which-Id iterieren - SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData(); - for( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr ) + SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); + for( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) if (*ppHtArr) { #ifdef DBG_UTIL @@ -611,10 +611,10 @@ SvStream &SfxItemPool::Load(SvStream &rStream) rStream >> nVersion >> nHStart >> nHEnd; sal_uInt16 nCount = nHEnd - nHStart + 1; - // Version neuer als bekannt? - if ( nVerNo >= pImp->aVersions.Count() ) + // Is new version is known? + if ( nVerNo >= pImp->aVersions.size() ) { - // neue Version hinzufuegen + // Add new Version sal_uInt16 *pMap = new sal_uInt16[nCount]; for ( sal_uInt16 n = 0; n < nCount; ++n ) rStream >> pMap[n]; @@ -632,7 +632,8 @@ SvStream &SfxItemPool::Load(SvStream &rStream) while ( aWhichIdsRec.GetContent() ) { // SlotId, Which-Id und Item-Version besorgen - sal_uInt16 nCount, nVersion, nWhich; + sal_uInt32 nCount; + sal_uInt16 nVersion, nWhich; //!sal_uInt16 nSlotId = aWhichIdsRec.GetContentTag(); rStream >> nWhich; if ( pImp->nLoadingVersion != pImp->nVersion ) @@ -799,10 +800,10 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) sal_uInt16 nCount = nHEnd - nHStart + 1; sal_uInt16 nBytes = (nCount)*sizeof(sal_uInt16); - // Version neuer als bekannt? - if ( nVerNo >= pImp->aVersions.Count() ) + // Is new version is known? + if ( nVerNo >= pImp->aVersions.size() ) { - // neue Version hinzufuegen + // Add new Version sal_uInt16 *pMap = new sal_uInt16[nCount]; for ( sal_uInt16 n = 0; n < nCount; ++n ) rStream >> pMap[n]; @@ -849,7 +850,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) sal_uInt16 nIndex = GetIndex_Impl(nWhich); ppArr = pImp->ppPoolItems + nIndex; - pNewArr = new SfxPoolItemArray_Impl( nCount ); + pNewArr = new SfxPoolItemArray_Impl(); pDefItem = *(ppStaticDefaults + nIndex); } @@ -897,8 +898,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) AddRef(*pItem, nRef); } } - - pNewArr->C40_INSERT( SfxPoolItem, pItem, j); + //pNewArr->insert( pItem, j ); + pNewArr->push_back( (SfxPoolItem*) pItem ); // restliche gespeicherte Laenge skippen (neueres Format) nLastPos = rStream.Tell(); @@ -924,24 +925,23 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) // die Items merken, die schon im Pool sind int bEmpty = sal_True; if ( 0 != pOldArr ) - for ( sal_uInt16 n = 0; bEmpty && n < pOldArr->Count(); ++n ) - bEmpty = pOldArr->GetObject(n) == 0; + for ( size_t n = 0; bEmpty && n < pOldArr->size(); ++n ) + bEmpty = pOldArr->operator[](n) == 0; DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" ); if ( !bEmpty ) { // f"ur alle alten suchen, ob ein gleiches neues existiert - for ( sal_uInt16 nOld = 0; nOld < pOldArr->Count(); ++nOld ) + for ( size_t nOld = 0; nOld < pOldArr->size(); ++nOld ) { SfxPoolItem *pOldItem = (*pOldArr)[nOld]; if ( pOldItem ) { - int bFound = sal_False; - for ( sal_uInt16 nNew = 0; - !bFound && nNew < (*ppArr)->Count(); - ++nNew ) + bool bFound = false; + for ( size_t nNew = 0; + nNew < (*ppArr)->size(); ++nNew ) { SfxPoolItem *&rpNewItem = - (SfxPoolItem*&)(*ppArr)->GetData()[nNew]; + (SfxPoolItem*&)(*ppArr)->operator[](nNew); if ( rpNewItem && *rpNewItem == *pOldItem ) { @@ -949,11 +949,11 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) SetRefCount( *rpNewItem, 0 ); delete rpNewItem; rpNewItem = pOldItem; - bFound = sal_True; + bFound = true; SFX_TRACE( "reusing item", pOldItem ); + break; } } - //! DBG_ASSERT( bFound, "old-item not found in file" ); if ( !bFound ) { SFX_TRACE( "item not found: ", pOldItem ); @@ -1039,7 +1039,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate L"adt Surrogat aus 'rStream' und liefert das dadurch in 'rRefPool' repr"asentierte SfxPoolItem zu"ruck. Ist das im Stream befindliche Surrogat == SFX_ITEMS_DIRECT (!SFX_ITEM_POOLABLE) wird 0 zur"uckgegeben, - das Item ist direkt aus dem Stream zu laden. Bei 0xfff0 (SFX_ITEMS_NULL) + das Item ist direkt aus dem Stream zu laden. Bei 0xfffffff0 (SFX_ITEMS_NULL) wird auch 0 zurueckgegeben und rWhich auf 0 gesetzt, das Item ist nicht verfuegbar. @@ -1071,15 +1071,15 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate */ { - // erstmal das Surrogat lesen - sal_uInt16 nSurrogat; + // Read the first surrogate + sal_uInt32 nSurrogat; rStream >> nSurrogat; - // direkt gespeichertes Item? + // Is item stored directly? if ( SFX_ITEMS_DIRECT == nSurrogat ) return 0; - // nicht vorhandenes Item? + // Item does not exist? if ( SFX_ITEMS_NULL == nSurrogat ) { rWhich = 0; @@ -1114,13 +1114,13 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate if ( pTarget->IsInRange(rWhich) ) { // dflt-Attribut? - if ( SFX_ITEMS_STATICDEFAULT == nSurrogat ) + if ( SFX_ITEMS_DEFAULT == nSurrogat ) return *(pTarget->ppStaticDefaults + pTarget->GetIndex_Impl(rWhich)); SfxPoolItemArray_Impl* pItemArr = *(pTarget->pImp->ppPoolItems + pTarget->GetIndex_Impl(rWhich)); - pItem = pItemArr && nSurrogat < pItemArr->Count() + pItem = pItemArr && nSurrogat < pItemArr->size() ? (*pItemArr)[nSurrogat] : 0; if ( !pItem ) @@ -1184,17 +1184,17 @@ int SfxItemPool::StoreSurrogate int bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); rStream << ( bRealSurrogate ? GetSurrogate( pItem ) - : (sal_uInt16) SFX_ITEMS_DIRECT ); + : SFX_ITEMS_DIRECT ); return bRealSurrogate; } - rStream << (sal_uInt16) SFX_ITEMS_NULL; + rStream << SFX_ITEMS_NULL; return sal_True; } // ----------------------------------------------------------------------- -sal_uInt16 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const +sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const { DBG_CHKTHIS(SfxItemPool, 0); DBG_ASSERT( pItem, "no 0-Pointer Surrogate" ); @@ -1210,18 +1210,18 @@ sal_uInt16 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const // Pointer auf static- oder pool-dflt-Attribut? if( IsStaticDefaultItem(pItem) || IsPoolDefaultItem(pItem) ) - return SFX_ITEMS_STATICDEFAULT; + return SFX_ITEMS_DEFAULT; SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(pItem->Which())); - DBG_ASSERT(pItemArr, "ItemArr nicht vorhanden"); - const sal_uInt16 nCount = pItemArr->Count(); - for ( sal_uInt16 i = 0; i < nCount; ++i ) + DBG_ASSERT(pItemArr, "ItemArr is not available"); + + for ( size_t i = 0; i < pItemArr->size(); ++i ) { const SfxPoolItem *p = (*pItemArr)[i]; if ( p == pItem ) return i; } - SFX_ASSERT( 0, pItem->Which(), "Item nicht im Pool"); + SFX_ASSERT( 0, pItem->Which(), "Item not in the pool"); return SFX_ITEMS_NULL; } @@ -1326,10 +1326,10 @@ void SfxItemPool::SetVersionMap */ { - // neuen Map-Eintrag erzeugen und einf"ugen - const SfxPoolVersion_Impl *pVerMap = new SfxPoolVersion_Impl( - nVer, nOldStart, nOldEnd, pOldWhichIdTab ); - pImp->aVersions.Insert( pVerMap, pImp->aVersions.Count() ); + // create new map entry to insert + const SfxPoolVersion_ImplPtr pVerMap = SfxPoolVersion_ImplPtr( new SfxPoolVersion_Impl( + nVer, nOldStart, nOldEnd, pOldWhichIdTab ) ); + pImp->aVersions.push_back( pVerMap ); DBG_ASSERT( nVer > pImp->nVersion, "Versions not sorted" ); pImp->nVersion = nVer; @@ -1398,9 +1398,9 @@ sal_uInt16 SfxItemPool::GetNewWhich if ( nDiff > 0 ) { // von der Top-Version bis runter zur File-Version stufenweise mappen - for ( sal_uInt16 nMap = pImp->aVersions.Count(); nMap > 0; --nMap ) + for ( size_t nMap = pImp->aVersions.size(); nMap > 0; --nMap ) { - SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap-1]; + SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap-1]; if ( pVerInfo->_nVer > pImp->nVersion ) { sal_uInt16 nOfs; sal_uInt16 nCount = pVerInfo->_nEnd - pVerInfo->_nStart + 1; @@ -1424,9 +1424,9 @@ sal_uInt16 SfxItemPool::GetNewWhich else if ( nDiff < 0 ) { // von der File-Version bis zur aktuellen Version stufenweise mappen - for ( sal_uInt16 nMap = 0; nMap < pImp->aVersions.Count(); ++nMap ) + for ( size_t nMap = 0; nMap < pImp->aVersions.size(); ++nMap ) { - SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap]; + SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap]; if ( pVerInfo->_nVer > pImp->nLoadingVersion ) { DBG_ASSERT( nFileWhich >= pVerInfo->_nStart && @@ -1637,7 +1637,8 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, int bDirect, else { // WID in der Version nicht vorhanden => ueberspringen - sal_uInt16 nSurro, nVersion, nLen; + sal_uInt32 nSurro; + sal_uInt16 nVersion, nLen; rStream >> nSurro; if ( SFX_ITEMS_DIRECT == nSurro ) { diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx index 9933294b4d86..237cf73f6c7f 100644 --- a/svl/source/items/whassert.hxx +++ b/svl/source/items/whassert.hxx @@ -42,7 +42,7 @@ ByteString aMsg( sMessage ); \ aMsg.Append(RTL_CONSTASCII_STRINGPARAM("\nwith Id/Pos: ")); \ aMsg += ByteString::CreateFromInt32( nId ); \ - DbgOut( aMsg.GetBuffer(), DBG_OUT_ERROR, __FILE__, __LINE__); \ + DbgError( aMsg.GetBuffer(), __FILE__, __LINE__); \ } \ } \ } diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx index 4dbedc1e5642..7088d036be3c 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.cxx @@ -61,7 +61,6 @@ #include <tools/debug.hxx> SV_IMPL_VARARR(SvPtrarr,VoidPtr) -SV_IMPL_VARARR_PLAIN(SvPtrarrPlain,VoidPtr) sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const { sal_uInt16 n; @@ -69,25 +68,12 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const return ( n >= nA ? USHRT_MAX : n ); } -sal_uInt16 SvPtrarrPlain::GetPos( const VoidPtr aElement ) const -{ sal_uInt16 n; - for( n=0; n < nA && *(GetData()+n) != aElement; ) n++; - return ( n >= nA ? USHRT_MAX : n ); -} - - -SV_IMPL_VARARR( SvBools, sal_Bool ) -SV_IMPL_VARARR( SvBytes, sal_uInt8 ) SV_IMPL_VARARR( SvULongs, sal_uIntPtr ) SV_IMPL_VARARR( SvUShorts, sal_uInt16 ) SV_IMPL_VARARR( SvLongs, long) -SV_IMPL_VARARR( SvShorts, short ) SV_IMPL_VARARR_SORT( SvULongsSort, sal_uIntPtr ) SV_IMPL_VARARR_SORT( SvLongsSort, long ) -SV_IMPL_VARARR_SORT( SvXub_StrLensSort, xub_StrLen ) - -SV_IMPL_VARARR( SvXub_StrLens, xub_StrLen ) SV_IMPL_PTRARR( SvStrings, StringPtr ) SV_IMPL_PTRARR( SvStringsDtor, StringPtr ) diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index 0cbd5d747882..de53c0d2f63f 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" + #include <lngmisc.hxx> #include <tools/solar.h> #include <tools/string.hxx> @@ -132,6 +133,38 @@ sal_Bool ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ ) return bModified; } + +String GetThesaurusReplaceText( const String &rText ) +{ + // The strings for synonyms returned by the thesaurus sometimes have some + // explanation text put in between '(' and ')' or a trailing '*'. + // These parts should not be put in the ReplaceEdit Text that may get + // inserted into the document. Thus we strip them from the text. + + String aText( rText ); + + xub_StrLen nPos = aText.Search( sal_Unicode('(') ); + while (STRING_NOTFOUND != nPos) + { + xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos ); + if (STRING_NOTFOUND != nEnd) + aText.Erase( nPos, nEnd-nPos+1 ); + else + break; + nPos = aText.Search( sal_Unicode('(') ); + } + + nPos = aText.Search( sal_Unicode('*') ); + if (STRING_NOTFOUND != nPos) + aText.Erase( nPos ); + + // remove any possible remaining ' ' that may confuse the thesaurus + // when it gets called with the text + aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); + + return aText; +} + /////////////////////////////////////////////////////////////////////////// } // namespace linguistic diff --git a/svl/source/numbers/nbdll.cxx b/svl/source/numbers/nbdll.cxx deleted file mode 100644 index 0a49d9ed0524..000000000000 --- a/svl/source/numbers/nbdll.cxx +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#ifdef WIN -#include <svwin.h> - -#ifndef _SYSDEP_HXX -#include <sysdep.hxx> -#endif - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return sal_True; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index bb490d6ba148..b7cae8f69562 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1697,6 +1697,58 @@ sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, return sal_False; } +sal_Bool SvNumberFormatter::GetPreviewString( const String& sFormatString, + const String& sPreviewString, + String& sOutString, + Color** ppColor, + LanguageType eLnge ) +{ + if (sFormatString.Len() == 0) // no empty string + return sal_False; + + xub_StrLen nCheckPos = STRING_NOTFOUND; + sal_uInt32 nKey; + if (eLnge == LANGUAGE_DONTKNOW) + eLnge = IniLnge; + ChangeIntl(eLnge); // switch if needed + eLnge = ActLnge; + String sTmpString = sFormatString; + SvNumberformat* p_Entry = new SvNumberformat( sTmpString, + pFormatScanner, + pStringScanner, + nCheckPos, + eLnge); + if (nCheckPos == 0) // String ok + { + String aNonConstPreview( sPreviewString); + // May have to create standard formats for this locale. + sal_uInt32 CLOffset = ImpGenerateCL(eLnge); + nKey = ImpIsEntry( p_Entry->GetFormatstring(), CLOffset, eLnge); + if (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND) // already present + GetOutputString( aNonConstPreview, nKey, sOutString, ppColor); + else + { + // If the format is valid but not a text format and does not + // include a text subformat, an empty string would result. Same as + // in SvNumberFormatter::GetOutputString() + if (p_Entry->IsTextFormat() || p_Entry->HasTextFormat()) + p_Entry->GetOutputString( aNonConstPreview, sOutString, ppColor); + else + { + *ppColor = NULL; + sOutString = sPreviewString; + } + } + delete p_Entry; + return sal_True; + } + else + { + delete p_Entry; + return sal_False; + } +} + sal_uInt32 SvNumberFormatter::TestNewString(const String& sFormatString, LanguageType eLnge) { diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index aba92a6c93d4..b601bcd89f2a 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2057,7 +2057,7 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, OutString = rScan.GetFalseString(); return sal_False; } - if (eType & NUMBERFORMAT_TEXT && bStandard) + if (eType & NUMBERFORMAT_TEXT) { ImpGetOutputStandard(fNumber, OutString); return sal_False; @@ -2086,7 +2086,9 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber, if (!nLen) return false; - if (nLen > 11) + // #i112250# With the 10-decimal limit, small numbers are formatted as "0". + // Switch to scientific in that case, too: + if (nLen > 11 || (OutString.EqualsAscii("0") && fNumber != 0.0)) { sal_uInt16 nStandardPrec = rScan.GetStandardPrec(); nStandardPrec = ::std::min(nStandardPrec, static_cast<sal_uInt16>(14)); // limits to 14 decimals diff --git a/svl/source/passwordcontainer/makefile.mk b/svl/source/passwordcontainer/makefile.mk index d9eb9615cf80..626a6ffc5830 100644 --- a/svl/source/passwordcontainer/makefile.mk +++ b/svl/source/passwordcontainer/makefile.mk @@ -60,3 +60,11 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/passwordcontainer.component + +$(MISC)/passwordcontainer.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component new file mode 100644 index 000000000000..42eb47cf14dd --- /dev/null +++ b/svl/source/passwordcontainer/passwordcontainer.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="stardiv.svl.PasswordContainer"> + <service name="com.sun.star.task.PasswordContainer"/> + </implementation> +</component> diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 7db18c65db1f..6e92d390eea9 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1543,24 +1543,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) - { - Reference< XRegistryKey > xRegistryKey ( - reinterpret_cast< XRegistryKey* >( pRegistryKey )); - Reference< XRegistryKey > xNewKey; - - xNewKey = xRegistryKey->createKey( - ::rtl::OUString::createFromAscii( "/stardiv.svl.PasswordContainer/UNO/SERVICES" )); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.task.PasswordContainer")); - - return sal_True; - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx index 4ee7c7298242..8e5be5eecca3 100644 --- a/svl/source/svdde/ddedata.cxx +++ b/svl/source/svdde/ddedata.cxx @@ -41,10 +41,6 @@ #include <osl/thread.h> -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeData::DdeData() ------------------------------------------ DdeData::DdeData() @@ -164,10 +160,10 @@ sal_uIntPtr DdeData::GetExternalFormat( sal_uIntPtr nFmt ) default: { -#if defined(WNT) || defined(WIN) || defined( PM2 ) +#if defined(WNT) || defined( PM2 ) String aName( SotExchange::GetFormatName( nFmt ) ); -#if defined(WNT) || defined(WIN) +#if defined(WNT) if( aName.Len() ) nFmt = RegisterClipboardFormat( reinterpret_cast<LPCWSTR>(aName.GetBuffer()) ); @@ -203,7 +199,7 @@ sal_uIntPtr DdeData::GetInternalFormat( sal_uIntPtr nFmt ) break; default: -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nFmt >= CF_MAX ) { TCHAR szName[ 256 ]; diff --git a/svl/source/svdde/ddedll.cxx b/svl/source/svdde/ddedll.cxx deleted file mode 100644 index 2394c9947465..000000000000 --- a/svl/source/svdde/ddedll.cxx +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" -#ifdef WIN - - -#include <sysdep.hxx> // included svwin.h - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -/*************************************************************************** -|* LibMain() -|* Beschreibung Initialisierungsfunktion der DLL -***************************************************************************/ -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return sal_True; -} - -/*************************************************************************** -|* WEP() -|* Beschreibung DLL-Deinitialisierung -***************************************************************************/ -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/svl/source/svdde/ddestrg.cxx b/svl/source/svdde/ddestrg.cxx index 4f0e2464a276..007c9f56c544 100644 --- a/svl/source/svdde/ddestrg.cxx +++ b/svl/source/svdde/ddestrg.cxx @@ -33,10 +33,6 @@ #include "ddeimp.hxx" #include <svl/svdde.hxx> -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeString::DdeString() -------------------------------------- DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) : diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index ab01d308c2da..8edbccc2d435 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.cxx @@ -60,37 +60,6 @@ SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SVL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo ( - void * /* _pServiceManager */, void * _pRegistryKey) -{ - if (_pRegistryKey) - { - Reference< css::registry::XRegistryKey > xRegistryKey ( - reinterpret_cast< css::registry::XRegistryKey* >(_pRegistryKey)); - Reference< css::registry::XRegistryKey > xNewKey; - - xNewKey = xRegistryKey->createKey ( - OUString::createFromAscii( - "/com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject/UNO/SERVICES" ) ); - xNewKey->createKey ( - OUString::createFromAscii( "com.sun.star.util.NumberFormatsSupplier" ) ); - - xNewKey = xRegistryKey->createKey ( - OUString::createFromAscii( - "/com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject/UNO/SERVICES" ) ); - xNewKey->createKey ( - OUString::createFromAscii( "com.sun.star.util.NumberFormatter" ) ); - - xNewKey = xRegistryKey->createKey( - OUString::createFromAscii( "/com.sun.star.comp.svl.PathService/UNO/SERVICES" ) ); - xNewKey->createKey ( - OUString::createFromAscii( "com.sun.star.config.SpecialConfigManager" ) ); - - return sal_True; - } - return sal_False; -} - SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/) { diff --git a/svl/util/makefile.mk b/svl/util/makefile.mk index 3cb87dcd33ad..7cb493ae0d94 100644 --- a/svl/util/makefile.mk +++ b/svl/util/makefile.mk @@ -120,3 +120,11 @@ ALL: $(SLB)$/svl.lib \ .INCLUDE : target.mk + +ALLTAR : $(MISC)/svl.component + +$(MISC)/svl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + svl.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt svl.component diff --git a/svl/util/svl.component b/svl/util/svl.component new file mode 100644 index 000000000000..4af1a31f5782 --- /dev/null +++ b/svl/util/svl.component @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.svl.PathService"> + <service name="com.sun.star.config.SpecialConfigManager"/> + </implementation> + <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject"> + <service name="com.sun.star.util.NumberFormatsSupplier"/> + </implementation> + <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject"> + <service name="com.sun.star.util.NumberFormatter"/> + </implementation> +</component> |