diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-11-29 20:19:11 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-11-29 21:20:28 +0100 |
commit | 34e2e7dd8441148fa8f05c1e9ca324003058ed11 (patch) | |
tree | 6ca0b1652950e1526ee8b6ae4612c429d36369be /starmath | |
parent | 6e91e7d4e7c283e40ae3f6a3fe520da392d84bb5 (diff) |
implement docx m:groupChr
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/ooxmlimport.cxx | 26 | ||||
-rw-r--r-- | starmath/source/ooxmlimport.hxx | 1 |
2 files changed, 26 insertions, 1 deletions
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx index 760505ca3cb9..300d81860e77 100644 --- a/starmath/source/ooxmlimport.cxx +++ b/starmath/source/ooxmlimport.cxx @@ -108,6 +108,8 @@ OUString SmOoxmlImport::readOMathArg() return handleLimLowUpp( LimLow ); case OPENING( M_TOKEN( limUpp )): return handleLimLowUpp( LimUpp ); + case OPENING( M_TOKEN( groupChr )): + return handleGroupChr(); case OPENING( M_TOKEN( r )): return handleR(); default: @@ -319,6 +321,9 @@ OUString SmOoxmlImport::handleFunc() stream.ensureOpeningTag( M_TOKEN( fName )); OUString fname = readOMathArg(); stream.ensureClosingTag( M_TOKEN( fName )); + // fix the various functions + if( fname.match( STR( "lim {" ), 0 )) // startsWith() + fname = STR( "lim from {" ) + fname.copy( 5 ); OUString ret = fname + STR( " {" ) + handleE() + STR( "}" ); stream.ensureClosingTag( M_TOKEN( func )); return ret; @@ -333,7 +338,26 @@ OUString SmOoxmlImport::handleLimLowUpp( LimLowUpp_t limlowupp ) OUString lim = readOMathArg(); stream.ensureClosingTag( M_TOKEN( lim )); stream.ensureClosingTag( token ); - return e + STR( " from {" ) + lim + STR( "}" ); + return e + STR( " {" ) + lim + STR( "}" ); +} + +OUString SmOoxmlImport::handleGroupChr() +{ + stream.ensureOpeningTag( M_TOKEN( groupChr )); + enum pos_t { top, bot } pos = bot; + if( stream.checkOpeningTag( M_TOKEN( groupChrPr ))) + { + if( XmlStream::Tag posTag = stream.checkOpeningTag( M_TOKEN( pos ))) + { + if( posTag.attribute( M_TOKEN( val ), STR( "bot" )) == STR( "top" )) + pos = top; + stream.ensureClosingTag( M_TOKEN( pos )); + } + stream.ensureClosingTag( M_TOKEN( groupChrPr )); + } + OUString ret = STR( "{ " ) + handleE() + ( pos == top ? STR( "} overbrace" ) : STR( "} underbrace" )); + stream.ensureClosingTag( M_TOKEN( groupChr )); + return ret; } // NOT complete diff --git a/starmath/source/ooxmlimport.hxx b/starmath/source/ooxmlimport.hxx index af7d1ca964bc..c0786bc5336f 100644 --- a/starmath/source/ooxmlimport.hxx +++ b/starmath/source/ooxmlimport.hxx @@ -53,6 +53,7 @@ private: rtl::OUString handleFunc(); enum LimLowUpp_t { LimLow, LimUpp }; rtl::OUString handleLimLowUpp( LimLowUpp_t limlowupp ); + rtl::OUString handleGroupChr(); rtl::OUString handleR(); rtl::OUString readOMathArg(); oox::formulaimport::XmlStream& stream; |