Logo Search packages:      
Sourcecode: inkscape version File versions

enum CRStatus cr_style_num_prop_val_to_string ( CRNumPropVal a_prop_val,
GString *  a_str,
guint  a_nb_indent 
)

dump a CRNumpPropVal in a string.

Parameters:
a_prop_val the numerical property value to dump
a_str the string to dump the numerical propertie into. Note that the string value is appended to a_str.
a_nb_indent the number white chars of indentation.

Definition at line 2322 of file cr-style.c.

{
        enum CRStatus status = CR_OK;
        guchar *tmp_str = NULL;
        GString *str = NULL;

        g_return_val_if_fail (a_prop_val && a_str, CR_BAD_PARAM_ERROR);

        str = g_string_new (NULL);
        cr_utils_dump_n_chars2 (' ', str, a_nb_indent);
        g_string_append (str, "NumPropVal {");
        tmp_str = cr_num_to_string (&a_prop_val->sv);
        if (!tmp_str) {
                status = CR_ERROR;
                goto cleanup;
        }
        g_string_append_printf (str, "sv: %s ", tmp_str);
        g_free (tmp_str);
        tmp_str = NULL;
        
        tmp_str = cr_num_to_string (&a_prop_val->cv);
        if (!tmp_str) {
                status = CR_ERROR;
                goto cleanup;
        }
        g_string_append_printf (str, "cv: %s ", tmp_str);
        g_free (tmp_str);
        tmp_str = NULL;

        tmp_str = cr_num_to_string (&a_prop_val->av);
        if (!tmp_str) {
                status = CR_ERROR;
                goto cleanup;
        }
        g_string_append_printf (str, "av: %s ", tmp_str);
        g_free (tmp_str);
        tmp_str = NULL;
        g_string_append (str, "}");
        g_string_append (a_str, str->str);
        status = CR_OK;
      cleanup:

        if (tmp_str) {
                g_free (tmp_str);
                tmp_str = NULL;
        }
        if (str) {
                g_string_free (str, TRUE);
        }
        return status;
}


Generated by  Doxygen 1.6.0   Back to index