summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-24 14:06:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-24 14:06:03 +0000
commiteff9dbc2d6dbaafd10e2522ada0e0b24ad820193 (patch)
tree64e5f5724da588826b2ed789589ba217e1c83df4
parentb2fd800446d3a84dc436dfe36a809e3904f6ad40 (diff)
de-trainwreck this a little to form something approaching readable
Change-Id: I9dbe7218d6ca0fa7ffc780094843be232af74e95
-rw-r--r--sw/source/core/view/viewsh.cxx22
1 files 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()