summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-03-26 16:07:52 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-03-26 17:19:58 +0100
commita75adeae36d96d507a774b91eb586e89f8035c3e (patch)
tree96e154fcf1e573c34f7d05db000d283ca639b4cf
parentdda5fe60ff6dfd61f5f262c61e1d538d20e9c978 (diff)
m:nor and m:lit math docx tags lead to quoting
The meaning should not be exactly the same, but it looks like there's no better way to express this (or rather quoting means both). Change-Id: I024ce6c89667a69f685bb84d768095100b0090b1
-rw-r--r--starmath/source/ooxmlimport.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index e3a48ca93a65..648f80895ebc 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -570,11 +570,21 @@ OUString SmOoxmlImport::handleNary()
OUString SmOoxmlImport::handleR()
{
stream.ensureOpeningTag( M_TOKEN( r ));
- if( XmlStream::Tag rPr = stream.checkOpeningTag( OOX_TOKEN( doc, rPr )))
- { // TODO
-// stream.checkOpeningTag( OOX_TOKEN( doc, rFonts ));
-// stream.ensureClosingTag( OOX_TOKEN( doc, rFonts ));
- stream.ensureClosingTag( OOX_TOKEN( doc, rPr ));
+ bool normal = false;
+ bool literal = false;
+ if( XmlStream::Tag rPr = stream.checkOpeningTag( M_TOKEN( rPr )))
+ {
+ if( XmlStream::Tag litTag = stream.checkOpeningTag( M_TOKEN( lit )))
+ {
+ literal = litTag.attribute( M_TOKEN( val ), true );
+ stream.ensureClosingTag( M_TOKEN( lit ));
+ }
+ if( XmlStream::Tag norTag = stream.checkOpeningTag( M_TOKEN( nor )))
+ {
+ normal = norTag.attribute( M_TOKEN( val ), true );
+ stream.ensureClosingTag( M_TOKEN( nor ));
+ }
+ stream.ensureClosingTag( M_TOKEN( rPr ));
}
OUString text;
while( !stream.atEnd() && stream.currentToken() != CLOSING( stream.currentToken()))
@@ -597,6 +607,8 @@ OUString SmOoxmlImport::handleR()
}
}
stream.ensureClosingTag( M_TOKEN( r ));
+ if( normal || literal )
+ text = "\"" + text + "\"";
return text.replaceAll("{", "\\{").replaceAll("}", "\\}");
}