[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Dec 11 10:42:28 UTC 2020
sw/source/core/edit/edtab.cxx | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 2c0930f19e269348a2aadc0ffe69ff23d04d7cc1
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Dec 11 09:03:51 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Dec 11 11:41:37 2020 +0100
cid#1470585 Dereference null return value
Change-Id: If2a3eae843753a06d2f3fa9ac31acc9470cb6982
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107584
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx
index b598e4754a70..03e951e2509c 100644
--- a/sw/source/core/edit/edtab.cxx
+++ b/sw/source/core/edit/edtab.cxx
@@ -148,17 +148,19 @@ bool SwEditShell::TextToTable( const SwInsertTableOptions& rInsTableOpts,
bool SwEditShell::TableToText( sal_Unicode cCh )
{
SwWait aWait( *GetDoc()->GetDocShell(), true );
- bool bRet = false;
SwPaM* pCursor = GetCursor();
const SwTableNode* pTableNd =
GetDoc()->IsIdxInTable( pCursor->GetPoint()->nNode );
+ if (!pTableNd)
+ return false;
+
if( IsTableMode() )
{
ClearMark();
pCursor = GetCursor();
}
- else if( !pTableNd || pCursor->GetNext() != pCursor )
- return bRet;
+ else if (pCursor->GetNext() != pCursor)
+ return false;
// TL_CHART2:
// tell the charts about the table to be deleted and have them use their own data
@@ -177,7 +179,7 @@ bool SwEditShell::TableToText( sal_Unicode cCh )
//Modified for bug #i119954# Application crashed if undo/redo convert nest table to text
StartUndo();
- bRet = ConvertTableToText( pTableNd, cCh );
+ bool bRet = ConvertTableToText( pTableNd, cCh );
EndUndo();
//End for bug #i119954#
pCursor->GetPoint()->nNode = aTabIdx;
More information about the Libreoffice-commits
mailing list