summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-07 13:20:28 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-05-07 15:47:27 +0100
commitb5e8833f57786336013b1607b9b92498aa554da4 (patch)
tree895a463d46b9418fc91eb19f5ad6589c2aa4a07d /sw
parentf36614bb7892af1c0aabe49c95bf3824a746e6f9 (diff)
coverity#735924 Explicit null dereferenced
Change-Id: I77044f6f9e99ddaa64cf69ba22205d6536a90b1b
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unosect.cxx6
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);