[Libreoffice-commits] .: sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 16 07:57:29 PST 2013


 sd/source/ui/framework/factories/ViewShellWrapper.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit a0d852b2ade42289af1e9b066a48c97aedeff3b1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 16 15:54:06 2013 +0000

    Resolves: fdo#55974 segfault while closing an Impress file
    
    regression since aa1927dc257b52edf96de220cc3797e02c83a0ae
    
     mpViewShell(pViewShell),
    +mpSlideSorterViewShell(
              ::boost::dynamic_pointer_cast< ::sd::slidesorter::SlideSorterViewShell >( pViewShell )),
    
    both are boost::shared_ptr potentially to the same thing then, given that we
    reset mpViewShell in ::disposing we presumably have to do the same thing to
    mpSlideSorterViewShell.
    
    add unset check on mpSlideSorterViewShell usages while I'm at it
    
    Change-Id: I35f51977c40f946a49789abd9405a4ef84aea0e8

diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
index 2768e99..bc50d9b 100644
--- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx
+++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
@@ -95,6 +95,7 @@ void SAL_CALL ViewShellWrapper::disposing (void)
         xWindow->removeWindowListener(this);
     }
 
+    mpSlideSorterViewShell.reset();
     mpViewShell.reset();
 }
 
@@ -145,6 +146,9 @@ sal_Bool SAL_CALL ViewShellWrapper::isAnchorOnly (void)
 
 sal_Bool SAL_CALL ViewShellWrapper::select( const ::com::sun::star::uno::Any& aSelection ) throw(lang::IllegalArgumentException, uno::RuntimeException)
 {
+    if (!mpSlideSorterViewShell)
+        return false;
+
     bool bOk = true;
 
     ::sd::slidesorter::controller::SlideSorterController& rSlideSorterController
@@ -180,6 +184,9 @@ uno::Any SAL_CALL ViewShellWrapper::getSelection() throw(uno::RuntimeException)
 {
     Any aResult;
 
+    if (!mpSlideSorterViewShell)
+        return aResult;
+
     slidesorter::model::PageEnumeration aSelectedPages (
         slidesorter::model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
             mpSlideSorterViewShell->GetSlideSorter().GetModel()));


More information about the Libreoffice-commits mailing list