summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: adede4a)
raw | patch | inline | side by side (parent: adede4a)
author | mgsloan <mgsloan@users.sourceforge.net> | |
Sat, 26 Aug 2006 01:31:22 +0000 (01:31 +0000) | ||
committer | mgsloan <mgsloan@users.sourceforge.net> | |
Sat, 26 Aug 2006 01:31:22 +0000 (01:31 +0000) |
SVG/XML save/load. Shouldn't cause problems though.
18 files changed:
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index 22ddb54250c2a46c2f99ffe63bf1bb888bdad37c..fbceb4eb5467096df8a220045e8c4af010aa4ef3 100644 (file)
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
// 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 8c6a8402e0a42c9348374b6734fe380b7bbf1c8c..720cebbedc0efbba201efc66060ec85a54dd2eab 100644 (file)
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
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)
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) {
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 cb83c9376eb268feca56338333a7be8e9076c489..64b1174fdbe0a3656db2112ab53a4c204bcb5143 100644 (file)
--- a/src/document-private.h
+++ b/src/document-private.h
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 09bb4e85729da13d2927cbdc5ce37bde63e5841c..c7da41080bd8d3593786aec4b1642c986109b351 100644 (file)
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
* 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) {
);
}
- 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 20bbeb73e10d9ea9f5eb82f2ccac2e236933499d..f403f3aad1ef91811a76b987c69e2a1dab407a66 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
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()) {
// 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);
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 b0afba5ec50e05e7b914eb0cf64ad5845f8a33ae..f957239c16eb4c37a70f0b158d86d060f93f2947 100644 (file)
--- 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);
index 68eb31e7bb0acfc0f6cd9d1cb851a9dd7c7d6492..94b0f6ab4ddd4c14ea11e760b7c529c89a606371 100644 (file)
--- a/src/extension/input.cpp
+++ b/src/extension/input.cpp
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 eadae090fd0bb0570141933ba935364fc7852d92..7f44fb55393515b79e10fed4191105c061427491 100644 (file)
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");
//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");
}
index 41d6e7513666a94e1f75166e02e974f2ff0c3e24..c202129308d88049841643ec3de44787afbedd31 100644 (file)
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
/* 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 f3dea40c76335b2f62b9bf051a9e7a191a6ce487..9c36b5057aa4df5f978a88e120914971b43816eb 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
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]);
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);
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 62a442d0a6483c48de2c2e49eb5b54df4014fad2..b16cd9a1ab27c3caa191602505d8f9cc507b9d6d 100644 (file)
--- 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 372570883791ca552e45ccc3f0613d8aaabd23ae..db2a891509ec282a5d6fef7567bd0e298f3f4f3a 100644 (file)
--- 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 6598a5731f79d99fe9dd9c0d8c236105db1d958b..e6899a3b2a3660adf9c6083d9469ee7f3f87e319 100644 (file)
--- a/src/svg/svg-path.cpp
+++ b/src/svg/svg-path.cpp
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 */
};
}
}
-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;
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
break;
case 'l':
/* lineto */
- if (ctx->param == 2
- || final)
+ if (ctx->param == 2 || final)
{
rsvg_parse_path_default_xy (ctx, 2);
#ifdef VERBOSE
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];
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;
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;
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');
}
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;
}
{
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;
}
}
}
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;
}
}
{
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';
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 , */
}
index 4ac73e48476b049e0cef28f45eb9224501858f5c..25143b9475198de67c19056492f6415e236600a2 100644 (file)
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);
_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");
_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");
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");
index b7839284a02b8baf7568080f0246c442c9b66e10..4628111c10f9512e4a59aa6b0363ba8e0cf391ac 100644 (file)
_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");
index 78ae4213d157a48fb55a7d511c855580d49f9f2c..f7f71e100627e67bfa393b3ab6cd425bc2d764d8 100644 (file)
@@ -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 10f6101b656df3c10039b7c6707291921824a8a7..d4eea0835013cb4a58402f7e0a8068938e48bf4d 100644 (file)
--- a/src/xml/repr-io.cpp
+++ b/src/xml/repr-io.cpp
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)
{
}
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());
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 7d2f7d47422b9435957cd59c7f7128280fae796e..c30dcf66a549c4d13d53ffeae5713c8e6712597e 100644 (file)
--- a/src/xml/repr.h
+++ b/src/xml/repr.h
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);