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

Caolán McNamara caolanm at redhat.com
Fri Mar 24 14:08:29 UTC 2017


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

New commits:
commit eff9dbc2d6dbaafd10e2522ada0e0b24ad820193
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 24 14:06:03 2017 +0000

    de-trainwreck this a little to form something approaching readable
    
    Change-Id: I9dbe7218d6ca0fa7ffc780094843be232af74e95

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()


More information about the Libreoffice-commits mailing list