[glabels/glabels_2_2] Fixed merge inconsistencies and crash
- From: Jim Evins <jimevins src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glabels/glabels_2_2] Fixed merge inconsistencies and crash
- Date: Thu, 5 Nov 2009 04:02:23 +0000 (UTC)
commit a2ad57fa1a0c1e826ff1b758a3baeed263d4b1a8
Author: Jim Evins <evins snaught com>
Date: Wed Nov 4 23:00:42 2009 -0500
Fixed merge inconsistencies and crash
merge.c:
Fixed crash when trying to print when a "key" radio has been selected
but no key has been selected yet.
object-editor-*-page.c:
Fixed potential inconsistencies with "key" radio buttons when a merge
source has not been selected but the field indicates that it is using a
merge key. This can happen when opening a glabels file that has a merg
type not supported by the current instance of glabels.
xml-label.c:
Also when parsing a merge field that has a merge type not supported,
don't continue parsing it.
src/merge.c | 2 +-
src/object-editor-bc-page.c | 2 +-
src/object-editor-data-page.c | 2 +-
src/object-editor-fill-page.c | 2 +-
src/object-editor-image-page.c | 2 +-
src/object-editor-line-page.c | 2 +-
src/object-editor-shadow-page.c | 2 +-
src/object-editor-text-page.c | 2 +-
src/xml-label.c | 13 ++++++++-----
9 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/src/merge.c b/src/merge.c
index 8af027f..4eecac3 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -685,7 +685,7 @@ gl_merge_eval_key (glMergeRecord *record,
gl_debug (DEBUG_MERGE, "START");
- if ( (record != NULL) ) {
+ if ( (record != NULL) && (key != NULL) ) {
for (p = record->field_list; p != NULL; p = p->next) {
field = (glMergeField *) p->data;
diff --git a/src/object-editor-bc-page.c b/src/object-editor-bc-page.c
index 464029e..0216d6c 100644
--- a/src/object-editor-bc-page.c
+++ b/src/object-editor-bc-page.c
@@ -342,7 +342,7 @@ gl_object_editor_set_bc_color (glObjectEditor *editor,
g_free (gdk_color);
}
- if (!color_node->field_flag) {
+ if (!color_node->field_flag || !merge_flag) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->bc_color_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE);
diff --git a/src/object-editor-data-page.c b/src/object-editor-data-page.c
index 449d3e2..1717845 100644
--- a/src/object-editor-data-page.c
+++ b/src/object-editor-data-page.c
@@ -155,7 +155,7 @@ gl_object_editor_set_data (glObjectEditor *editor,
gtk_widget_set_sensitive (editor->priv->data_key_radio, merge_flag);
- if (!text_node->field_flag) {
+ if (!text_node->field_flag || !merge_flag) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->data_literal_radio), TRUE);
diff --git a/src/object-editor-fill-page.c b/src/object-editor-fill-page.c
index c40f8a1..4daedab 100644
--- a/src/object-editor-fill-page.c
+++ b/src/object-editor-fill-page.c
@@ -143,7 +143,7 @@ gl_object_editor_set_fill_color (glObjectEditor *editor,
}
- if (!color_node->field_flag) {
+ if (!color_node->field_flag || !merge_flag) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->fill_color_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE);
diff --git a/src/object-editor-image-page.c b/src/object-editor-image-page.c
index a975ab2..1433913 100644
--- a/src/object-editor-image-page.c
+++ b/src/object-editor-image-page.c
@@ -159,7 +159,7 @@ gl_object_editor_set_image (glObjectEditor *editor,
gtk_widget_set_sensitive (editor->priv->img_key_radio, merge_flag);
- if (!text_node->field_flag) {
+ if (!text_node->field_flag || !merge_flag) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->img_file_radio), TRUE);
diff --git a/src/object-editor-line-page.c b/src/object-editor-line-page.c
index a9daf76..c2f6450 100644
--- a/src/object-editor-line-page.c
+++ b/src/object-editor-line-page.c
@@ -190,7 +190,7 @@ gl_object_editor_set_line_color (glObjectEditor *editor,
}
- if (!color_node->field_flag) {
+ if (!color_node->field_flag || !merge_flag) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->line_color_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE);
diff --git a/src/object-editor-shadow-page.c b/src/object-editor-shadow-page.c
index 4be309e..bf297da 100644
--- a/src/object-editor-shadow-page.c
+++ b/src/object-editor-shadow-page.c
@@ -231,7 +231,7 @@ gl_object_editor_set_shadow_color (glObjectEditor *editor,
}
- if (!color_node->field_flag) {
+ if (!color_node->field_flag || !merge_flag) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->shadow_color_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE);
diff --git a/src/object-editor-text-page.c b/src/object-editor-text-page.c
index e8a463d..d283531 100644
--- a/src/object-editor-text-page.c
+++ b/src/object-editor-text-page.c
@@ -476,7 +476,7 @@ gl_object_editor_set_text_color (glObjectEditor *editor,
g_free (gdk_color);
}
- if (!text_color_node->field_flag) {
+ if (!text_color_node->field_flag || !merge_flag) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->text_color_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE);
diff --git a/src/xml-label.c b/src/xml-label.c
index 0f8e104..5a56d8c 100644
--- a/src/xml-label.c
+++ b/src/xml-label.c
@@ -809,13 +809,16 @@ xml_parse_merge_fields (xmlNodePtr node,
merge = gl_merge_new (string);
g_free (string);
- string = lgl_xml_get_prop_string (node, "src", NULL);
- gl_merge_set_src (merge, string);
- g_free (string);
+ if (merge)
+ {
+ string = lgl_xml_get_prop_string (node, "src", NULL);
+ gl_merge_set_src (merge, string);
+ g_free (string);
- gl_label_set_merge (label, merge);
+ gl_label_set_merge (label, merge);
- g_object_unref (G_OBJECT(merge));
+ g_object_unref (G_OBJECT(merge));
+ }
gl_debug (DEBUG_XML, "END");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]