[Libreoffice-commits] core.git: sw/source

Christoph Lutz christoph.lutz_ml at cib.de
Thu Mar 12 03:58:46 PDT 2015


 sw/source/uibase/dbui/dbmgr.cxx |   41 +++++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 19 deletions(-)

New commits:
commit 86a547e33bab2a89513385c5af535a6099526616
Author: Christoph Lutz <christoph.lutz_ml at cib.de>
Date:   Mon Mar 9 15:37:45 2015 +0000

    Don't store temporary mail merge file if mail merge job was cancelled
    
    If a mail merge "to single file" is canceled, the temporary file was still saved.
    This needed a lot of time for large mail merge results (>20s) which is not needed,
    wanted and inteded. We want mail merge to return asap.
    
    Change-Id: I74e9048c7eb483766e7e677dd21167b7d844a518
    Reviewed-on: https://gerrit.libreoffice.org/14811
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 74ecf73..8f89438 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1421,27 +1421,30 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
             {
                 if( rMergeDescriptor.nMergeType != DBMGR_MERGE_PRINTER )
                 {
-                    assert( aTempFile.get());
-                    INetURLObject aTempFileURL( rMergeDescriptor.bSubjectIsFilename ? sSubject : aTempFile->GetURL());
-                    SfxMedium* pDstMed = new SfxMedium(
-                        aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
-                        STREAM_STD_READWRITE );
-                    pDstMed->SetFilter( pStoreToFilter );
-                    if(pDstMed->GetItemSet())
+                    if( !bCancel )
                     {
-                        if(pStoreToFilterOptions )
-                            pDstMed->GetItemSet()->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, *pStoreToFilterOptions));
-                        if(rMergeDescriptor.aSaveToFilterData.getLength())
-                            pDstMed->GetItemSet()->Put(SfxUsrAnyItem(SID_FILTER_DATA, makeAny(rMergeDescriptor.aSaveToFilterData)));
-                    }
+                        assert( aTempFile.get());
+                        INetURLObject aTempFileURL( rMergeDescriptor.bSubjectIsFilename ? sSubject : aTempFile->GetURL());
+                        SfxMedium* pDstMed = new SfxMedium(
+                            aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
+                            STREAM_STD_READWRITE );
+                        pDstMed->SetFilter( pStoreToFilter );
+                        if(pDstMed->GetItemSet())
+                        {
+                            if(pStoreToFilterOptions )
+                                pDstMed->GetItemSet()->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, *pStoreToFilterOptions));
+                            if(rMergeDescriptor.aSaveToFilterData.getLength())
+                                pDstMed->GetItemSet()->Put(SfxUsrAnyItem(SID_FILTER_DATA, makeAny(rMergeDescriptor.aSaveToFilterData)));
+                        }
 
-                    xTargetDocShell->DoSaveAs(*pDstMed);
-                    xTargetDocShell->DoSaveCompleted(pDstMed);
-                    if( xTargetDocShell->GetError() )
-                    {
-                        // error message ??
-                        ErrorHandler::HandleError( xTargetDocShell->GetError() );
-                        bNoError = false;
+                        xTargetDocShell->DoSaveAs(*pDstMed);
+                        xTargetDocShell->DoSaveCompleted(pDstMed);
+                        if( xTargetDocShell->GetError() )
+                        {
+                            // error message ??
+                            ErrorHandler::HandleError( xTargetDocShell->GetError() );
+                            bNoError = false;
+                        }
                     }
                 }
                 else if( pTargetView ) // must be available!


More information about the Libreoffice-commits mailing list