diff options
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index f96cd774a92a..9b94d9cca8b5 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -1571,19 +1571,17 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, bool View::PasteRTFTable( const ::tools::SvRef<SotTempStream>& xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ) { - SdDrawDocument aModel( DocumentType::Impress, mpDocSh ); - aModel.NewOrLoadCompleted(DocCreationMode::New); - aModel.GetItemPool().SetDefaultMetric(MapUnit::Map100thMM); - aModel.InsertPage(aModel.AllocPage(false).get()); + DrawDocShellRef xShell = new DrawDocShell(SfxObjectCreateMode::INTERNAL, false, DocumentType::Impress); + xShell->DoInitNew(); - Reference< XComponent > xComponent( new SdXImpressDocument( &aModel, true ) ); - aModel.setUnoModel( Reference< XInterface >::query( xComponent ) ); + SdDrawDocument* pModel = xShell->GetDoc(); + pModel->GetItemPool().SetDefaultMetric(MapUnit::Map100thMM); + pModel->InsertPage(pModel->AllocPage(false).get()); - CreateTableFromRTF( *xStm, &aModel ); - bool bRet = Paste(aModel, maDropPos, pPage, nPasteOptions); + CreateTableFromRTF(*xStm, pModel); + bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions); - xComponent->dispose(); - xComponent.clear(); + xShell->DoClose(); return bRet; } |