diff options
author | Sebastian Geerken <devnull@localhost> | 2012-10-08 11:35:59 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2012-10-08 11:35:59 +0200 |
commit | 7fee878b09701ac3d0f8cb8e8fabc8afff7bcf98 (patch) | |
tree | 7727765e63a78e05c2abc94dfd81f3d793e25462 | |
parent | d3c0fe575e06cfce5b595ba615e885fd189cd75a (diff) |
Now, also selection works (in a temporal way).
-rw-r--r-- | dw/iterator.cc | 6 | ||||
-rw-r--r-- | dw/textblock.cc | 4 | ||||
-rw-r--r-- | dw/types.cc | 8 | ||||
-rw-r--r-- | dw/types.hh | 4 |
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 |