Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

static gboolean class_add_sel_matches_node ( CRAdditionalSel a_add_sel,
CRNodeIface const *  a_node_iface,
CRXMLNodePtr  a_node 
) [static]

Parameters:
a_add_sel the class additional selector to consider.
a_node the xml node to consider.
Returns:
TRUE if the class additional selector matches the xml node given in argument, FALSE otherwise.

Definition at line 222 of file cr-sel-eng.c.

References _CRAdditionalSel::content, cr_utils_is_white_space(), and _CRAdditionalSel::type.

Referenced by additional_selector_matches_node().

{
        gboolean result = FALSE;
        char *klass = NULL;

        g_return_val_if_fail (a_add_sel
                              && a_add_sel->type == CLASS_ADD_SELECTOR
                              && a_add_sel->content.class_name
                              && a_add_sel->content.class_name->stryng
                              && a_add_sel->content.class_name->stryng->str
                              && a_node, FALSE);

        klass = a_node_iface->getProp (a_node, "class");
        if (klass) {
                char const *cur;
                for (cur = klass; cur && *cur; cur++) {
                        while (cur && *cur
                               && cr_utils_is_white_space (*cur) 
                               == TRUE)
                                cur++;

                        if (!strncmp (cur, 
                                      a_add_sel->content.class_name->stryng->str,
                                      a_add_sel->content.class_name->stryng->len)) {
                                cur += a_add_sel->content.class_name->stryng->len;
                                if ((cur && !*cur)
                                    || cr_utils_is_white_space (*cur) == TRUE)
                                        result = TRUE;
                        }
                        if (cur && !*cur)
                                break ;
                }
                a_node_iface->freePropVal (klass);
                klass = NULL;
        }
        return result;

}


Generated by  Doxygen 1.6.0   Back to index