starmath/source/ooxmlexport.cxx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
New commits: commit cde6d800698522a804dc8f82c158ce7e0c3e05f5 Author: Dinesh Patil <dinesh.pa...@synerzip.com> Date: Wed Mar 12 20:04:16 2014 +0530 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 <mst...@redhat.com> Reviewed-by: Michael Stahl <mst...@redhat.com> (cherry picked from commit ade1641ab632565820ede720b6151435aca4dd78) Signed-off-by: Michael Stahl <mst...@redhat.com> Conflicts: sw/qa/extras/inc/swmodeltestbase.hxx sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I34a8a635b42bfdfac265fb70b977c0001cd2b4ff diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx index 8d1c808..0a98d98 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 ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits