summaryrefslogtreecommitdiff
path: root/sw/source/ui/uno
diff options
context:
space:
mode:
authoros <os@openoffice.org>2010-01-20 15:50:24 +0100
committeros <os@openoffice.org>2010-01-20 15:50:24 +0100
commitf92fd37f4d19e5ee6cee4531ca4d700b09dc35a1 (patch)
treee52ccdd3dd1e5dc583ef4240886b254d3612b255 /sw/source/ui/uno
parentec23ab025fa3f49d7552ed989f38bc0a12135e99 (diff)
#i108081# take care of OLE objects in mail merge
Diffstat (limited to 'sw/source/ui/uno')
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 044c5bd78f..8e233c537c 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -107,6 +107,8 @@
#include <drawdoc.hxx>
#include <SwStyleNameMapper.hxx>
#include <osl/file.hxx>
+#include <comphelper/storagehelper.hxx>
+
// --> FME 2004-06-08 #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
@@ -2864,16 +2866,13 @@ uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno::
if(!IsValid())
throw RuntimeException();
//create a new document - hidden - copy the storage and return it
- SwDoc* pCopyDoc = pDocShell->GetDoc()->CreateCopy();
- SfxObjectShell* pShell = new SwDocShell( pCopyDoc, SFX_CREATE_MODE_STANDARD );
- pShell->DoInitNew();
-
- uno::Reference< embed::XStorage > xSourceStorage = getDocumentStorage();
+ SfxObjectShell* pShell = pDocShell->GetDoc()->CreateCopy(false);
uno::Reference< frame::XModel > xNewModel = pShell->GetModel();
- //copy this storage
+ uno::Reference< embed::XStorage > xNewStorage = ::comphelper::OStorageHelper::GetTemporaryStorage( );
+ uno::Sequence< beans::PropertyValue > aTempMediaDescriptor;
+ storeToStorage( xNewStorage, aTempMediaDescriptor );
uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY );
- uno::Reference< embed::XStorage > xNewStorage = xStorageDoc->getDocumentStorage();
- xSourceStorage->copyToStorage( xNewStorage );
+ xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor );
return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
}
/* -----------------------------20.06.00 09:54--------------------------------