tdf#127410 Reliably copy doc print settings for MM
Commit 8385e511aa
("tdf#117664: mailmerge: copy printer settings to new mailmerge
document") already implemented copying print settings.
Move it into 'lcl_CreateWorkingDocument' so this happens
whenever a working document is created from the source
document.
The problem previously was that a printer settings weren't
previously copied to the working copy for the
if( pSourceDocSh->IsModified() )
case in 'SwDBManager::Merge'.
Change-Id: I0dbe830bed0a36eb25da0d1b43a7f0d7dbc18f2e
Reviewed-on: https://gerrit.libreoffice.org/78714
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
@@ -1016,6 +1016,10 @@ static SfxObjectShell* lcl_CreateWorkingDocument(
|
|||||||
pWorkDoc->GetIDocumentUndoRedo().DoUndo( false );
|
pWorkDoc->GetIDocumentUndoRedo().DoUndo( false );
|
||||||
pWorkDoc->ReplaceDocumentProperties( *pSourceDoc );
|
pWorkDoc->ReplaceDocumentProperties( *pSourceDoc );
|
||||||
|
|
||||||
|
// import print settings
|
||||||
|
const SwPrintData &rPrintData = pSourceDoc->getIDocumentDeviceAccess().getPrintData();
|
||||||
|
pWorkDoc->getIDocumentDeviceAccess().setPrintData(rPrintData);
|
||||||
|
|
||||||
if( aType == WorkingDocType::TARGET )
|
if( aType == WorkingDocType::TARGET )
|
||||||
{
|
{
|
||||||
assert( !ppDBManager );
|
assert( !ppDBManager );
|
||||||
@@ -1296,10 +1300,6 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
|
|||||||
*pSourceShell, bMT_SHELL ? pSourceWindow : nullptr,
|
*pSourceShell, bMT_SHELL ? pSourceWindow : nullptr,
|
||||||
nullptr, &pTargetView, &pTargetShell, &pTargetDoc );
|
nullptr, &pTargetView, &pTargetShell, &pTargetDoc );
|
||||||
|
|
||||||
// import current print settings
|
|
||||||
const SwPrintData &rPrintData = pSourceShell->getIDocumentDeviceAccess().getPrintData();
|
|
||||||
pTargetDoc->getIDocumentDeviceAccess().setPrintData(rPrintData);
|
|
||||||
|
|
||||||
if (nMaxDumpDocs)
|
if (nMaxDumpDocs)
|
||||||
lcl_SaveDebugDoc( xTargetDocShell.get(), "MergeDoc" );
|
lcl_SaveDebugDoc( xTargetDocShell.get(), "MergeDoc" );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user