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

Katarina Behrens Katarina.Behrens at cib.de
Fri Feb 2 08:43:03 UTC 2018


 sc/source/ui/inc/linkarea.hxx      |    2 +-
 sc/source/ui/miscdlgs/linkarea.cxx |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit a74590e4b4475253bd7752738e570cdafe45e674
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Thu Feb 1 12:08:34 2018 +0100

    Don't recycle DocumentInserter, create a new one every time
    
    After all, everyone else using DocumentInserter across the codebase
    does the same.
    
    For KDE4, an attempt to reuse the same filepicker dialog sporadically
    crashes in the depths of (old-ish, possibly buggy) libQt due to nested
    event loop and/or recursive repaints.
    
    (crash scenario: Calc > Sheet > Link to external data > Browse > double-click
    a file > Browse again > Kaboom!)
    
    Change-Id: Ib494203abd07873919b8394a442f09c5329d237c
    Reviewed-on: https://gerrit.libreoffice.org/49082
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx
index 245ad1c34769..e0fef1f20f9e 100644
--- a/sc/source/ui/inc/linkarea.hxx
+++ b/sc/source/ui/inc/linkarea.hxx
@@ -46,7 +46,7 @@ private:
     VclPtr<OKButton>     m_pBtnOk;
 
     ScDocShell*             pSourceShell;
-    sfx2::DocumentInserter* pDocInserter;
+    std::unique_ptr<sfx2::DocumentInserter> pDocInserter;
 
     SfxObjectShellRef   aSourceRef;
 
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index dab027b2f954..430af73633f2 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -83,8 +83,7 @@ void ScLinkedAreaDlg::dispose()
 
 IMPL_LINK_NOARG(ScLinkedAreaDlg, BrowseHdl, Button*, void)
 {
-    if ( !pDocInserter )
-        pDocInserter = new sfx2::DocumentInserter(this, ScDocShell::Factory().GetFactoryName());
+    pDocInserter.reset( new sfx2::DocumentInserter(this, ScDocShell::Factory().GetFactoryName()) );
     pDocInserter->StartExecuteModal( LINK( this, ScLinkedAreaDlg, DialogClosedHdl ) );
 }
 


More information about the Libreoffice-commits mailing list