diff options
author | Sebastian Geerken <devnull@localhost> | 2015-10-24 14:24:09 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-10-24 14:24:09 +0200 |
commit | f3208e402d57f50a253c693dbc32db5d3b2e8299 (patch) | |
tree | 3357519cfe2c6a39c0bb60b5ab6ed6348f07f893 /dw/textblock.hh | |
parent | 41fd1ce51b281bd7814909b00ddb1e6fd057f350 (diff) |
Remove Textblock::childBaseAllocation (not needed anymore after SRDOP).
Diffstat (limited to 'dw/textblock.hh')
-rw-r--r-- | dw/textblock.hh | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/dw/textblock.hh b/dw/textblock.hh index 70070975..562528b9 100644 --- a/dw/textblock.hh +++ b/dw/textblock.hh @@ -527,9 +527,6 @@ protected: friend class TextblockIterator; - // See sizeAllocateImpl for details. It is also used elsewhere. - core::Allocation childBaseAllocation; - /* These fields provide some ad-hoc-functionality, used by sub-classes. */ bool hasListitemValue; /* If true, the first word of the page is treated specially (search in source). */ @@ -704,48 +701,43 @@ protected: return getWidgetRegardingBorderForLine (lineNo) == NULL; } - inline int _lineYOffsetWidgetAllocation (Line *line, - core::Allocation *allocation) + // The following methods return the y offset of a line, + // - given as pointer or by index; + // - either within the canvas, or within this widget; + // - with allocation passed explicitely, or using the widget allocation + // (important: this is set *after* sizeRequestImpl is returning. + + inline int lineYOffsetWidget (Line *line, core::Allocation *allocation) { return line->top + (allocation->ascent - lines->getRef(0)->borderAscent); } inline int lineYOffsetWidget (Line *line) { - return _lineYOffsetWidgetAllocation (line, &childBaseAllocation); + return lineYOffsetWidget (line, &allocation); } - /** - * Like lineYOffsetCanvas, but with the allocation as parameter. Rarely used - * outside of lineYOffsetCanvas. - */ - inline int _lineYOffsetCanvasAllocation (Line *line, - core::Allocation *allocation) + inline int lineYOffsetCanvas (Line *line, core::Allocation *allocation) { - return allocation->y + _lineYOffsetWidgetAllocation (line, allocation); + return allocation->y + lineYOffsetWidget (line, allocation); } - /** - * Returns the y offset (within the canvas) of a line. - */ inline int lineYOffsetCanvas (Line *line) { - return _lineYOffsetCanvasAllocation (line, &childBaseAllocation); + return lineYOffsetCanvas (line, &allocation); } - inline int lineYOffsetWidgetI (int lineIndex) + inline int lineYOffsetWidget (int lineIndex) { return lineYOffsetWidget (lines->getRef (lineIndex)); } - inline int lineYOffsetWidgetIAllocation (int lineIndex, - core::Allocation *allocation) + inline int lineYOffsetWidget (int lineIndex, core::Allocation *allocation) { - return _lineYOffsetWidgetAllocation (lines->getRef (lineIndex), - allocation); + return lineYOffsetWidget (lines->getRef (lineIndex), allocation); } - inline int lineYOffsetCanvasI (int lineIndex) + inline int lineYOffsetCanvas (int lineIndex) { return lineYOffsetCanvas (lines->getRef (lineIndex)); } |