Although dom_node_set_user_data() can only return two values (OK, and
out-of-memory) at the moment, it may return others in the future. We
now catch all other return values and convert them into CSS_INVALID.
* \param node Libdom SVG node on which to store the data
* \param libcss_node_data Pointer to the data to store
*
- * \return CSS_OK on success, or CSS_NOMEM on error
+ * \return CSS_OK on success, CSS_NOMEM if libdom runs out of memory,
+ * or CSS_INVALID if any other error occurs
*/
css_error set_libcss_node_data(void *pw, void *node,
void *libcss_node_data)
if (err == DOM_NO_MEM_ERR) {
return CSS_NOMEM;
}
+ else if (err != DOM_NO_ERR) {
+ return CSS_INVALID;
+ }
- /* dom_node_set_user_data() only has two return values, okay
- and not-okay. */
return CSS_OK;
}