]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetert.C
Enable the external inset to handle unknown templates gracefully.
[lyx.git] / src / insets / insetert.C
index aab2a2b4d5bf50e4fe575988a6f2b775e43d1a0e..4a6888091f1e5aca24a0a23463045ef511755fdb 100644 (file)
@@ -63,16 +63,16 @@ InsetERT::InsetERT(BufferParams const & bp, bool collapsed)
 }
 
 
-InsetERT::InsetERT(InsetERT const & in, bool same_id)
-       : InsetCollapsable(in, same_id), status_(in.status_)
+InsetERT::InsetERT(InsetERT const & in)
+       : InsetCollapsable(in), status_(in.status_)
 {
        init();
 }
 
 
-Inset * InsetERT::clone(Buffer const &, bool same_id) const
+Inset * InsetERT::clone() const
 {
-       return new InsetERT(*const_cast<InsetERT *>(this), same_id);
+       return new InsetERT(*this);
 }
 
 
@@ -323,8 +323,8 @@ void InsetERT::lfunMouseMotion(FuncRequest const & cmd)
 }
 
 
-int InsetERT::latex(Buffer const *, ostream & os, LatexRunParams const &,
-                   bool /*fragile*/, bool /*free_spc*/) const
+int InsetERT::latex(Buffer const *, ostream & os,
+                   LatexRunParams const &) const
 {
        ParagraphList::iterator par = inset.paragraphs.begin();
        ParagraphList::iterator end = inset.paragraphs.end();
@@ -346,8 +346,8 @@ int InsetERT::latex(Buffer const *, ostream & os, LatexRunParams const &,
                }
                ++par;
                if (par != end) {
-                       os << "\n\n";
-                       lines += 2;
+                       os << "\n";
+                       ++lines;
                }
        }
 
@@ -552,20 +552,18 @@ bool InsetERT::checkInsertChar(LyXFont & /* font */)
 }
 
 
-void InsetERT::dimension(BufferView * bv, LyXFont const & font,
-       Dimension & dim) const
+void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        if (inlined())
-               inset.dimension(bv, font, dim);
+               inset.metrics(mi, dim);
        else
-               InsetCollapsable::dimension(bv, font, dim);
+               InsetCollapsable::metrics(mi, dim);
 }
 
 
-void InsetERT::draw(BufferView * bv, LyXFont const & f,
-                   int baseline, float & x) const
+void InsetERT::draw(PainterInfo & pi, int x, int y) const
 {
-       InsetCollapsable::draw(bv, f, baseline, x, inlined());
+       InsetCollapsable::draw(pi, x, y, inlined());
 }