Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3060

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/60/3060/1

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
---
M starmath/source/ooxmlimport.cxx
1 file changed, 17 insertions(+), 5 deletions(-)



diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index e3a48ca..648f808 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -570,11 +570,21 @@
 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 @@
         }
     }
     stream.ensureClosingTag( M_TOKEN( r ));
+    if( normal || literal )
+        text = "\"" + text + "\"";
     return text.replaceAll("{", "\\{").replaceAll("}", "\\}");
 }
 

-- 
To view, visit https://gerrit.libreoffice.org/3060
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I024ce6c89667a69f685bb84d768095100b0090b1
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Luboš Luňák <l.lunak@suse.cz>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.