]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetQuotes.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetQuotes.cpp
index 82be45c29468092ae9a9ff7d2285f03f7eb2f077..994d0436ec63d6093be176cb38f3bffe7618adcb 100644 (file)
 
 #include "InsetQuotes.h"
 
-#include "buffer.h"
-#include "bufferparams.h"
+#include "Buffer.h"
+#include "BufferParams.h"
 #include "debug.h"
-#include "language.h"
+#include "Language.h"
 #include "LaTeXFeatures.h"
-#include "lyxlex.h"
-#include "lyxrc.h"
-#include "metricsinfo.h"
-#include "outputparams.h"
-#include "paragraph.h"
-#include "paragraph_funcs.h"
+#include "Lexer.h"
+#include "LyXRC.h"
+#include "MetricsInfo.h"
+#include "OutputParams.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;
 
 
@@ -85,14 +82,12 @@ char const * const latex_quote_babel[2][5] =
 InsetQuotes::InsetQuotes(string const & str)
 {
        parseString(str);
-       setInsetName(from_utf8("InsetQuotes"));
 }
 
 
 InsetQuotes::InsetQuotes(quote_language l, quote_side s, quote_times t)
        : language_(l), side_(s), times_(t)
 {
-       setInsetName(from_utf8("InsetQuotes"));
 }
 
 
@@ -100,7 +95,6 @@ InsetQuotes::InsetQuotes(char_type c, BufferParams const & params)
        : language_(params.quotes_language), times_(params.quotes_times)
 {
        getPosition(c);
-       setInsetName(from_utf8("InsetQuotes"));
 }
 
 
@@ -108,7 +102,6 @@ InsetQuotes::InsetQuotes(char_type c, quote_language l, quote_times t)
        : language_(l), times_(t)
 {
        getPosition(c);
-       setInsetName(from_utf8("InsetQuotes"));
 }
 
 
@@ -208,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)
@@ -223,7 +216,7 @@ docstring const InsetQuotes::dispString(Language const * loclang) const
 
 bool 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();
@@ -246,12 +239,12 @@ bool InsetQuotes::metrics(MetricsInfo & mi, Dimension & dim) const
 
 
 #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
 }
@@ -284,7 +277,7 @@ void InsetQuotes::write(Buffer const &, ostream & os) const
 }
 
 
-void InsetQuotes::read(Buffer const &, LyXLex & lex)
+void InsetQuotes::read(Buffer const &, Lexer & lex)
 {
        lex.next();
        parseString(lex.getString());
@@ -296,7 +289,7 @@ void InsetQuotes::read(Buffer const &, LyXLex & 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;
@@ -329,7 +322,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;
@@ -338,7 +331,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)
@@ -390,15 +383,15 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<InsetBase> InsetQuotes::doClone() const
+Inset * InsetQuotes::clone() const
 {
-       return auto_ptr<InsetBase>(new InsetQuotes(language_, side_, times_));
+       return new InsetQuotes(language_, side_, times_);
 }
 
 
-InsetBase::Code InsetQuotes::lyxCode() const
+Inset::Code InsetQuotes::lyxCode() const
 {
-       return InsetBase::QUOTE_CODE;
+       return Inset::QUOTE_CODE;
 }