diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-07 13:20:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-07 15:47:27 +0100 |
commit | b5e8833f57786336013b1607b9b92498aa554da4 (patch) | |
tree | 895a463d46b9418fc91eb19f5ad6589c2aa4a07d /sw | |
parent | f36614bb7892af1c0aabe49c95bf3824a746e6f9 (diff) |
coverity#735924 Explicit null dereferenced
Change-Id: I77044f6f9e99ddaa64cf69ba22205d6536a90b1b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index f2eb49adb3d5..4d403a7cb855 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -1115,11 +1115,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, { pEnclosingSection = pEnclosingSection->GetParent(); } - if (pEnclosingSection) + SwTOXBaseSection* const pTOXBaseSect = pEnclosingSection ? + PTR_CAST(SwTOXBaseSection, pEnclosingSection) : NULL; + if (pTOXBaseSect) { // convert section to TOXBase and get SwXDocumentIndex - SwTOXBaseSection *const pTOXBaseSect = - PTR_CAST(SwTOXBaseSection, pEnclosingSection); const uno::Reference<text::XDocumentIndex> xIndex = SwXDocumentIndex::CreateXDocumentIndex( *pTOXBaseSect->GetFmt()->GetDoc(), *pTOXBaseSect); |