summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-06-23 09:27:27 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2014-09-30 09:47:56 +0200
commit4b2e33e14654651630281999b7d343b5f2110cab (patch)
treeb6f6874fb14ceac47a8f3bfd6292c102cc61528c
parente5da198776ecfcea6ff2f4ceed466fc0206a1ccb (diff)
MM: always copy the internal document
There is really no need to create the first document via UNO createClone(), which is also slower then the internal copy. Actually createClone also calls createCopy, but without initializing the document. Change-Id: I2d1ee6e12e37caf1b0d9bfa393fb4240516628e9 Reviewed-on: https://gerrit.libreoffice.org/10966 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> (cherry picked from commit 660349579d282bcc62f5eb8b777a78c7fadf8b1c) Conflicts: sw/source/uibase/dbui/dbmgr.cxx
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx24
1 files changed, 2 insertions, 22 deletions
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index c0d6edecda5c..25f27bbf934e 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -1021,17 +1021,8 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
Application::Reschedule();
// The SfxObjectShell will be closed explicitly later but it is more safe to use SfxObjectShellLock here
- SfxObjectShellLock xWorkDocSh;
// copy the source document
- if( 1 == nDocNo && (bAsSingleFile || rMergeDescriptor.bCreateSingleFile) )
- {
- uno::Reference< util::XCloneable > xClone( pSourceDocSh->GetModel(), uno::UNO_QUERY);
- uno::Reference< lang::XUnoTunnel > xWorkDocShell( xClone->createClone(), uno::UNO_QUERY);
- SwXTextDocument* pWorkModel = reinterpret_cast<SwXTextDocument*>(xWorkDocShell->getSomething(SwXTextDocument::getUnoTunnelId()));
- xWorkDocSh = pWorkModel->GetDocShell();
- }
- else
- xWorkDocSh = pSourceDocSh->GetDoc()->CreateCopy( true );
+ SfxObjectShellLock xWorkDocSh = pSourceDocSh->GetDoc()->CreateCopy( true );
{
//create a view frame for the document
@@ -2841,18 +2832,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
// copy the source document
// the copy will be closed later, but it is more safe to use SfxObjectShellLock here
- SfxObjectShellLock xWorkDocSh;
- if(nDocNo == 1 )
- {
- uno::Reference< util::XCloneable > xClone( rSourceView.GetDocShell()->GetModel(), uno::UNO_QUERY);
- uno::Reference< lang::XUnoTunnel > xWorkDocShell( xClone->createClone(), uno::UNO_QUERY);
- SwXTextDocument* pWorkModel = reinterpret_cast<SwXTextDocument*>(xWorkDocShell->getSomething(SwXTextDocument::getUnoTunnelId()));
- xWorkDocSh = pWorkModel->GetDocShell();
- }
- else
- {
- xWorkDocSh = rSourceView.GetDocShell()->GetDoc()->CreateCopy(true);
- }
+ SfxObjectShellLock xWorkDocSh = rSourceView.GetDocShell()->GetDoc()->CreateCopy(true);
#ifdef DBG_UTIL
if ( nDocNo <= MAX_DOC_DUMP )
lcl_SaveDoc( xWorkDocSh, "WorkDoc", nDocNo );