aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock.hh
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-08-29 19:00:08 +0200
committerSebastian Geerken <devnull@localhost>2014-08-29 19:00:08 +0200
commit9430132423d99689de9c02db79df60fd1b4a5703 (patch)
tree8dd8f75e27d9789be5146560ef6557ef59fc589e /dw/textblock.hh
parentcd2b7abca85195e32eff716ed15aa0b9051fe46a (diff)
parent16607bb593346401334d0988b2b25a3df3b5ce0d (diff)
Merge with main repo.
Diffstat (limited to 'dw/textblock.hh')
-rw-r--r--dw/textblock.hh22
1 files changed, 13 insertions, 9 deletions
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 5e8986b3..3abe1f41 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -475,6 +475,9 @@ 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). */
@@ -637,24 +640,25 @@ protected:
return getTextblockForLine (lineNo) == NULL;
}
- inline int lineYOffsetWidgetAllocation (Line *line,
- core::Allocation *allocation)
+ inline int _lineYOffsetWidgetAllocation (Line *line,
+ core::Allocation *allocation)
{
return line->top + (allocation->ascent - lines->getRef(0)->boxAscent);
}
inline int lineYOffsetWidget (Line *line)
{
- return lineYOffsetWidgetAllocation (line, &allocation);
+ return _lineYOffsetWidgetAllocation (line, &childBaseAllocation);
}
/**
- * Like lineYOffsetCanvas, but with the allocation as parameter.
+ * Like lineYOffsetCanvas, but with the allocation as parameter. Rarely used
+ * outside of lineYOffsetCanvas.
*/
- inline int lineYOffsetCanvasAllocation (Line *line,
+ inline int _lineYOffsetCanvasAllocation (Line *line,
core::Allocation *allocation)
{
- return allocation->y + lineYOffsetWidgetAllocation (line, allocation);
+ return allocation->y + _lineYOffsetWidgetAllocation (line, allocation);
}
/**
@@ -662,7 +666,7 @@ protected:
*/
inline int lineYOffsetCanvas (Line *line)
{
- return lineYOffsetCanvasAllocation(line, &allocation);
+ return _lineYOffsetCanvasAllocation(line, &childBaseAllocation);
}
inline int lineYOffsetWidgetI (int lineIndex)
@@ -673,8 +677,8 @@ protected:
inline int lineYOffsetWidgetIAllocation (int lineIndex,
core::Allocation *allocation)
{
- return lineYOffsetWidgetAllocation (lines->getRef (lineIndex),
- allocation);
+ return _lineYOffsetWidgetAllocation (lines->getRef (lineIndex),
+ allocation);
}
inline int lineYOffsetCanvasI (int lineIndex)