summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starmath/source/node.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index a13f5deada56..c4c013b15725 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -782,6 +782,12 @@ void SmRootNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
nHeight += rFormat.GetDistance(DIS_ROOT)
* GetFont().GetFontSize().Height() / 100;
+ if (nHeight < 0)
+ {
+ SAL_WARN("starmath", "negative height");
+ nHeight = 0;
+ }
+
// font specialist advised to change the width first
pRootSym->AdaptToY(rDev, nHeight);
pRootSym->AdaptToX(rDev, pBody->GetItalicWidth());