Kaydet (Commit) 83d747d5 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

MM: fix silent mode on merge start

We currently don't handle the change of silent mode during a running
mail merge job correctly, so don't allow it.

Change-Id: I2cb8cc1c737e93e8b2a90a6e73fb3e49008fe91d
üst e3e2a4a2
...@@ -1038,6 +1038,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, ...@@ -1038,6 +1038,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
//check if the doc is synchronized and contains at least one linked section //check if the doc is synchronized and contains at least one linked section
const bool bSynchronizedDoc = pSourceShell->IsLabelDoc() && pSourceShell->GetSectionFormatCount() > 1; const bool bSynchronizedDoc = pSourceShell->IsLabelDoc() && pSourceShell->GetSectionFormatCount() > 1;
const bool bNeedsTempFiles = ( bMT_EMAIL || bMT_FILE ); const bool bNeedsTempFiles = ( bMT_EMAIL || bMT_FILE );
const bool bIsMergeSilent = IsMergeSilent();
bool bCheckSingleFile_ = rMergeDescriptor.bCreateSingleFile; bool bCheckSingleFile_ = rMergeDescriptor.bCreateSingleFile;
if( bMT_EMAIL ) if( bMT_EMAIL )
...@@ -1162,7 +1163,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, ...@@ -1162,7 +1163,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
vcl::Window *pSourceWindow = nullptr; vcl::Window *pSourceWindow = nullptr;
VclPtr<CancelableDialog> pProgressDlg; VclPtr<CancelableDialog> pProgressDlg;
if( !IsMergeSilent() ) if( !bIsMergeSilent )
{ {
// construct the process dialog // construct the process dialog
pSourceWindow = &pSourceShell->GetView().GetEditWin(); pSourceWindow = &pSourceShell->GetView().GetEditWin();
...@@ -1225,7 +1226,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, ...@@ -1225,7 +1226,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
// it can be manually computed from the source documents (for which we do layouts, so the page // it can be manually computed from the source documents (for which we do layouts, so the page
// count is known, and there is a blank page between each of them in the target document). // count is known, and there is a blank page between each of them in the target document).
int targetDocPageCount = 0; int targetDocPageCount = 0;
if( !IsMergeSilent() && bMT_SHELL && if( !bIsMergeSilent && bMT_SHELL &&
lcl_getCountFromResultSet( nDocCount, pImpl->pMergeData->xResultSet ) ) lcl_getCountFromResultSet( nDocCount, pImpl->pMergeData->xResultSet ) )
static_cast<CreateMonitor*>( pProgressDlg.get() )->SetTotalCount( nDocCount ); static_cast<CreateMonitor*>( pProgressDlg.get() )->SetTotalCount( nDocCount );
...@@ -1290,7 +1291,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, ...@@ -1290,7 +1291,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
std::unique_ptr< INetURLObject > aTempFileURL; std::unique_ptr< INetURLObject > aTempFileURL;
if( bNeedsTempFiles ) if( bNeedsTempFiles )
aTempFileURL.reset( new INetURLObject(aTempFile->GetURL())); aTempFileURL.reset( new INetURLObject(aTempFile->GetURL()));
if (!IsMergeSilent()) { if( !bIsMergeSilent ) {
if( bMT_SHELL ) if( bMT_SHELL )
static_cast<CreateMonitor*>( pProgressDlg.get() )->SetCurrentPosition( nDocNo ); static_cast<CreateMonitor*>( pProgressDlg.get() )->SetCurrentPosition( nDocNo );
else { else {
...@@ -1394,7 +1395,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, ...@@ -1394,7 +1395,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions ); uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions );
lcl_PreparePrinterOptions( rMergeDescriptor.aPrintOptions, false, aOptions ); lcl_PreparePrinterOptions( rMergeDescriptor.aPrintOptions, false, aOptions );
pWorkView->StartPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync ); pWorkView->StartPrint( aOptions, bIsMergeSilent, rMergeDescriptor.bPrintAsync );
// some GetPrinter functions have a true default, so keep the false // some GetPrinter functions have a true default, so keep the false
SfxPrinter* pDocPrt = pWorkView->GetPrinter( false ); SfxPrinter* pDocPrt = pWorkView->GetPrinter( false );
JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : pWorkView->GetJobSetup(); JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : pWorkView->GetJobSetup();
...@@ -1533,7 +1534,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, ...@@ -1533,7 +1534,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
// print the target document // print the target document
uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions ); uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions );
lcl_PreparePrinterOptions( rMergeDescriptor.aPrintOptions, true, aOptions ); lcl_PreparePrinterOptions( rMergeDescriptor.aPrintOptions, true, aOptions );
pTargetView->ExecPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync ); pTargetView->ExecPrint( aOptions, bIsMergeSilent, rMergeDescriptor.bPrintAsync );
} }
if( IsMergeOk() && bMT_SHELL ) if( IsMergeOk() && bMT_SHELL )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment