diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-11-30 12:01:02 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-11-30 16:11:44 +0100 |
commit | 9414d02629e3267e47ac4d93a318b13ef2efc39e (patch) | |
tree | 673f13f148226151f5b469623940157294f17015 | |
parent | f28c6c55ad902a399cc7a7f8cb426c09da5ba58c (diff) |
implement docx m:rad
-rw-r--r-- | starmath/source/ooxmlimport.cxx | 27 | ||||
-rw-r--r-- | starmath/source/ooxmlimport.hxx | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx index 3f884e5123fe..6b4e7e20dae5 100644 --- a/starmath/source/ooxmlimport.cxx +++ b/starmath/source/ooxmlimport.cxx @@ -131,6 +131,9 @@ OUString SmOoxmlImport::readOMathArg() case OPENING( M_TOKEN( r )): ret += handleR(); break; + case OPENING( M_TOKEN( rad )): + ret += handleRad(); + break; default: stream.handleUnexpectedTag(); break; @@ -538,4 +541,28 @@ OUString SmOoxmlImport::handleR() return text; } +OUString SmOoxmlImport::handleRad() +{ + stream.ensureOpeningTag( M_TOKEN( rad )); + bool degHide = false; + if( stream.checkOpeningTag( M_TOKEN( radPr ))) + { + if( XmlStream::Tag degHideTag = stream.checkOpeningTag( M_TOKEN( degHide ))) + { + degHide = degHideTag.attribute( M_TOKEN( val ), degHide ); + stream.ensureClosingTag( M_TOKEN( degHide )); + } + stream.ensureClosingTag( M_TOKEN( radPr )); + } + stream.ensureOpeningTag( M_TOKEN( deg )); + OUString deg = readOMathArg(); + stream.ensureClosingTag( M_TOKEN( deg )); + OUString e = handleE(); + stream.ensureClosingTag( M_TOKEN( rad )); + if( degHide ) + return STR( "sqrt {" ) + e + STR( "}" ); + else + return STR( "nroot {" ) + deg + STR( "}{" ) + e + STR( "}" ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/source/ooxmlimport.hxx b/starmath/source/ooxmlimport.hxx index 350ff3f1efd2..fe88dfa52417 100644 --- a/starmath/source/ooxmlimport.hxx +++ b/starmath/source/ooxmlimport.hxx @@ -57,6 +57,7 @@ private: rtl::OUString handleM(); rtl::OUString handleNary(); rtl::OUString handleR(); + rtl::OUString handleRad(); rtl::OUString readOMathArg(); oox::formulaimport::XmlStream& stream; }; |