[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Nov 16 17:51:47 UTC 2019
sw/source/core/undo/SwUndoTOXChange.cxx | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 32c39e510aba585fd6675e3497e158efab74b8a4
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Nov 16 16:50:03 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Nov 16 18:51:06 2019 +0100
cid#1448525 Dereference null return value
Change-Id: I0dae9e73e85cef74f041535f3787e3afb45bb94d
Reviewed-on: https://gerrit.libreoffice.org/82989
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/core/undo/SwUndoTOXChange.cxx b/sw/source/core/undo/SwUndoTOXChange.cxx
index 4296aa23d35f..c88182b7a522 100644
--- a/sw/source/core/undo/SwUndoTOXChange.cxx
+++ b/sw/source/core/undo/SwUndoTOXChange.cxx
@@ -24,12 +24,22 @@
#include <doc.hxx>
#include <node.hxx>
+namespace
+{
+ sal_uLong GetSectionNodeIndex(SwTOXBaseSection const& rTOX)
+ {
+ const SwSectionNode* pSectNd = rTOX.GetFormat()->GetSectionNode();
+ assert(pSectNd);
+ return pSectNd->GetIndex();
+ }
+}
+
SwUndoTOXChange::SwUndoTOXChange(const SwDoc *pDoc,
SwTOXBaseSection const& rTOX, SwTOXBase const& rNew)
: SwUndo(SwUndoId::TOXCHANGE, pDoc)
, m_Old(rTOX)
, m_New(rNew)
- , m_nNodeIndex(rTOX.GetFormat()->GetSectionNode()->GetIndex())
+ , m_nNodeIndex(GetSectionNodeIndex(rTOX))
{
}
More information about the Libreoffice-commits
mailing list