diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-18 18:54:25 +0000 |
|---|---|---|
| committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-18 18:54:25 +0000 |
| commit | 5a5b61fa8085a8c5eec59614834cb882d1d778e2 (patch) | |
| tree | 848df1de494bcdae296dcaf1de4a164cbaaec780 /src/ui | |
| parent | Run clang-tidy’s modernize-pass-by-value pass. (diff) | |
| download | inkscape-5a5b61fa8085a8c5eec59614834cb882d1d778e2.tar.gz inkscape-5a5b61fa8085a8c5eec59614834cb882d1d778e2.zip | |
Run clang-tidy’s modernize-use-bool-literals pass.
This makes it clearer whether an integer or a boolean has to be passed
in this specific call.
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/contextmenu.cpp | 64 | ||||
| -rw-r--r-- | src/ui/dialog/align-and-distribute.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/clonetiler.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/export.cpp | 6 | ||||
| -rw-r--r-- | src/ui/dialog/filedialogimpl-gtkmm.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/find.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/object-properties.cpp | 18 | ||||
| -rw-r--r-- | src/ui/dialog/swatches.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/connector-tool.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/eraser-tool.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/measure-tool.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/text-tool.cpp | 28 |
17 files changed, 73 insertions, 73 deletions
diff --git a/src/ui/contextmenu.cpp b/src/ui/contextmenu.cpp index f66a71cd8..7a6c4e7cf 100644 --- a/src/ui/contextmenu.cpp +++ b/src/ui/contextmenu.cpp @@ -94,7 +94,7 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : } Gtk::MenuItem* mi; - mi = Gtk::manage(new Gtk::MenuItem(_("Hide selected objects"),1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Hide selected objects"),true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::HideSelected)); if (_desktop->selection->isEmpty()) { mi->set_sensitive(false); @@ -102,7 +102,7 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : mi->show(); append(*mi);//insert(*mi,positionOfLastDialog++); - mi = Gtk::manage(new Gtk::MenuItem(_("Unhide objects below"),1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Unhide objects below"),true)); mi->signal_activate().connect(sigc::bind<std::vector< SPItem * > >(sigc::mem_fun(*this, &ContextMenu::UnHideBelow), down_items)); if (!has_down_hidden) { mi->set_sensitive(false); @@ -110,7 +110,7 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : mi->show(); append(*mi);//insert(*mi,positionOfLastDialog++); - mi = Gtk::manage(new Gtk::MenuItem(_("Lock selected objects"),1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Lock selected objects"),true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::LockSelected)); if (_desktop->selection->isEmpty()) { mi->set_sensitive(false); @@ -118,7 +118,7 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : mi->show(); append(*mi);//insert(*mi,positionOfLastDialog++); - mi = Gtk::manage(new Gtk::MenuItem(_("Unlock objects below"),1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Unlock objects below"),true)); mi->signal_activate().connect(sigc::bind<std::vector< SPItem * > >(sigc::mem_fun(*this, &ContextMenu::UnLockBelow), down_items)); if (!has_down_locked) { mi->set_sensitive(false); @@ -156,7 +156,7 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : append(MIParent); /* Pop selection out of group */ - Gtk::MenuItem* miu = Gtk::manage(new Gtk::MenuItem(_("_Pop selection out of group"), 1)); + Gtk::MenuItem* miu = Gtk::manage(new Gtk::MenuItem(_("_Pop selection out of group"), true)); miu->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ActivateUngroupPopSelection)); miu->show(); append(*miu); @@ -320,7 +320,7 @@ void ContextMenu::MakeItemMenu (void) Gtk::MenuItem* mi; /* Item dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Object Properties..."),1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Object Properties..."),true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ItemProperties)); mi->show(); append(*mi);//insert(*mi,positionOfLastDialog++); @@ -329,7 +329,7 @@ void ContextMenu::MakeItemMenu (void) /* Select item */ if (Inkscape::Verb::getbyid( "org.inkscape.followlink" )) { - mi = Gtk::manage(new Gtk::MenuItem(_("_Select This"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Select This"), true)); if (_desktop->selection->includes(_item)) { mi->set_sensitive(FALSE); } else { @@ -350,42 +350,42 @@ void ContextMenu::MakeItemMenu (void) append(*mi); /* Select same fill and stroke */ - mi = Gtk::manage(new Gtk::MenuItem(_("Fill and Stroke"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Fill and Stroke"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SelectSameFillStroke)); mi->set_sensitive(!SP_IS_ANCHOR(_item)); mi->show(); select_same_submenu->append(*mi); /* Select same fill color */ - mi = Gtk::manage(new Gtk::MenuItem(_("Fill Color"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Fill Color"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SelectSameFillColor)); mi->set_sensitive(!SP_IS_ANCHOR(_item)); mi->show(); select_same_submenu->append(*mi); /* Select same stroke color */ - mi = Gtk::manage(new Gtk::MenuItem(_("Stroke Color"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Stroke Color"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SelectSameStrokeColor)); mi->set_sensitive(!SP_IS_ANCHOR(_item)); mi->show(); select_same_submenu->append(*mi); /* Select same stroke style */ - mi = Gtk::manage(new Gtk::MenuItem(_("Stroke Style"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Stroke Style"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SelectSameStrokeStyle)); mi->set_sensitive(!SP_IS_ANCHOR(_item)); mi->show(); select_same_submenu->append(*mi); /* Select same stroke style */ - mi = Gtk::manage(new Gtk::MenuItem(_("Object type"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Object type"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SelectSameObjectType)); mi->set_sensitive(!SP_IS_ANCHOR(_item)); mi->show(); select_same_submenu->append(*mi); /* Move to layer */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Move to layer ..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Move to layer ..."), true)); if (_desktop->selection->isEmpty()) { mi->set_sensitive(FALSE); } else { @@ -395,7 +395,7 @@ void ContextMenu::MakeItemMenu (void) append(*mi); /* Create link */ - mi = Gtk::manage(new Gtk::MenuItem(_("Create _Link"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Create _Link"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ItemCreateLink)); mi->set_sensitive(!SP_IS_ANCHOR(_item)); mi->show(); @@ -418,7 +418,7 @@ void ContextMenu::MakeItemMenu (void) } } /* Set mask */ - mi = Gtk::manage(new Gtk::MenuItem(_("Set Mask"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Set Mask"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SetMask)); if (ClipRefOK || MaskRefOK) { mi->set_sensitive(FALSE); @@ -429,7 +429,7 @@ void ContextMenu::MakeItemMenu (void) append(*mi); /* Release mask */ - mi = Gtk::manage(new Gtk::MenuItem(_("Release Mask"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Release Mask"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ReleaseMask)); if (MaskRefOK) { mi->set_sensitive(TRUE); @@ -440,14 +440,14 @@ void ContextMenu::MakeItemMenu (void) append(*mi); /*SSet Clip Group */ - mi = Gtk::manage(new Gtk::MenuItem(_("Create Clip G_roup"),1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Create Clip G_roup"),true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::CreateGroupClip)); mi->set_sensitive(TRUE); mi->show(); append(*mi); /* Set Clip */ - mi = Gtk::manage(new Gtk::MenuItem(_("Set Cl_ip"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Set Cl_ip"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SetClip)); if (ClipRefOK || MaskRefOK) { mi->set_sensitive(FALSE); @@ -458,7 +458,7 @@ void ContextMenu::MakeItemMenu (void) append(*mi); /* Release Clip */ - mi = Gtk::manage(new Gtk::MenuItem(_("Release C_lip"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Release C_lip"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ReleaseClip)); if (ClipRefOK) { mi->set_sensitive(TRUE); @@ -469,7 +469,7 @@ void ContextMenu::MakeItemMenu (void) append(*mi); /* Group */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Group"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Group"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ActivateGroup)); if (_desktop->selection->isEmpty()) { mi->set_sensitive(FALSE); @@ -575,7 +575,7 @@ void ContextMenu::ReleaseClip(void) void ContextMenu::MakeGroupMenu(void) { /* Ungroup */ - Gtk::MenuItem* mi = Gtk::manage(new Gtk::MenuItem(_("_Ungroup"), 1)); + Gtk::MenuItem* mi = Gtk::manage(new Gtk::MenuItem(_("_Ungroup"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ActivateUngroup)); mi->show(); append(*mi); @@ -605,19 +605,19 @@ void ContextMenu::MakeAnchorMenu(void) Gtk::MenuItem* mi; /* Link dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("Link _Properties..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Link _Properties..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::AnchorLinkProperties)); mi->show(); insert(*mi,positionOfLastDialog++); /* Select item */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Follow Link"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Follow Link"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::AnchorLinkFollow)); mi->show(); append(*mi); /* Reset transformations */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Remove Link"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Remove Link"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::AnchorLinkRemove)); mi->show(); append(*mi); @@ -658,13 +658,13 @@ void ContextMenu::MakeImageMenu (void) const gchar *href = ir->attribute("xlink:href"); /* Image properties */ - mi = Gtk::manage(new Gtk::MenuItem(_("Image _Properties..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Image _Properties..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageProperties)); mi->show(); insert(*mi,positionOfLastDialog++); /* Edit externally */ - mi = Gtk::manage(new Gtk::MenuItem(_("Edit Externally..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Edit Externally..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageEdit)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -673,7 +673,7 @@ void ContextMenu::MakeImageMenu (void) } /* Trace Bitmap */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Trace Bitmap..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Trace Bitmap..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageTraceBitmap)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -682,7 +682,7 @@ void ContextMenu::MakeImageMenu (void) } /* Trace Pixel Art */ - mi = Gtk::manage(new Gtk::MenuItem(_("Trace Pixel Art"), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Trace Pixel Art"), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ImageTracePixelArt)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -864,7 +864,7 @@ void ContextMenu::MakeShapeMenu (void) Gtk::MenuItem* mi; /* Item dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::FillSettings)); mi->show(); insert(*mi,positionOfLastDialog++); @@ -884,19 +884,19 @@ void ContextMenu::MakeTextMenu (void) Gtk::MenuItem* mi; /* Fill and Stroke dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Fill and Stroke..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::FillSettings)); mi->show(); insert(*mi,positionOfLastDialog++); /* Edit Text dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("_Text and Font..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("_Text and Font..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::TextSettings)); mi->show(); insert(*mi,positionOfLastDialog++); /* Spellcheck dialog */ - mi = Gtk::manage(new Gtk::MenuItem(_("Check Spellin_g..."), 1)); + mi = Gtk::manage(new Gtk::MenuItem(_("Check Spellin_g..."), true)); mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::SpellcheckSettings)); mi->show(); insert(*mi,positionOfLastDialog++); diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index ad69bb59c..8e6b5e0e5 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -936,7 +936,7 @@ AlignAndDistribute::AlignAndDistribute() _nodesTable(), _anchorLabel(_("Relative to: ")), _anchorLabelNode(_("Relative to: ")), - _selgrpLabel(_("_Treat selection as group: "), 1) + _selgrpLabel(_("_Treat selection as group: "), true) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index c1998249d..3346dd595 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -919,7 +919,7 @@ CloneTiler::CloneTiler () : { auto b = Gtk::manage(new Gtk::CheckButton(_("Color"))); - bool old = prefs->getBool(prefs_path + "pick_to_color", 0); + bool old = prefs->getBool(prefs_path + "pick_to_color", false); b->set_active(old); b->set_tooltip_text(_("Each clone is painted by the picked color (the original must have unset fill or stroke)")); table_attach (table, b, 0.0, 1, 2); @@ -928,7 +928,7 @@ CloneTiler::CloneTiler () : { auto b = Gtk::manage(new Gtk::CheckButton(_("Opacity"))); - bool old = prefs->getBool(prefs_path + "pick_to_opacity", 0); + bool old = prefs->getBool(prefs_path + "pick_to_opacity", false); b->set_active(old); b->set_tooltip_text(_("Each clone's opacity is determined by the picked value in that point")); table_attach (table, b, 0.0, 2, 2); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 1dda7f17d..0b47f9bac 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1024,9 +1024,9 @@ void DocumentProperties::build_metadata() } } - Gtk::Button *button_save = Gtk::manage (new Gtk::Button(_("_Save as default"),1)); + Gtk::Button *button_save = Gtk::manage (new Gtk::Button(_("_Save as default"),true)); button_save->set_tooltip_text(_("Save this metadata as the default metadata")); - Gtk::Button *button_load = Gtk::manage (new Gtk::Button(_("Use _default"),1)); + Gtk::Button *button_load = Gtk::manage (new Gtk::Button(_("Use _default"),true)); button_load->set_tooltip_text(_("Use the previously saved default metadata here")); auto box_buttons = Gtk::manage (new Gtk::ButtonBox); diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 4d61091a2..392587bef 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -138,7 +138,7 @@ Export::Export (void) : unit_selector(), units_label(_("Units:")), filename_box(false, 5), - browse_label(_("_Export As..."), 1), + browse_label(_("_Export As..."), true), browse_image(), batch_box(false, 5), batch_export(_("B_atch export all selected objects"), _("Export each selected object into its own PNG file, using export hints if any (caution, overwrites without asking!)")), @@ -324,7 +324,7 @@ Export::Export (void) : button_box.pack_end(export_button, false, false, 0); /*Advanced*/ - Gtk::Label *label_advanced = Gtk::manage(new Gtk::Label(_("Advanced"),1)); + Gtk::Label *label_advanced = Gtk::manage(new Gtk::Label(_("Advanced"),true)); expander.set_label_widget(*label_advanced); const char* const modes_list[]={"Gray_1", "Gray_2","Gray_4","Gray_8","Gray_16","RGB_8","RGB_16","GrayAlpha_8","GrayAlpha_16","RGBA_8","RGBA_16"}; for(int i=0; i<11; ++i) @@ -363,7 +363,7 @@ Export::Export (void) : contents->pack_start(singleexport_box); contents->pack_start(batch_box); contents->pack_start(hide_box); - contents->pack_end(button_box, false, 0); + contents->pack_end(button_box, false, false); contents->pack_end(_prog, Gtk::PACK_EXPAND_WIDGET); contents->pack_end(expander, FALSE, FALSE,0); diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index 006a59ece..72cca76d3 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -1076,7 +1076,7 @@ void FileSaveDialogImplGtk::fileNameEntryChangedCallback() if (Glib::file_test(fileName, Glib::FILE_TEST_IS_DIR)) { set_current_folder(fileName); - } else if (/*Glib::file_test(fileName, Glib::FILE_TEST_IS_REGULAR)*/ 1) { + } else if (/*Glib::file_test(fileName, Glib::FILE_TEST_IS_REGULAR)*/ true) { // dialog with either (1) select a regular file or (2) cd to dir // simulate an 'OK' set_filename(fileName); diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index a010ac667..d9a43d21b 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -71,7 +71,7 @@ Find::Find() check_scope_selection(_("Sele_ction"), _("Limit search to the current selection")), check_searchin_text(_("_Text"), _("Search in text objects")), check_searchin_property(_("_Properties"), _("Search in object properties, styles, attributes and IDs")), - vbox_searchin(0, false), + vbox_searchin(false, false), frame_searchin(_("Search in")), frame_scope(_("Scope")), diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 06309885c..6092c26d3 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -493,7 +493,7 @@ void InkscapePreferences::initPageTools() this->AddGradientCheckbox(_page_text, "/tools/text", true); { PrefCheckButton* cb = Gtk::manage( new PrefCheckButton); - cb->init ( _("Show font samples in the drop-down list"), "/tools/text/show_sample_in_list", 1); + cb->init ( _("Show font samples in the drop-down list"), "/tools/text/show_sample_in_list", true); _page_text.add_line( false, "", *cb, "", _("Show font samples alongside font names in the drop-down list in Text bar")); _font_dialog.init ( _("Show font substitution warning dialog"), "/options/font/substitutedlg", false); diff --git a/src/ui/dialog/object-properties.cpp b/src/ui/dialog/object-properties.cpp index a43791d08..8f92050f5 100644 --- a/src/ui/dialog/object-properties.cpp +++ b/src/ui/dialog/object-properties.cpp @@ -50,12 +50,12 @@ ObjectProperties::ObjectProperties() : UI::Widget::Panel("/dialogs/object/", SP_VERB_DIALOG_ITEM) , _blocked (false) , _current_item(nullptr) - , _label_id(_("_ID:"), 1) - , _label_label(_("_Label:"), 1) - , _label_title(_("_Title:"), 1) - , _label_image_rendering(_("_Image Rendering:"), 1) - , _cb_hide(_("_Hide"), 1) - , _cb_lock(_("L_ock"), 1) + , _label_id(_("_ID:"), true) + , _label_label(_("_Label:"), true) + , _label_title(_("_Title:"), true) + , _label_image_rendering(_("_Image Rendering:"), true) + , _cb_hide(_("_Hide"), true) + , _cb_lock(_("L_ock"), true) , _attr_table(Gtk::manage(new SPAttributeTable())) , _desktop(nullptr) { @@ -168,7 +168,7 @@ void ObjectProperties::_init() _entry_title.signal_activate().connect(sigc::mem_fun(this, &ObjectProperties::_labelChanged)); /* Create the frame for the object description */ - Gtk::Label *label_desc = Gtk::manage(new Gtk::Label(_("_Description:"), 1)); + Gtk::Label *label_desc = Gtk::manage(new Gtk::Label(_("_Description:"), true)); UI::Widget::Frame *frame_desc = Gtk::manage(new UI::Widget::Frame("", FALSE)); frame_desc->set_label_widget(*label_desc); frame_desc->set_padding (0,0,0,0); @@ -237,7 +237,7 @@ void ObjectProperties::_init() /* Button for setting the object's id, label, title and description. */ - Gtk::Button *btn_set = Gtk::manage(new Gtk::Button(_("_Set"), 1)); + Gtk::Button *btn_set = Gtk::manage(new Gtk::Button(_("_Set"), true)); btn_set->set_hexpand(); btn_set->set_valign(Gtk::ALIGN_CENTER); grid_cb->attach(*btn_set, 2, 0, 1, 1); @@ -245,7 +245,7 @@ void ObjectProperties::_init() btn_set->signal_clicked().connect(sigc::mem_fun(this, &ObjectProperties::_labelChanged)); /* Create the frame for interactivity options */ - Gtk::Label *label_interactivity = Gtk::manage(new Gtk::Label(_("_Interactivity"), 1)); + Gtk::Label *label_interactivity = Gtk::manage(new Gtk::Label(_("_Interactivity"), true)); _exp_interactivity.set_label_widget(*label_interactivity); contents->pack_start(_exp_interactivity, FALSE, FALSE, 0); diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 7d8729b0e..dbb170025 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -693,7 +693,7 @@ SwatchesPanel::~SwatchesPanel() void SwatchesPanel::_build_menu() { guint panel_size = 0, panel_mode = 0, panel_ratio = 100, panel_border = 0; - bool panel_wrap = 0; + bool panel_wrap = false; if (!_prefs_path.empty()) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); panel_wrap = prefs->getBool(_prefs_path + "/panel_wrap"); diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index af044eff0..a4d067acd 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -106,7 +106,7 @@ SymbolColumns* SymbolsDialog::getColumns() SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : UI::Widget::Panel(prefsPath, SP_VERB_DIALOG_SYMBOLS), store(Gtk::ListStore::create(*getColumns())), - all_docs_processed(0), + all_docs_processed(false), icon_view(nullptr), current_desktop(nullptr), desk_track(), diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 7010f58bf..b80a1e675 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -616,7 +616,7 @@ bool MultiPathManipulator::event(Inkscape::UI::Tools::ToolBase *event_context, G } if (handled) return true; - } while(0); + } while(false); } diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp index 7481e8470..09f18e630 100644 --- a/src/ui/tools/connector-tool.cpp +++ b/src/ui/tools/connector-tool.cpp @@ -242,7 +242,7 @@ void ConnectorTool::setup() sp_event_context_read(this, "curvature"); sp_event_context_read(this, "orthogonal"); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (prefs->getBool("/tools/connector/selcue", 0)) { + if (prefs->getBool("/tools/connector/selcue", false)) { this->enableSelectionCue(); } diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index 1cd9db6b2..60d572e16 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -151,7 +151,7 @@ static ProfileFloatElement f_profile[PROFILE_FLOAT_SIZE] = { //TODO not sure why get 0.01 if slider width == 0, maybe a double/int problem Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (prefs->getBool("/tools/eraser/selcue", 0) != 0) { + if (prefs->getBool("/tools/eraser/selcue", false) != 0) { this->enableSelectionCue(); } diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index 633bf6ec3..2048dce23 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -1177,7 +1177,7 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups) if(newover != over){ over = newover; Preferences *prefs = Preferences::get(); - int prefs_bbox = prefs->getBool("/tools/bounding_box", 0); + int prefs_bbox = prefs->getBool("/tools/bounding_box", false); SPItem::BBoxType bbox_type = !prefs_bbox ? SPItem::VISUAL_BBOX : SPItem::GEOMETRIC_BBOX; Geom::OptRect bbox = over->bounds(bbox_type); if (bbox) { diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index c5855540b..e7301152f 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -1291,7 +1291,7 @@ void PenTool::_setAngleDistanceStatusMessage(Geom::Point const p, int pc_point_t Glib::ustring dist = q.string(desktop->namedview->display_units); double angle = atan2(rel[Geom::Y], rel[Geom::X]) * 180 / M_PI; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (prefs->getBool("/options/compassangledisplay/value", 0) != 0) { + if (prefs->getBool("/options/compassangledisplay/value", false) != 0) { angle = 90 - angle; if (angle < 0) { angle += 360; diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index f4f20ef30..8ed03ece1 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -452,7 +452,7 @@ static void insert_uni_char(TextTool *const tc) } else { if (!tc->text) { // printable key; create text if none (i.e. if nascent_object) sp_text_context_setup_text(tc); - tc->nascent_object = 0; // we don't need it anymore, having created a real <text> + tc->nascent_object = false; // we don't need it anymore, having created a real <text> } gchar u[10]; @@ -539,7 +539,7 @@ bool TextTool::root_handler(GdkEvent* event) { GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK, nullptr, event->button.time); this->grabbed = SP_CANVAS_ITEM(desktop->acetate); - this->creating = 1; + this->creating = true; /* Processed */ return TRUE; @@ -547,7 +547,7 @@ bool TextTool::root_handler(GdkEvent* event) { break; case GDK_MOTION_NOTIFY: if (this->over_text) { - this->over_text = 0; + this->over_text = false; // update cursor and statusbar: we are not over a text object now this->cursor_shape = cursor_text_xpm; this->sp_event_context_update_cursor(); @@ -615,8 +615,8 @@ bool TextTool::root_handler(GdkEvent* event) { desktop->getSelection()->clear(); this->pdoc = desktop->dt2doc(p1); this->show = TRUE; - this->phase = 1; - this->nascent_object = 1; // new object was just created + this->phase = true; + this->nascent_object = true; // new object was just created /* Cursor */ sp_canvas_item_show(this->cursor); @@ -780,7 +780,7 @@ bool TextTool::root_handler(GdkEvent* event) { /* No-break space */ if (!this->text) { // printable key; create text if none (i.e. if nascent_object) sp_text_context_setup_text(this); - this->nascent_object = 0; // we don't need it anymore, having created a real <text> + this->nascent_object = false; // we don't need it anymore, having created a real <text> } this->text_sel_start = this->text_sel_end = sp_te_replace(this->text, this->text_sel_start, this->text_sel_end, "\302\240"); sp_text_context_update_cursor(this); @@ -865,7 +865,7 @@ bool TextTool::root_handler(GdkEvent* event) { { if (!this->text) { // printable key; create text if none (i.e. if nascent_object) sp_text_context_setup_text(this); - this->nascent_object = 0; // we don't need it anymore, having created a real <text> + this->nascent_object = false; // we don't need it anymore, having created a real <text> } iterator_pair enter_pair; @@ -1095,7 +1095,7 @@ bool TextTool::root_handler(GdkEvent* event) { return TRUE; case GDK_KEY_Escape: if (this->creating) { - this->creating = 0; + this->creating = false; if (this->grabbed) { sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME); this->grabbed = nullptr; @@ -1217,7 +1217,7 @@ bool TextTool::root_handler(GdkEvent* event) { return TRUE; } else if (group0_keyval == GDK_KEY_Escape) { // cancel rubberband if (this->creating) { - this->creating = 0; + this->creating = false; if (this->grabbed) { sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME); this->grabbed = nullptr; @@ -1297,7 +1297,7 @@ bool sp_text_paste_inline(ToolBase *ec) if (!tc->text) { // create text if none (i.e. if nascent_object) sp_text_context_setup_text(tc); - tc->nascent_object = 0; // we don't need it anymore, having created a real <text> + tc->nascent_object = false; // we don't need it anymore, having created a real <text> } // using indices is slow in ustrings. Whatever. @@ -1591,7 +1591,7 @@ static void sp_text_context_update_cursor(TextTool *tc, bool scroll_to_see) } tc->show = TRUE; - tc->phase = 1; + tc->phase = true; Inkscape::Text::Layout const *layout = te_get_layout(tc->text); int const nChars = layout->iteratorToCharIndex(layout->end()); @@ -1665,10 +1665,10 @@ static gint sp_text_context_timeout(TextTool *tc) if (tc->show) { sp_canvas_item_show(tc->cursor); if (tc->phase) { - tc->phase = 0; + tc->phase = false; tc->cursor->setRgba32(0x000000ff); } else { - tc->phase = 1; + tc->phase = true; tc->cursor->setRgba32(0xffffffff); } } @@ -1720,7 +1720,7 @@ static void sptc_commit(GtkIMContext */*imc*/, gchar *string, TextTool *tc) { if (!tc->text) { sp_text_context_setup_text(tc); - tc->nascent_object = 0; // we don't need it anymore, having created a real <text> + tc->nascent_object = false; // we don't need it anymore, having created a real <text> } tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, string); |
