summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/node.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index cf50b773e18e..a1847ef1db35 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -34,6 +34,7 @@
#include <tools/gen.hxx>
#include <vcl/outdev.hxx>
+#include <cassert>
#include <math.h>
#include <float.h>
#include <vector>
@@ -259,16 +260,15 @@ void SmNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
sal_uInt16 SmNode::FindIndex() const
{
- const SmStructureNode* pParent = GetParent();
- if (!pParent) { return 0; }
+ assert(mpParentNode != nullptr && "FindIndex() requires this is a subnode.");
- for (sal_uInt16 i = 0; i < pParent->GetNumSubNodes(); ++i) {
- if (pParent->GetSubNode(i) == this) {
+ for (sal_uInt16 i = 0; i < mpParentNode->GetNumSubNodes(); ++i) {
+ if (mpParentNode->GetSubNode(i) == this) {
return i;
}
}
- DBG_ASSERT(false, "Connection between parent and child is inconsistent.");
+ assert(false && "Connection between parent and child is inconsistent.");
return 0;
}