summaryrefslogtreecommitdiff
path: root/starmath/inc/node.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/inc/node.hxx')
-rw-r--r--starmath/inc/node.hxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 7949779f4ac9..48590a937517 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -64,8 +64,15 @@ typedef std::stack< SmNode* > SmNodeStack;
typedef std::vector< SmNode * > SmNodeArray;
typedef std::vector< SmStructureNode * > SmStructureNodeArray;
-
-
+template < typename T >
+T* popOrZero( ::std::stack<T*> & rStack )
+{
+ if (rStack.empty())
+ return 0;
+ T* pTmp = rStack.top();
+ rStack.pop();
+ return pTmp;
+}
enum SmScaleMode { SCALE_NONE, SCALE_WIDTH, SCALE_HEIGHT };