summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2009-09-03 18:15:03 +0000
committercorvid <corvid@lavabit.com>2009-09-03 18:15:03 +0000
commit1428b404564a2d36e7726849981929d3f28fe0fb (patch)
tree15ff1f6e68f977e2247447ce99f3080fb59988b9
parent5231f9206c6c31ae0d53a5c52d6bb75d3d3b3a9e (diff)
always use getRef for Words and Lines
-rw-r--r--dw/listitem.cc2
-rw-r--r--dw/textblock.cc24
2 files changed, 14 insertions, 12 deletions
diff --git a/dw/listitem.cc b/dw/listitem.cc
index 338f8486..a4c58074 100644
--- a/dw/listitem.cc
+++ b/dw/listitem.cc
@@ -57,7 +57,7 @@ int ListItem::getValue ()
if (words->size () == 0)
return 0;
else
- return words->get(0).size.width + words->get(0).origSpace;
+ return words->getRef(0)->size.width + words->getRef(0)->origSpace;
}
void ListItem::setMaxValue (int maxValue, int value)
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 25ff750c..28d4390a 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -1788,20 +1788,22 @@ void Textblock::addParbreak (int space, core::style::Style *style)
widget = widget->getParent ()) {
Textblock *textblock2 = (Textblock*)widget->getParent ();
if (textblock2->listItem)
- isfirst = (textblock2->words->get(1).content.type
+ isfirst = (textblock2->words->getRef(1)->content.type
== core::Content::WIDGET
- && textblock2->words->get(1).content.widget == widget);
+ && textblock2->words->getRef(1)->content.widget
+ == widget);
else
- isfirst = (textblock2->words->get(0).content.type
+ isfirst = (textblock2->words->getRef(0)->content.type
== core::Content::WIDGET
- && textblock2->words->get(0).content.widget == widget);
+ && textblock2->words->getRef(0)->content.widget
+ == widget);
if (!isfirst) {
/* The page we searched for has been found. */
lineno = widget->parentRef;
if (lineno > 0 &&
(word2 =
textblock2->words->getRef(textblock2->lines
- ->get(lineno - 1).firstWord)) &&
+ ->getRef(lineno - 1)->firstWord)) &&
word2->content.type == core::Content::BREAK) {
if (word2->content.breakSpace < space) {
word2->content.breakSpace = space;
@@ -1845,7 +1847,7 @@ void Textblock::addLinebreak (core::style::Style *style)
Word *word;
if (words->size () == 0 ||
- words->get(words->size () - 1).content.type == core::Content::BREAK)
+ words->getRef(words->size () - 1)->content.type == core::Content::BREAK)
// An <BR> in an empty line gets the height of the current font
// (why would someone else place it here?), ...
word = addWord (0, style->font->ascent, style->font->descent, style);
@@ -2022,7 +2024,7 @@ Textblock::TextblockIterator::TextblockIterator (Textblock *textblock,
else if (index >= textblock->words->size ())
content.type = core::Content::END;
else
- content = textblock->words->get(index).content;
+ content = textblock->words->getRef(index)->content;
}
object::Object *Textblock::TextblockIterator::clone()
@@ -2048,9 +2050,9 @@ bool Textblock::TextblockIterator::next ()
content.type = core::Content::END;
return false;
}
- } while ((textblock->words->get(index).content.type & getMask()) == 0);
+ } while ((textblock->words->getRef(index)->content.type & getMask()) == 0);
- content = textblock->words->get(index).content;
+ content = textblock->words->getRef(index)->content;
return true;
}
@@ -2067,9 +2069,9 @@ bool Textblock::TextblockIterator::prev ()
content.type = core::Content::START;
return false;
}
- } while ((textblock->words->get(index).content.type & getMask()) == 0);
+ } while ((textblock->words->getRef(index)->content.type & getMask()) == 0);
- content = textblock->words->get(index).content;
+ content = textblock->words->getRef(index)->content;
return true;
}