2009-06-10 Xan Lopez <xlopez@igalia.com>
authorxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Jun 2009 20:55:25 +0000 (20:55 +0000)
committerxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Jun 2009 20:55:25 +0000 (20:55 +0000)
        Reviewed by Gustavo Noronha.

        https://bugs.webkit.org/show_bug.cgi?id=25609
        [GTK] Implement support for get_selection and get_n_selections

        Implement atk_text_get_n_selections.

        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
        (webkit_accessible_text_get_n_selections):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@44592 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

index 8052d1a..2871dbe 100644 (file)
@@ -1,3 +1,15 @@
+2009-06-10  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        https://bugs.webkit.org/show_bug.cgi?id=25609
+        [GTK] Implement support for get_selection and get_n_selections
+
+        Implement atk_text_get_n_selections.
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        (webkit_accessible_text_get_n_selections):
+
 2009-06-10  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Anders Carlsson.
index f656819..d06c689 100644 (file)
@@ -612,8 +612,12 @@ static gint webkit_accessible_text_get_offset_at_point(AtkText* text, gint x, gi
 
 static gint webkit_accessible_text_get_n_selections(AtkText* text)
 {
-    notImplemented();
-    return 0;
+    AccessibilityObject* coreObject = core(text);
+    VisibleSelection selection = coreObject->selection();
+
+    // We don't support multiple selections for now, so there's only
+    // two possibilities
+    return selection.isNone() ? 0 : 1;
 }
 
 static gchar* webkit_accessible_text_get_selection(AtkText* text, gint selection_num, gint* start_offset, gint* end_offset)