[gimp] Bug 742159 - Empty gradient in loaded tool preset
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 742159 - Empty gradient in loaded tool preset
- Date: Sun, 25 Jan 2015 15:20:40 +0000 (UTC)
commit ba69862a44d602b5321d689f20dd612919604e5b
Author: Michael Natterer <mitch gimp org>
Date: Sun Jan 25 16:13:04 2015 +0100
Bug 742159 - Empty gradient in loaded tool preset
gimp_tool_preset_deserialize_property(): initialize all object
properties (brush, pattern, gradient, ...) of the preset's
GimpToolOptions with non-NULL values from the user context,
so loading a broken preset never results in NULL objects being
used.
app/core/gimptoolpreset.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimptoolpreset.c b/app/core/gimptoolpreset.c
index ece584e..b4c6003 100644
--- a/app/core/gimptoolpreset.c
+++ b/app/core/gimptoolpreset.c
@@ -374,6 +374,20 @@ gimp_tool_preset_deserialize_property (GimpConfig *config,
"gimp", tool_preset->gimp,
NULL);
+ /* Initialize all GimpContext object properties that can be
+ * used by presets with some non-NULL object, so loading a
+ * broken preset won't leave us with NULL objects that have
+ * bad effects. See bug #742159.
+ */
+ gimp_context_copy_properties (gimp_get_user_context (tool_preset->gimp),
+ GIMP_CONTEXT (options),
+ GIMP_CONTEXT_BRUSH_MASK |
+ GIMP_CONTEXT_DYNAMICS_MASK |
+ GIMP_CONTEXT_PATTERN_MASK |
+ GIMP_CONTEXT_GRADIENT_MASK |
+ GIMP_CONTEXT_PALETTE_MASK |
+ GIMP_CONTEXT_FONT_MASK);
+
if (! GIMP_CONFIG_GET_INTERFACE (options)->deserialize (GIMP_CONFIG (options),
scanner, 1,
NULL))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]