~ubuntu-branches/debian/experimental/inkscape/experimental

« back to all changes in this revision

Viewing changes to src/prefs-utils.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
 
21
21
void
22
 
prefs_set_int_attribute(gchar const *path, gchar const *attr, gint value)
 
22
prefs_set_int_attribute(gchar const *path, gchar const *attr, long long int value)
23
23
{
24
24
    Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE, path);
25
25
    if (repr) {
27
27
    }
28
28
}
29
29
 
30
 
gint
31
 
prefs_get_int_attribute(gchar const *path, gchar const *attr, gint def)
 
30
long long int
 
31
prefs_get_int_attribute(gchar const *path, gchar const *attr, long long int def)
32
32
{
33
33
    Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE, path);
34
34
    if (repr) {
41
41
/**
42
42
\brief Retrieves an int attribute guarding against screwed-up data; if the value is beyond limits, default is returned
43
43
*/
44
 
gint
45
 
prefs_get_int_attribute_limited(gchar const *path, gchar const *attr, gint def, gint min, gint max)
 
44
long long int
 
45
prefs_get_int_attribute_limited(gchar const *path, gchar const *attr, long long int def, long long int min, long long int max)
46
46
{
47
47
    Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE, path);
48
48
    if (repr) {
49
 
        gint const v = sp_repr_get_int_attribute(repr, attr, def);
 
49
        long long int const v = sp_repr_get_int_attribute(repr, attr, def);
50
50
        if (v >= min && v <= max) {
51
51
            return v;
52
52
        } else {
143
143
                if (child) {
144
144
                    recent->changeOrder(child, NULL);
145
145
                } else {
146
 
                    child = sp_repr_new("document");
 
146
                    child = recent->document()->createElement("document");
147
147
                    child->setAttribute("uri", uri);
148
148
                    recent->addChild(child, NULL);
149
149
                }