Blob Blame History Raw
From d1c1cce4ec0222ac50f9f78ddf5f4ce7aa7377ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 10 Sep 2012 22:55:02 +0100
Subject: [PATCH] Resolves: rhbz#855972 crash on switching to outline view

Change-Id: Ic2675e9d1d8ce6bb67e9c9e4db292f79c4240409
---
 svx/source/form/fmvwimp.cxx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 195b47e..638fd6e 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -938,8 +938,10 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/)
     do
     {
 
+    SdrPageView *pPageView = m_pView ? m_pView->GetSdrPageView() : NULL;
+    SdrPage *pSdrPage = pPageView ? pPageView->GetPage() : NULL;
     // get the forms collection of the page we belong to
-    FmFormPage* pPage = m_pView ? PTR_CAST( FmFormPage, m_pView->GetSdrPageView()->GetPage() ) : NULL;
+    FmFormPage* pPage = PTR_CAST( FmFormPage, pSdrPage );
     Reference< XIndexAccess > xForms( pPage ? Reference< XIndexAccess >( pPage->GetForms(), UNO_QUERY ) : Reference< XIndexAccess >() );
 
     const PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? NULL : m_aPageWindowAdapters[0];
-- 
1.7.11.4