projects
/
platform
/
core
/
uifw
/
at-spi2-atk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some refactoring to remove duplicate code and other clean-ups
[platform/core/uifw/at-spi2-atk.git]
/
atk-adaptor
/
adaptors
/
table-adaptor.c
diff --git
a/atk-adaptor/adaptors/table-adaptor.c
b/atk-adaptor/adaptors/table-adaptor.c
index
76e4cd6
..
26fec2b
100644
(file)
--- a/
atk-adaptor/adaptors/table-adaptor.c
+++ b/
atk-adaptor/adaptors/table-adaptor.c
@@
-25,7
+25,7
@@
#include <atk/atk.h>
#include <droute/droute.h>
#include <atk/atk.h>
#include <droute/droute.h>
-#include "
common/
spi-dbus.h"
+#include "spi-dbus.h"
#include "object.h"
#include "introspection.h"
#include "object.h"
#include "introspection.h"
@@
-95,6
+95,7
@@
impl_GetAccessibleAt (DBusConnection * bus, DBusMessage * message,
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row, column;
{
AtkTable *table = (AtkTable *) user_data;
dbus_int32_t row, column;
+ DBusMessage *reply;
DBusError error;
AtkObject *obj;
DBusError error;
AtkObject *obj;
@@
-108,7
+109,10
@@
impl_GetAccessibleAt (DBusConnection * bus, DBusMessage * message,
return droute_invalid_arguments_error (message);
}
obj = atk_table_ref_at (table, row, column);
return droute_invalid_arguments_error (message);
}
obj = atk_table_ref_at (table, row, column);
- return spi_object_return_reference (message, obj);
+ reply = spi_object_return_reference (message, obj);
+ g_object_unref (obj);
+
+ return reply;
}
static DBusMessage *
}
static DBusMessage *
@@
-195,6
+199,19
@@
impl_GetColumnAtIndex (DBusConnection * bus, DBusMessage * message,
return reply;
}
return reply;
}
+static const gchar *
+validate_unallocated_string (const gchar *str)
+{
+ if (!str)
+ return "";
+ if (!g_utf8_validate (str, -1, NULL))
+ {
+ g_warning ("atk-bridge: received bad UTF-8 string from a table function");
+ return "";
+ }
+ return str;
+}
+
static DBusMessage *
impl_GetRowDescription (DBusConnection * bus, DBusMessage * message,
void *user_data)
static DBusMessage *
impl_GetRowDescription (DBusConnection * bus, DBusMessage * message,
void *user_data)
@@
-214,8
+231,7
@@
impl_GetRowDescription (DBusConnection * bus, DBusMessage * message,
return droute_invalid_arguments_error (message);
}
description = atk_table_get_row_description (table, row);
return droute_invalid_arguments_error (message);
}
description = atk_table_get_row_description (table, row);
- if (!description)
- description = "";
+ description = validate_unallocated_string (description);
reply = dbus_message_new_method_return (message);
if (reply)
{
reply = dbus_message_new_method_return (message);
if (reply)
{
@@
-244,8
+260,7
@@
impl_GetColumnDescription (DBusConnection * bus, DBusMessage * message,
return droute_invalid_arguments_error (message);
}
description = atk_table_get_column_description (table, column);
return droute_invalid_arguments_error (message);
}
description = atk_table_get_column_description (table, column);
- if (!description)
- description = "";
+ description = validate_unallocated_string (description);
reply = dbus_message_new_method_return (message);
if (reply)
{
reply = dbus_message_new_method_return (message);
if (reply)
{
@@
-352,7
+367,6
@@
impl_GetColumnHeader (DBusConnection * bus, DBusMessage * message,
return droute_invalid_arguments_error (message);
}
obj = atk_table_get_column_header (table, column);
return droute_invalid_arguments_error (message);
}
obj = atk_table_get_column_header (table, column);
- obj = atk_table_get_column_header (table, column);
return spi_object_return_reference (message, obj);
}
return spi_object_return_reference (message, obj);
}
@@
-678,8
+692,8
@@
static DRouteProperty properties[] = {
{impl_get_NColumns, NULL, "NColumns"},
{impl_get_Caption, NULL, "Caption"},
{impl_get_Summary, NULL, "Summary"},
{impl_get_NColumns, NULL, "NColumns"},
{impl_get_Caption, NULL, "Caption"},
{impl_get_Summary, NULL, "Summary"},
- {impl_get_NSelectedRows, NULL, "
n
SelectedRows"},
- {impl_get_NSelectedColumns, NULL, "
n
SelectedColumns"},
+ {impl_get_NSelectedRows, NULL, "
N
SelectedRows"},
+ {impl_get_NSelectedColumns, NULL, "
N
SelectedColumns"},
{NULL, NULL, NULL}
};
{NULL, NULL, NULL}
};
@@
-687,5
+701,5
@@
void
spi_initialize_table (DRoutePath * path)
{
droute_path_add_interface (path,
spi_initialize_table (DRoutePath * path)
{
droute_path_add_interface (path,
-
SPI_DBUS_INTERFACE_TABLE, spi_org_freedesktop
_atspi_Table, methods, properties);
+
ATSPI_DBUS_INTERFACE_TABLE, spi_org_a11y
_atspi_Table, methods, properties);
};
};