+2002-05-14 Juergen Vigna <jug@sad.it>
+
+ * text.C (breakParagraph): fixed function to honor the keepempty
+ layout in the right maner and also to permit the right breaking
+ algorithm on empty or non empyt keepempty paragraphs.
+
+ * paragraph.C (breakParagraph): we have to check also if the par
+ is really empty (!size()) for isempty otherwise we do the wrong
+ paragraph break.
+
2002-05-10 Juergen Vigna <jug@sad.it>
* buffer.[Ch] : The following are only changes to the ert
tmp->setLabelWidthString(params().labelWidthString());
}
- bool isempty = textclasslist[bparams.textclass][layout()].keepempty;
+ bool isempty = (textclasslist[bparams.textclass][layout()].keepempty &&
+ !size());
if (!isempty && (size() > pos || !size() || flag == 2)) {
tmp->layout(layout());
tmp->params().align(params().align());
keep_layout = 2;
else
keep_layout = layout.isEnvironment();
+
+ // we need to set this before we insert the paragraph. IMO the
+ // breakParagraph call should return a bool if it inserts the
+ // paragraph before or behind and we should react on that one
+ // but we can fix this in 1.3.0 (Jug 20020509)
+ bool const isempty = (layout.keepempty && !cursor.par()->size());
cursor.par()->breakParagraph(bview->buffer()->params, cursor.pos(),
keep_layout);
/* This check is necessary. Otherwise the new empty paragraph will
* be deleted automatically. And it is more friendly for the user! */
- if (cursor.pos() || layout.keepempty)
+ if (cursor.pos() || isempty)
setCursor(bview, cursor.par()->next(), 0);
else
setCursor(bview, cursor.par(), 0);