From: André Pönitz Date: Thu, 2 May 2002 07:30:49 +0000 (+0000) Subject: return to 1.1.6 behaviour for ascii export X-Git-Tag: 1.6.10~19297 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4d6b99e8655b0454dd5f9cf2d1ab4134277df01d;p=features.git return to 1.1.6 behaviour for ascii export git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4110 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 53b8bf2fef..c145aa8fb5 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -294,7 +294,7 @@ int InsetFormula::latex(Buffer const *, ostream & os, bool fragile, bool) const int InsetFormula::ascii(Buffer const *, ostream & os, int) const { -#if 1 +#if 0 TextMetricsInfo mi; par()->metricsT(mi); TextPainter tpain(par()->width(), par()->height()); @@ -304,7 +304,7 @@ int InsetFormula::ascii(Buffer const *, ostream & os, int) const metrics(); return tpain.textheight(); #else - WriteStream wi(os, false); + WriteStream wi(os, false, true); par_->write(wi); return wi.line(); #endif diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 8a8dbee8aa..8e52adb9e0 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -10,6 +10,8 @@ #include "math_support.h" #include "debug.h" #include "Painter.h" +#include "textpainter.h" +#include "Lsstream.h" #include "LaTeXFeatures.h" #include "support/LAssert.h" @@ -199,21 +201,39 @@ void MathHullInset::draw(Painter & pain, int x, int y) const } } -/* -void MathHullInset::metricsT(TextMetricsInfo const & mi) const + +void MathHullInset::metricsT(TextMetricsInfo const &) const { - ascent_ = 1; - descent_ = 0; - width_ = normalName(objtype_).size(); +#if 0 + if (display()) { + MathGridInset::metricsT(mi); + } else +#endif + { + ostringstream os; + WriteStream wi(os, false, true); + write(wi); + width_ = os.str().size(); + ascent_ = 1; + descent_ = 0; + } } void MathHullInset::drawT(TextPainter & pain, int x, int y) const { - pain.draw(x, y, normalName(objtype_).c_str()); - MathGridInset::draw(pain, x, y); +#if 0 + if (display()) { + MathGridInset::drawT(pain, x, y); + } else +#endif + { + ostringstream os; + WriteStream wi(os, false, true); + write(wi); + pain.draw(x, y, os.str().c_str()); + } } -*/ string MathHullInset::label(row_type row) const diff --git a/src/mathed/math_hullinset.h b/src/mathed/math_hullinset.h index 6f234e7d0d..8b05af262e 100644 --- a/src/mathed/math_hullinset.h +++ b/src/mathed/math_hullinset.h @@ -31,9 +31,9 @@ public: /// void draw(Painter &, int x, int y) const; /// - //void metricsT(TextMetricsInfo const & st) const; + void metricsT(TextMetricsInfo const & st) const; /// - //void drawT(TextPainter &, int x, int y) const; + void drawT(TextPainter &, int x, int y) const; /// string label(row_type row) const; ///