summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-10-25 05:33:24 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-10-25 05:33:24 +0000
commit4da0f782dab1c1706be555e8de68552ab5e20a31 (patch)
tree10aab4ecda45783ff1074cba8116dee39afc2573 /src
parentpreserve clip/mask for stroke-to-path also (diff)
downloadinkscape-4da0f782dab1c1706be555e8de68552ab5e20a31.tar.gz
inkscape-4da0f782dab1c1706be555e8de68552ab5e20a31.zip
switch pref/repr utility methods to using long long ints; with
out it, we cannot even store an rgba32 color in an attribute\! (bzr r1860)
Diffstat (limited to 'src')
-rw-r--r--src/prefs-utils.cpp12
-rw-r--r--src/prefs-utils.h6
-rw-r--r--src/xml/repr-util.cpp4
-rw-r--r--src/xml/repr.h2
4 files changed, 12 insertions, 12 deletions
diff --git a/src/prefs-utils.cpp b/src/prefs-utils.cpp
index a0851a354..e365966bd 100644
--- a/src/prefs-utils.cpp
+++ b/src/prefs-utils.cpp
@@ -19,7 +19,7 @@
void
-prefs_set_int_attribute(gchar const *path, gchar const *attr, gint value)
+prefs_set_int_attribute(gchar const *path, gchar const *attr, long long int value)
{
Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE, path);
if (repr) {
@@ -27,8 +27,8 @@ prefs_set_int_attribute(gchar const *path, gchar const *attr, gint value)
}
}
-gint
-prefs_get_int_attribute(gchar const *path, gchar const *attr, gint def)
+long long int
+prefs_get_int_attribute(gchar const *path, gchar const *attr, long long int def)
{
Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE, path);
if (repr) {
@@ -41,12 +41,12 @@ prefs_get_int_attribute(gchar const *path, gchar const *attr, gint def)
/**
\brief Retrieves an int attribute guarding against screwed-up data; if the value is beyond limits, default is returned
*/
-gint
-prefs_get_int_attribute_limited(gchar const *path, gchar const *attr, gint def, gint min, gint max)
+long long int
+prefs_get_int_attribute_limited(gchar const *path, gchar const *attr, long long int def, long long int min, long long int max)
{
Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE, path);
if (repr) {
- gint const v = sp_repr_get_int_attribute(repr, attr, def);
+ long long int const v = sp_repr_get_int_attribute(repr, attr, def);
if (v >= min && v <= max) {
return v;
} else {
diff --git a/src/prefs-utils.h b/src/prefs-utils.h
index 3cd2998e5..1293ca5b8 100644
--- a/src/prefs-utils.h
+++ b/src/prefs-utils.h
@@ -14,9 +14,9 @@
#include <glib/gtypes.h>
-void prefs_set_int_attribute(gchar const *path, gchar const *attr, gint value);
-gint prefs_get_int_attribute(gchar const *path, gchar const *attr, gint def);
-gint prefs_get_int_attribute_limited(gchar const *path, gchar const *attr, gint def, gint min, gint max);
+void prefs_set_int_attribute(gchar const *path, gchar const *attr, long long int value);
+long long int prefs_get_int_attribute(gchar const *path, gchar const *attr, long long int def);
+long long int prefs_get_int_attribute_limited(gchar const *path, gchar const *attr, long long int def, long long int min, long long int max);
void prefs_set_double_attribute(gchar const *path, gchar const *attr, double value);
double prefs_get_double_attribute(gchar const *path, gchar const *attr, double def);
diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp
index 83231e5da..42b957d43 100644
--- a/src/xml/repr-util.cpp
+++ b/src/xml/repr-util.cpp
@@ -319,7 +319,7 @@ double sp_repr_get_double_attribute(Inkscape::XML::Node *repr, char const *key,
return g_ascii_strtod(result, NULL);
}
-int sp_repr_get_int_attribute(Inkscape::XML::Node *repr, char const *key, int def)
+long long int sp_repr_get_int_attribute(Inkscape::XML::Node *repr, char const *key, long long int def)
{
char *result;
@@ -330,7 +330,7 @@ int sp_repr_get_int_attribute(Inkscape::XML::Node *repr, char const *key, int de
if (result == NULL) return def;
- return atoi(result);
+ return atoll(result);
}
/**
diff --git a/src/xml/repr.h b/src/xml/repr.h
index c30dcf66a..dc96cb3e6 100644
--- a/src/xml/repr.h
+++ b/src/xml/repr.h
@@ -227,7 +227,7 @@ unsigned sp_repr_set_svg_double(Inkscape::XML::Node *repr, gchar const *key, dou
/// \deprecated !
double sp_repr_get_double_attribute(Inkscape::XML::Node *repr, gchar const *key, double def);
/// \deprecated !
-int sp_repr_get_int_attribute(Inkscape::XML::Node *repr, gchar const *key, int def);
+long long int sp_repr_get_int_attribute(Inkscape::XML::Node *repr, gchar const *key, long long int def);
/* End Deprecated? */
int sp_repr_compare_position(Inkscape::XML::Node *first, Inkscape::XML::Node *second);