diff options
author | pw <pw@openoffice.org> | 2000-10-12 10:59:19 +0000 |
---|---|---|
committer | pw <pw@openoffice.org> | 2000-10-12 10:59:19 +0000 |
commit | de99db82ffd1f5c740f46e5988c02dddac2d1031 (patch) | |
tree | 0ea139336902c4567f111b879c548567faaead6e /svx/source/unodraw | |
parent | db7fe04c6c07f8b7be2578d8b9f35c2f28c9bb5f (diff) |
#79317# Don't modify pooled items !
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/unobtabl.cxx | 14 | ||||
-rw-r--r-- | svx/source/unodraw/unogtabl.cxx | 12 | ||||
-rw-r--r-- | svx/source/unodraw/unohtabl.cxx | 12 | ||||
-rw-r--r-- | svx/source/unodraw/unomtabl.cxx | 18 | ||||
-rw-r--r-- | svx/source/unodraw/unottabl.cxx | 46 |
5 files changed, 27 insertions, 75 deletions
diff --git a/svx/source/unodraw/unobtabl.cxx b/svx/source/unodraw/unobtabl.cxx index eb403befd700..6e4242163e22 100644 --- a/svx/source/unodraw/unobtabl.cxx +++ b/svx/source/unodraw/unobtabl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unobtabl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:01:27 $ + * last change: $Author: pw $ $Date: 2000-10-12 11:56:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,7 +106,6 @@ DECLARE_LIST( ItemSetArray_Impl, SfxItemSet* ) class SvxUnoBitmapTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo > { private: - XBitmapList* mpBitmapList; SdrModel* mpModel; SfxItemPool* mpPool; @@ -149,7 +148,6 @@ public: SvxUnoBitmapTable::SvxUnoBitmapTable( SdrModel* pModel ) throw() : mpModel( pModel ), - mpBitmapList( pModel ? pModel->GetBitmapList() : NULL ), mpPool( pModel ? &pModel->GetItemPool() : (SfxItemPool*)NULL ) { } @@ -261,11 +259,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoBitmapTable::getElementNames( ) { pStrings[nSurrogate] = pItem->GetName(); - if( !pStrings[nSurrogate].getLength() ) - { - CreateName( pStrings[nSurrogate] ); - pItem->SetName( String( pStrings[nSurrogate] ) ); - } + DBG_ASSERT( pStrings[nSurrogate].getLength(), "XFillBitmapItem in pool should have a name !"); } } @@ -319,7 +313,7 @@ void SvxUnoBitmapTable::CreateName( OUString& rStrName) } /** - * Create a hatchtable + * Create a bitmaptable */ uno::Reference< uno::XInterface > SAL_CALL SvxUnoBitmapTable_createInstance( SdrModel* pModel ) { diff --git a/svx/source/unodraw/unogtabl.cxx b/svx/source/unodraw/unogtabl.cxx index df7f4ebb8fdc..423a174a0c4e 100644 --- a/svx/source/unodraw/unogtabl.cxx +++ b/svx/source/unodraw/unogtabl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unogtabl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:01:27 $ + * last change: $Author: pw $ $Date: 2000-10-12 11:59:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -100,7 +100,6 @@ DECLARE_LIST( ItemSetArray_Impl, SfxItemSet* ) class SvxUnoGradientTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo > { private: - XGradientList* mpGradientList; SdrModel* mpModel; SfxItemPool* mpPool; @@ -144,7 +143,6 @@ public: SvxUnoGradientTable::SvxUnoGradientTable( SdrModel* pModel ) throw() : mpModel( pModel ), - mpGradientList( pModel ? pModel->GetGradientList() : NULL ), mpPool( pModel ? &pModel->GetItemPool() : (SfxItemPool*)NULL ) { } @@ -274,11 +272,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoGradientTable::getElementNames( ) { pStrings[nSurrogate] = pItem->GetName(); - if( !pStrings[nSurrogate].getLength() ) - { - CreateName( pStrings[nSurrogate] ); - pItem->SetName( String( pStrings[nSurrogate] ) ); - } + DBG_ASSERT( pStrings[nSurrogate].getLength(), "XFillGradientItem in pool should have a name !"); } } diff --git a/svx/source/unodraw/unohtabl.cxx b/svx/source/unodraw/unohtabl.cxx index fbd1d970e6ef..011f5ad78fc6 100644 --- a/svx/source/unodraw/unohtabl.cxx +++ b/svx/source/unodraw/unohtabl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unohtabl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:01:27 $ + * last change: $Author: pw $ $Date: 2000-10-12 11:58:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -100,7 +100,6 @@ DECLARE_LIST( ItemSetArray_Impl, SfxItemSet* ) class SvxUnoHatchTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo > { private: - XHatchList* mpHatchList; SdrModel* mpModel; SfxItemPool* mpPool; @@ -143,7 +142,6 @@ public: SvxUnoHatchTable::SvxUnoHatchTable( SdrModel* pModel ) throw() : mpModel( pModel ), - mpHatchList( pModel ? pModel->GetHatchList() : NULL ), mpPool( pModel ? &pModel->GetItemPool() : (SfxItemPool*)NULL ) { } @@ -254,11 +252,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoHatchTable::getElementNames( ) { pStrings[nSurrogate] = pItem->GetName(); - if( !pStrings[nSurrogate].getLength() ) - { - CreateName( pStrings[nSurrogate] ); - pItem->SetName( String( pStrings[nSurrogate] ) ); - } + DBG_ASSERT( pStrings[nSurrogate].getLength(), "XFillHatchItem in pool should have a name !"); } } diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx index 1a3e60ea0421..587e35641079 100644 --- a/svx/source/unodraw/unomtabl.cxx +++ b/svx/source/unodraw/unomtabl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unomtabl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:01:27 $ + * last change: $Author: pw $ $Date: 2000-10-12 11:58:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -105,7 +105,6 @@ DECLARE_LIST( ItemSetArray_Impl, SfxItemSet* ) class SvxUnoMarkerTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo > { private: - XBitmapList* mpBitmapList; SdrModel* mpModel; SfxItemPool* mpPool; @@ -148,7 +147,6 @@ public: SvxUnoMarkerTable::SvxUnoMarkerTable( SdrModel* pModel ) throw() : mpModel( pModel ), - mpBitmapList( pModel ? pModel->GetBitmapList() : NULL ), mpPool( pModel ? &pModel->GetItemPool() : (SfxItemPool*)NULL ) { } @@ -282,11 +280,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoMarkerTable::getElementNames( ) { pStrings[nSurrogate] = pEndItem->GetName(); - if( !pStrings[nSurrogate].getLength() ) - { - CreateName( pStrings[nSurrogate] ); - pEndItem->SetName( String( pStrings[nSurrogate] ) ); - } + DBG_ASSERT( pStrings[nSurrogate].getLength(), "XLineEndItem in pool should have a name !"); } } @@ -299,11 +293,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoMarkerTable::getElementNames( ) { pStrings[nSurrogate+nEndCount] = pStartItem->GetName(); - if( !pStrings[nSurrogate+nEndCount].getLength() ) - { - CreateName( pStrings[nSurrogate+nEndCount] ); - pStartItem->SetName( String( pStrings[nSurrogate+nEndCount] ) ); - } + DBG_ASSERT( pStrings[nSurrogate].getLength(), "XLineStartItem in pool should have a name !"); } } diff --git a/svx/source/unodraw/unottabl.cxx b/svx/source/unodraw/unottabl.cxx index 23f6ecb185ea..f502e610e160 100644 --- a/svx/source/unodraw/unottabl.cxx +++ b/svx/source/unodraw/unottabl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unottabl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:01:27 $ + * last change: $Author: pw $ $Date: 2000-10-12 11:57:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,14 +106,11 @@ DECLARE_LIST( ItemSetArray_Impl, SfxItemSet* ) class SvxUnoTransGradientTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo > { private: - XBitmapList* mpBitmapList; SdrModel* mpModel; SfxItemPool* mpPool; ItemSetArray_Impl aItemSetArray; - const OUString GetOrCreateName( USHORT nSurrogate ); - public: SvxUnoTransGradientTable( SdrModel* pModel ) throw(); virtual ~SvxUnoTransGradientTable() throw(); @@ -149,7 +146,6 @@ public: SvxUnoTransGradientTable::SvxUnoTransGradientTable( SdrModel* pModel ) throw() : mpModel( pModel ), - mpBitmapList( pModel ? pModel->GetBitmapList() : NULL ), mpPool( pModel ? &pModel->GetItemPool() : (SfxItemPool*)NULL ) { } @@ -198,7 +194,7 @@ void SAL_CALL SvxUnoTransGradientTable::insertByName( const OUString& aName, con throw container::ElementExistException(); SfxItemSet* mpInSet = new SfxItemSet( *mpPool, XATTR_FILLFLOATTRANSPARENCE, XATTR_FILLFLOATTRANSPARENCE ); - aItemSetArray.Insert( mpInSet );//, aItemSetArray.Count() ); + aItemSetArray.Insert( mpInSet ); XFillFloatTransparenceItem aTransGradient; aTransGradient.SetName( String( aName ) ); @@ -225,7 +221,7 @@ uno::Any SAL_CALL SvxUnoTransGradientTable::getByName( const OUString& aName ) { if( mpPool ) { - const OUString aSearchName( aName ); + const String aSearchName( aName ); const USHORT nCount = mpPool->GetItemCount(XATTR_FILLFLOATTRANSPARENCE); const XFillFloatTransparenceItem *pItem; @@ -233,7 +229,7 @@ uno::Any SAL_CALL SvxUnoTransGradientTable::getByName( const OUString& aName ) { pItem = (XFillFloatTransparenceItem*)mpPool->GetItem(XATTR_FILLFLOATTRANSPARENCE, nSurrogate); - if( pItem && ( GetOrCreateName( nSurrogate ) == aSearchName ) ) + if( pItem && ( pItem->GetName() == aSearchName ) ) { uno::Any aAny; pItem->QueryValue( aAny ); @@ -256,8 +252,12 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTransGradientTable::getElementNames( ) for( USHORT nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) { pItem = (XFillFloatTransparenceItem*)mpPool->GetItem(XATTR_FILLFLOATTRANSPARENCE, nSurrogate); + if( pItem ) - pStrings[nSurrogate] = GetOrCreateName( nSurrogate ); + { + pStrings[nSurrogate] = pItem->GetName(); + DBG_ASSERT( pStrings[nSurrogate].getLength(), "XFillFloatTransparenceItem in pool should have a name !"); + } } return aSeq; @@ -266,7 +266,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTransGradientTable::getElementNames( ) sal_Bool SAL_CALL SvxUnoTransGradientTable::hasByName( const OUString& aName ) throw( uno::RuntimeException ) { - const OUString aSearchName( aName ); + const String aSearchName( aName ); const USHORT nCount = mpPool ? mpPool->GetItemCount(XATTR_FILLFLOATTRANSPARENCE) : 0; uno::Sequence< OUString > aSeq( nCount ); OUString* pStrings = aSeq.getArray(); @@ -275,34 +275,14 @@ sal_Bool SAL_CALL SvxUnoTransGradientTable::hasByName( const OUString& aName ) for( USHORT nSurrogate = 0; nSurrogate < nCount; nSurrogate++ ) { pItem = (XFillFloatTransparenceItem*)mpPool->GetItem(XATTR_FILLFLOATTRANSPARENCE, nSurrogate); - if( GetOrCreateName( nSurrogate ) == aSearchName ) + + if( pItem && pItem->GetName() == aSearchName ) return sal_True; } return sal_False; } -const OUString SvxUnoTransGradientTable::GetOrCreateName( USHORT nSurrogate ) -{ - String aStrName; - XFillFloatTransparenceItem* pItem = (XFillFloatTransparenceItem*)mpPool-> - GetItem( XATTR_FILLFLOATTRANSPARENCE, nSurrogate ); - if( pItem ) - { - aStrName = pItem->GetName(); - - if( !aStrName.Len() ) - { - aStrName = String::CreateFromAscii( "TrGr" ); - aStrName += String::CreateFromInt32( sal_Int32( nSurrogate ) ); - - pItem->SetName( aStrName ); - } - } - - return aStrName; -} - // XElementAccess uno::Type SAL_CALL SvxUnoTransGradientTable::getElementType( ) throw( uno::RuntimeException ) |