]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlatexaccent.C
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / insetlatexaccent.C
index 76223c833ddbc536a4a1bb7bcbd7e9b10034f691..a0a364ce29d118069aa7890c27dc963cd4dedf78 100644 (file)
@@ -5,7 +5,7 @@
  *
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
@@ -26,6 +26,7 @@ using namespace lyx::support;
 
 using std::ostream;
 using std::endl;
+using std::auto_ptr;
 
 
 /* LatexAccent. Proper handling of accented characters */
@@ -359,7 +360,6 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
        // overhaul. Different ways of drawing (what metrics to use)
        // should also be considered.
 
-       BufferView * bv = pi.base.bv;
        LyXFont font = pi.base.font;
        if (lyxrc.font_norm_type == LyXRC::ISO_10646_1)
                font.setLanguage(english_language);
@@ -404,7 +404,8 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                        // closer to the top of the dot-less 'i' or 'j'.
                        char tmpic = ic; // store the ic when we
                        ic = 'x';        // calculates the ascent of
-                       int asc = ascent(bv, font); // the dot-less version (here: 'x')
+#warning metrics?
+                       int asc = ascent(); // the dot-less version (here: 'x')
                        ic = tmpic;      // set the orig ic back
                        y = baseline - asc; // update to new y coord.
                }
@@ -473,7 +474,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
 
                case CIRCLE:     // circle
                {
-                       LyXFont tmpf(font);
+                       LyXFont tmpf = font;
                        tmpf.decSize().decSize();
                        pi.pain.text(int(x2 - (font_metrics::rbearing(0xB0, tmpf) - font_metrics::lbearing(0xB0, tmpf)) / 2.0),
                                  int(baseline - font_metrics::ascent(ic, font) - font_metrics::descent(0xB0, tmpf) - (font_metrics::ascent(0xB0, tmpf) + font_metrics::descent(0xB0, tmpf)) / 3.0),
@@ -600,13 +601,13 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
 }
 
 
-void InsetLatexAccent::write(Buffer const *, ostream & os) const
+void InsetLatexAccent::write(Buffer const &, ostream & os) const
 {
        os << "\\i " << contents << "\n";
 }
 
 
-void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
+void InsetLatexAccent::read(Buffer const &, LyXLex & lex)
 {
        lex.eatLine();
        contents = lex.getString();
@@ -614,7 +615,7 @@ void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
 }
 
 
-int InsetLatexAccent::latex(Buffer const *, ostream & os,
+int InsetLatexAccent::latex(Buffer const &, ostream & os,
                            LatexRunParams const &) const
 {
        os << contents;
@@ -622,21 +623,21 @@ int InsetLatexAccent::latex(Buffer const *, ostream & os,
 }
 
 
-int InsetLatexAccent::ascii(Buffer const *, ostream & os, int) const
+int InsetLatexAccent::ascii(Buffer const &, ostream & os, int) const
 {
        os << contents;
        return 0;
 }
 
 
-int InsetLatexAccent::linuxdoc(Buffer const *, ostream & os) const
+int InsetLatexAccent::linuxdoc(Buffer const &, ostream & os) const
 {
        os << contents;
        return 0;
 }
 
 
-int InsetLatexAccent::docbook(Buffer const *, ostream & os, bool) const
+int InsetLatexAccent::docbook(Buffer const &, ostream & os, bool) const
 {
        os << contents;
        return 0;
@@ -649,15 +650,15 @@ bool InsetLatexAccent::directWrite() const
 }
 
 
-InsetBase * InsetLatexAccent::clone() const
+auto_ptr<InsetBase> InsetLatexAccent::clone() const
 {
-       return new InsetLatexAccent(contents);
+       return auto_ptr<InsetBase>(new InsetLatexAccent(contents));
 }
 
 
-Inset::Code InsetLatexAccent::lyxCode() const
+InsetOld::Code InsetLatexAccent::lyxCode() const
 {
-       return Inset::ACCENT_CODE;
+       return InsetOld::ACCENT_CODE;
 }