]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBox.cpp
Allow automatic text direction in Painter::text()
[lyx.git] / src / mathed / InsetMathBox.cpp
index 7a59d973cd2c8b7500623b5d4472eac45f76b23e..aee9381cd79ff1bcd852e3041f3d0aa6a7514294 100644 (file)
 #include "MathSupport.h"
 #include "MetricsInfo.h"
 
+#include "support/gettext.h"
+#include "support/lstrings.h"
+
 #include "frontends/Painter.h"
 
+#include <algorithm>
 #include <ostream>
 
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -92,7 +97,7 @@ void InsetMathBox::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathBox::infoize(odocstream & os) const
 {      
-       os << "Box: " << name_;
+       os << bformat(_("Box: %1$s"), name_);
 }
 
 
@@ -218,7 +223,7 @@ void InsetMathMakebox::metrics(MetricsInfo & mi, Dimension & dim) const
        
        Dimension wdim;
        static docstring bracket = from_ascii("[");
-       mathed_string_dim(mi.base.font, bracket, wdim);
+       metricsStrRedBlack(mi, wdim, bracket);
        int w = wdim.wid;
        
        Dimension dim0;
@@ -282,9 +287,9 @@ void InsetMathMakebox::write(WriteStream & os) const
 {
        ModeSpecifier specifier(os, TEXT_MODE);
        os << (framebox_ ? "\\framebox" : "\\makebox");
-       if (cell(0).size() || !os.latex()) {
+       if (!cell(0).empty() || !os.latex()) {
                os << '[' << cell(0) << ']';
-               if (cell(1).size() || !os.latex())
+               if (!cell(1).empty() || !os.latex())
                        os << '[' << cell(1) << ']';
        }
        os << '{' << cell(2) << '}';