diff options
-rw-r--r-- | chart2/source/view/main/DrawModelWrapper.cxx | 11 | ||||
-rw-r--r-- | include/svl/itempool.hxx | 2 | ||||
-rw-r--r-- | svl/source/items/itempool.cxx | 9 | ||||
-rw-r--r-- | svx/source/xoutdev/xpool.cxx | 9 |
4 files changed, 13 insertions, 18 deletions
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx index 14bd6b55cfcb..916087e6c69a 100644 --- a/chart2/source/view/main/DrawModelWrapper.cxx +++ b/chart2/source/view/main/DrawModelWrapper.cxx @@ -62,17 +62,8 @@ DrawModelWrapper::DrawModelWrapper() pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, true) ); pMasterPool->SetPoolDefaultItem(makeSvx3DPercentDiagonalItem (5)); - SfxItemPool* pPool = pMasterPool; // append chart pool to end of pool chain - for (;;) - { - SfxItemPool* pSecondary = pPool->GetSecondaryPool(); - if (!pSecondary) - break; - - pPool = pSecondary; - } - pPool->SetSecondaryPool(m_pChartItemPool); + pMasterPool->GetLastPoolInChain()->SetSecondaryPool(m_pChartItemPool); pMasterPool->FreezeIdRanges(); SetTextDefaults(); diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx index 12e525722d6a..baab6da1a3d7 100644 --- a/include/svl/itempool.hxx +++ b/include/svl/itempool.hxx @@ -184,6 +184,8 @@ public: bool IsInRange( sal_uInt16 nWhich ) const; void SetSecondaryPool( SfxItemPool *pPool ); SfxItemPool* GetSecondaryPool() const; + /* get the last pool by following the GetSecondaryPool chain */ + SfxItemPool* GetLastPoolInChain(); SfxItemPool* GetMasterPool() const; void FreezeIdRanges(); diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 1d84ab00a115..24fda80d1bfe 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -773,6 +773,15 @@ SfxItemPool* SfxItemPool::GetSecondaryPool() const return pImpl->mpSecondary; } +/* get the last pool by following the GetSecondaryPool chain */ +SfxItemPool* SfxItemPool::GetLastPoolInChain() +{ + SfxItemPool* pLast = this; + while(pLast->GetSecondaryPool()) + pLast = pLast->GetSecondaryPool(); + return pLast; +} + SfxItemPool* SfxItemPool::GetMasterPool() const { return pImpl->mpMaster; diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx index 997c6b576f36..be56e4fd7a14 100644 --- a/svx/source/xoutdev/xpool.cxx +++ b/svx/source/xoutdev/xpool.cxx @@ -88,14 +88,7 @@ XOutdevItemPool::XOutdevItemPool(SfxItemPool* _pMaster) } else { - SfxItemPool* pParent = _pMaster; - - while(pParent->GetSecondaryPool()) - { - pParent = pParent->GetSecondaryPool(); - } - - pParent->SetSecondaryPool(this); + _pMaster->GetLastPoolInChain()->SetSecondaryPool(this); } // prepare PoolDefaults |