summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-23 10:21:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-23 11:13:23 +0100
commit2083b5350055177fbb3fcef75b2be63cf26d6039 (patch)
tree9e1ca5f6d46f8cfcff6234871ca2a908f8e0dd79 /sw
parent1f581d50419d002618c48dd87017451d1915d43e (diff)
coverity#1019337 Dereference after null check
Change-Id: I31584f1b204b85929a5549ecd7f7e05b6968e580
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unotext.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 7a3d8696e230..f0c5f4447040 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1584,9 +1584,10 @@ SwXText::convertToTextFrame(
// todo: if the start/end is in a table then insert a paragraph
// before/after, move the start/end nodes, then convert and
// remove the additional paragraphs in the end
+ SwTableNode * pStartTableNode(0);
if (pStartStartNode->GetStartNodeType() == SwTableBoxStartNode)
{
- SwTableNode * pStartTableNode(pStartStartNode->FindTableNode());
+ pStartTableNode = pStartStartNode->FindTableNode();
// Is it the same table start node than the end?
SwTableNode *const pEndStartTableNode(pEndStartNode->FindTableNode());
while (pEndStartTableNode && pStartTableNode &&
@@ -1595,6 +1596,9 @@ SwXText::convertToTextFrame(
SwStartNode* pStartStartTableNode = pStartTableNode->StartOfSectionNode();
pStartTableNode = pStartStartTableNode->FindTableNode();
}
+ }
+ if (pStartTableNode)
+ {
const SwNodeIndex aTblIdx( *pStartTableNode, -1 );
SwPosition aBefore(aTblIdx);
bParaBeforeInserted = GetDoc()->getIDocumentContentOperations().AppendTxtNode( aBefore );