diff options
author | corvid <corvid@lavabit.com> | 2009-10-23 22:39:32 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2009-10-23 22:39:32 +0000 |
commit | 43e8a66deeb77ca030b774dc8b7aeb41a5885d62 (patch) | |
tree | 369450cd4c83e572fa92ca44e4310f8c1760c5b3 /dw | |
parent | d0c29ad22847af6e768dd69fd2262a2134ac1d3e (diff) |
don't crash with LIST_STYLE_TYPE_NONE
Diffstat (limited to 'dw')
-rw-r--r-- | dw/textblock.cc | 17 |
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; |