summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-11-24 18:00:47 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-11-24 18:44:01 +0100
commit48d2a5b86e464dfb75196e440448f0319d676956 (patch)
tree7ce31adaca8c3f02df606d5e7b7b887617fd6d33 /starmath
parent5e10ed16ce2ec607324206d49b1073228cacd1aa (diff)
mathml docx read m:bar
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/ooxmlimport.cxx27
-rw-r--r--starmath/source/ooxmlimport.hxx1
2 files changed, 28 insertions, 0 deletions
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index 5bbb71119d55..b12b80637822 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -80,6 +80,9 @@ OUString SmOoxmlImport::handleStream()
case OPENING( M_TOKEN( acc )):
ret += STR( " " ) + handleAcc();
break;
+ case OPENING( M_TOKEN( bar )):
+ ret += STR( " " ) + handleBar();
+ break;
case OPENING( M_TOKEN( f )):
ret += STR( " " ) + handleF();
break;
@@ -160,6 +163,30 @@ OUString SmOoxmlImport::handleAcc()
return acc + STR( " { " ) + e + STR( " }" );
}
+OUString SmOoxmlImport::handleBar()
+{
+ stream.ensureOpeningTag( M_TOKEN( bar ));
+ enum pos_t { top, bot } topbot = bot;
+ if( stream.checkOpeningTag( M_TOKEN( barPr )))
+ {
+ if( XmlStream::Tag pos = stream.checkOpeningTag( M_TOKEN( pos )))
+ {
+ if( pos.attributes.attribute( M_TOKEN( val )) == STR( "top" ))
+ topbot = top;
+ else if( pos.attributes.attribute( M_TOKEN( val )) == STR( "bot" ))
+ topbot = bot;
+ stream.ensureClosingTag( M_TOKEN( pos ));
+ }
+ stream.ensureClosingTag( M_TOKEN( barPr ));
+ }
+ OUString e = handleE();
+ stream.ensureClosingTag( M_TOKEN( bar ));
+ if( topbot == top )
+ return STR( "bar { " ) + e + STR( " }" );
+ else
+ return STR( "underline { " ) + e + STR( " }" );
+}
+
OUString SmOoxmlImport::handleE()
{
stream.ensureOpeningTag( M_TOKEN( e ));
diff --git a/starmath/source/ooxmlimport.hxx b/starmath/source/ooxmlimport.hxx
index 42fbd050f5be..508723c4c8be 100644
--- a/starmath/source/ooxmlimport.hxx
+++ b/starmath/source/ooxmlimport.hxx
@@ -45,6 +45,7 @@ public:
private:
rtl::OUString handleStream();
rtl::OUString handleAcc();
+ rtl::OUString handleBar();
rtl::OUString handleE();
rtl::OUString handleF();
rtl::OUString handleR();