+2003-10-21 Martin Vermeer <martin.vermeer@hut.fi>
+
+ * text.C: (1) finish off the inset display() work;
+ (2) fix the "is a bit silly" bug (accessing char
+ past end of par).
+
2003-10-20 Martin Vermeer <martin.vermeer@hut.fi>
* text.C: re-introduce display() for insets, fixing the
+2003-10-21 Martin Vermeer <martin.vermeer@hut.fi>
+
+ * insetcollapsable.h:
+ * insetcommand.h:
+ * insetfloat.h:
+ * insetfootlike.h:
+ * insetinclude.h: (1) finish off the inset display() work;
+ (2) fix the "is a bit silly" bug (accessing char
+ past end of par).
+
2003-10-20 Martin Vermeer <martin.vermeer@hut.fi>
* inset.h:
///
LyXCursor const & cursor(BufferView *) const;
///
+ virtual bool display() const { return isOpen(); }
+ ///
bool isOpen() const;
///
void open(BufferView *);
virtual int docbook(Buffer const &, std::ostream &, bool) const;
///
InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
-
+ ///
+ virtual bool display() const { return true; }
+
///
InsetCommandParams const & params() const { return p_; }
///
///
~InsetFloat();
///
- virtual bool display() const { return true; }
- ///
void write(Buffer const & buf, std::ostream & os) const;
///
void read(Buffer const & buf, LyXLex & lex);
///
void write(Buffer const & buf, std::ostream & os) const;
///
- bool display() const { return true; }
- ///
bool insetAllowed(InsetOld::Code) const;
/** returns true if, when outputing LaTeX, font changes should
be closed before generating this inset. This is needed for
void metrics(MetricsInfo & mi, Dimension & dim) const;
///
void draw(PainterInfo & pi, int x, int y) const;
+ ///
+ virtual bool display() const { return true; }
/// get the parameters
InsetCommandParams const & params(void) const;
point = i;
break;
}
- InsetOld * in;
// Break before...
if (i + 1 < last) {
- in = pit->getInset(i + 1);
+ InsetOld * in = pit->getInset(i + 1);
if (in && in->display()) {
point = i;
break;
x += thiswidth;
chunkwidth += thiswidth;
- in = pit->getInset(i);
+ InsetOld * in = pit->getInset(i);
// break before a character that will fall off
// the right of the row
if (x >= width) {
// if no break before, break here
- if (point == last || chunkwidth >= width - left)
- point = (pos < i) ? i - 1 : i;
- break;
+ if (point == last || chunkwidth >= width - left) {
+ if (pos < i) {
+ point = i - 1;
+ break;
+ }
+ }
}
if (!in || in->isChar()) {
}
// Display-style insets should always be on a centred row
- // (Simplify this to inset = pit->getInset(rit->pos()) once
- // the "bit silly" bug is fixed, MV)
- inset = pit->isInset(rit->pos()) ? pit->getInset(rit->pos()) : 0;
+ // The test on pit->size() is to catch zero-size pars, which
+ // would trigger the assert in Paragraph::getInset().
+ inset = pit->size() ? pit->getInset(rit->pos()) : 0;
if (inset && inset->display()) {
align = LYX_ALIGN_CENTER;
}