summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-06-23 09:27:27 +0200
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2014-09-09 18:46:48 +0000
commit660349579d282bcc62f5eb8b777a78c7fadf8b1c (patch)
tree5eb472f0a3739a48487b5a83fb34b406e6f5675a /sw
parent56e103fd94fc52ca9717b3810d291c88b29c97b1 (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>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx24
1 files changed, 2 insertions, 22 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 0b6aa6e2215d..20bcefb26d46 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1010,17 +1010,8 @@ bool SwDBManager::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
@@ -2818,18 +2809,7 @@ sal_Int32 SwDBManager::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 );