From eff9dbc2d6dbaafd10e2522ada0e0b24ad820193 Mon Sep 17 00:00:00 2001
From: Caolán McNamara <caolanm@redhat.com>
Date: Fri, 24 Mar 2017 14:06:03 +0000
Subject: de-trainwreck this a little to form something approaching readable

Change-Id: I9dbe7218d6ca0fa7ffc780094843be232af74e95
---
 sw/source/core/view/viewsh.cxx | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index fa61ea70eff5..7a868ce94031 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2489,24 +2489,16 @@ sal_Int32 SwViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const S
 // --> PB 2007-05-30 #146850#
 const BitmapEx& SwViewShell::GetReplacementBitmap( bool bIsErrorState )
 {
-    BitmapEx** ppRet;
-    sal_uInt16 nResId = 0;
-    if( bIsErrorState )
+    if (bIsErrorState)
     {
-        ppRet = &m_pErrorBmp;
-        nResId = RID_GRAPHIC_ERRORBMP;
-    }
-    else
-    {
-        ppRet = &m_pReplaceBmp;
-        nResId = RID_GRAPHIC_REPLACEBMP;
+        if (!m_pErrorBmp)
+            m_pErrorBmp = new BitmapEx(SW_RES(RID_GRAPHIC_ERRORBMP));
+        return *m_pErrorBmp;
     }
 
-    if( !*ppRet )
-    {
-        *ppRet = new BitmapEx( SW_RES( nResId ) );
-    }
-    return **ppRet;
+    if (!m_pReplaceBmp)
+        m_pReplaceBmp = new BitmapEx(SW_RES(RID_GRAPHIC_REPLACEBMP));
+    return *m_pReplaceBmp;
 }
 
 void SwViewShell::DeleteReplacementBitmaps()
-- 
cgit