diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-03-17 12:53:46 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-03-17 12:53:46 +0000 |
| commit | d570aaf4446417dd50323db02470c1f9f5437b22 (patch) | |
| tree | d9afb4515a0e1264f8b7671ce3b8e72198af9ba7 /src | |
| parent | cppcheck (diff) | |
| download | inkscape-d570aaf4446417dd50323db02470c1f9f5437b22.tar.gz inkscape-d570aaf4446417dd50323db02470c1f9f5437b22.zip | |
cppcheck
(bzr r12218)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/export.cpp | 5 | ||||
| -rw-r--r-- | src/ui/dialog/filedialogimpl-gtkmm.cpp | 8 | ||||
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/text-edit.cpp | 3 | ||||
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.cpp | 1 | ||||
| -rw-r--r-- | src/ui/widget/licensor.cpp | 3 |
6 files changed, 10 insertions, 14 deletions
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 086e52a6c..99a8c08d2 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -428,7 +428,6 @@ void Export::set_default_filename () { if ( SP_ACTIVE_DOCUMENT && SP_ACTIVE_DOCUMENT->getURI() ) { - gchar *name; SPDocument * doc = SP_ACTIVE_DOCUMENT; const gchar *uri = doc->getURI(); const gchar *text_extension = get_file_save_extension (Inkscape::Extension::FILE_SAVE_METHOD_SAVE_AS).c_str(); @@ -457,7 +456,7 @@ void Export::set_default_filename () { g_free(uri_copy); } } else { - name = g_strconcat(uri, ".png", NULL); + gchar *name = g_strconcat(uri, ".png", NULL); filename_entry.set_text(name); filename_entry.set_position(strlen(name)); @@ -1326,7 +1325,7 @@ void Export::onBrowse () WCHAR _filename[_MAX_PATH + 1]; memset(_filename, 0, sizeof(_filename)); gunichar2* utf16_path_string = g_utf8_to_utf16(filename.c_str(), -1, NULL, NULL, NULL); - wcsncpy(_filename, (wchar_t*)utf16_path_string, _MAX_PATH); + wcsncpy(_filename, reinterpret_cast<wchar_t*>(utf16_path_string), _MAX_PATH); g_free(utf16_path_string); opf.hwndOwner = (HWND)(GDK_WINDOW_HWND(gtk_widget_get_window(GTK_WIDGET(this)))); diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index 75f80ed4a..cb6d92799 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -1068,7 +1068,7 @@ FileSaveDialogImplGtk::FileSaveDialogImplGtk( Gtk::Window &parentWindow, std::vector<Gtk::Entry *> entries; findEntryWidgets(cont, entries); //g_message("Found %d entry widgets\n", entries.size()); - if (entries.size() >=1 ) + if (!entries.empty()) { //Catch when user hits [return] on the text field fileNameEntry = entries[0]; @@ -1080,7 +1080,7 @@ FileSaveDialogImplGtk::FileSaveDialogImplGtk( Gtk::Window &parentWindow, std::vector<Gtk::Expander *> expanders; findExpanderWidgets(cont, expanders); //g_message("Found %d expander widgets\n", expanders.size()); - if (expanders.size() >=1 ) + if (!expanders.empty()) { //Always show the file list Gtk::Expander *expander = expanders[0]; @@ -1639,7 +1639,7 @@ FileExportDialogImpl::FileExportDialogImpl( Gtk::Window& parentWindow, std::vector<Gtk::Entry *> entries; findEntryWidgets(cont, entries); //g_message("Found %d entry widgets\n", entries.size()); - if (entries.size() >=1 ) + if (!entries.empty()) { //Catch when user hits [return] on the text field fileNameEntry = entries[0]; @@ -1651,7 +1651,7 @@ FileExportDialogImpl::FileExportDialogImpl( Gtk::Window& parentWindow, std::vector<Gtk::Expander *> expanders; findExpanderWidgets(cont, expanders); //g_message("Found %d expander widgets\n", expanders.size()); - if (expanders.size() >=1 ) + if (!expanders.empty()) { //Always show the file list Gtk::Expander *expander = expanders[0]; diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 989c40264..5afc85f10 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -945,13 +945,11 @@ private: and all widgets within the setting group are aligned automatically. */ void add_widget(Gtk::Widget* w, const Glib::ustring& label) { - Gtk::Label *lbl = 0; Gtk::HBox *hb = Gtk::manage(new Gtk::HBox); hb->set_spacing(12); if(label != "") { - //lbl = Gtk::manage(new Gtk::Label(label + (label == "" ? "" : ":"), Gtk::ALIGN_LEFT)); colon now in label (LP #358921) - lbl = Gtk::manage(new Gtk::Label(label, Gtk::ALIGN_START)); + Gtk::Label *lbl = Gtk::manage(new Gtk::Label(label, Gtk::ALIGN_START)); hb->pack_start(*lbl, false, false); _size_group->add_widget(*lbl); lbl->show(); diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp index 67c6578f9..c87e94fc6 100644 --- a/src/ui/dialog/text-edit.cpp +++ b/src/ui/dialog/text-edit.cpp @@ -424,12 +424,11 @@ void TextEdit::onSelectionChange() void TextEdit::updateObjectText ( SPItem *text ) { GtkTextIter start, end; - gchar *str; // write text if (gtk_text_buffer_get_modified (text_buffer)) { gtk_text_buffer_get_bounds (text_buffer, &start, &end); - str = gtk_text_buffer_get_text (text_buffer, &start, &end, TRUE); + gchar *str = gtk_text_buffer_get_text (text_buffer, &start, &end, TRUE); sp_te_set_repr_text_multiline (text, str); g_free (str); gtk_text_buffer_set_modified (text_buffer, FALSE); diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 1f074c8da..629608242 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -65,7 +65,6 @@ typedef std::pair<double, IterPair> DistanceMapItem; void find_join_iterators(ControlPointSelection &sel, IterPairList &pairs) { IterSet join_iters; - DistanceMap dists; // find all endnodes in selection for (ControlPointSelection::iterator i = sel.begin(); i != sel.end(); ++i) { diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 8ecd36af2..c729354cb 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -79,7 +79,8 @@ void LicenseItem::on_toggled() //--------------------------------------------------- Licensor::Licensor() -: Gtk::VBox(false,4) +: Gtk::VBox(false,4), + _eentry (NULL) { } |
