summaryrefslogtreecommitdiff
path: root/dw/textblock.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r--dw/textblock.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 94e3d8ea..e8da3422 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1740,16 +1740,13 @@ void Textblock::addParbreak (int space, core::style::Style *style)
widget->getParent()->instanceOf (Textblock::CLASS_ID);
widget = widget->getParent ()) {
Textblock *textblock2 = (Textblock*)widget->getParent ();
- if (textblock2->listItem)
- isfirst = (textblock2->words->getRef(1)->content.type
- == core::Content::WIDGET
- && textblock2->words->getRef(1)->content.widget
- == widget);
- else
- isfirst = (textblock2->words->getRef(0)->content.type
- == core::Content::WIDGET
- && textblock2->words->getRef(0)->content.widget
- == widget);
+ int index = (textblock2->listItem &&
+ (textblock2->getStyle()->listStyleType !=
+ dw::core::style::LIST_STYLE_TYPE_NONE)) ? 1 : 0;
+ isfirst = (textblock2->words->getRef(index)->content.type
+ == core::Content::WIDGET
+ && textblock2->words->getRef(index)->content.widget
+ == widget);
if (!isfirst) {
/* The page we searched for has been found. */
lineno = widget->parentRef;