summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael G. Sloan <mgsloan@gmail.com>2006-08-26 01:31:22 +0000
committermgsloan <mgsloan@users.sourceforge.net>2006-08-26 01:31:22 +0000
commit36a1242bc96b3afee539421ec2c38d9934dd5095 (patch)
tree0148b856984f87a8229675a65753d5ca451d1565 /src
parentFixed a crash in modifying filter parameters in XML editor. (diff)
downloadinkscape-36a1242bc96b3afee539421ec2c38d9934dd5095.tar.gz
inkscape-36a1242bc96b3afee539421ec2c38d9934dd5095.zip
gboolean -> bool conversion commit 1. Modifies code to do with getting the undo system to ignore actions, as well as
SVG/XML save/load. Shouldn't cause problems though. (bzr r1639)
Diffstat (limited to 'src')
-rw-r--r--src/conn-avoid-ref.cpp4
-rw-r--r--src/dialogs/export.cpp20
-rw-r--r--src/document-private.h2
-rw-r--r--src/document-undo.cpp19
-rw-r--r--src/document.cpp8
-rw-r--r--src/document.h4
-rw-r--r--src/extension/input.cpp4
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp5
-rw-r--r--src/extension/system.cpp8
-rw-r--r--src/sp-namedview.cpp12
-rw-r--r--src/sp-object.cpp6
-rw-r--r--src/svg/svg-color.cpp18
-rw-r--r--src/svg/svg-path.cpp72
-rw-r--r--src/ui/widget/registered-widget.cpp16
-rw-r--r--src/ui/widget/tolerance-slider.cpp4
-rw-r--r--src/widgets/gradient-vector.cpp4
-rw-r--r--src/xml/repr-io.cpp16
-rw-r--r--src/xml/repr.h2
18 files changed, 114 insertions, 110 deletions
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index 22ddb5425..fbceb4eb5 100644
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
@@ -273,8 +273,8 @@ void init_avoided_shape_geometry(SPDesktop *desktop)
// Don't count this as changes to the document,
// it is basically just llate initialisation.
SPDocument *document = sp_desktop_document(desktop);
- gboolean saved = sp_document_get_undo_sensitive(document);
- sp_document_set_undo_sensitive(document, FALSE);
+ bool saved = sp_document_get_undo_sensitive(document);
+ sp_document_set_undo_sensitive(document, false);
bool initialised = false;
GSList *items = get_avoided_items(NULL, desktop->currentRoot(), desktop,
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index 8c6a8402e..720cebbed 100644
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
@@ -1098,26 +1098,26 @@ sp_export_export_clicked (GtkButton *button, GtkObject *base)
case SELECTION_DRAWING: {
SPDocument * doc = SP_ACTIVE_DOCUMENT;
Inkscape::XML::Node * repr = sp_document_repr_root(doc);
- bool modified = FALSE;
+ bool modified = false;
const gchar * temp_string;
bool saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive(doc, FALSE);
+ sp_document_set_undo_sensitive(doc, false);
temp_string = repr->attribute("inkscape:export-filename");
if (temp_string == NULL || strcmp(temp_string, filename)) {
repr->setAttribute("inkscape:export-filename", filename);
- modified = TRUE;
+ modified = true;
}
temp_string = repr->attribute("inkscape:export-xdpi");
if (temp_string == NULL || xdpi != atof(temp_string)) {
sp_repr_set_svg_double(repr, "inkscape:export-xdpi", xdpi);
- modified = TRUE;
+ modified = true;
}
temp_string = repr->attribute("inkscape:export-ydpi");
if (temp_string == NULL || xdpi != atof(temp_string)) {
sp_repr_set_svg_double(repr, "inkscape:export-ydpi", ydpi);
- modified = TRUE;
+ modified = true;
}
if (modified)
@@ -1128,10 +1128,10 @@ sp_export_export_clicked (GtkButton *button, GtkObject *base)
case SELECTION_SELECTION: {
const GSList * reprlst;
SPDocument * doc = SP_ACTIVE_DOCUMENT;
- bool modified = FALSE;
+ bool modified = false;
bool saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive(doc, FALSE);
+ sp_document_set_undo_sensitive(doc, false);
reprlst = sp_desktop_selection(SP_ACTIVE_DESKTOP)->reprList();
for(; reprlst != NULL; reprlst = reprlst->next) {
@@ -1145,18 +1145,18 @@ sp_export_export_clicked (GtkButton *button, GtkObject *base)
temp_string = repr->attribute("inkscape:export-filename");
if (temp_string == NULL || strcmp(temp_string, filename)) {
repr->setAttribute("inkscape:export-filename", filename);
- modified = TRUE;
+ modified = true;
}
}
temp_string = repr->attribute("inkscape:export-xdpi");
if (temp_string == NULL || xdpi != atof(temp_string)) {
sp_repr_set_svg_double(repr, "inkscape:export-xdpi", xdpi);
- modified = TRUE;
+ modified = true;
}
temp_string = repr->attribute("inkscape:export-ydpi");
if (temp_string == NULL || xdpi != atof(temp_string)) {
sp_repr_set_svg_double(repr, "inkscape:export-ydpi", ydpi);
- modified = TRUE;
+ modified = true;
}
}
diff --git a/src/document-private.h b/src/document-private.h
index cb83c9376..64b1174fd 100644
--- a/src/document-private.h
+++ b/src/document-private.h
@@ -59,7 +59,7 @@ struct SPDocumentPrivate {
SPDocument::CommitSignal commit_signal;
/* Undo/Redo state */
- guint sensitive: 1; /* If we save actions to undo stack */
+ bool sensitive: true; /* If we save actions to undo stack */
Inkscape::XML::Event * partial; /* partial undo log when interrupted */
int history_size;
GSList * undo; /* Undo stack of reprs */
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 09bb4e857..c7da41080 100644
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
@@ -75,18 +75,18 @@
* Since undo sensitivity needs to be nested, setting undo sensitivity
* should be done like this:
*\verbatim
- gboolean saved = sp_document_get_undo_sensitive(document);
- sp_document_set_undo_sensitive(document, FALSE);
+ bool saved = sp_document_get_undo_sensitive(document);
+ sp_document_set_undo_sensitive(document, false);
... do stuff ...
sp_document_set_undo_sensitive(document, saved); \endverbatim
*/
void
-sp_document_set_undo_sensitive (SPDocument *doc, gboolean sensitive)
+sp_document_set_undo_sensitive (SPDocument *doc, bool sensitive)
{
g_assert (doc != NULL);
g_assert (doc->priv != NULL);
- if ( !(sensitive) == !(doc->priv->sensitive) )
+ if ( sensitive == doc->priv->sensitive )
return;
if (sensitive) {
@@ -98,10 +98,17 @@ sp_document_set_undo_sensitive (SPDocument *doc, gboolean sensitive)
);
}
- doc->priv->sensitive = !!sensitive;
+ doc->priv->sensitive = sensitive;
}
-gboolean sp_document_get_undo_sensitive(SPDocument const *document) {
+/*TODO: Throughout the inkscape code tree set/get_undo_sensitive are used for
+ * as is shown above. Perhaps it makes sense to create new functions,
+ * undo_ignore, and undo_recall to replace the start and end parts of the above.
+ * The main complexity with this is that they have to nest, so you have to store
+ * the saved bools in a stack. Perhaps this is why the above solution is better.
+ */
+
+bool sp_document_get_undo_sensitive(SPDocument const *document) {
g_assert(document != NULL);
g_assert(document->priv != NULL);
diff --git a/src/document.cpp b/src/document.cpp
index 20bbeb73e..f403f3aad 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -308,7 +308,7 @@ sp_document_create(Inkscape::XML::Document *rdoc,
inkscape_ref();
}
- sp_document_set_undo_sensitive(document, TRUE);
+ sp_document_set_undo_sensitive(document, true);
// reset undo key when selection changes, so that same-key actions on different objects are not coalesced
if (!Inkscape::NSApplication::Application::getNewGui()) {
@@ -549,8 +549,8 @@ void sp_document_set_uri(SPDocument *document, gchar const *uri)
// Update saveable repr attributes.
Inkscape::XML::Node *repr = sp_document_repr_root(document);
// changing uri in the document repr must not be not undoable
- gboolean saved = sp_document_get_undo_sensitive(document);
- sp_document_set_undo_sensitive(document, FALSE);
+ bool saved = sp_document_get_undo_sensitive(document);
+ sp_document_set_undo_sensitive(document, false);
if (document->base)
repr->setAttribute("sodipodi:docbase", document->base);
@@ -767,7 +767,7 @@ SPDocument::_updateDocument()
sp_document_setup_viewport (this, &ctx);
bool saved = sp_document_get_undo_sensitive(this);
- sp_document_set_undo_sensitive(this, FALSE);
+ sp_document_set_undo_sensitive(this, false);
this->root->updateDisplay((SPCtx *)&ctx, 0);
diff --git a/src/document.h b/src/document.h
index b0afba5ec..f957239c1 100644
--- a/src/document.h
+++ b/src/document.h
@@ -175,8 +175,8 @@ void sp_document_set_height (SPDocument * document, gdouble height, const SPUnit
* Undo & redo
*/
-void sp_document_set_undo_sensitive (SPDocument * document, gboolean sensitive);
-gboolean sp_document_get_undo_sensitive (SPDocument const * document);
+void sp_document_set_undo_sensitive (SPDocument * document, bool sensitive);
+bool sp_document_get_undo_sensitive (SPDocument const * document);
void sp_document_clear_undo (SPDocument * document);
void sp_document_clear_redo (SPDocument * document);
diff --git a/src/extension/input.cpp b/src/extension/input.cpp
index 68eb31e7b..94b0f6ab4 100644
--- a/src/extension/input.cpp
+++ b/src/extension/input.cpp
@@ -165,8 +165,8 @@ Input::open (const gchar *uri)
if (doc != NULL) {
Inkscape::XML::Node * repr = sp_document_repr_root(doc);
- gboolean saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive (doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive(doc);
+ sp_document_set_undo_sensitive (doc, false);
repr->setAttribute("inkscape:output_extension", output_extension);
sp_document_set_undo_sensitive (doc, saved);
}
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index eadae090f..7f44fb553 100644
--- a/src/extension/internal/gdkpixbuf-input.cpp
+++ b/src/extension/internal/gdkpixbuf-input.cpp
@@ -21,7 +21,8 @@ SPDocument *
GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
{
SPDocument *doc = sp_document_new(NULL, TRUE, TRUE);
- sp_document_set_undo_sensitive(doc, FALSE); // no need to undo in this temporary document
+ bool saved = sp_document_get_undo_sensitive(doc);
+ sp_document_set_undo_sensitive(doc, false); // no need to undo in this temporary document
GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL );
Inkscape::XML::Node *rdoc = sp_document_repr_root(doc);
gchar const *docbase = rdoc->attribute("sodipodi:docbase");
@@ -92,7 +93,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
//alter the canvas size to fit the image size
fit_canvas_to_drawing(doc);
// restore undo, as now this document may be shown to the user if a bitmap was opened
- sp_document_set_undo_sensitive(doc, TRUE);
+ sp_document_set_undo_sensitive(doc, saved);
} else {
printf("GdkPixbuf loader failed\n");
}
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index 41d6e7513..c20212930 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -104,8 +104,8 @@ open(Extension *key, gchar const *filename)
/* This kinda overkill as most of these are already set, but I want
to make sure for this release -- TJG */
Inkscape::XML::Node *repr = sp_document_repr_root(doc);
- gboolean saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive(doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive(doc);
+ sp_document_set_undo_sensitive(doc, false);
repr->setAttribute("sodipodi:modified", NULL);
sp_document_set_undo_sensitive(doc, saved);
@@ -250,10 +250,10 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
if (official) {
// save the filename for next use
sp_document_set_uri(doc, fileName);
- gboolean saved = sp_document_get_undo_sensitive(doc);
+ bool saved = sp_document_get_undo_sensitive(doc);
+ sp_document_set_undo_sensitive (doc, false);
// also save the extension for next use
Inkscape::XML::Node *repr = sp_document_repr_root(doc);
- sp_document_set_undo_sensitive (doc, FALSE);
repr->setAttribute("inkscape:output_extension", omod->get_id());
// set the "dataloss" attribute if the chosen extension is lossy
repr->setAttribute("inkscape:dataloss", NULL);
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index f3dea40c7..9c36b5057 100644
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -687,8 +687,8 @@ void sp_namedview_document_from_window(SPDesktop *desktop)
NR::Rect const r = desktop->get_display_area();
// saving window geometry is not undoable
- gboolean saved = sp_document_get_undo_sensitive(sp_desktop_document(desktop));
- sp_document_set_undo_sensitive(sp_desktop_document(desktop), FALSE);
+ bool saved = sp_document_get_undo_sensitive(sp_desktop_document(desktop));
+ sp_document_set_undo_sensitive(sp_desktop_document(desktop), false);
sp_repr_set_svg_double(view, "inkscape:zoom", desktop->current_zoom());
sp_repr_set_svg_double(view, "inkscape:cx", r.midpoint()[NR::X]);
@@ -771,8 +771,8 @@ void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr)
v = !v;
}
- gboolean saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive(doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive(doc);
+ sp_document_set_undo_sensitive(doc, false);
sp_repr_set_boolean(repr, "showguides", v);
@@ -786,8 +786,8 @@ void sp_namedview_toggle_grid(SPDocument *doc, Inkscape::XML::Node *repr)
sp_repr_get_boolean(repr, "showgrid", &v);
v = !v;
- gboolean saved = sp_document_get_undo_sensitive(doc);
- sp_document_set_undo_sensitive(doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive(doc);
+ sp_document_set_undo_sensitive(doc, false);
sp_repr_set_boolean(repr, "showgrid", v);
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 62a442d0a..b16cd9a1a 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -825,10 +825,10 @@ sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::No
/* Redefine ID, if required */
if ((id == NULL) || (strcmp(id, realid) != 0)) {
- gboolean undo_sensitive=sp_document_get_undo_sensitive(document);
- sp_document_set_undo_sensitive(document, FALSE);
+ bool saved = sp_document_get_undo_sensitive(document);
+ sp_document_set_undo_sensitive(document, false);
object->repr->setAttribute("id", realid);
- sp_document_set_undo_sensitive(document, undo_sensitive);
+ sp_document_set_undo_sensitive(document, saved);
}
}
} else {
diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp
index 372570883..db2a89150 100644
--- a/src/svg/svg-color.cpp
+++ b/src/svg/svg-color.cpp
@@ -235,22 +235,22 @@ internal_sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def)
*end_ptr = str + i;
}
} else if (strneq(str, "rgb(", 4)) {
- gboolean hasp, hasd;
+ bool hasp, hasd;
gchar *s, *e;
gdouble r, g, b;
s = (gchar *) str + 4;
- hasp = FALSE;
- hasd = FALSE;
+ hasp = false;
+ hasd = false;
r = g_ascii_strtod(s, &e);
if (s == e) return def;
s = e;
if (*s == '%') {
- hasp = TRUE;
+ hasp = true;
s += 1;
} else {
- hasd = TRUE;
+ hasd = true;
}
while (*s && g_ascii_isspace(*s)) s += 1;
if (*s != ',') return def;
@@ -260,10 +260,10 @@ internal_sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def)
if (s == e) return def;
s = e;
if (*s == '%') {
- hasp = TRUE;
+ hasp = true;
s += 1;
} else {
- hasd = TRUE;
+ hasd = true;
}
while (*s && g_ascii_isspace(*s)) s += 1;
if (*s != ',') return def;
@@ -273,10 +273,10 @@ internal_sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def)
if (s == e) return def;
s = e;
if (*s == '%') {
- hasp = TRUE;
+ hasp = true;
s += 1;
} else {
- hasd = TRUE;
+ hasd = true;
}
while(*s && g_ascii_isspace(*s)) s += 1;
if (*s != ')') {
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp
index 6598a5731..e6899a3b2 100644
--- a/src/svg/svg-path.cpp
+++ b/src/svg/svg-path.cpp
@@ -63,7 +63,7 @@ struct RSVGParsePathCtx {
double spx, spy; /* beginning of current subpath point */
char cmd; /* current command (lowercase) */
int param; /* parameter number */
- gboolean rel; /* true if relative coords */
+ bool rel; /* true if relative coords */
double params[7]; /* parameters that have been parsed */
};
@@ -221,7 +221,7 @@ static void rsvg_parse_path_default_xy(RSVGParsePathCtx *ctx, int n_params)
}
}
-static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, gboolean final)
+static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, bool final)
{
double x1, y1, x2, y2, x3, y3;
@@ -238,8 +238,7 @@ static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, gboolean final)
switch (ctx->cmd) {
case 'm':
/* moveto */
- if (ctx->param == 2
- || final)
+ if (ctx->param == 2 || final)
{
rsvg_parse_path_default_xy (ctx, 2);
#ifdef VERBOSE
@@ -256,8 +255,7 @@ static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, gboolean final)
break;
case 'l':
/* lineto */
- if (ctx->param == 2
- || final)
+ if (ctx->param == 2 || final)
{
rsvg_parse_path_default_xy (ctx, 2);
#ifdef VERBOSE
@@ -273,8 +271,7 @@ static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, gboolean final)
break;
case 'c':
/* curveto */
- if ( ( ctx->param == 6 )
- || final )
+ if (ctx->param == 6 || final )
{
rsvg_parse_path_default_xy (ctx, 6);
x1 = ctx->params[0];
@@ -298,8 +295,7 @@ static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, gboolean final)
break;
case 's':
/* smooth curveto */
- if ( ( ctx->param == 4 )
- || final )
+ if (ctx->param == 4 || final)
{
rsvg_parse_path_default_xy (ctx, 4);
x1 = 2 * ctx->cpx - ctx->rpx;
@@ -455,10 +451,10 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, const char *data)
int i = 0;
double val = 0;
char c = 0;
- gboolean in_num = FALSE;
- gboolean in_frac = FALSE;
- gboolean in_exp = FALSE;
- gboolean exp_wait_sign = FALSE;
+ bool in_num = false;
+ bool in_frac = false;
+ bool in_exp = false;
+ bool exp_wait_sign = false;
int sign = 0;
int exp = 0;
int exp_sign = 0;
@@ -479,7 +475,7 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, const char *data)
if (in_exp)
{
exp = (exp * 10) + c - '0';
- exp_wait_sign = FALSE;
+ exp_wait_sign = false;
}
else if (in_frac)
val += (frac *= 0.1) * (c - '0');
@@ -488,11 +484,11 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, const char *data)
}
else
{
- in_num = TRUE;
+ in_num = true;
assert(!in_frac && !in_exp);
exp = 0;
exp_sign = 1;
- exp_wait_sign = FALSE;
+ exp_wait_sign = false;
val = c - '0';
sign = 1;
}
@@ -501,23 +497,23 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, const char *data)
{
if (!in_num)
{
- in_num = TRUE;
+ in_num = true;
assert(!in_exp);
exp = 0;
exp_sign = 1;
- exp_wait_sign = FALSE;
+ exp_wait_sign = false;
val = 0;
sign = 1;
}
- in_frac = TRUE;
+ in_frac = true;
frac = 1;
}
else if ((c == 'E' || c == 'e') && in_num)
{
/* fixme: Should we add `&& !in_exp' to the above condition?
* It looks like the current code will parse `1e3e4' (as 1e4). */
- in_exp = TRUE;
- exp_wait_sign = TRUE;
+ in_exp = true;
+ exp_wait_sign = true;
exp = 0;
exp_sign = 1;
}
@@ -568,18 +564,18 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, const char *data)
}
}
ctx->params[ctx->param++] = val;
- rsvg_parse_path_do_cmd (ctx, FALSE);
+ rsvg_parse_path_do_cmd (ctx, false);
if (c=='.') {
- in_num = TRUE;
+ in_num = true;
val = 0;
- in_frac = TRUE;
- in_exp = FALSE;
+ in_frac = true;
+ in_exp = false;
frac = 1;
}
else {
- in_num = FALSE;
- in_frac = FALSE;
- in_exp = FALSE;
+ in_num = false;
+ in_frac = false;
+ in_exp = false;
}
}
@@ -589,17 +585,17 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, const char *data)
{
sign = c == '+' ? 1 : -1;;
val = 0;
- in_num = TRUE;
- in_frac = FALSE;
- in_exp = FALSE;
+ in_num = true;
+ in_frac = false;
+ in_exp = false;
exp = 0;
exp_sign = 1;
- exp_wait_sign = FALSE;
+ exp_wait_sign = false;
}
else if (c == 'z' || c == 'Z')
{
if (ctx->param)
- rsvg_parse_path_do_cmd (ctx, TRUE);
+ rsvg_parse_path_do_cmd (ctx, true);
rsvg_bpath_def_closepath (ctx->bpath);
ctx->cmd = 'm';
@@ -610,16 +606,16 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, const char *data)
else if (c >= 'A' && c <= 'Z' && c != 'E')
{
if (ctx->param)
- rsvg_parse_path_do_cmd (ctx, TRUE);
+ rsvg_parse_path_do_cmd (ctx, true);
ctx->cmd = c + 'a' - 'A';
- ctx->rel = FALSE;
+ ctx->rel = false;
}
else if (c >= 'a' && c <= 'z' && c != 'e')
{
if (ctx->param)
- rsvg_parse_path_do_cmd (ctx, TRUE);
+ rsvg_parse_path_do_cmd (ctx, true);
ctx->cmd = c;
- ctx->rel = TRUE;
+ ctx->rel = true;
}
/* else c _should_ be whitespace or , */
}
diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp
index 4ac73e484..25143b947 100644
--- a/src/ui/widget/registered-widget.cpp
+++ b/src/ui/widget/registered-widget.cpp
@@ -94,8 +94,8 @@ RegisteredCheckButton::on_toggled()
Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
_wr->setUpdating (true);
- gboolean saved = sp_document_get_undo_sensitive (doc);
- sp_document_set_undo_sensitive (doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive (doc);
+ sp_document_set_undo_sensitive (doc, false);
sp_repr_set_boolean(repr, _key.c_str(), _button->get_active());
doc->rroot->setAttribute("sodipodi:modified", "true");
sp_document_set_undo_sensitive (doc, saved);
@@ -152,8 +152,8 @@ RegisteredUnitMenu::on_changed()
_wr->setUpdating (true);
SPDocument *doc = sp_desktop_document(dt);
- gboolean saved = sp_document_get_undo_sensitive (doc);
- sp_document_set_undo_sensitive (doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive (doc);
+ sp_document_set_undo_sensitive (doc, false);
Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
repr->setAttribute(_key.c_str(), os.str().c_str());
doc->rroot->setAttribute("sodipodi:modified", "true");
@@ -220,8 +220,8 @@ RegisteredScalarUnit::on_value_changed()
_wr->setUpdating (true);
SPDocument *doc = sp_desktop_document(dt);
- gboolean saved = sp_document_get_undo_sensitive (doc);
- sp_document_set_undo_sensitive (doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive (doc);
+ sp_document_set_undo_sensitive (doc, false);
Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
repr->setAttribute(_key.c_str(), os.str().c_str());
doc->rroot->setAttribute("sodipodi:modified", "true");
@@ -395,8 +395,8 @@ RegisteredRadioButtonPair::on_value_changed()
bool second = _rb2->get_active();
SPDocument *doc = sp_desktop_document(dt);
- gboolean saved = sp_document_get_undo_sensitive (doc);
- sp_document_set_undo_sensitive (doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive (doc);
+ sp_document_set_undo_sensitive (doc, false);
Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
repr->setAttribute(_key.c_str(), second ? "true" : "false");
doc->rroot->setAttribute("sodipodi:modified", "true");
diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp
index b7839284a..4628111c1 100644
--- a/src/ui/widget/tolerance-slider.cpp
+++ b/src/ui/widget/tolerance-slider.cpp
@@ -163,8 +163,8 @@ ToleranceSlider::update (double val)
_wr->setUpdating (true);
SPDocument *doc = sp_desktop_document(dt);
- gboolean saved = sp_document_get_undo_sensitive (doc);
- sp_document_set_undo_sensitive (doc, FALSE);
+ bool saved = sp_document_get_undo_sensitive (doc);
+ sp_document_set_undo_sensitive (doc, false);
Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
repr->setAttribute(_key.c_str(), os.str().c_str());
doc->rroot->setAttribute("sodipodi:modified", "true");
diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp
index 78ae4213d..f7f71e100 100644
--- a/src/widgets/gradient-vector.cpp
+++ b/src/widgets/gradient-vector.cpp
@@ -1025,8 +1025,8 @@ sp_gradient_vector_widget_load_gradient (GtkWidget *widget, SPGradient *gradient
// Once the user edits a gradient, it stops being auto-collectable
if (SP_OBJECT_REPR(gradient)->attribute("inkscape:collect")) {
SPDocument *document = SP_OBJECT_DOCUMENT (gradient);
- gboolean saved = sp_document_get_undo_sensitive(document);
- sp_document_set_undo_sensitive (document, FALSE);
+ bool saved = sp_document_get_undo_sensitive(document);
+ sp_document_set_undo_sensitive (document, false);
SP_OBJECT_REPR(gradient)->setAttribute("inkscape:collect", NULL);
sp_document_set_undo_sensitive (document, saved);
}
diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp
index 10f6101b6..d4eea0835 100644
--- a/src/xml/repr-io.cpp
+++ b/src/xml/repr-io.cpp
@@ -36,9 +36,9 @@ using Inkscape::XML::AttributeRecord;
static Document *sp_repr_do_read (xmlDocPtr doc, const gchar *default_ns);
static Node *sp_repr_svg_read_node (xmlNodePtr node, const gchar *default_ns, GHashTable *prefix_map);
static gint sp_repr_qualified_name (gchar *p, gint len, xmlNsPtr ns, const xmlChar *name, const gchar *default_ns, GHashTable *prefix_map);
-static void sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitespace, gchar const *default_ns);
-static void sp_repr_write_stream (Node *repr, Writer &out, gint indent_level, gboolean add_whitespace, Glib::QueryQuark elide_prefix);
-static void sp_repr_write_stream_element (Node *repr, Writer &out, gint indent_level, gboolean add_whitespace, Glib::QueryQuark elide_prefix, List<AttributeRecord const> attributes);
+static void sp_repr_write_stream_root_element (Node *repr, Writer &out, bool add_whitespace, gchar const *default_ns);
+static void sp_repr_write_stream (Node *repr, Writer &out, gint indent_level, bool add_whitespace, Glib::QueryQuark elide_prefix);
+static void sp_repr_write_stream_element (Node *repr, Writer &out, gint indent_level, bool add_whitespace, Glib::QueryQuark elide_prefix, List<AttributeRecord const> attributes);
#ifdef HAVE_LIBWMF
static xmlDocPtr sp_wmf_convert (const char * file_name);
@@ -539,7 +539,7 @@ sp_repr_save_stream (Document *doc, FILE *fp, gchar const *default_ns, bool comp
/* Returns TRUE if file successfully saved; FALSE if not
*/
-gboolean
+bool
sp_repr_save_file (Document *doc, const gchar *filename,
gchar const *default_ns)
{
@@ -667,7 +667,7 @@ void populate_ns_map(NSMap &ns_map, Node &repr) {
}
void
-sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitespace, gchar const *default_ns)
+sp_repr_write_stream_root_element (Node *repr, Writer &out, bool add_whitespace, gchar const *default_ns)
{
using Inkscape::Util::ptr_shared;
g_assert(repr != NULL);
@@ -710,7 +710,7 @@ sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitesp
void
sp_repr_write_stream (Node *repr, Writer &out, gint indent_level,
- gboolean add_whitespace, Glib::QueryQuark elide_prefix)
+ bool add_whitespace, Glib::QueryQuark elide_prefix)
{
if (repr->type() == Inkscape::XML::TEXT_NODE) {
repr_quote_write (out, repr->content());
@@ -725,12 +725,12 @@ sp_repr_write_stream (Node *repr, Writer &out, gint indent_level,
void
sp_repr_write_stream_element (Node * repr, Writer & out, gint indent_level,
- gboolean add_whitespace,
+ bool add_whitespace,
Glib::QueryQuark elide_prefix,
List<AttributeRecord const> attributes)
{
Node *child;
- gboolean loose;
+ bool loose;
gint i;
g_return_if_fail (repr != NULL);
diff --git a/src/xml/repr.h b/src/xml/repr.h
index 7d2f7d474..c30dcf66a 100644
--- a/src/xml/repr.h
+++ b/src/xml/repr.h
@@ -180,7 +180,7 @@ inline Inkscape::XML::Node *sp_repr_next(Inkscape::XML::Node *repr) {
Inkscape::XML::Document *sp_repr_read_file(gchar const *filename, gchar const *default_ns);
Inkscape::XML::Document *sp_repr_read_mem(gchar const *buffer, int length, gchar const *default_ns);
void sp_repr_save_stream(Inkscape::XML::Document *doc, FILE *to_file, gchar const *default_ns=NULL, bool compress = false);
-gboolean sp_repr_save_file(Inkscape::XML::Document *doc, gchar const *filename, gchar const *default_ns=NULL);
+bool sp_repr_save_file(Inkscape::XML::Document *doc, gchar const *filename, gchar const *default_ns=NULL);
void sp_repr_print(Inkscape::XML::Node *repr);