diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-12-20 10:43:17 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-12-20 10:49:41 +0100 |
commit | a69d808021e25303c62b84df459515d1ca52dc12 (patch) | |
tree | 740a4a2e03632f82b247218a7b90d6794c1076eb /starmath/source/ooxmlexport.cxx | |
parent | 0acff1783abf132a9fc3481848b6b1a81559086a (diff) |
export vertical stack as m:eqArr, seems to fit much better
Diffstat (limited to 'starmath/source/ooxmlexport.cxx')
-rw-r--r-- | starmath/source/ooxmlexport.cxx | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx index 360489424f36..a7740dac48ce 100644 --- a/starmath/source/ooxmlexport.cxx +++ b/starmath/source/ooxmlexport.cxx @@ -152,7 +152,7 @@ void SmOoxmlExport::HandleTable( const SmNode* pNode, int nLevel ) //OOXML output stack which would grow //without bound in a multi step conversion if( nLevel || pNode->GetNumSubNodes() > 1 ) - HandleVerticalStack( pNode, nLevel, 0 ); + HandleVerticalStack( pNode, nLevel ); else HandleAllSubNodes( pNode, nLevel ); } @@ -174,29 +174,19 @@ void SmOoxmlExport::HandleAllSubNodes( const SmNode* pNode, int nLevel ) } } -// output vertical stack, firstItem says which child to use as first (if there -// are more than two children, OOXML can have only a vertical stack of two items, -// so create a bigger vertical stack recursively) -void SmOoxmlExport::HandleVerticalStack( const SmNode* pNode, int nLevel, int firstItem ) +void SmOoxmlExport::HandleVerticalStack( const SmNode* pNode, int nLevel ) { - if( firstItem == pNode->GetNumSubNodes() - 1 ) // only one item, just output the item + m_pSerializer->startElementNS( XML_m, XML_eqArr, FSEND ); + int size = pNode->GetNumSubNodes(); + for( int i = 0; + i < size; + ++i ) { - HandleNode( pNode->GetSubNode( firstItem ), nLevel + 1 ); - return; + m_pSerializer->startElementNS( XML_m, XML_e, FSEND ); + HandleNode( pNode->GetSubNode( i ), nLevel + 1 ); + m_pSerializer->endElementNS( XML_m, XML_e ); } - m_pSerializer->startElementNS( XML_m, XML_f, FSEND ); - m_pSerializer->startElementNS( XML_m, XML_fPr, FSEND ); - m_pSerializer->singleElementNS( XML_m, XML_type, FSNS( XML_m, XML_val ), "noBar", FSEND ); - m_pSerializer->endElementNS( XML_m, XML_fPr ); - m_pSerializer->startElementNS( XML_m, XML_num, FSEND ); - HandleNode( pNode->GetSubNode( firstItem ), nLevel + 1 ); - m_pSerializer->endElementNS( XML_m, XML_num ); - // TODO this nesting means MSOffice will use smaller fonts for nested items, - // not sure if there's another way to represent a bigger stack than 2 items - m_pSerializer->startElementNS( XML_m, XML_den, FSEND ); - HandleVerticalStack( pNode, nLevel, firstItem + 1 ); - m_pSerializer->endElementNS( XML_m, XML_den ); - m_pSerializer->endElementNS( XML_m, XML_f ); + m_pSerializer->endElementNS( XML_m, XML_eqArr ); } void SmOoxmlExport::HandleText( const SmNode* pNode, int /*nLevel*/) |