summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-01-25 18:10:29 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2016-03-24 22:40:50 +0100
commitd2f21bfcddeec33d7b6e9dfeb6b1293c7a038fa8 (patch)
tree9ab0aea0f6db8b93a600797e364815aa29a299af /sw/source
parent2b11dee4847dc21a0ce54224815468307a5d0eb2 (diff)
MM: use working doc DB manager on save
This is related to tdf#97318 but doesn't fix it, as the wizard works with a single merged document, which is split later. When saving the working document in !bCreateSingleFile mode, we have to restore the documents DB manager for two reasons: 1. We otherwise would save the whole database content. 2. We crash with embedded databases of the original DB manager. Change-Id: I9b209854703ec95c2c63c83019e857f2d26f753d
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 6e217df5497b..df1348a941af 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1351,6 +1351,12 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
else
{
assert( bNeedsTempFiles );
+ assert( pWorkShell->IsExpFieldsLocked() );
+
+ // fields are locked, so it's fine to
+ // restore the old / empty DB manager for save
+ pWorkDoc->SetDBManager( pWorkDocOrigDBManager );
+
// save merged document
OUString sFileURL;
if( !lcl_SaveDoc( aTempFileURL.get(), pStoreToFilter, pStoreToFilterOptions,
@@ -1359,6 +1365,10 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
{
m_aMergeStatus = MergeStatus::ERROR;
}
+
+ // back to the MM DB manager
+ pWorkDoc->SetDBManager( this );
+
if( bMT_EMAIL && !IsMergeError() )
{
if( !SwMailMergeHelper::CheckMailAddress( sColumnData ) )