diff options
Diffstat (limited to 'sd/source/filter/ppt/pptin.cxx')
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 89c823dc6493..59d5b5e0b98a 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -255,6 +255,8 @@ sal_Bool ImplSdPPTImport::Import() return FALSE; pSdrModel->setLock( sal_True ); + pSdrModel->EnableUndo(false); + SdrOutliner& rOutl = mpDoc->GetDrawOutliner(); sal_uInt32 nControlWord = rOutl.GetEditEngine().GetControlWord(); nControlWord |= EE_CNTRL_ULSPACESUMMATION; @@ -861,35 +863,29 @@ sal_Bool ImplSdPPTImport::Import() { if ( pMPage->GetPageKind() == PK_STANDARD ) { - // Hintergrundobjekt gefunden (erstes Objekt der MasterPage) - pObj->SetEmptyPresObj( TRUE ); - pObj->SetUserCall( pMPage ); - pObj->SetLayer( mnBackgroundLayerID ); - - // Schatten am ersten Objekt (Hintergrundobjekt) entfernen (#57918#) - SfxItemSet aTempAttr( mpDoc->GetPool() ); - aTempAttr.Put( pObj->GetMergedItemSet() ); + // transform data from imported background object to new form + // and delete the object. It was used as container to transport + // the attributes of the MasterPage background fill + SfxStyleSheet* pSheet = pMPage->GetStyleSheetForMasterPageBackground(); - BOOL bShadowIsOn = ( (SdrShadowItem&)( aTempAttr.Get( SDRATTR_SHADOW ) ) ).GetValue(); - if( bShadowIsOn ) + if(pSheet) { - aTempAttr.Put( SdrShadowItem( FALSE ) ); - pObj->SetMergedItemSet( aTempAttr ); - } - SfxStyleSheet* pSheet = pMPage->GetStyleSheetForPresObj( PRESOBJ_BACKGROUND ); - if ( pSheet ) - { // StyleSheet fuellen und dem Objekt zuweisen + // if we have a StyleSheet (for Masterpages), set attributes there and use it pSheet->GetItemSet().ClearItem(); - pSheet->GetItemSet().Put( pObj->GetMergedItemSet() ); - aTempAttr.ClearItem(); - pObj->SetMergedItemSet( aTempAttr ); - pObj->SetStyleSheet( pSheet, FALSE ); + pSheet->GetItemSet().Put(pObj->GetMergedItemSet()); + pMPage->getSdrPageProperties().ClearItem(); + pMPage->getSdrPageProperties().SetStyleSheet(pSheet); + } + else + { + // without StyleSheet, set attributes directly. This + // should not be done at all and is an error (will be asserted by SdrPage) + pMPage->getSdrPageProperties().ClearItem(); + pMPage->getSdrPageProperties().PutItemSet(pObj->GetMergedItemSet()); } - pMPage->InsertPresObj( pObj, PRESOBJ_BACKGROUND ); - // #110094#-15 - // tell the page that it's visualization has changed - pMPage->ActionChanged(); + pMPage->RemoveObject(pObj->GetOrdNum()); + SdrObject::Free(pObj); } } } @@ -1419,6 +1415,7 @@ sal_Bool ImplSdPPTImport::Import() xDocProps->setTemplateName(::rtl::OUString()); pSdrModel->setLock( sal_False ); + pSdrModel->EnableUndo(true); return bOk; } |