==> more versions, no optional parameters.
-** make Inset::display() more useful
+** DONE When a document ends with a newline, add the bottom margin anyway
+
+The code that tests for a newline was added at 6bb98d07 in 2007.
+
+** When a paragraph ends with a newline, compute correctly the height of the extra row.
+** Rewrite TextMetrics::completionPosAndDim using row information
+
+Currently it uses setRowHeight in a very weird way. In particular the
+topBottomSpace parameter should be removed after that.
+
+** Rewrite TextMetrics::editXY, checkInsetHit using row information (getPosNearX)?
+
+ The helper version should return a Row::Element instead of an InsetTable.
+
+** TODO make Inset::display() more useful
+
+[This has been started in the features/betterbreak branch. Time will
+tell whether it really helps. The question in particular is the
+handling of separator insets]
Extending the DisplayType enum would allow to remove special cases
from the code.
pm.dim().des += row.height();
} while (first < par.size() || need_new_row);
+ // FIXME: It might be better to move this in another method
+ // specially tailored for the main text.
+ // Top and bottom margin of the document (only at top-level)
+ if (text_->isMainText()) {
+ if (pit == 0) {
+ pm.rows().front().dimension().asc += 20;
+ pm.dim().des += 20;
+ }
+ ParagraphList const & pars = text_->paragraphs();
+ if (pit + 1 == pit_type(pars.size())) {
+ pm.rows().back().dimension().des += 20;
+ pm.dim().des += 20;
+ }
+ }
+
if (row_index < pm.rows().size())
pm.rows().resize(row_index);
maxasc += int(layoutasc * 2 / (2 + pars[pit].getDepth()));
maxdes += int(layoutdesc * 2 / (2 + pars[pit].getDepth()));
- // FIXME: the correct way is to do the following is to move the
- // following code in another method specially tailored for the
- // main Text. The following test is thus bogus.
- // Top and bottom margin of the document (only at top-level)
- if (text_->isMainText() && topBottomSpace) {
- if (pit == 0 && row.pos() == 0)
- maxasc += 20;
- if (pit + 1 == pit_type(pars.size()) &&
- row.endpos() == par.size() &&
- !(row.endpos() > 0 && par.isNewline(row.endpos() - 1)))
- maxdes += 20;
- }
-
row.dimension().asc = maxasc + labeladdon;
row.dimension().des = maxdes;
}