예제 #1
0
/**
 * cr_font_size_adjust_destroy:
 * @a_this: the current instance of #CRFontSizeAdjust.
 *
 */
void
cr_font_size_adjust_destroy (CRFontSizeAdjust * a_this)
{
        g_return_if_fail (a_this);

        if (a_this->type == FONT_SIZE_ADJUST_NUMBER && a_this->num) {
                cr_num_destroy (a_this->num);
                a_this->num = NULL;
        }
}
예제 #2
0
파일: cr-term.c 프로젝트: vabz7867/inkscape
static void
cr_term_clear (CRTerm * a_this)
{
    g_return_if_fail (a_this);

    switch (a_this->type) {
    case TERM_NUMBER:
        if (a_this->content.num) {
            cr_num_destroy (a_this->content.num);
            a_this->content.num = NULL;
        }
        break;

    case TERM_FUNCTION:
        if (a_this->ext_content.func_param) {
            cr_term_destroy (a_this->ext_content.func_param);
            a_this->ext_content.func_param = NULL;
        }
    case TERM_STRING:
    case TERM_IDENT:
    case TERM_URI:
    case TERM_HASH:
        if (a_this->content.str) {
            cr_string_destroy (a_this->content.str);
            a_this->content.str = NULL;
        }
        break;

    case TERM_RGB:
        if (a_this->content.rgb) {
            cr_rgb_destroy (a_this->content.rgb);
            a_this->content.rgb = NULL;
        }
        break;

    case TERM_UNICODERANGE:
    case TERM_NO_TYPE:
    default:
        break;
    }

    a_this->type = TERM_NO_TYPE;
}
예제 #3
0
파일: cr-token.c 프로젝트: Spin0za/inkscape
/**
 *Frees the attributes of the current instance
 *of #CRtoken.
 *@param a_this the current instance of #CRToken.
 */
static void
cr_token_clear (CRToken * a_this)
{
        g_return_if_fail (a_this);

        switch (a_this->type) {
        case S_TK:
        case CDO_TK:
        case INCLUDES_TK:
        case DASHMATCH_TK:
        case PAGE_SYM_TK:
        case MEDIA_SYM_TK:
        case FONT_FACE_SYM_TK:
        case CHARSET_SYM_TK:
        case IMPORT_SYM_TK:
        case IMPORTANT_SYM_TK:
        case SEMICOLON_TK:
        case NO_TK:
        case DELIM_TK:
        case CBO_TK:
        case CBC_TK:
        case BO_TK:
        case BC_TK:
                break;

        case STRING_TK:
        case IDENT_TK:
        case HASH_TK:
        case URI_TK:
        case FUNCTION_TK:
        case COMMENT_TK:
        case ATKEYWORD_TK:
                if (a_this->u.str) {
                        cr_string_destroy (a_this->u.str);
                        a_this->u.str = NULL;
                }
                break;

        case EMS_TK:
        case EXS_TK:
        case LENGTH_TK:
        case ANGLE_TK:
        case TIME_TK:
        case FREQ_TK:
        case PERCENTAGE_TK:
        case NUMBER_TK:
        case PO_TK:
        case PC_TK:
                if (a_this->u.num) {
                        cr_num_destroy (a_this->u.num);
                        a_this->u.num = NULL;
                }
                break;

        case DIMEN_TK:
                if (a_this->u.num) {
                        cr_num_destroy (a_this->u.num);
                        a_this->u.num = NULL;
                }

                if (a_this->dimen) {
                        cr_string_destroy (a_this->dimen);
                        a_this->dimen = NULL;
                }

                break;

        case RGB_TK:
                if (a_this->u.rgb) {
                        cr_rgb_destroy (a_this->u.rgb) ;
                        a_this->u.rgb = NULL ;
                }
                break ;

        case UNICODERANGE_TK:
                /*not supported yet. */
                break;

        default:
                cr_utils_trace_info ("I don't know how to clear this token\n") ;
                break;
        }

        a_this->type = NO_TK;
}