Changeset 50727 in webkit
- Timestamp:
- Nov 10, 2009 1:53:33 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r50726 r50727 1 2009-11-10 Joanmarie Diggs <joanmarie.diggs@gmail.com> 2 3 Reviewed by Reviewed by Jan Alonzo. 4 5 https://bugs.webkit.org/show_bug.cgi?id=30901 6 [Gtk] Need to de-lint the Atk a11y code 7 8 Removal of various and sundry style-violating nits. 9 10 * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: 11 1 12 2009-11-10 Philippe Normand <pnormand@igalia.com> 2 13 -
trunk/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
r50641 r50727 200 200 } 201 201 202 static gpointer webkit_accessible_parent_class = NULL;202 static gpointer webkit_accessible_parent_class = 0; 203 203 204 204 static AtkObject* atkParentOfWebView(AtkObject* object) … … 248 248 AccessibilityObject* coreObject = core(object); 249 249 AccessibilityObject::AccessibilityChildrenVector children = coreObject->children(); 250 if (index < 0 || index>= children.size())250 if (index < 0 || static_cast<unsigned>(index) >= children.size()) 251 251 return 0; 252 252 … … 254 254 255 255 if (!coreChild) 256 return NULL;256 return 0; 257 257 258 258 AtkObject* child = coreChild->wrapper(); … … 305 305 static AtkAttributeSet* webkit_accessible_get_attributes(AtkObject* object) 306 306 { 307 AtkAttributeSet* attributeSet = NULL;307 AtkAttributeSet* attributeSet = 0; 308 308 309 309 int headingLevel = core(object)->headingLevel(); … … 593 593 static const GTypeInfo tinfo = { 594 594 sizeof(WebKitAccessibleClass), 595 (GBaseInitFunc) NULL,596 (GBaseFinalizeFunc) NULL,597 (GClassInitFunc) webkit_accessible_class_init,598 (GClassFinalizeFunc) NULL,599 NULL, /* class data */595 (GBaseInitFunc) 0, 596 (GBaseFinalizeFunc) 0, 597 (GClassInitFunc) webkit_accessible_class_init, 598 (GClassFinalizeFunc) 0, 599 0, /* class data */ 600 600 sizeof(WebKitAccessible), /* instance size */ 601 601 0, /* nb preallocs */ 602 (GInstanceInitFunc) NULL,603 NULL/* value table */602 (GInstanceInitFunc) 0, 603 0 /* value table */ 604 604 }; 605 605 … … 625 625 static const gchar* webkit_accessible_action_get_description(AtkAction* action, gint i) 626 626 { 627 g_return_val_if_fail(i == 0, NULL);627 g_return_val_if_fail(i == 0, 0); 628 628 // TODO: Need a way to provide/localize action descriptions. 629 629 notImplemented(); … … 633 633 static const gchar* webkit_accessible_action_get_keybinding(AtkAction* action, gint i) 634 634 { 635 g_return_val_if_fail(i == 0, NULL);635 g_return_val_if_fail(i == 0, 0); 636 636 // FIXME: Construct a proper keybinding string. 637 637 return returnString(core(action)->accessKey().string()); … … 640 640 static const gchar* webkit_accessible_action_get_name(AtkAction* action, gint i) 641 641 { 642 g_return_val_if_fail(i == 0, NULL);642 g_return_val_if_fail(i == 0, 0); 643 643 return returnString(core(action)->actionVerb()); 644 644 } … … 841 841 CString stringUTF8 = UTF8Encoding().encode(characters, length, QuestionMarksForUnencodables); 842 842 gchar* utf8String = utf8Substr(stringUTF8.data(), from, to); 843 if (!g_utf8_validate(utf8String, -1, NULL)) {843 if (!g_utf8_validate(utf8String, -1, 0)) { 844 844 g_free(utf8String); 845 845 return 0; 846 846 } 847 847 gsize len = strlen(utf8String); 848 GString* ret = g_string_new_len( NULL, len);848 GString* ret = g_string_new_len(0, len); 849 849 gchar* ptr = utf8String; 850 850 … … 877 877 return 0; 878 878 879 GString* str = g_string_new( NULL);879 GString* str = g_string_new(0); 880 880 881 881 AccessibilityRenderObject* accObject = static_cast<AccessibilityRenderObject*>(coreObject); … … 889 889 InlineTextBox* box = renderText->firstTextBox(); 890 890 while (box) { 891 gchar *text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());891 gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end()); 892 892 g_string_append(str, text); 893 893 g_string_append(str, "\n"); … … 918 918 { 919 919 notImplemented(); 920 return NULL;920 return 0; 921 921 } 922 922 … … 930 930 { 931 931 notImplemented(); 932 return NULL;932 return 0; 933 933 } 934 934 … … 936 936 { 937 937 notImplemented(); 938 return NULL;938 return 0; 939 939 } 940 940 … … 981 981 } 982 982 983 static bool selectionBelongsToObject(AccessibilityObject *coreObject, VisibleSelection& selection)983 static bool selectionBelongsToObject(AccessibilityObject* coreObject, VisibleSelection& selection) 984 984 { 985 985 if (!coreObject->isAccessibilityRenderObject()) … … 1016 1016 if (selection_num != 0 || !selectionBelongsToObject(coreObject, selection)) { 1017 1017 *start_offset = *end_offset = 0; 1018 return NULL;1018 return 0; 1019 1019 } 1020 1020 … … 1202 1202 AccessibilityObject* target = core(component)->doAccessibilityHitTest(pos); 1203 1203 if (!target) 1204 return NULL;1204 return 0; 1205 1205 g_object_ref(target->wrapper()); 1206 1206 return target->wrapper(); … … 1219 1219 } 1220 1220 1221 static void atk_component_interface_init(AtkComponentIface *iface)1221 static void atk_component_interface_init(AtkComponentIface* iface) 1222 1222 { 1223 1223 iface->ref_accessible_at_point = webkit_accessible_component_ref_accessible_at_point; … … 1266 1266 } 1267 1267 1268 static gint cellIndex(AccessibilityTableCell* AXCell, AccessibilityTable* AXTable)1268 static gint cellIndex(AccessibilityTableCell* axCell, AccessibilityTable* axTable) 1269 1269 { 1270 1270 // Calculate the cell's index as if we had a traditional Gtk+ table in 1271 1271 // which cells are all direct children of the table, arranged row-first. 1272 1272 AccessibilityObject::AccessibilityChildrenVector allCells; 1273 AXTable->cells(allCells);1273 axTable->cells(allCells); 1274 1274 AccessibilityObject::AccessibilityChildrenVector::iterator position; 1275 position = std::find(allCells.begin(), allCells.end(), AXCell);1275 position = std::find(allCells.begin(), allCells.end(), axCell); 1276 1276 if (position == allCells.end()) 1277 1277 return -1; … … 1295 1295 static AtkObject* webkit_accessible_table_ref_at(AtkTable* table, gint row, gint column) 1296 1296 { 1297 AccessibilityTableCell* AXCell = cell(table, row, column);1298 if (! AXCell)1299 return 0; 1300 return AXCell->wrapper();1297 AccessibilityTableCell* axCell = cell(table, row, column); 1298 if (!axCell) 1299 return 0; 1300 return axCell->wrapper(); 1301 1301 } 1302 1302 1303 1303 static gint webkit_accessible_table_get_index_at(AtkTable* table, gint row, gint column) 1304 1304 { 1305 AccessibilityTableCell* AXCell = cell(table, row, column);1306 AccessibilityTable* AXTable = static_cast<AccessibilityTable*>(core(table));1307 return cellIndex( AXCell, AXTable);1305 AccessibilityTableCell* axCell = cell(table, row, column); 1306 AccessibilityTable* axTable = static_cast<AccessibilityTable*>(core(table)); 1307 return cellIndex(axCell, axTable); 1308 1308 } 1309 1309 … … 1348 1348 static gint webkit_accessible_table_get_column_extent_at(AtkTable* table, gint row, gint column) 1349 1349 { 1350 AccessibilityTableCell* AXCell = cell(table, row, column);1351 if ( AXCell) {1350 AccessibilityTableCell* axCell = cell(table, row, column); 1351 if (axCell) { 1352 1352 pair<int, int> columnRange; 1353 AXCell->columnIndexRange(columnRange);1353 axCell->columnIndexRange(columnRange); 1354 1354 return columnRange.second; 1355 1355 } … … 1359 1359 static gint webkit_accessible_table_get_row_extent_at(AtkTable* table, gint row, gint column) 1360 1360 { 1361 AccessibilityTableCell* AXCell = cell(table, row, column);1362 if ( AXCell) {1361 AccessibilityTableCell* axCell = cell(table, row, column); 1362 if (axCell) { 1363 1363 pair<int, int> rowRange; 1364 AXCell->rowIndexRange(rowRange);1364 axCell->rowIndexRange(rowRange); 1365 1365 return rowRange.second; 1366 1366 } … … 1499 1499 static const GInterfaceInfo AtkInterfacesInitFunctions[] = { 1500 1500 {(GInterfaceInitFunc)atk_action_interface_init, 1501 (GInterfaceFinalizeFunc) NULL, NULL},1501 (GInterfaceFinalizeFunc) 0, 0}, 1502 1502 {(GInterfaceInitFunc)atk_selection_interface_init, 1503 (GInterfaceFinalizeFunc) NULL, NULL},1503 (GInterfaceFinalizeFunc) 0, 0}, 1504 1504 {(GInterfaceInitFunc)atk_editable_text_interface_init, 1505 (GInterfaceFinalizeFunc) NULL, NULL},1505 (GInterfaceFinalizeFunc) 0, 0}, 1506 1506 {(GInterfaceInitFunc)atk_text_interface_init, 1507 (GInterfaceFinalizeFunc) NULL, NULL},1507 (GInterfaceFinalizeFunc) 0, 0}, 1508 1508 {(GInterfaceInitFunc)atk_component_interface_init, 1509 (GInterfaceFinalizeFunc) NULL, NULL},1509 (GInterfaceFinalizeFunc) 0, 0}, 1510 1510 {(GInterfaceInitFunc)atk_image_interface_init, 1511 (GInterfaceFinalizeFunc) NULL, NULL},1511 (GInterfaceFinalizeFunc) 0, 0}, 1512 1512 {(GInterfaceInitFunc)atk_table_interface_init, 1513 (GInterfaceFinalizeFunc) NULL, NULL},1513 (GInterfaceFinalizeFunc) 0, 0}, 1514 1514 {(GInterfaceInitFunc)atk_document_interface_init, 1515 (GInterfaceFinalizeFunc) NULL, NULL}1515 (GInterfaceFinalizeFunc) 0, 0} 1516 1516 }; 1517 1517 … … 1596 1596 #define WAI_TYPE_NAME_LEN (30) /* Enough for prefix + 5 hex characters (max) */ 1597 1597 static char name[WAI_TYPE_NAME_LEN + 1]; 1598 1598 1599 1599 g_sprintf(name, "WAIType%x", interfaceMask); 1600 1600 name[WAI_TYPE_NAME_LEN] = '\0'; 1601 1601 1602 1602 return name; 1603 1603 } … … 1607 1607 static const GTypeInfo typeInfo = { 1608 1608 sizeof(WebKitAccessibleClass), 1609 (GBaseInitFunc) NULL,1610 (GBaseFinalizeFunc) NULL,1611 (GClassInitFunc) NULL,1612 (GClassFinalizeFunc) NULL,1613 NULL, /* class data */1609 (GBaseInitFunc) 0, 1610 (GBaseFinalizeFunc) 0, 1611 (GClassInitFunc) 0, 1612 (GClassFinalizeFunc) 0, 1613 0, /* class data */ 1614 1614 sizeof(WebKitAccessible), /* instance size */ 1615 1615 0, /* nb preallocs */ 1616 (GInstanceInitFunc) NULL,1617 NULL/* value table */1616 (GInstanceInitFunc) 0, 1617 0 /* value table */ 1618 1618 }; 1619 1619 … … 1640 1640 { 1641 1641 GType type = getAccessibilityTypeFromObject(coreObject); 1642 AtkObject* object = static_cast<AtkObject*>(g_object_new(type, NULL));1642 AtkObject* object = static_cast<AtkObject*>(g_object_new(type, 0)); 1643 1643 1644 1644 atk_object_initialize(object, coreObject);
Note: See TracChangeset
for help on using the changeset viewer.