aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/iterator.cc6
-rw-r--r--dw/textblock.cc4
-rw-r--r--dw/types.cc8
-rw-r--r--dw/types.hh4
4 files changed, 15 insertions, 7 deletions
diff --git a/dw/iterator.cc b/dw/iterator.cc
index d42bdae3..b6fde502 100644
--- a/dw/iterator.cc
+++ b/dw/iterator.cc
@@ -655,12 +655,8 @@ CharIterator::CharIterator ()
*/
CharIterator::CharIterator (Widget *widget, bool followReferences)
{
- Content::Type widgetMask = (Content::Type)
- (Content::WIDGET_IN_FLOW |
- (followReferences ? Content::WIDGET_OOF_REF : Content::WIDGET_OOF_CONT));
Iterator *i =
- widget->iterator ((Content::Type)
- (Content::SELECTION_CONTENT | widgetMask), false);
+ widget->iterator (Content::maskForSelection (followReferences), false);
it = new DeepIterator (i);
i->unref ();
ch = START;
diff --git a/dw/textblock.cc b/dw/textblock.cc
index ee5d4f67..2557a28f 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -800,7 +800,9 @@ bool Textblock::sendSelectionEvent (core::SelectionState::EventType eventType,
}
}
}
- it = new TextblockIterator (this, core::Content::SELECTION_CONTENT,
+
+ /** \todo Reactivate followReferences = true, as soon as it works. */
+ it = new TextblockIterator (this, core::Content::maskForSelection (false),
false, wordIndex);
r = selectionHandleEvent (eventType, it, charPos, link, event);
it->unref ();
diff --git a/dw/types.cc b/dw/types.cc
index 074cb352..dc243ad7 100644
--- a/dw/types.cc
+++ b/dw/types.cc
@@ -268,5 +268,13 @@ void Region::addRectangle (Rectangle *rPointer)
rectangleList->append (r);
}
+Content::Type Content::maskForSelection (bool followReferences)
+{
+ Content::Type widgetMask = (Content::Type)
+ (Content::WIDGET_IN_FLOW |
+ (followReferences ? Content::WIDGET_OOF_REF : Content::WIDGET_OOF_CONT));
+ return (Content::Type)(Content::SELECTION_CONTENT | widgetMask);
+}
+
} // namespace dw
} // namespace core
diff --git a/dw/types.hh b/dw/types.hh
index bc78f406..514733a5 100644
--- a/dw/types.hh
+++ b/dw/types.hh
@@ -203,8 +203,8 @@ struct Content
widget (containing this content) is only the generator
(parent), but _not_ container */
WIDGET_OOF_REF = 1 << 5,
-
BREAK = 1 << 6,
+
ALL = 0xff,
REAL_CONTENT = 0xff ^ (START | END),
SELECTION_CONTENT = TEXT | BREAK, // WIDGET_* must be set additionally
@@ -221,6 +221,8 @@ struct Content
Widget *widget;
int breakSpace;
};
+
+ static Content::Type maskForSelection (bool followReferences);
};
} // namespace dw