diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-10-22 06:52:47 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-10-22 06:52:47 +0000 |
commit | d9d19083567ab4d3c0652cb0cd79c605ce1c240b (patch) | |
tree | 6b34f3a7d1393174e6387da755a6e23571fbbe2c /svx/source/svdraw/svdogrp.cxx | |
parent | 8a2678edf2d5137cf21bc68232ccdb01477fe4f7 (diff) |
INTEGRATION: CWS dtransfix (1.21.444); FILE MERGED
2004/10/11 06:49:22 tra 1.21.444.2: RESYNC: (1.21-1.22); FILE MERGED
2004/10/06 18:00:17 tra 1.21.444.1: #i30648#
Diffstat (limited to 'svx/source/svdraw/svdogrp.cxx')
-rw-r--r-- | svx/source/svdraw/svdogrp.cxx | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 2109a23fbc37..a59e36f44bff 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdogrp.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: kz $ $Date: 2004-10-04 17:54:36 $ + * last change: $Author: rt $ $Date: 2004-10-22 07:52:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -769,18 +769,40 @@ void SdrObjGroup::SetPage(SdrPage* pNewPage) void SdrObjGroup::SetModel(SdrModel* pNewModel) { - FASTBOOL bLinked=IsLinkedGroup(); - FASTBOOL bChg=pNewModel!=pModel; - if (bLinked && bChg) { + // #i30648# + // This method also needs to migrate the used ItemSet + // when the destination model uses a different pool + // than the current one. Else it is possible to create + // SdrObjGroups which reference the old pool which might + // be destroyed (as the bug shows). + SdrModel* pOldModel = pModel; + const sal_Bool bLinked(IsLinkedGroup()); + const sal_Bool bChg(pNewModel!=pModel); + + if(bLinked && bChg) + { ImpLinkAbmeldung(); } + // test for correct pool in ItemSet; move to new pool if necessary + if(pNewModel && GetItemPool() && GetItemPool() != &pNewModel->GetItemPool()) + { + MigrateItemPool(GetItemPool(), &pNewModel->GetItemPool(), pNewModel); + } + + // call parent SdrObject::SetModel(pNewModel); + + // set new model at content pSub->SetModel(pNewModel); - if (bLinked && bChg) { + if(bLinked && bChg) + { ImpLinkAnmeldung(); } + + // modify properties + GetProperties().SetModel(pOldModel, pNewModel); } |