[Libreoffice-commits] core.git: Branch 'feature/mailmerge-toolbar' - sw/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Mar 17 09:42:28 UTC 2016


 sw/source/uibase/app/apphdl.cxx |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 06db842d732bba0deacc27e54176536e4c45b2c9
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Mar 17 10:20:34 2016 +0100

    SwMailMergeWizardExecutor::EndDialogHdl: avoid accessing already deleted view
    
    Valgrind points out that SwView::GetMailMergeConfigItem() is called on a
    pointer that is already deleted. SwView gets deleted, because it is
    closed by SwMailMergeWizardExecutor::EndDialogHdl().
    
    Since the new MM toolbar the source view is never closed (since the
    toolbar is part of the source view), so adapt code here to always show
    the source frame at the end of the wizard, instead of conditionally
    showing or closing it.
    
    With this, MM to a merged document or individual documents no longer
    crashes for me.
    
    Change-Id: If90302f0619f621420e832a1acc0a05865b8f87d

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 3b6d4ae..9ff9992 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -567,11 +567,7 @@ IMPL_LINK_NOARG_TYPED( SwMailMergeWizardExecutor, EndDialogHdl, Dialog&, void )
             SwView* pSourceView = pMMConfig->GetSourceView();
             if(pSourceView)
             {
-                SwDocShell* pDocShell = pSourceView->GetDocShell();
-                if(pDocShell->HasName() && !pDocShell->IsModified())
-                    pMMConfig->GetSourceView()->GetViewFrame()->DoClose();
-                else
-                    pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().Appear();
+                pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().Appear();
             }
             ExecutionFinished();
             break;


More information about the Libreoffice-commits mailing list