]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetQuotes.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetQuotes.cpp
index b822ff3e168a3adfc61f2fbeac3bdabccacc4299..e2cd014433129e052534883ece33a339a7c0fb49 100644 (file)
@@ -21,8 +21,6 @@
 #include "LyXRC.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
-#include "Paragraph.h"
-#include "paragraph_funcs.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
@@ -36,7 +34,6 @@ using support::prefixIs;
 
 using std::endl;
 using std::string;
-using std::auto_ptr;
 using std::ostream;
 
 
@@ -204,7 +201,7 @@ docstring const InsetQuotes::dispString(Language const * loclang) const
 #endif
        else
                retdisp = lyx::from_ascii(disp);
-       
+
        // in french, spaces are added inside double quotes
        if (times_ == DoubleQ && prefixIs(loclang->code(), "fr")) {
                if (side_ == LeftQ)
@@ -217,9 +214,9 @@ docstring const InsetQuotes::dispString(Language const * loclang) const
 }
 
 
-bool InsetQuotes::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetQuotes::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       LyXFont & font = mi.base.font;
+       Font & font = mi.base.font;
        frontend::FontMetrics const & fm =
                theFontMetrics(font);
        dim.asc = fm.maxAscent();
@@ -235,19 +232,16 @@ bool InsetQuotes::metrics(MetricsInfo & mi, Dimension & dim) const
                else
                        dim.wid += fm.width(',');
        }
-       bool const changed = dim_ != dim;
-       dim_ = dim;
-       return changed;
 }
 
 
 #if 0
-LyXFont const InsetQuotes::convertFont(LyXFont const & f) const
+Font const InsetQuotes::convertFont(Font const & f) const
 {
 #if 1
        return f;
 #else
-       LyXFont font(f);
+       Font font(f);
        return font;
 #endif
 }
@@ -266,7 +260,6 @@ void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
        } else {
                pi.pain.text(x, y, text, pi.base.font);
        }
-       setPosCache(pi, x, y);
 }
 
 
@@ -292,7 +285,7 @@ void InsetQuotes::read(Buffer const &, Lexer & lex)
 
 
 int InsetQuotes::latex(Buffer const &, odocstream & os,
-                       OutputParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        const int quoteind = quote_index[side_][language_];
        string qstr;
@@ -325,7 +318,7 @@ int InsetQuotes::latex(Buffer const &, odocstream & os,
 
 
 int InsetQuotes::plaintext(Buffer const & buf, odocstream & os,
-                           OutputParams const &) const
+                          OutputParams const &) const
 {
        docstring const str = dispString(buf.params().language);
        os << str;
@@ -334,7 +327,7 @@ int InsetQuotes::plaintext(Buffer const & buf, odocstream & os,
 
 
 int InsetQuotes::docbook(Buffer const &, odocstream & os,
-                         OutputParams const &) const
+                        OutputParams const &) const
 {
        if (times_ == DoubleQ) {
                if (side_ == LeftQ)
@@ -386,9 +379,9 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<Inset> InsetQuotes::doClone() const
+Inset * InsetQuotes::clone() const
 {
-       return auto_ptr<Inset>(new InsetQuotes(language_, side_, times_));
+       return new InsetQuotes(language_, side_, times_);
 }