diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-03-07 17:19:18 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-03-07 17:19:18 +0000 |
| commit | 2eb76fb0bd4b8572866d3c2390eaa82747890292 (patch) | |
| tree | 673eb8fdedd2cc54fd48347fb59cc5e1e20f8508 /src/ui | |
| parent | Translations. Greek translation update by Dimitris Spingos. (diff) | |
| download | inkscape-2eb76fb0bd4b8572866d3c2390eaa82747890292.tar.gz inkscape-2eb76fb0bd4b8572866d3c2390eaa82747890292.zip | |
cppcheck
(bzr r11052)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/icon-preview.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/object-attributes.cpp | 6 | ||||
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.cpp | 24 | ||||
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 2 |
4 files changed, 17 insertions, 17 deletions
diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index d102e5779..19cdea9bc 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -199,12 +199,12 @@ IconPreviewPanel::IconPreviewPanel() : Gtk::Alignment *align = Gtk::manage(new Gtk::Alignment(0.5, 0.5, 0, 0)); align->add(*buttons[i]); - int pad = 12; if ( !pack || ( (avail == 0) && (previous == 0) ) ) { verts->pack_end(*align, Gtk::PACK_SHRINK); previous = sizes[i]; avail = sizes[i]; } else { + int pad = 12; if ((avail < pad) || ((sizes[i] > avail) && (sizes[i] < previous))) { horiz = 0; } diff --git a/src/ui/dialog/object-attributes.cpp b/src/ui/dialog/object-attributes.cpp index a1c747ce8..74deffb06 100644 --- a/src/ui/dialog/object-attributes.cpp +++ b/src/ui/dialog/object-attributes.cpp @@ -79,8 +79,8 @@ ObjectAttributes::ObjectAttributes (void) : subselChangedConn(), selectModifiedConn() { - attrTable.show(); - widget_setup(); + attrTable.show(); + widget_setup(); desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &ObjectAttributes::setTargetDesktop) ); deskTrack.connect(GTK_WIDGET(gobj())); @@ -143,11 +143,11 @@ void ObjectAttributes::widget_setup (void) return; } - int len = 0; std::vector<Glib::ustring> labels; std::vector<Glib::ustring> attrs; if (CurrentItem != item) { + int len = 0; while (desc[len].label) { labels.push_back(desc[len].label); diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 56d209886..2127ef402 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -175,9 +175,9 @@ void GlyphComboBox::update(SPFont* spfont){ for(SPObject* node = spfont->children; node; node=node->next){ if (SP_IS_GLYPH(node)){ #if WITH_GTKMM_2_24 - this->append(((SPGlyph*)node)->unicode); + this->append((static_cast<SPGlyph*>(node))->unicode); #else - this->append_text(((SPGlyph*)node)->unicode); + this->append_text((static_cast<SPGlyph*>(node))->unicode); #endif } } @@ -423,9 +423,9 @@ SvgFontsDialog::populate_glyphs_box() for(SPObject* node = spfont->children; node; node=node->next){ if (SP_IS_GLYPH(node)){ Gtk::TreeModel::Row row = *(_GlyphsListStore->append()); - row[_GlyphsListColumns.glyph_node] = (SPGlyph*) node; - row[_GlyphsListColumns.glyph_name] = ((SPGlyph*) node)->glyph_name; - row[_GlyphsListColumns.unicode] = ((SPGlyph*) node)->unicode; + row[_GlyphsListColumns.glyph_node] = static_cast<SPGlyph*>(node); + row[_GlyphsListColumns.glyph_name] = (static_cast<SPGlyph*>(node))->glyph_name; + row[_GlyphsListColumns.unicode] = (static_cast<SPGlyph*>(node))->unicode; } } } @@ -441,10 +441,10 @@ SvgFontsDialog::populate_kerning_pairs_box() for(SPObject* node = spfont->children; node; node=node->next){ if (SP_IS_HKERN(node)){ Gtk::TreeModel::Row row = *(_KerningPairsListStore->append()); - row[_KerningPairsListColumns.first_glyph] = ((SPGlyphKerning*) node)->u1->attribute_string().c_str(); - row[_KerningPairsListColumns.second_glyph] = ((SPGlyphKerning*) node)->u2->attribute_string().c_str(); - row[_KerningPairsListColumns.kerning_value] = ((SPGlyphKerning*) node)->k; - row[_KerningPairsListColumns.spnode] = (SPGlyphKerning*) node; + row[_KerningPairsListColumns.first_glyph] = (static_cast<SPGlyphKerning*>(node))->u1->attribute_string().c_str(); + row[_KerningPairsListColumns.second_glyph] = (static_cast<SPGlyphKerning*>(node))->u2->attribute_string().c_str(); + row[_KerningPairsListColumns.kerning_value] = (static_cast<SPGlyphKerning*>(node))->k; + row[_KerningPairsListColumns.spnode] = static_cast<SPGlyphKerning*>(node); } } } @@ -743,9 +743,9 @@ void SvgFontsDialog::add_kerning_pair(){ for(SPObject* node = this->get_selected_spfont()->children; node; node=node->next){ //TODO: It is not really correct to get only the first byte of each string. //TODO: We should also support vertical kerning - if (SP_IS_HKERN(node) && ((SPGlyphKerning*)node)->u1->contains((gchar) first_glyph.get_active_text().c_str()[0]) - && ((SPGlyphKerning*)node)->u2->contains((gchar) second_glyph.get_active_text().c_str()[0]) ){ - this->kerning_pair = (SPGlyphKerning*)node; + if (SP_IS_HKERN(node) && (static_cast<SPGlyphKerning*>(node))->u1->contains((gchar) first_glyph.get_active_text().c_str()[0]) + && (static_cast<SPGlyphKerning*>(node))->u2->contains((gchar) second_glyph.get_active_text().c_str()[0]) ){ + this->kerning_pair = static_cast<SPGlyphKerning*>(node); continue; } } diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 9ae853aaf..ab7b99237 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -1439,7 +1439,7 @@ Dialog::FillAndStroke *get_fill_and_stroke_panel(SPDesktop *desktop) Dialog::FillAndStroke &fill_and_stroke = dynamic_cast<Dialog::FillAndStroke &>(panel_dialog->getPanel()); return &fill_and_stroke; - } catch (std::exception e) { } + } catch (std::exception &e) { } } return 0; |
