diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2012-01-03 08:58:04 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2012-01-03 08:58:04 +0000 |
| commit | 7a6239683da762264133d85d7c79aa06fcc7d725 (patch) | |
| tree | 71deb81dfdf5699c171ee2d00f819ddd4700b1f5 /src/ui/widget | |
| parent | More deprecated GtkTooltips (diff) | |
| download | inkscape-7a6239683da762264133d85d7c79aa06fcc7d725.tar.gz inkscape-7a6239683da762264133d85d7c79aa06fcc7d725.zip | |
Fixed null-pointer ctor crashes.
(bzr r10828)
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/rendering-options.cpp | 8 | ||||
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 18 | ||||
| -rw-r--r-- | src/ui/widget/style-swatch.cpp | 15 |
3 files changed, 28 insertions, 13 deletions
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(); |
