diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-06-16 12:00:37 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-06-16 12:05:37 +0200 |
commit | e9f405a0daf1dc47a46cb902f05fe24e095b837d (patch) | |
tree | 7f0444270f67a35ed921ee4a899ebabfaa524a3d /sd | |
parent | 6154e810836a7a4bc7f417cbe16d7c84584d49e9 (diff) |
Clean up SdrModel::MigrateItemSet
* No need to support null pNewModel argument (the one call site that did pass in
null explicitly in sd/source/ui/func/fupate.cxx can just as well pass in
mpDoc, and all existing call sites are guaranteed to pass in a non-null
value).
* With that changed, SdrModel::MigrateItemSet can be static. (At least in
JunitTest_forms_unoapi it could happen that the call from
svx/source/sdr/properties/attributeproperites.cxx called MigrateItemSet on a
null GetSdrObject.GetModel(), which was undefined behavior even though it was
harmless.)
Change-Id: Idface48da7e889c6e5768d0e49bc67c88b4c3ec4
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/unchss.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx index a87655947712..05a5f0220587 100644 --- a/sd/source/ui/dlg/unchss.cxx +++ b/sd/source/ui/dlg/unchss.cxx @@ -46,10 +46,10 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, // Create ItemSets; Attention, it is possible that the new one is from a, // different pool. Therefore we clone it with its items. pNewSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(), pTheNewItemSet->GetRanges()); - pTheDoc->MigrateItemSet( pTheNewItemSet, pNewSet, pTheDoc ); + SdrModel::MigrateItemSet( pTheNewItemSet, pNewSet, pTheDoc ); pOldSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(),pStyleSheet->GetItemSet().GetRanges()); - pTheDoc->MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet, pTheDoc ); + SdrModel::MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet, pTheDoc ); aComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT); OUString aName(pStyleSheet->GetName()); @@ -98,7 +98,7 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, void StyleSheetUndoAction::Undo() { SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() ); - mpDoc->MigrateItemSet( pOldSet, &aNewSet, mpDoc ); + SdrModel::MigrateItemSet( pOldSet, &aNewSet, mpDoc ); pStyleSheet->GetItemSet().Set(aNewSet); if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) @@ -111,7 +111,7 @@ void StyleSheetUndoAction::Undo() void StyleSheetUndoAction::Redo() { SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() ); - mpDoc->MigrateItemSet( pNewSet, &aNewSet, mpDoc ); + SdrModel::MigrateItemSet( pNewSet, &aNewSet, mpDoc ); pStyleSheet->GetItemSet().Set(aNewSet); if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 92776325786f..a0bb59f82de3 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -301,7 +301,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) // MigrateItemSet makes sure the XFillBitmapItem will have a unique name SfxItemSet aMigrateSet( mpDoc->GetPool(), XATTR_FILLBITMAP, XATTR_FILLBITMAP ); aMigrateSet.Put(XFillBitmapItem(OUString("background"), aGraphic)); - mpDoc->MigrateItemSet( &aMigrateSet, pTempSet.get(), NULL ); + SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc ); pTempSet->Put( XFillBmpStretchItem( true )); pTempSet->Put( XFillBmpTileItem( false )); |