diff options
author | Dinesh Patil <dinesh.patil@synerzip.com> | 2014-03-12 20:04:16 +0530 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-03-25 11:39:59 +0200 |
commit | c4fa1b9de379d266e5f52e45de824ec27f835498 (patch) | |
tree | 72ae58a1c5bd0a4ed8d1b8d35028c7578dca9a41 /starmath | |
parent | e853a0131d4ade86e458fe1b880795c301496a0c (diff) |
fdo#76078: LO Crashes while saving the docx file containing only opening brace
- System handles an equation having opening brace and closing brace.
- Whereas it fails to handle equations having only opening brace and no closing
brace, due to which LO crashes with assertion while exporting.
- Fixed this issue and added unit test case for the same.
- Also fixed the same for closing brace alone.
Reviewed-on: https://gerrit.libreoffice.org/8561
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit ade1641ab632565820ede720b6151435aca4dd78)
Signed-off-by: Michael Stahl <mstahl@redhat.com>
Conflicts:
sw/qa/extras/inc/swmodeltestbase.hxx
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Change-Id: I34a8a635b42bfdfac265fb70b977c0001cd2b4ff
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/ooxmlexport.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx index 8d1c80809a71..0a98d985dc1d 100644 --- a/starmath/source/ooxmlexport.cxx +++ b/starmath/source/ooxmlexport.cxx @@ -453,8 +453,15 @@ void SmOoxmlExport::HandleBrace( const SmBraceNode* pNode, int nLevel ) { m_pSerializer->startElementNS( XML_m, XML_d, FSEND ); m_pSerializer->startElementNS( XML_m, XML_dPr, FSEND ); - m_pSerializer->singleElementNS( XML_m, XML_begChr, - FSNS( XML_m, XML_val ), mathSymbolToString( pNode->OpeningBrace()).getStr(), FSEND ); + + //check if the node has an opening brace + if( TNONE == pNode->GetSubNode(0)->GetToken().eType ) + m_pSerializer->singleElementNS( XML_m, XML_begChr, + FSNS( XML_m, XML_val ), "", FSEND ); + else + m_pSerializer->singleElementNS( XML_m, XML_begChr, + FSNS( XML_m, XML_val ), mathSymbolToString( pNode->OpeningBrace()).getStr(), FSEND ); + std::vector< const SmNode* > subnodes; if( pNode->Body()->GetType() == NBRACEBODY ) { @@ -479,8 +486,14 @@ void SmOoxmlExport::HandleBrace( const SmBraceNode* pNode, int nLevel ) } else subnodes.push_back( pNode->Body()); - m_pSerializer->singleElementNS( XML_m, XML_endChr, - FSNS( XML_m, XML_val ), mathSymbolToString( pNode->ClosingBrace()).getStr(), FSEND ); + + if( TNONE == pNode->GetSubNode(2)->GetToken().eType ) + m_pSerializer->singleElementNS( XML_m, XML_endChr, + FSNS( XML_m, XML_val ), "", FSEND ); + else + m_pSerializer->singleElementNS( XML_m, XML_endChr, + FSNS( XML_m, XML_val ), mathSymbolToString( pNode->ClosingBrace()).getStr(), FSEND ); + m_pSerializer->endElementNS( XML_m, XML_dPr ); for( unsigned int i = 0; i < subnodes.size(); ++i ) { |