]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetert.C
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / insetert.C
index a4dba614378cc6198b273b512e58f70d23ac37a1..5cc6ba64c99498d76d9eda6e9c11573953c2ebf0 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "insetert.h"
 #include "insettext.h"
+#include "metricsinfo.h"
 
 #include "buffer.h"
 #include "BufferView.h"
@@ -111,7 +112,7 @@ InsetERT::~InsetERT()
 }
 
 
-void InsetERT::read(Buffer const * buf, LyXLex & lex)
+void InsetERT::read(Buffer const & buf, LyXLex & lex)
 {
        bool token_found = false;
        if (lex.isOK()) {
@@ -181,7 +182,7 @@ void InsetERT::read(Buffer const * buf, LyXLex & lex)
 }
 
 
-void InsetERT::write(Buffer const * buf, ostream & os) const
+void InsetERT::write(Buffer const & buf, ostream & os) const
 {
        string st;
 
@@ -201,7 +202,7 @@ void InsetERT::write(Buffer const * buf, ostream & os) const
           << "status "<< st << "\n";
 
        //inset.writeParagraphData(buf, os);
-       string const layout(buf->params.getLyXTextClass().defaultLayoutName());
+       string const layout(buf.params.getLyXTextClass().defaultLayoutName());
        ParagraphList::iterator par = inset.paragraphs.begin();
        ParagraphList::iterator end = inset.paragraphs.end();
        for (; par != end; ++par) {
@@ -324,7 +325,7 @@ void InsetERT::lfunMouseMotion(FuncRequest const & cmd)
 }
 
 
-int InsetERT::latex(Buffer const *, ostream & os,
+int InsetERT::latex(Buffer const &, ostream & os,
                    LatexRunParams const &) const
 {
        ParagraphList::iterator par = inset.paragraphs.begin();
@@ -356,13 +357,13 @@ int InsetERT::latex(Buffer const *, ostream & os,
 }
 
 
-int InsetERT::ascii(Buffer const *, ostream &, int /*linelen*/) const
+int InsetERT::ascii(Buffer const &, ostream &, int /*linelen*/) const
 {
        return 0;
 }
 
 
-int InsetERT::linuxdoc(Buffer const *, ostream & os) const
+int InsetERT::linuxdoc(Buffer const &, ostream & os) const
 {
        ParagraphList::iterator par = inset.paragraphs.begin();
        ParagraphList::iterator end = inset.paragraphs.end();
@@ -389,7 +390,7 @@ int InsetERT::linuxdoc(Buffer const *, ostream & os) const
 }
 
 
-int InsetERT::docbook(Buffer const *, ostream & os, bool) const
+int InsetERT::docbook(Buffer const &, ostream & os, bool) const
 {
        ParagraphList::iterator par = inset.paragraphs.begin();
        ParagraphList::iterator end = inset.paragraphs.end();
@@ -454,7 +455,7 @@ InsetOld::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
                 * taken by the text).
                 */
                inset.getLyXText(cmd.view())->fullRebreak();
-               bv->updateInset();
+               bv->updateInset(this);
                result = DISPATCHED;
        }
        break;
@@ -555,6 +556,10 @@ void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
                inset.metrics(mi, dim);
        else
                InsetCollapsable::metrics(mi, dim);
+       // Make it stand out on its own as it is code, not part of running
+       // text:
+       if (isOpen() && !inlined())
+               dim.wid = mi.base.textwidth;
        dim_ = dim;
 }
 
@@ -598,7 +603,7 @@ void InsetERT::status(BufferView * bv, ERTStatus const st) const
                        break;
                }
                if (bv) {
-                       bv->updateInset();
+                       bv->updateInset(this);
                        bv->buffer()->markDirty();
                }
        }