diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-23 16:03:53 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-12-26 18:35:59 +0000 |
commit | 833e6ca9d284bca536d09f6a30b1a8cfbb1c86d8 (patch) | |
tree | bd620398e39c9b2b84bb6127fa58575440193a80 /sw | |
parent | d6a7f7fe98af19b43d8e82555a10bf1e835d0533 (diff) |
use std::vector instead of naked array in SfxItemPool
Change-Id: I2d4ac010ff5818e673567cee05700872588918e4
Reviewed-on: https://gerrit.libreoffice.org/32384
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/hintids.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/attr/swatrset.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/bastyp/init.cxx | 7 |
3 files changed, 5 insertions, 7 deletions
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 6b628d6d4300..ea578f4a7077 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -23,6 +23,7 @@ #include <sal/types.h> #include <svx/xdef.hxx> #include "swdllapi.h" +#include <vector> // For SwTextHints without end index the following char is added: @@ -420,7 +421,7 @@ inline bool isUNKNOWNATR(const sal_uInt16 nWhich) // Inline in PRODUCT. class SfxPoolItem; struct SfxItemInfo; -typedef SfxPoolItem* SwDfltAttrTab[ POOLATTR_END - POOLATTR_BEGIN ]; +typedef std::vector<SfxPoolItem*> SwDfltAttrTab; extern SwDfltAttrTab aAttrTab; extern SfxItemInfo aSlotTab[]; diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index 2b8ab0f94b36..065b305257cd 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -48,7 +48,7 @@ SwAttrPool::SwAttrPool( SwDoc* pD ) : SfxItemPool( OUString("SWG"), POOLATTR_BEGIN, POOLATTR_END-1, - aSlotTab, aAttrTab ), + aSlotTab, &aAttrTab ), m_pDoc( pD ) { SetVersionMap( 1, 1, 60, pVersionMap1 ); diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index d655412e67b3..09768730a6de 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -260,7 +260,7 @@ sal_uInt16 aPgFrameFormatSetRange[] = { }; // create table for accessing default format attributes -SwDfltAttrTab aAttrTab; +SwDfltAttrTab aAttrTab( POOLATTR_END - POOLATTR_BEGIN, nullptr ); SfxItemInfo aSlotTab[] = { @@ -460,9 +460,6 @@ void InitCore() { SfxPoolItem* pItem; - // first initialize all attribute pointers with 0 - memset( aAttrTab, 0, (POOLATTR_END - POOLATTR_BEGIN) * sizeof( SfxPoolItem* ) ); - aAttrTab[ RES_CHRATR_CASEMAP- POOLATTR_BEGIN ] = new SvxCaseMapItem( SVX_CASEMAP_NOT_MAPPED, RES_CHRATR_CASEMAP); aAttrTab[ RES_CHRATR_CHARSETCOLOR- POOLATTR_BEGIN ] = new SvxCharSetColorItem(RES_CHRATR_CHARSETCOLOR); aAttrTab[ RES_CHRATR_COLOR- POOLATTR_BEGIN ] = new SvxColorItem(RES_CHRATR_COLOR); @@ -774,7 +771,7 @@ void FinitCore() #if OSL_DEBUG_LEVEL > 0 // free defaults to prevent assertions if ( aAttrTab[0]->GetRefCount() ) - SfxItemPool::ReleaseDefaults( aAttrTab, POOLATTR_END-POOLATTR_BEGIN); + SfxItemPool::ReleaseDefaults( &aAttrTab ); #endif delete SwDoc::mpACmpltWords; |