summaryrefslogtreecommitdiff
path: root/dw/textblock.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2016-01-10 12:45:13 +0100
committerSebastian Geerken <devnull@localhost>2016-01-10 12:45:13 +0100
commit7e838b973ac92c0d41fcd2798eb5f569ca274616 (patch)
tree46fe82bd6c17bd26d4ffd811c6691e06c59fea60 /dw/textblock.cc
parent32d24ec33ce800cd14ecf05d68a659143a3e1cd3 (diff)
SRDOP: Fix passing positions to first block within a list item.
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r--dw/textblock.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index cebfa972..514d3e93 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -2270,10 +2270,22 @@ bool Textblock::calcSizeOfWidgetInFlow (int wordIndex, Widget *widget,
DBG_OBJ_ENTER ("resize", 0, "calcSizeOfWidgetInFlow", "%d, %p, ...",
wordIndex, widget);
- bool result;
+ bool result, firstWordOfLine;
+
+ if (hasListitemValue)
+ // For list items, the word #0 at the beginning (bullet, number ...) has
+ // to be considered;
+ firstWordOfLine = wordIndex == 1 ||
+ (wordIndex > 0 &&
+ words->getRef(wordIndex - 1)->content.type == core::Content::BREAK);
+ else
+ firstWordOfLine = wordIndex == 0 ||
+ words->getRef(wordIndex - 1)->content.type == core::Content::BREAK;
+
+ DBG_OBJ_MSGF ("resize", 1, "firstWordOfLine = %s",
+ boolToStr (firstWordOfLine));
- if ((wordIndex == 0 ||
- words->getRef(wordIndex - 1)->content.type == core::Content::BREAK) &&
+ if (firstWordOfLine &&
(widget->getStyle()->display == core::style::DISPLAY_BLOCK ||
widget->getStyle()->display == core::style::DISPLAY_LIST_ITEM ||
widget->getStyle()->display == core::style::DISPLAY_TABLE)) {