]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathSupport.cpp
A little cleanup of the layout files.
[lyx.git] / src / mathed / MathSupport.cpp
index aa3a627addc7ad3734d7045ebc8e94c780540c46..5b08f70bd41abdbec3d1a51d0170915464bcdeb7 100644 (file)
@@ -4,7 +4,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Alejandro Aguilar Sierra
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
 #include "MathParser.h"
 #include "MathStream.h"
 
-#include "support/debug.h"
-
-#include "support/docstream.h"
-
 #include "frontends/FontLoader.h"
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
 
+#include "support/debug.h"
+#include "support/docstream.h"
+
 #include <map>
 #include <sstream>
 
@@ -339,7 +338,7 @@ named_deco_struct deco_table[] = {
 };
 
 
-std::map<docstring, deco_struct> deco_list;
+map<docstring, deco_struct> deco_list;
 
 // sort the table on startup
 class init_deco_table {
@@ -360,7 +359,7 @@ static init_deco_table dummy;
 
 deco_struct const * search_deco(docstring const & name)
 {
-       std::map<docstring, deco_struct>::const_iterator p = deco_list.find(name);
+       map<docstring, deco_struct>::const_iterator p = deco_list.find(name);
        return p == deco_list.end() ? 0 : &(p->second);
 }
 
@@ -499,7 +498,7 @@ void math_font_max_dim(FontInfo const & font, int & asc, int & des)
 
 
 struct fontinfo {
-       std::string cmd_;
+       string cmd_;
        FontFamily family_;
        FontSeries series_;
        FontShape  shape_;
@@ -605,7 +604,7 @@ fontinfo * lookupFont(docstring const & name0)
 {
        //lyxerr << "searching font '" << name << "'" << endl;
        int const n = sizeof(fontinfos) / sizeof(fontinfo);
-       std::string name = to_utf8(name0);
+       string name = to_utf8(name0);
        for (int i = 0; i < n; ++i)
                if (fontinfos[i].cmd_ == name) {
                        //lyxerr << "found '" << i << "'" << endl;
@@ -686,9 +685,11 @@ docstring asString(MathData const & ar)
 }
 
 
-void asArray(docstring const & str, MathData & ar)
+void asArray(docstring const & str, MathData & ar, Parse::flags pf)
 {
-       mathed_parse_cell(ar, str);
+       bool quiet = pf & Parse::QUIET;
+       if ((str.size() == 1 && quiet) || (!mathed_parse_cell(ar, str, pf) && quiet))
+               mathed_parse_cell(ar, str, pf | Parse::VERBATIM);
 }