diff --git a/src/mathed/math_macrotemplate.C b/src/mathed/math_macrotemplate.C index 44ad9f7f26..9cba8e8b93 100644 --- a/src/mathed/math_macrotemplate.C +++ b/src/mathed/math_macrotemplate.C @@ -102,9 +102,10 @@ string MathMacroTemplate::name() const } -string MathMacroTemplate::prefix() const +docstring MathMacroTemplate::prefix() const { - return bformat(_(" Macro: %1$s: "), name_); + // FIXME: delete the conversion when bformat() will return a docstring. + return lyx::from_utf8(bformat(_(" Macro: %1$s: "), name_)); } @@ -112,7 +113,7 @@ void MathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi); cell(1).metrics(mi); - docstring dp(prefix().begin(), prefix().end()); + docstring dp = prefix(); dim.wid = cell(0).width() + cell(1).width() + 20 + font_metrics::width(dp, mi.base.font); dim.asc = std::max(cell(0).ascent(), cell(1).ascent()) + 7; @@ -150,7 +151,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const if (cur.isInside(this)) cur.drawSelection(pi); #endif - docstring dp(prefix().begin(), prefix().end()); + docstring dp = prefix(); pi.pain.text(x + 2, y, dp, font); x += font_metrics::width(dp, pi.base.font) + 6; diff --git a/src/mathed/math_macrotemplate.h b/src/mathed/math_macrotemplate.h index 54ff52f317..6b471088d9 100644 --- a/src/mathed/math_macrotemplate.h +++ b/src/mathed/math_macrotemplate.h @@ -17,6 +17,7 @@ #include "math_macrotable.h" #include "math_nestinset.h" +#include "support/types.h" /// This class contains the macro definition. class MathMacroTemplate : public MathNestInset { @@ -62,7 +63,7 @@ public: private: virtual std::auto_ptr doClone() const; /// prefix in inset - std::string prefix() const; + lyx::docstring prefix() const; /// int numargs_;