summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-11-15 11:19:41 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-11-15 11:19:41 +0000
commitf02cd4f80de3b2d54d62958c3f4747908d43eecd (patch)
tree3c18ff0e692f661620bddab3ec76ba64d01452df /src
parentcppcheck: Fix a couple more C-style pointer casts and inefficient vector-empt... (diff)
downloadinkscape-f02cd4f80de3b2d54d62958c3f4747908d43eecd.tar.gz
inkscape-f02cd4f80de3b2d54d62958c3f4747908d43eecd.zip
cppcheck: Simple fixes for src/ui/widget
(bzr r11873)
Diffstat (limited to 'src')
-rw-r--r--src/ui/widget/color-picker.cpp2
-rw-r--r--src/ui/widget/preferences-widget.cpp2
-rw-r--r--src/ui/widget/selected-style.cpp8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp
index e5c542a7c..31fb3096c 100644
--- a/src/ui/widget/color-picker.cpp
+++ b/src/ui/widget/color-picker.cpp
@@ -55,7 +55,7 @@ void ColorPicker::setupDialog(const Glib::ustring &title)
_colorSelectorDialog.hide();
_colorSelectorDialog.set_title (title);
_colorSelectorDialog.set_border_width (4);
- _colorSelector = (SPColorSelector*)sp_color_selector_new(SP_TYPE_COLOR_NOTEBOOK);
+ _colorSelector = SP_COLOR_SELECTOR(sp_color_selector_new(SP_TYPE_COLOR_NOTEBOOK));
_colorSelectorDialog.get_vbox()->pack_start (
*Glib::wrap(&_colorSelector->vbox), true, true, 0);
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index 07145f5f3..b793893c7 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -640,7 +640,7 @@ void PrefCombo::on_changed()
if (this->get_visible()) //only take action if user changed value
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if(_values.size() > 0)
+ if(!_values.empty())
{
prefs->setInt(_prefs_path, _values[this->get_active_row_number()]);
}
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index ee835216d..41d7c8be2 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -300,7 +300,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/)
// List of units should match with Fill/Stroke dialog stroke style width list
for (GSList *l = sp_unit_get_list(SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE); l != NULL; l = l->next) {
- SPUnit const *u = (SPUnit*)l->data;
+ SPUnit const *u = static_cast<SPUnit*>(l->data);
Gtk::RadioMenuItem *mi = Gtk::manage(new Gtk::RadioMenuItem(_sw_group));
mi->add(*(new Gtk::Label(u->abbr, 0.0, 0.5)));
_unit_mis = g_slist_append(_unit_mis, mi);
@@ -451,7 +451,7 @@ SelectedStyle::setDesktop(SPDesktop *desktop)
this )
));
- _sw_unit = (SPUnit *) sp_desktop_namedview(desktop)->doc_units;
+ _sw_unit = const_cast<SPUnit*>(sp_desktop_namedview(desktop)->doc_units);
// Set the doc default unit active in the units list
gint length = g_slist_length(_unit_mis);
@@ -988,13 +988,13 @@ SelectedStyle::update()
if (SP_IS_LINEARGRADIENT (server)) {
SPGradient *vector = SP_GRADIENT(server)->getVector();
- sp_gradient_image_set_gradient ((SPGradientImage *) _gradient_preview_l[i], vector);
+ sp_gradient_image_set_gradient(SP_GRADIENT_IMAGE(_gradient_preview_l[i]), vector);
place->add(_gradient_box_l[i]);
place->set_tooltip_text(__lgradient[i]);
_mode[i] = SS_LGRADIENT;
} else if (SP_IS_RADIALGRADIENT (server)) {
SPGradient *vector = SP_GRADIENT(server)->getVector();
- sp_gradient_image_set_gradient ((SPGradientImage *) _gradient_preview_r[i], vector);
+ sp_gradient_image_set_gradient(SP_GRADIENT_IMAGE(_gradient_preview_r[i]), vector);
place->add(_gradient_box_r[i]);
place->set_tooltip_text(__rgradient[i]);
_mode[i] = SS_RGRADIENT;