summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2012-01-03 08:58:04 +0000
committerJon A. Cruz <jon@joncruz.org>2012-01-03 08:58:04 +0000
commit7a6239683da762264133d85d7c79aa06fcc7d725 (patch)
tree71deb81dfdf5699c171ee2d00f819ddd4700b1f5 /src/ui
parentMore deprecated GtkTooltips (diff)
downloadinkscape-7a6239683da762264133d85d7c79aa06fcc7d725.tar.gz
inkscape-7a6239683da762264133d85d7c79aa06fcc7d725.zip
Fixed null-pointer ctor crashes.
(bzr r10828)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp24
-rw-r--r--src/ui/widget/rendering-options.cpp8
-rw-r--r--src/ui/widget/selected-style.cpp18
-rw-r--r--src/ui/widget/style-swatch.cpp15
4 files changed, 46 insertions, 19 deletions
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 8a0808bd8..321cc0789 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -103,7 +103,9 @@ public:
_true_val(tv), _false_val(fv)
{
signal_toggled().connect(signal_attr_changed().make_slot());
- if (tip_text) set_tooltip_text(tip_text);
+ if (tip_text) {
+ set_tooltip_text(tip_text);
+ }
}
Glib::ustring get_as_attribute() const
@@ -135,7 +137,9 @@ public:
: Inkscape::UI::Widget::SpinButton(climb_rate, digits),
AttrWidget(a, def)
{
- if (tip_text) set_tooltip_text(tip_text);
+ if (tip_text) {
+ set_tooltip_text(tip_text);
+ }
set_range(lower, upper);
set_increments(step_inc, 0);
@@ -227,8 +231,12 @@ public:
: AttrWidget(a, def), //TO-DO: receive default num-opt-num as parameter in the constructor
_s1(climb_rate, digits), _s2(climb_rate, digits)
{
- if (tt1) _s1.set_tooltip_text(tt1);
- if (tt2) _s2.set_tooltip_text(tt2);
+ if (tt1) {
+ _s1.set_tooltip_text(tt1);
+ }
+ if (tt2) {
+ _s2.set_tooltip_text(tt2);
+ }
_s1.set_range(lower, upper);
_s2.set_range(lower, upper);
_s1.set_increments(step_inc, 0);
@@ -288,7 +296,9 @@ public:
: AttrWidget(a, def)
{
signal_color_set().connect(signal_attr_changed().make_slot());
- if (tip_text) set_tooltip_text(tip_text);
+ if (tip_text) {
+ set_tooltip_text(tip_text);
+ }
Gdk::Color col;
col.set_rgb(65535, 65535, 65535);
@@ -336,7 +346,9 @@ public:
_tree.show();
add(_tree);
set_shadow_type(Gtk::SHADOW_IN);
- if (tip_text) _tree.set_tooltip_text(tip_text);
+ if (tip_text) {
+ _tree.set_tooltip_text(tip_text);
+ }
}
std::vector<double> get_values() const
diff --git a/src/ui/widget/rendering-options.cpp b/src/ui/widget/rendering-options.cpp
index a8c321d7d..7655f25e3 100644
--- a/src/ui/widget/rendering-options.cpp
+++ b/src/ui/widget/rendering-options.cpp
@@ -40,16 +40,16 @@ RenderingOptions::RenderingOptions () :
false)
{
// set up tooltips
- _radio_vector.set_tooltip_text (Glib::ustring(
+ _radio_vector.set_tooltip_text(
_("Render using Cairo vector operations. "
"The resulting image is usually smaller in file "
"size and can be arbitrarily scaled, but some "
- "filter effects will not be correctly rendered.")));
- _radio_bitmap.set_tooltip_text (Glib::ustring(
+ "filter effects will not be correctly rendered."));
+ _radio_bitmap.set_tooltip_text(
_("Render everything as bitmap. The resulting image "
"is usually larger in file size and cannot be "
"arbitrarily scaled without quality loss, but all "
- "objects will be rendered exactly as displayed.")));
+ "objects will be rendered exactly as displayed."));
set_border_width(2);
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 35d92db7b..afbb52e05 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -70,6 +70,16 @@ ss_subselection_changed( gpointer /*dragger*/, gpointer data )
ss_selection_changed (NULL, data);
}
+namespace {
+
+void clearTooltip( Gtk::Widget &widget )
+{
+ widget.set_tooltip_text("");
+ widget.set_has_tooltip(false);
+}
+
+} // namespace
+
namespace Inkscape {
namespace UI {
namespace Widget {
@@ -904,8 +914,8 @@ SelectedStyle::update()
place->remove();
flag_place->remove();
- place->set_tooltip_text(0);
- flag_place->set_tooltip_text(0);
+ clearTooltip(*place);
+ clearTooltip(*flag_place);
_mode[i] = SS_NA;
_paintserver_id[i].clear();
@@ -1012,8 +1022,8 @@ SelectedStyle::update()
}
// Now query opacity
- _opacity_place.set_tooltip_text(0);
- _opacity_sb.set_tooltip_text(0);
+ clearTooltip(_opacity_place);
+ clearTooltip(_opacity_sb);
int result = sp_desktop_query_style (_desktop, query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp
index 1fdeb39df..759e2ff04 100644
--- a/src/ui/widget/style-swatch.cpp
+++ b/src/ui/widget/style-swatch.cpp
@@ -160,7 +160,10 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
_swatch.signal_button_press_event().connect(sigc::mem_fun(*this, &StyleSwatch::on_click));
- _swatch.set_tooltip_text(main_tip);
+ if (main_tip)
+ {
+ _swatch.set_tooltip_text(main_tip);
+ }
}
void StyleSwatch::setClickVerb(sp_verb_t verb_t) {
@@ -327,8 +330,9 @@ StyleSwatch::setStyle(SPStyle *query)
g_free (str);
}
} else {
- _stroke_width_place.set_tooltip_text(0);
- _stroke_width.set_markup ("");
+ _stroke_width_place.set_tooltip_text("");
+ _stroke_width.set_markup("");
+ _stroke_width.set_has_tooltip(false);
}
gdouble op = SP_SCALE24_TO_FLOAT(query->opacity.value);
@@ -348,8 +352,9 @@ StyleSwatch::setStyle(SPStyle *query)
g_free (str);
}
} else {
- _opacity_place.set_tooltip_text(0);
- _opacity_value.set_markup ("");
+ _opacity_place.set_tooltip_text("");
+ _opacity_value.set_markup("");
+ _opacity_value.set_has_tooltip(false);
}
show_all();