diff options
-rw-r--r-- | dw/textblock.cc | 18 |
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)) { |