changeset 1302:d5af811c56f9

always use getRef for Words and Lines
author corvid <corvid@lavabit.com>
date Thu, 03 Sep 2009 18:15:03 +0000
parents 55697486ef42
children a422b79d70f5
files dw/listitem.cc dw/textblock.cc
diffstat 2 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/dw/listitem.cc	Thu Sep 03 03:03:06 2009 +0000
+++ b/dw/listitem.cc	Thu Sep 03 18:15:03 2009 +0000
@@ -57,7 +57,7 @@
    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)
--- a/dw/textblock.cc	Thu Sep 03 03:03:06 2009 +0000
+++ b/dw/textblock.cc	Thu Sep 03 18:15:03 2009 +0000
@@ -1788,20 +1788,22 @@
            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 @@
    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 @@
    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 @@
          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 @@
          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;
 }