diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-17 20:49:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-18 11:34:10 +0000 |
commit | d50c0a09a58b5c24a2a484e83004c286fe873205 (patch) | |
tree | 1cd239ea5cb74bc970cb2cf92af92f06b1246d4e | |
parent | 20265785f1faf670ab61f6532e708f6986f7653c (diff) |
cppcheck: nullPointer
Change-Id: I2f96d4ea73ccf47b2783ade35890c2dd8e558e5f
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index dff76a786831..ef7c360c4211 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -788,7 +788,7 @@ const SfxPoolItem* MSWordExportBase::HasItem( sal_uInt16 nWhich ) const const SfxPoolItem& MSWordExportBase::GetItem(sal_uInt16 nWhich) const { - const SfxPoolItem* pItem; + assert((m_pISet || m_pChpIter) && "Where is my ItemSet / pChpIter ?"); if (m_pISet) { // if write a EditEngine text, then the WhichIds are greater as @@ -796,16 +796,9 @@ const SfxPoolItem& MSWordExportBase::GetItem(sal_uInt16 nWhich) const // EditEngine Range nWhich = sw::hack::GetSetWhichFromSwDocWhich(*m_pISet, *m_pDoc, nWhich); OSL_ENSURE(nWhich != 0, "All broken, Impossible"); - pItem = &m_pISet->Get(nWhich); - } - else if( m_pChpIter ) - pItem = &m_pChpIter->GetItem( nWhich ); - else - { - OSL_ENSURE( false, "Where is my ItemSet / pChpIter ?" ); - pItem = nullptr; + return m_pISet->Get(nWhich); } - return *pItem; + return m_pChpIter->GetItem( nWhich ); } WW8_WrPlc1::WW8_WrPlc1( sal_uInt16 nStructSz ) |