]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsDelim.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormMathsDelim.C
index 509d97adedd0d97b59553118f6b8fd0984cf22bd..a13a9cae872bdf6e2051846dfe1e886fb7af1879 100644 (file)
@@ -8,48 +8,50 @@
  * \author John Levon
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-
 #include "FormMathsDelim.h"
 #include "forms/form_maths_delim.h"
-#include "ControlMath2.h"
-#include "xformsBC.h"
-#include "ButtonController.h"
+#include "ControlMath.h"
 
 #include "bmtable.h"
+#include "xformsBC.h"
 
-#include "support/lstrings.h"
+#include "controllers/ButtonController.h"
 
-#include "Lsstream.h"
+#include "support/std_sstream.h"
 
-#include "lyx_forms.h"
+using std::ostringstream;
 
 #include "delim.xbm"
 #include "delim0.xpm"
 #include "delim1.xpm"
 
 
-static int const delim_rversion[] = {
-1,1,3,3,4,5,7,7,9,9,10,11,
+namespace {
 
+int const delim_rversion[] = {
+       1,1,3,3,4,5,7,7,9,9,10,11,
+       3,13,15,15,16,17,19,19,20,21,22
 };
+int const delim_size = 
+       sizeof(delim_rversion) / sizeof(delim_rversion[0]);
 
-
-static char const * delim_values[] = {
+char const * delim_values[] = {
        "(", ")", "lceil",  "rceil",  "uparrow",  "Uparrow",
        "[", "]", "lfloor", "rfloor", "updownarrow", "Updownarrow",
        "{", "}",  "/", "backslash",  "downarrow",  "Downarrow",
        "langle",  "rangle", "|", "Vert", ".", 0
 };
 
-using std::endl;
+
+} // namespace anon
 
 
-typedef FormController<ControlMath2, FormView<FD_maths_delim> > base_class;
+typedef FormController<ControlMath, FormView<FD_maths_delim> > base_class;
 
 FormMathsDelim::FormMathsDelim(Dialog & parent)
        : base_class(parent, _("Math Delimiters"), false)
@@ -90,7 +92,7 @@ void FormMathsDelim::apply()
 
        ostringstream os;
        os << delim_values[left] << ' ' << delim_values[right];
-       controller().dispatchDelim(STRCONV(os.str()));
+       controller().dispatchDelim(os.str());
 }
 
 
@@ -119,7 +121,7 @@ ButtonPolicy::SMInput FormMathsDelim::input(FL_OBJECT *, long)
                        if (both) {
                                right = delim_rversion[i];
                                // Add left delimiter in "both" case if right one was pressed:
-                               for (int j = 0; j <= 23; ++j) {
+                               for (int j = 0; j < delim_size; ++j) {
                                        if (delim_rversion[j] == left) {
                                                right = left;
                                                left = j;