+2000-01-11 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * src/paragraph.C (BreakParagraph): do not reserve space on text
+ if we don't need to (otherwise, if pos_end < pos, we end up
+ reserving huge amounts of memory due to bad unsigned karma).
+ (BreakParagraphConservative): ditto, although I have not seen
+ evidence the bug can happen here.
+
+ * src/lyxparagraph.h: add a using std::list.
+
2000-01-11 Juergen Vigna <jug@sad.it>
* src/menus.C (MenuDocu): output an Alert if the documentation-file
#include "layout.h"
#include "support/block.h"
-
#define NEW_INSETTABLE 1
#define NEW_FONTTABLE 1
class TexRow;
struct LaTeXFeatures;
+using std::list;
+
/// A LyXParagraph holds all text, attributes and insets in a text paragraph
class LyXParagraph {
public:
pos_first++;
pos_end = pos_first + par->text.size() - 1;
- tmp->text.reserve(pos_end - pos);
+ if (pos_end > pos)
+ tmp->text.reserve(pos_end - pos);
for (i = pos; i <= pos_end; i++) {
par->CutIntoMinibuffer(i - pos_first);
// InsertFromMinibuffer will enlarge the memory (it uses
// InsertChar of course). But doing it by hand
// is MUCH faster! (only one time, not thousend times!!)
- tmp->text.reserve(pos_end - pos);
+ if (pos_end > pos)
+ tmp->text.reserve(pos_end - pos);
for (i = pos; i <= pos_end; i++) {