summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <cmc@openoffice.org>2000-12-11 15:27:34 +0000
committerCaolán McNamara <cmc@openoffice.org>2000-12-11 15:27:34 +0000
commit8ef1cd7c9c555d71e21f872e6cf7e4d278cd2030 (patch)
treede28f85fa7e94951ca8a402a94f8a81c93fcfa4a /starmath
parent2e9639b8d5cf2e9396e5cd18a40e418e74f45be2 (diff)
#81764# Empty table row (double newline)
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathml.cxx56
1 files changed, 22 insertions, 34 deletions
diff --git a/starmath/source/mathml.cxx b/starmath/source/mathml.cxx
index 56a68a8340a4..003985098ce6 100644
--- a/starmath/source/mathml.cxx
+++ b/starmath/source/mathml.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: mathml.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: cmc $ $Date: 2000-12-11 15:43:30 $
+ * last change: $Author: cmc $ $Date: 2000-12-11 16:27:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1059,37 +1059,8 @@ public:
SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList > &xAttrList);
- void EndElement();
};
-void SmXMLTableRowContext_Impl::EndElement()
-{
- SmNodeArray aRelationArray;
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- USHORT nSize = rNodeStack.Count()-nElementCount;
-
- if (nSize)
- {
- aRelationArray.SetSize(nSize);
- for(USHORT i=rNodeStack.Count()-nElementCount;i > 0;i--)
- aRelationArray.Put(i-1,rNodeStack.Pop());
- }
- else //Multiple newlines result in empty row elements
- {
- aRelationArray.SetSize(1);
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TNEWLINE;
- aRelationArray.Put(0,new SmLineNode(aToken));
- }
-
- SmToken aDummy;
- SmStructureNode *pSNode = new SmExpressionNode(aDummy);
- pSNode->SetSubNodes(aRelationArray);
- rNodeStack.Push(pSNode);
-}
class SmXMLTableContext_Impl : public SmXMLTableRowContext_Impl
{
@@ -1449,10 +1420,24 @@ void SmXMLRowContext_Impl::EndElement()
{
SmNodeArray aRelationArray;
SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- aRelationArray.SetSize(rNodeStack.Count()-nElementCount);
+ USHORT nSize = rNodeStack.Count()-nElementCount;
- for(USHORT i=rNodeStack.Count()-nElementCount;i > 0;i--)
- aRelationArray.Put(i-1,rNodeStack.Pop());
+ if (nSize)
+ {
+ aRelationArray.SetSize(nSize);
+ for(USHORT i=rNodeStack.Count()-nElementCount;i > 0;i--)
+ aRelationArray.Put(i-1,rNodeStack.Pop());
+ }
+ else //Multiple newlines result in empty row elements
+ {
+ aRelationArray.SetSize(1);
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+ aToken.eType = TNEWLINE;
+ aRelationArray.Put(0,new SmLineNode(aToken));
+ }
SmToken aDummy;
SmStructureNode *pSNode = new SmExpressionNode(aDummy);
@@ -1460,6 +1445,9 @@ void SmXMLRowContext_Impl::EndElement()
rNodeStack.Push(pSNode);
}
+
+
+
SvXMLImportContext *SmXMLRowContext_Impl::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,