diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2014-01-20 19:56:38 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2014-01-20 19:56:38 +0000 |
| commit | 1534dc84087db1b26f1e86e79436eb63f3dffd3f (patch) | |
| tree | 9e09737acdf595abc28a96559d22a1ae658aefbe /src | |
| parent | Dutch translation update (diff) | |
| download | inkscape-1534dc84087db1b26f1e86e79436eb63f3dffd3f.tar.gz inkscape-1534dc84087db1b26f1e86e79436eb63f3dffd3f.zip | |
cppcheck stuff
(bzr r12963)
Diffstat (limited to 'src')
| -rw-r--r-- | src/line-geometry.cpp | 16 | ||||
| -rw-r--r-- | src/ui/dialog/template-load-tab.cpp | 7 | ||||
| -rw-r--r-- | src/ui/tools/text-tool.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/icon.cpp | 4 |
4 files changed, 15 insertions, 16 deletions
diff --git a/src/line-geometry.cpp b/src/line-geometry.cpp index e9f07f96f..982762a12 100644 --- a/src/line-geometry.cpp +++ b/src/line-geometry.cpp @@ -28,8 +28,9 @@ namespace Box3D { * of the segment. Otherwise interpret it as the direction of the line. * FIXME: Think of a better way to distinguish between the two constructors of lines. */ -Line::Line(Geom::Point const &start, Geom::Point const &vec, bool is_endpoint) { - pt = start; +Line::Line(Geom::Point const &start, Geom::Point const &vec, bool is_endpoint): + pt(start) +{ if (is_endpoint) v_dir = vec - start; else @@ -38,11 +39,12 @@ Line::Line(Geom::Point const &start, Geom::Point const &vec, bool is_endpoint) { d0 = Geom::dot(normal, pt); } -Line::Line(Line const &line) { - pt = line.pt; - v_dir = line.v_dir; - normal = line.normal; - d0 = line.d0; +Line::Line(Line const &line): + pt(line.pt), + v_dir(line.v_dir), + normal(line.normal), + d0(line.d0) +{ } Line &Line::operator=(Line const &line) { diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 4f2d51ef7..6b1f4542f 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -220,12 +220,9 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const std::s n = result.display_name.rfind(".svg"); result.display_name.replace(n, 4, 1, ' '); - Inkscape::XML::Document *rdoc; - rdoc = sp_repr_read_file(path.data(), SP_SVG_NS_URI); - Inkscape::XML::Node *myRoot; - + Inkscape::XML::Document *rdoc = sp_repr_read_file(path.data(), SP_SVG_NS_URI); if (rdoc){ - myRoot = rdoc->root(); + Inkscape::XML::Node *myRoot = rdoc->root(); if (strcmp(myRoot->name(), "svg:svg") != 0){ // Wrong file format return result; } diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index c73164c09..9b5ab1016 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -1335,7 +1335,7 @@ bool sp_text_paste_inline(ToolBase *ec) paste_string_uchar == 0x00000009 || paste_string_uchar == 0x0000000A || paste_string_uchar == 0x0000000D) { - itr++; + ++itr; } else { itr = text.erase(itr); } @@ -1637,7 +1637,7 @@ static void sp_text_context_update_text_selection(TextTool *tc) // the selection update (can't do both atomically, alas) if (!tc->desktop) return; - for (std::vector<SPCanvasItem*>::iterator it = tc->text_selection_quads.begin() ; it != tc->text_selection_quads.end() ; it++) { + for (std::vector<SPCanvasItem*>::iterator it = tc->text_selection_quads.begin() ; it != tc->text_selection_quads.end() ; ++it) { sp_canvas_item_hide(*it); sp_canvas_item_destroy(*it); } diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index 768a835c9..a9c30ee8f 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -1310,11 +1310,11 @@ guchar *IconImpl::load_svg_pixels(std::list<Glib::ustring> const &names, } static void addToIconSet(GdkPixbuf* pb, gchar const* name, GtkIconSize lsize, unsigned psize) { - static bool dump = Inkscape::Preferences::get()->getBool("/debug/icons/dumpGtk"); Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default(); bool icon_found = icon_theme->has_icon(name); if ( !icon_found ) { Gtk::IconTheme::add_builtin_icon( name, psize, Glib::wrap(pb) ); + static bool dump = Inkscape::Preferences::get()->getBool("/debug/icons/dumpGtk"); if (dump) { g_message(" set in a builtin for %s:%d:%d", name, lsize, psize); } @@ -1354,7 +1354,6 @@ static std::string getDestDir( unsigned psize ) bool IconImpl::prerenderIcon(gchar const *name, GtkIconSize lsize, unsigned psize) { bool loadNeeded = false; - static bool dump = Inkscape::Preferences::get()->getBool("/debug/icons/dumpGtk"); static bool useCache = Inkscape::Preferences::get()->getBool("/debug/icons/useCache", true); static bool cacheValidated = false; if (!cacheValidated) { @@ -1366,6 +1365,7 @@ bool IconImpl::prerenderIcon(gchar const *name, GtkIconSize lsize, unsigned psiz Glib::ustring key = icon_cache_key(name, psize); if ( !get_cached_pixbuf(key) ) { + static bool dump = Inkscape::Preferences::get()->getBool("/debug/icons/dumpGtk"); if ((internalNames.find(name) != internalNames.end()) || (!gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), name))) { if (dump) { |
