diff options
Diffstat (limited to 'dw')
-rw-r--r-- | dw/listitem.cc | 3 | ||||
-rw-r--r-- | dw/textblock.cc | 11 | ||||
-rw-r--r-- | dw/textblock.hh | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/dw/listitem.cc b/dw/listitem.cc index f4499400..02a91eb7 100644 --- a/dw/listitem.cc +++ b/dw/listitem.cc @@ -30,7 +30,6 @@ ListItem::ListItem (ListItem *ref, bool limitTextWidth): AlignedTextblock (limitTextWidth) { registerName ("dw::ListItem", &CLASS_ID); - listItem = true; setRefTextblock (ref); } @@ -41,6 +40,7 @@ ListItem::~ListItem() void ListItem::initWithWidget (core::Widget *widget, core::style::Style *style) { + hasListitemValue = true; addWidget (widget, style); addSpace (style); updateValue (); @@ -48,6 +48,7 @@ void ListItem::initWithWidget (core::Widget *widget, void ListItem::initWithText (const char *text, core::style::Style *style) { + hasListitemValue = true; addText (text, style); addSpace (style); updateValue (); diff --git a/dw/textblock.cc b/dw/textblock.cc index d18d0dc8..5d838277 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -38,7 +38,7 @@ Textblock::Textblock (bool limitTextWidth) setFlags (USES_HINTS); setButtonSensitive(true); - listItem = false; + hasListitemValue = false; innerPadding = 0; line1Offset = 0; line1OffsetEff = 0; @@ -1041,8 +1041,7 @@ void Textblock::wordWrap(int wordIndex) if (leftOffset < 0) leftOffset = 0; - if (listItem && - getStyle()->listStyleType != core::style::LIST_STYLE_TYPE_NONE && + if (hasListitemValue && lastLine == lines->getRef (0)) { /* List item markers are always on the left. */ lastLine->leftOffset = 0; @@ -1720,7 +1719,7 @@ void Textblock::addParbreak (int space, core::style::Style *style) the bullet/number (which is the first word) in a list item. (See also comment in Dw_page_size_request.) */ if (words->size () == 0 || - (listItem && words->size () == 1)) { + (hasListitemValue && words->size () == 1)) { /* This is a bit hackish: If a break is added as the first/second word of a page, and the parent widget is also a DwPage, and there is a break before -- this is the case when @@ -1735,9 +1734,7 @@ void Textblock::addParbreak (int space, core::style::Style *style) widget->getParent()->instanceOf (Textblock::CLASS_ID); widget = widget->getParent ()) { Textblock *textblock2 = (Textblock*)widget->getParent (); - int index = (textblock2->listItem && - (textblock2->getStyle()->listStyleType != - dw::core::style::LIST_STYLE_TYPE_NONE)) ? 1 : 0; + int index = textblock2->hasListitemValue ? 1 : 0; bool isfirst = (textblock2->words->getRef(index)->content.type == core::Content::WIDGET && textblock2->words->getRef(index)->content.widget diff --git a/dw/textblock.hh b/dw/textblock.hh index 2e83c09e..d7fab7e9 100644 --- a/dw/textblock.hh +++ b/dw/textblock.hh @@ -196,7 +196,7 @@ protected: friend class TextblockIterator; /* These fields provide some ad-hoc-functionality, used by sub-classes. */ - bool listItem; /* If true, the first word of the page is treated + bool hasListitemValue; /* If true, the first word of the page is treated specially (search in source). */ int innerPadding; /* This is an additional padding on the left side (used by ListItem). */ |