summaryrefslogtreecommitdiff
path: root/chart2/source/view/main/DrawModelWrapper.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-05 10:54:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-07 21:51:32 +0200
commit2ed8c34bca56c1a30d727b21d9096cb77e88197a (patch)
tree4eb83db9bd66a6719ed88df70a123993ce246306 /chart2/source/view/main/DrawModelWrapper.cxx
parentea67083cf5b8bceeab7d521663c768b59dd49d1d (diff)
use a single global item pool for chart2 draw model
which exposed a bug in SvxUnoNameItemTable::replaceByName Change-Id: If3207df6d46a2185b78ea5c3e1c145527b42d7cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115126 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/view/main/DrawModelWrapper.cxx')
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx29
1 files changed, 1 insertions, 28 deletions
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index 916087e6c69a..09daef1d6d54 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -48,23 +48,12 @@ namespace chart
{
DrawModelWrapper::DrawModelWrapper()
-: SdrModel()
- , m_pChartItemPool(nullptr)
+: SdrModel(&ChartItemPool::GetGlobalChartItemPool())
{
- m_pChartItemPool = ChartItemPool::CreateChartItemPool();
-
SetScaleUnit(MapUnit::Map100thMM);
SetScaleFraction(Fraction(1, 1));
SetDefaultFontHeight(423); // 12pt
- SfxItemPool* pMasterPool = &GetItemPool();
- pMasterPool->SetDefaultMetric(MapUnit::Map100thMM);
- pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, true) );
- pMasterPool->SetPoolDefaultItem(makeSvx3DPercentDiagonalItem (5));
-
- // append chart pool to end of pool chain
- pMasterPool->GetLastPoolInChain()->SetSecondaryPool(m_pChartItemPool);
- pMasterPool->FreezeIdRanges();
SetTextDefaults();
//this factory needs to be created before first use of 3D scenes once upon an office runtime
@@ -108,22 +97,6 @@ DrawModelWrapper::DrawModelWrapper()
DrawModelWrapper::~DrawModelWrapper()
{
- //remove m_pChartItemPool from pool chain
- if(m_pChartItemPool)
- {
- SfxItemPool* pPool = &GetItemPool();
- for (;;)
- {
- SfxItemPool* pSecondary = pPool->GetSecondaryPool();
- if(pSecondary == m_pChartItemPool)
- {
- pPool->SetSecondaryPool (nullptr);
- break;
- }
- pPool = pSecondary;
- }
- SfxItemPool::Free(m_pChartItemPool);
- }
m_pRefDevice.disposeAndClear();
}