#include "support/LOstream.h"
#include "support/LAssert.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
using std::ostream;
LyXFont font(LyXFont::ALL_INHERIT, latex_language);
font.setFamily(LyXFont::TYPEWRITER_FAMILY);
font.setColor(LColor::latex);
- Paragraph * par = inset.paragraph();
- while (par) {
- pos_type siz = par->size();
+
+ ParagraphList::iterator pit = inset.paragraphs.begin();
+ ParagraphList::iterator pend = inset.paragraphs.end();
+ for (; pit != pend; ++pit) {
+ pos_type siz = pit->size();
for (pos_type i = 0; i < siz; ++i) {
- par->setFont(i, font);
+ pit->setFont(i, font);
}
- par = par->next();
}
#endif
}
}
-void InsetERT::edit(BufferView * bv, int x, int y, mouse_button::state button)
-{
- if (button == mouse_button::button3)
- return;
-
- if (status_ == Inlined) {
- if (!bv->lockInset(this))
- return;
- inset.edit(bv, x, y, button);
- } else {
- InsetCollapsable::edit(bv, x, y, button);
- }
- set_latex_font(bv);
- updateStatus(bv);
-}
-
Inset::EDITABLE InsetERT::editable() const
{
}
-void InsetERT::edit(BufferView * bv, bool front)
-{
- InsetCollapsable::edit(bv, front);
- updateStatus(0);
- set_latex_font(bv);
-}
-
-
void InsetERT::lfunMousePress(FuncRequest const & cmd)
{
if (status_ == Inlined)
if (status_ == Inlined)
inset.localDispatch(cmd1);
else if (!collapsed_ && (cmd.y > button_bottom_y)) {
- cmd1.y -= ascent_collapsed() + descent_collapsed();
+ cmd1.y -= height_collapsed();
inset.localDispatch(cmd1);
}
}
}
-int InsetERT::latex(Buffer const *, ostream & os, 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();
}
switch (cmd.action) {
+
+ case LFUN_INSET_EDIT:
+ if (cmd.button() == mouse_button::button3)
+ break;
+ if (status_ == Inlined) {
+ if (!bv->lockInset(this))
+ break;
+ result = inset.localDispatch(cmd);
+ } else {
+ result = InsetCollapsable::localDispatch(cmd);
+ }
+ set_latex_font(bv);
+ updateStatus(bv);
+ break;
+
case LFUN_INSET_MODIFY: {
InsetERT::ERTStatus status_;
InsetERTMailer::string2params(cmd.argument, status_);
}
-int InsetERT::ascent(BufferView * bv, LyXFont const & font) const
-{
- if (!inlined())
- return InsetCollapsable::ascent(bv, font);
-
- return inset.ascent(bv, font);
-}
-
-
-int InsetERT::descent(BufferView * bv, LyXFont const & font) const
-{
- if (!inlined())
- return InsetCollapsable::descent(bv, font);
-
- return inset.descent(bv, font);
-}
-
-
-int InsetERT::width(BufferView * bv, LyXFont const & font) const
+void InsetERT::dimension(BufferView * bv, LyXFont const & font,
+ Dimension & dim) const
{
- if (!inlined())
- return InsetCollapsable::width(bv, font);
-
- return inset.width(bv, font);
+ if (inlined())
+ inset.dimension(bv, font, dim);
+ else
+ InsetCollapsable::dimension(bv, font, dim);
}