summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-18 18:54:25 +0000
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-18 18:54:25 +0000
commit5a5b61fa8085a8c5eec59614834cb882d1d778e2 (patch)
tree848df1de494bcdae296dcaf1de4a164cbaaec780 /src
parentRun clang-tidy’s modernize-pass-by-value pass. (diff)
downloadinkscape-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')
-rw-r--r--src/display/drawing-text.cpp8
-rw-r--r--src/display/snap-indicator.cpp2
-rw-r--r--src/display/sp-canvas.cpp2
-rw-r--r--src/extension/internal/cairo-renderer.cpp2
-rw-r--r--src/extension/internal/emf-inout.cpp2
-rw-r--r--src/extension/internal/emf-print.cpp6
-rw-r--r--src/extension/internal/odf.cpp4
-rw-r--r--src/extension/internal/odf.h2
-rw-r--r--src/extension/internal/pdfinput/pdf-parser.cpp6
-rw-r--r--src/extension/internal/pdfinput/svg-builder.cpp2
-rw-r--r--src/extension/internal/wmf-inout.cpp8
-rw-r--r--src/inkscape.cpp2
-rw-r--r--src/libnrtype/Layout-TNG-Output.cpp2
-rw-r--r--src/libnrtype/Layout-TNG.cpp2
-rw-r--r--src/livarot/ShapeMisc.cpp6
-rw-r--r--src/livarot/ShapeSweep.cpp2
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp4
-rw-r--r--src/object-snapper.cpp4
-rw-r--r--src/object/filters/convolvematrix.cpp2
-rw-r--r--src/object/filters/image.cpp2
-rw-r--r--src/object/filters/turbulence.cpp2
-rw-r--r--src/object/sp-gradient.cpp4
-rw-r--r--src/object/sp-guide.cpp2
-rw-r--r--src/object/sp-item.cpp2
-rw-r--r--src/object/sp-paint-server.cpp2
-rw-r--r--src/object/sp-star.cpp2
-rw-r--r--src/selcue.cpp2
-rw-r--r--src/selection-chemistry.cpp6
-rw-r--r--src/splivarot.cpp2
-rw-r--r--src/style-internal.cpp8
-rw-r--r--src/ui/contextmenu.cpp64
-rw-r--r--src/ui/dialog/align-and-distribute.cpp2
-rw-r--r--src/ui/dialog/clonetiler.cpp4
-rw-r--r--src/ui/dialog/document-properties.cpp4
-rw-r--r--src/ui/dialog/export.cpp6
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.cpp2
-rw-r--r--src/ui/dialog/find.cpp2
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp2
-rw-r--r--src/ui/dialog/object-properties.cpp18
-rw-r--r--src/ui/dialog/swatches.cpp2
-rw-r--r--src/ui/dialog/symbols.cpp2
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp2
-rw-r--r--src/ui/tools/connector-tool.cpp2
-rw-r--r--src/ui/tools/eraser-tool.cpp2
-rw-r--r--src/ui/tools/measure-tool.cpp2
-rw-r--r--src/ui/tools/pen-tool.cpp2
-rw-r--r--src/ui/tools/text-tool.cpp28
-rw-r--r--src/widgets/button.cpp2
48 files changed, 125 insertions, 125 deletions
diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp
index edfd5eca2..76c392d67 100644
--- a/src/display/drawing-text.cpp
+++ b/src/display/drawing-text.cpp
@@ -306,7 +306,7 @@ void DrawingText::decorateStyle(DrawingContext &dc, double vextent, double xphas
else if(_nrstyle.text_decoration_style & TEXT_DECORATION_STYLE_DOTTED){
// FIXME: Per spec, this should produce round dots.
Geom::Point pv = ps;
- while(1){
+ while(true){
Geom::Point pvlast = pv;
if(dots[i]>0){
if(pv[Geom::X] > pf[Geom::X]) break;
@@ -331,7 +331,7 @@ void DrawingText::decorateStyle(DrawingContext &dc, double vextent, double xphas
}
else if(_nrstyle.text_decoration_style & TEXT_DECORATION_STYLE_DASHED){
Geom::Point pv = ps;
- while(1){
+ while(true){
Geom::Point pvlast = pv;
if(dashes[i]>0){
if(pv[Geom::X]> pf[Geom::X]) break;
@@ -359,7 +359,7 @@ void DrawingText::decorateStyle(DrawingContext &dc, double vextent, double xphas
double x = ps[Geom::X];
double y = ps[Geom::Y] + poff[Geom::Y];
dc.moveTo(Geom::Point(x, y + amp * wave[i]));
- while(1){
+ while(true){
i = ((i + 1) & 15);
x += step;
dc.lineTo(Geom::Point(x, y + amp * wave[i]));
@@ -367,7 +367,7 @@ void DrawingText::decorateStyle(DrawingContext &dc, double vextent, double xphas
}
y = ps[Geom::Y] - poff[Geom::Y];
dc.lineTo(Geom::Point(x, y + amp * wave[i]));
- while(1){
+ while(true){
i = ((i - 1) & 15);
x -= step;
dc.lineTo(Geom::Point(x, y + amp * wave[i]));
diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp
index 2e329c4aa..79a1191b9 100644
--- a/src/display/snap-indicator.cpp
+++ b/src/display/snap-indicator.cpp
@@ -323,7 +323,7 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap
nullptr);
SP_CTRLRECT(box)->setRectangle(*bbox);
- SP_CTRLRECT(box)->setColor(pre_snap ? 0x7f7f7fff : 0xff0000ff, 0, 0);
+ SP_CTRLRECT(box)->setColor(pre_snap ? 0x7f7f7fff : 0xff0000ff, false, 0);
SP_CTRLRECT(box)->setDashed(true);
SP_CTRLRECT(box)->pickable = false; // See the extensive comment above
sp_canvas_item_move_to_z(box, 0);
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index 6a38ae3e7..5850cad7a 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1767,7 +1767,7 @@ bool SPCanvas::paintRect(int xx0, int yy0, int xx1, int yy1)
Geom::IntRect paint_rect(xx0, yy0, xx1, yy1);
Geom::OptIntRect area = paint_rect & canvas_rect;
- if (!area || area->hasZeroArea()) return 0;
+ if (!area || area->hasZeroArea()) return false;
paint_rect = *area;
PaintRectSetup setup;
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index c7cd35eb2..c06119391 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -403,7 +403,7 @@ static void sp_symbol_render(SPSymbol *symbol, CairoRenderContext *ctx)
ctx->transform(symbol->c2p);
// apply viewbox if set
- if (0 /*symbol->viewBox_set*/) {
+ if (false /*symbol->viewBox_set*/) {
Geom::Affine vb2user;
double x, y, width, height;
double view_width, view_height;
diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp
index 549d4300e..e34d73cca 100644
--- a/src/extension/internal/emf-inout.cpp
+++ b/src/extension/internal/emf-inout.cpp
@@ -2920,7 +2920,7 @@ std::cout << "BEFORE DRAW"
}
}
- if (0 && strlen(tmp_str.str().c_str())) {
+ if (false && strlen(tmp_str.str().c_str())) {
tmp_outsvg << " <!-- \"";
tmp_outsvg << tmp_str.str().c_str();
tmp_outsvg << "\" -->\n";
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 548caea95..add2f0d37 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -245,7 +245,7 @@ unsigned int PrintEmf::begin(Inkscape::Extension::Print *mod, SPDocument *doc)
}
- if (1) {
+ if (true) {
snprintf(buff, sizeof(buff) - 1, "Screen=%dx%dpx, %dx%dmm", PixelsX, PixelsY, MMX, MMY);
rec = textcomment_set(buff);
if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) {
@@ -1007,7 +1007,7 @@ void PrintEmf::do_clip_if_present(SPStyle const *style){
/* find the first clip_ref at object or up the stack. There may not be one. */
SPClipPath *scp = nullptr;
SPItem *item = SP_ITEM(style->object);
- while(1) {
+ while(true) {
scp = (item->clip_ref ? item->clip_ref->getObject() : nullptr);
if(scp)break;
item = SP_ITEM(item->parent);
@@ -1029,7 +1029,7 @@ void PrintEmf::do_clip_if_present(SPStyle const *style){
*/
Geom::Affine tf = item->transform;
SPItem *scan_item = item;
- while(1) {
+ while(true) {
scan_item = SP_ITEM(scan_item->parent);
if(!scan_item)break;
tf *= scan_item->transform;
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index 18092873e..bd036da05 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -1696,8 +1696,8 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts,
Glib::ustring outputStroke;
Glib::ustring outputStyle;
- processGradient(item, id, tf, gradientNameFill, outputFill, 1);
- processGradient(item, id, tf, gradientNameStroke, outputStroke, 0);
+ processGradient(item, id, tf, gradientNameFill, outputFill, true);
+ processGradient(item, id, tf, gradientNameStroke, outputStroke, false);
souts.writeUString(outputFill);
souts.writeUString(outputStroke);
diff --git a/src/extension/internal/odf.h b/src/extension/internal/odf.h
index e92bc1249..691d6e1f7 100644
--- a/src/extension/internal/odf.h
+++ b/src/extension/internal/odf.h
@@ -311,7 +311,7 @@ private:
bool processStyle(SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill, const Glib::ustring &gradientNameStroke, Glib::ustring& output);
bool processGradient(SPItem *item,
- const Glib::ustring &id, Geom::Affine &tf, Glib::ustring& gradientName, Glib::ustring& output, bool checkFillGradient = 1);
+ const Glib::ustring &id, Geom::Affine &tf, Glib::ustring& gradientName, Glib::ustring& output, bool checkFillGradient = true);
bool writeStyleHeader(Writer &outs);
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index b81d7abcb..5fa21263a 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -1759,7 +1759,7 @@ void PdfParser::doShadingPatternFillFallback(GfxShadingPattern *sPat,
saveState();
// clip to bbox
- if (0 ){//shading->getHasBBox()) {
+ if (false ){//shading->getHasBBox()) {
shading->getBBox(&xMin, &yMin, &xMax, &yMax);
state->moveTo(xMin, yMin);
state->lineTo(xMax, yMin);
@@ -2599,7 +2599,7 @@ void PdfParser::doShowText(const GooString *s) {
builder->beginString(state);
// handle a Type 3 char
- if (font->getType() == fontType3 && 0) {//out->interpretType3Chars()) {
+ if (font->getType() == fontType3 && false) {//out->interpretType3Chars()) {
mat = state->getCTM();
for (int i = 0; i < 6; ++i) {
oldCTM[i] = mat[i];
@@ -2644,7 +2644,7 @@ void PdfParser::doShowText(const GooString *s) {
state->setCTM(newCTM[0], newCTM[1], newCTM[2], newCTM[3], x, y);
//~ the CTM concat values here are wrong (but never used)
//out->updateCTM(state, 1, 0, 0, 1, 0, 0);
- if (0){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
code, u, uLen)) {*/
#if defined(POPPLER_NEW_OBJECT_API)
charProc = ((Gfx8BitFont *)font)->getCharProc(code);
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
index c8e24a5e1..3fdc3db55 100644
--- a/src/extension/internal/pdfinput/svg-builder.cpp
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
@@ -1255,7 +1255,7 @@ void SvgBuilder::_flushText() {
Glib::ustring text_buffer;
// Output all buffered glyphs
- while (1) {
+ while (true) {
const SvgGlyph& glyph = (*i);
std::vector<SvgGlyph>::iterator prev_iterator = i - 1;
// Check if we need to make a new tspan
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index db7c9c9ce..bcc8aea85 100644
--- a/src/extension/internal/wmf-inout.cpp
+++ b/src/extension/internal/wmf-inout.cpp
@@ -1252,8 +1252,8 @@ Wmf::delete_object(PWMF_CALLBACK_DATA d, int index)
d->dc[d->level].style.font_size.computed = 16.0;
d->dc[d->level].style.font_weight.value = SP_CSS_FONT_WEIGHT_400;
d->dc[d->level].style.font_style.value = SP_CSS_FONT_STYLE_NORMAL;
- d->dc[d->level].style.text_decoration_line.underline = 0;
- d->dc[d->level].style.text_decoration_line.line_through = 0;
+ d->dc[d->level].style.text_decoration_line.underline = false;
+ d->dc[d->level].style.text_decoration_line.line_through = false;
d->dc[d->level].style.baseline_shift.value = 0;
}
@@ -3119,8 +3119,8 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri )
d.dc[0].style.font_size.computed = 16.0;
d.dc[0].style.font_weight.value = SP_CSS_FONT_WEIGHT_400;
d.dc[0].style.font_style.value = SP_CSS_FONT_STYLE_NORMAL;
- d.dc[0].style.text_decoration_line.underline = 0;
- d.dc[0].style.text_decoration_line.line_through = 0;
+ d.dc[0].style.text_decoration_line.underline = false;
+ d.dc[0].style.text_decoration_line.line_through = false;
d.dc[0].style.baseline_shift.value = 0;
// Default pen, WMF files that do not specify a pen are unlikely to look very good!
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index c5089b633..a29b2fad5 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -473,7 +473,7 @@ Application::Application(const char* argv, bool use_gui) :
Glib::ustring ui_language = prefs->getString("/ui/language");
if(!ui_language.empty())
{
- setenv("LANGUAGE", ui_language, 1);
+ setenv("LANGUAGE", ui_language, true);
}
/* DebugDialog redirection. On Linux, default to OFF, on Win32, default to ON.
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index b9171d27b..dc69934b1 100644
--- a/src/libnrtype/Layout-TNG-Output.cpp
+++ b/src/libnrtype/Layout-TNG-Output.cpp
@@ -323,7 +323,7 @@ Geom::Affine glyph_matrix;
unsigned lc_index = char_index;
unsigned hold_iisi = _spans[span_index].in_input_stream_item;
int newtarget = 0;
- while(1){
+ while(true){
glyph_index = _characters[lc_index].in_glyph;
if(glyph_index == -1){ // end of a line within a paragraph, for instance
lc_index++;
diff --git a/src/libnrtype/Layout-TNG.cpp b/src/libnrtype/Layout-TNG.cpp
index b3386926a..a9e70a74b 100644
--- a/src/libnrtype/Layout-TNG.cpp
+++ b/src/libnrtype/Layout-TNG.cpp
@@ -17,7 +17,7 @@ const gunichar Layout::UNICODE_SOFT_HYPHEN = 0x00AD;
const double Layout::LINE_HEIGHT_NORMAL = 1.25;
Layout::Layout() :
- _input_truncated(0),
+ _input_truncated(false),
_path_fitted(nullptr)
{
textLength._set = false;
diff --git a/src/livarot/ShapeMisc.cpp b/src/livarot/ShapeMisc.cpp
index f44a326ba..63700e1ba 100644
--- a/src/livarot/ShapeMisc.cpp
+++ b/src/livarot/ShapeMisc.cpp
@@ -163,7 +163,7 @@ Shape::ConvertToForme (Path * dest)
}
}
}
- while (1 /*swdData[curBord].precParc >= 0 */ );
+ while (true /*swdData[curBord].precParc >= 0 */ );
// fin du cas non-oriente
}
}
@@ -316,7 +316,7 @@ Shape::ConvertToForme (Path * dest, int nbP, Path * *orig, bool splitWhenForced)
//printf("suite %d\n",curBord);
}
}
- while (1 /*swdData[curBord].precParc >= 0 */ );
+ while (true /*swdData[curBord].precParc >= 0 */ );
// fin du cas non-oriente
}
}
@@ -527,7 +527,7 @@ Shape::ConvertToFormeNested (Path * dest, int nbP, Path * *orig, int /*wildPath*
//printf("suite %d\n",curBord);
}
}
- while (1 /*swdData[curBord].precParc >= 0 */ );
+ while (true /*swdData[curBord].precParc >= 0 */ );
// fin du cas non-oriente
}
}
diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp
index 4004f183d..53e9d3137 100644
--- a/src/livarot/ShapeSweep.cpp
+++ b/src/livarot/ShapeSweep.cpp
@@ -2496,7 +2496,7 @@ Shape::GetWindings (Shape * /*a*/, Shape * /*b*/, BooleanOp /*mod*/, bool brutal
curDir = true;
}
}
- while (1 /*swdData[curBord].precParc >= 0 */ );
+ while (true /*swdData[curBord].precParc >= 0 */ );
// fin du cas non-oriente
}
}
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index a6c8ab90b..6c07f246c 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -575,7 +575,7 @@ LPEFilletChamfer::doEffect_path(Geom::PathVector const &path_in)
Geom::Path path_chamfer;
path_chamfer.start(tmp_path.finalPoint());
if (eliptical) {
- ccw_toggle = ccw_toggle ? 0 : 1;
+ ccw_toggle = ccw_toggle ? false : true;
path_chamfer.appendNew<Geom::EllipticalArc>(rx, ry, arc_angle, 0, ccw_toggle, end_arc_point);
} else {
path_chamfer.appendNew<Geom::CubicBezier>(handle_1, handle_2, end_arc_point);
@@ -607,7 +607,7 @@ LPEFilletChamfer::doEffect_path(Geom::PathVector const &path_in)
default: //fillet
{
if (eliptical) {
- ccw_toggle = ccw_toggle ? 0 : 1;
+ ccw_toggle = ccw_toggle ? false : true;
tmp_path.appendNew<Geom::EllipticalArc>(rx, ry, arc_angle, 0, ccw_toggle, end_arc_point);
} else {
tmp_path.appendNew<Geom::CubicBezier>(handle_1, handle_2, end_arc_point);
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index 6d0b3cd7e..6764f351c 100644
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -125,7 +125,7 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent,
} else {
Geom::OptRect bbox_of_item;
Preferences *prefs = Preferences::get();
- int prefs_bbox = prefs->getBool("/tools/bounding_box", 0);
+ int prefs_bbox = prefs->getBool("/tools/bounding_box", false);
// We'll only need to obtain the visual bounding box if the user preferences tell
// us to, AND if we are snapping to the bounding box itself. If we're snapping to
// paths only, then we can just as well use the geometric bounding box (which is faster)
@@ -366,7 +366,7 @@ void Inkscape::ObjectSnapper::_collectPaths(Geom::Point /*p*/,
if (_snapmanager->snapprefs.isTargetSnappable(SNAPTARGET_BBOX_EDGE)) {
Preferences *prefs = Preferences::get();
- int prefs_bbox = prefs->getBool("/tools/bounding_box", 0);
+ int prefs_bbox = prefs->getBool("/tools/bounding_box", false);
bbox_type = !prefs_bbox ?
SPItem::VISUAL_BBOX : SPItem::GEOMETRIC_BBOX;
}
diff --git a/src/object/filters/convolvematrix.cpp b/src/object/filters/convolvematrix.cpp
index 0f9c993f6..28fcb0ba1 100644
--- a/src/object/filters/convolvematrix.cpp
+++ b/src/object/filters/convolvematrix.cpp
@@ -28,7 +28,7 @@
SPFeConvolveMatrix::SPFeConvolveMatrix() : SPFilterPrimitive() {
this->bias = 0;
- this->divisorIsSet = 0;
+ this->divisorIsSet = false;
this->divisor = 0;
//Setting default values:
diff --git a/src/object/filters/image.cpp b/src/object/filters/image.cpp
index 4b58ce464..83a185cfb 100644
--- a/src/object/filters/image.cpp
+++ b/src/object/filters/image.cpp
@@ -35,7 +35,7 @@
SPFeImage::SPFeImage() : SPFilterPrimitive() {
this->href = nullptr;
- this->from_element = 0;
+ this->from_element = false;
this->SVGElemRef = nullptr;
this->SVGElem = nullptr;
diff --git a/src/object/filters/turbulence.cpp b/src/object/filters/turbulence.cpp
index b626b2380..6ba3a3eee 100644
--- a/src/object/filters/turbulence.cpp
+++ b/src/object/filters/turbulence.cpp
@@ -23,7 +23,7 @@
#include "display/nr-filter.h"
SPFeTurbulence::SPFeTurbulence() : SPFilterPrimitive() {
- this->stitchTiles = 0;
+ this->stitchTiles = false;
this->seed = 0;
this->numOctaves = 0;
this->type = Inkscape::Filters::TURBULENCE_FRACTALNOISE;
diff --git a/src/object/sp-gradient.cpp b/src/object/sp-gradient.cpp
index 1fed2a206..0e3fa8e77 100644
--- a/src/object/sp-gradient.cpp
+++ b/src/object/sp-gradient.cpp
@@ -107,7 +107,7 @@ bool SPGradient::isEquivalent(SPGradient *that)
bool status = false;
- while(1){ // not really a loop, used to avoid deep nesting or multiple exit points from function
+ while(true){ // not really a loop, used to avoid deep nesting or multiple exit points from function
if (this->getStopCount() != that->getStopCount()) { break; }
if (this->hasStops() != that->hasStops()) { break; }
if (!this->getVector() || !that->getVector()) { break; }
@@ -167,7 +167,7 @@ bool SPGradient::isAligned(SPGradient *that)
matches the default value.
*/
- while(1){ // not really a loop, used to avoid deep nesting or multiple exit points from function
+ while(true){ // not really a loop, used to avoid deep nesting or multiple exit points from function
if(this->gradientTransform_set != that->gradientTransform_set) { break; }
if(this->gradientTransform_set &&
(this->gradientTransform != that->gradientTransform)) { break; }
diff --git a/src/object/sp-guide.cpp b/src/object/sp-guide.cpp
index eb0b27ab4..de15c7bcf 100644
--- a/src/object/sp-guide.cpp
+++ b/src/object/sp-guide.cpp
@@ -48,7 +48,7 @@ using std::vector;
SPGuide::SPGuide()
: SPObject()
, label(nullptr)
- , locked(0)
+ , locked(false)
, normal_to_line(Geom::Point(0.,1.))
, point_on_line(Geom::Point(0.,0.))
, color(0x0000ff7f)
diff --git a/src/object/sp-item.cpp b/src/object/sp-item.cpp
index 6e4a163dc..59ea0a554 100644
--- a/src/object/sp-item.cpp
+++ b/src/object/sp-item.cpp
@@ -1496,7 +1496,7 @@ void SPItem::doWriteTransform(Geom::Affine const &transform, Geom::Affine const
} // endif(compensate)
- gint preserve = prefs->getBool("/options/preservetransform/value", 0);
+ gint preserve = prefs->getBool("/options/preservetransform/value", false);
Geom::Affine transform_attr (transform);
// CPPIFY: check this code.
diff --git a/src/object/sp-paint-server.cpp b/src/object/sp-paint-server.cpp
index 79e60d116..9ada0fee5 100644
--- a/src/object/sp-paint-server.cpp
+++ b/src/object/sp-paint-server.cpp
@@ -30,7 +30,7 @@ bool SPPaintServerReference::_acceptObject(SPObject *obj) const
}
SPPaintServer::SPPaintServer() : SPObject() {
- this->swatch = 0;
+ this->swatch = false;
}
SPPaintServer::~SPPaintServer() = default;
diff --git a/src/object/sp-star.cpp b/src/object/sp-star.cpp
index 1375bcecb..235fd32d8 100644
--- a/src/object/sp-star.cpp
+++ b/src/object/sp-star.cpp
@@ -34,7 +34,7 @@
SPStar::SPStar() : SPPolygon() ,
sides(5),
center(0, 0),
- flatsided(0),
+ flatsided(false),
rounded(0.0),
randomized(0.0)
{
diff --git a/src/selcue.cpp b/src/selcue.cpp
index 375156412..f7d1cdba6 100644
--- a/src/selcue.cpp
+++ b/src/selcue.cpp
@@ -178,7 +178,7 @@ void Inkscape::SelCue::_newItemBboxes()
nullptr);
SP_CTRLRECT(box)->setRectangle(*b);
- SP_CTRLRECT(box)->setColor(0x000000a0, 0, 0);
+ SP_CTRLRECT(box)->setColor(0x000000a0, false, 0);
SP_CTRLRECT(box)->setDashed(true);
SP_CTRLRECT(box)->setShadow(1, 0xffffffff);
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 3ecefadde..2108db35a 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -805,7 +805,7 @@ void ObjectSet::popFromGroup(){
sp_item_group_ungroup(static_cast<SPGroup*>(parent_group), children, false);
}
else {
- toNextLayer(1);
+ toNextLayer(true);
}
parent_group->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
@@ -3064,8 +3064,8 @@ void ObjectSet::toGuides()
}
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- bool deleteitems = !prefs->getBool("/tools/cvg_keep_objects", 0);
- bool wholegroups = prefs->getBool("/tools/cvg_convert_whole_groups", 0);
+ bool deleteitems = !prefs->getBool("/tools/cvg_keep_objects", false);
+ bool wholegroups = prefs->getBool("/tools/cvg_convert_whole_groups", false);
// If an object is earlier in the selection list than its clone, and it is deleted, then the clone will have changed
// and its entry in the selection list is invalid (crash).
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 08cf9584a..7a3971994 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -2400,7 +2400,7 @@ sp_selected_path_simplify(SPDesktop *desktop)
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gdouble simplifyThreshold =
prefs->getDouble("/options/simplifythreshold/value", 0.003);
- bool simplifyJustCoalesce = prefs->getBool("/options/simplifyjustcoalesce/value", 0);
+ bool simplifyJustCoalesce = prefs->getBool("/options/simplifyjustcoalesce/value", false);
//Get the current time
GTimeVal currentTimeVal;
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index f1d672fce..429353493 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -2694,11 +2694,11 @@ SPITextDecorationLine::read( gchar const *str ) {
// This method ignores inlineid keys and extra delimiters, so " ,,, blink hello" will set
// blink and ignore hello
const gchar *hstr = str;
- while (1) {
+ while (true) {
if (*str == ' ' || *str == ',' || *str == '\0'){
int slen = str - hstr;
// CSS 2 keywords
- while(1){ // not really a loop, used to avoid a goto
+ while(true){ // not really a loop, used to avoid a goto
hit_one = true; // most likely we will
if ((slen == 9) && strneq(hstr, "underline", slen)){ found_underline = true; break; }
if ((slen == 8) && strneq(hstr, "overline", slen)){ found_overline = true; break; }
@@ -2833,7 +2833,7 @@ SPITextDecorationStyle::read( gchar const *str ) {
// this method ignores inlineid keys and extra delimiters, so " ,,, style hello" will set style and ignore hello
// if more than one style is present, the first is used
const gchar *hstr = str;
- while (1) {
+ while (true) {
if (*str == ' ' || *str == ',' || *str == '\0'){
int slen = str - hstr;
if ( (slen == 5) && strneq(hstr, "solid", slen)){ found_solid = true; found_one = true; break; }
@@ -2977,7 +2977,7 @@ SPITextDecoration::read( gchar const *str ) {
test_color.read( "currentColor" ); // Default value
test_color.set = false;
const gchar *hstr = str;
- while (1) {
+ while (true) {
if (*str == ' ' || *str == ',' || *str == '\0'){
int slen = str - hstr;
gchar *frag = g_strndup(hstr,slen+1); // only send one piece at a time, since keywords may be intermixed
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);
diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp
index 7ebc20b6f..19443716c 100644
--- a/src/widgets/button.cpp
+++ b/src/widgets/button.cpp
@@ -227,7 +227,7 @@ static void sp_button_action_set_active(SPButton *button, bool active)
}
/* temporarily lobotomized until SPActions are per-view */
- if (0 && !active != !SP_BUTTON_IS_DOWN(button)) {
+ if (false && !active != !SP_BUTTON_IS_DOWN(button)) {
sp_button_toggle_set_down(button, active);
}
}