[Libreoffice-commits] .: editeng/inc editeng/source
Joseph Powers
jpowers at kemper.freedesktop.org
Thu Dec 16 23:11:20 PST 2010
editeng/inc/editeng/unoipset.hxx | 13 +++++++------
editeng/source/uno/unoipset.cxx | 35 +++++++++++++----------------------
2 files changed, 20 insertions(+), 28 deletions(-)
New commits:
commit 4d46820d71a837465965ec155ba5999b3a88b444
Author: Joseph Powers <jpowers27 at cox.net>
Date: Thu Dec 16 23:09:37 2010 -0800
Remove DECLARE_LIST( SvxIDPropertyCombineList, SvxIDPropertyCombine* )
diff --git a/editeng/inc/editeng/unoipset.hxx b/editeng/inc/editeng/unoipset.hxx
index b5f002d..5ad230b 100644
--- a/editeng/inc/editeng/unoipset.hxx
+++ b/editeng/inc/editeng/unoipset.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,11 +33,12 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include "editeng/editengdllapi.h"
#include <svl/itemprop.hxx>
+#include <vector>
-class SvxIDPropertyCombineList;
class SdrItemPool;
class SfxItemSet;
class SvxShape;
+struct SvxIDPropertyCombine;
#define SFX_METRIC_ITEM (0x40)
@@ -46,9 +47,9 @@ class EDITENG_DLLPUBLIC SvxItemPropertySet
SfxItemPropertyMap m_aPropertyMap;
mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo;
const SfxItemPropertyMapEntry* _pMap;
- SvxIDPropertyCombineList* pCombiList;
- sal_Bool mbConvertTwips;
- SfxItemPool& mrItemPool;
+ ::std::vector< SvxIDPropertyCombine* > aCombineList;
+ sal_Bool mbConvertTwips;
+ SfxItemPool& mrItemPool;
public:
SvxItemPropertySet( const SfxItemPropertyMapEntry *pMap, SfxItemPool& rPool, sal_Bool bConvertTwips = sal_False );
@@ -62,7 +63,7 @@ public:
::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const;
void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal ) const;
- sal_Bool AreThereOwnUsrAnys() const { return (pCombiList ? sal_True : sal_False); }
+ sal_Bool AreThereOwnUsrAnys() const { return ( aCombineList.empty() ? sal_False : sal_True ); }
::com::sun::star::uno::Any* GetUsrAnyForID(sal_uInt16 nWID) const;
void AddUsrAnyForID(const ::com::sun::star::uno::Any& rAny, sal_uInt16 nWID);
void ClearAllUsrAny();
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 3616dda..61879da 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -33,7 +33,6 @@
#include <tools/list.hxx>
#include <hash_map>
-#include <vector>
#include <svl/itemprop.hxx>
#include <editeng/unoipset.hxx>
@@ -45,6 +44,8 @@
using namespace ::com::sun::star;
using namespace ::rtl;
+using ::std::vector;
+
//----------------------------------------------------------------------
struct SfxItemPropertyMapEntryHash
@@ -60,13 +61,11 @@ struct SvxIDPropertyCombine
uno::Any aAny;
};
-DECLARE_LIST( SvxIDPropertyCombineList, SvxIDPropertyCombine * )
SvxItemPropertySet::SvxItemPropertySet( const SfxItemPropertyMapEntry* pMap, SfxItemPool& rItemPool, sal_Bool bConvertTwips )
: m_aPropertyMap( pMap ),
_pMap(pMap), mbConvertTwips(bConvertTwips), mrItemPool( rItemPool )
{
- pCombiList = NULL;
}
//----------------------------------------------------------------------
@@ -78,16 +77,11 @@ SvxItemPropertySet::~SvxItemPropertySet()
//----------------------------------------------------------------------
uno::Any* SvxItemPropertySet::GetUsrAnyForID(sal_uInt16 nWID) const
{
- if(pCombiList && pCombiList->Count())
+ for ( size_t i = 0, n = aCombineList.size(); i < n; ++i )
{
- SvxIDPropertyCombine* pActual = pCombiList->First();
- while(pActual)
- {
- if(pActual->nWID == nWID)
- return &pActual->aAny;
- pActual = pCombiList->Next();
-
- }
+ SvxIDPropertyCombine* pActual = aCombineList[ i ];
+ if( pActual->nWID == nWID )
+ return &pActual->aAny;
}
return NULL;
}
@@ -95,22 +89,19 @@ uno::Any* SvxItemPropertySet::GetUsrAnyForID(sal_uInt16 nWID) const
//----------------------------------------------------------------------
void SvxItemPropertySet::AddUsrAnyForID(const uno::Any& rAny, sal_uInt16 nWID)
{
- if(!pCombiList)
- pCombiList = new SvxIDPropertyCombineList();
-
SvxIDPropertyCombine* pNew = new SvxIDPropertyCombine;
pNew->nWID = nWID;
pNew->aAny = rAny;
- pCombiList->Insert(pNew);
+ aCombineList.push_back( pNew );
}
//----------------------------------------------------------------------
void SvxItemPropertySet::ClearAllUsrAny()
{
- if(pCombiList)
- delete pCombiList;
- pCombiList = NULL;
+ for ( size_t i = 0, n = aCombineList.size(); i < n; ++i )
+ delete aCombineList[ i ];
+ aCombineList.clear();
}
//----------------------------------------------------------------------
@@ -152,7 +143,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
{
if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( aVal ) )
SvxUnoConvertToMM( eMapUnit, aVal );
- }
+ }
}
else if ( pMap->pType->getTypeClass() == uno::TypeClass_ENUM &&
aVal.getValueType() == ::getCppuType((const sal_Int32*)0) )
@@ -267,7 +258,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
if(pMap->nMemberId & SFX_METRIC_ITEM && eMapUnit != SFX_MAPUNIT_100TH_MM)
{
SvxUnoConvertToMM( eMapUnit, aVal );
- }
+ }
}
if ( pMap->pType->getTypeClass() == uno::TypeClass_ENUM &&
More information about the Libreoffice-commits
mailing list