summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gradient-drag.cpp20
-rw-r--r--src/inkview-window.cpp2
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp10
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp6
-rw-r--r--src/live_effects/lpe-powerclip.cpp12
-rw-r--r--src/path-chemistry.cpp5
-rw-r--r--src/text-editing.cpp2
-rw-r--r--src/ui/widget/font-variants.cpp4
-rw-r--r--src/ui/widget/ink-color-wheel.cpp2
-rw-r--r--src/widgets/paint-selector.cpp2
10 files changed, 30 insertions, 35 deletions
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index f27ac1efe..bb895ab72 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -2109,10 +2109,10 @@ void GrDrag::addCurve(SPItem *item, Geom::Point p0, Geom::Point p1, Geom::Point
GrDragger* dragger1 = getDraggerFor(item, POINT_MG_CORNER, corner1, fill_or_stroke);
GrDragger* dragger2 = getDraggerFor(item, POINT_MG_HANDLE, handle0, fill_or_stroke);
GrDragger* dragger3 = getDraggerFor(item, POINT_MG_HANDLE, handle1, fill_or_stroke);
- if (dragger0->knot && (dragger0->knot->flags & SP_KNOT_MOUSEOVER) ||
- dragger1->knot && (dragger1->knot->flags & SP_KNOT_MOUSEOVER) ||
- dragger2->knot && (dragger2->knot->flags & SP_KNOT_MOUSEOVER) ||
- dragger3->knot && (dragger3->knot->flags & SP_KNOT_MOUSEOVER) ) {
+ if ((dragger0->knot && (dragger0->knot->flags & SP_KNOT_MOUSEOVER)) ||
+ (dragger1->knot && (dragger1->knot->flags & SP_KNOT_MOUSEOVER)) ||
+ (dragger2->knot && (dragger2->knot->flags & SP_KNOT_MOUSEOVER)) ||
+ (dragger3->knot && (dragger3->knot->flags & SP_KNOT_MOUSEOVER)) ) {
highlight = true;
}
@@ -2207,9 +2207,9 @@ void GrDrag::addDraggersMesh(SPMeshGradient *mg, SPItem *item, Inkscape::PaintTa
// Show/hide mesh on fill/stroke. This doesn't work at the moment... and prevents node color updating.
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- bool show_handles = abs(prefs->getBool("/tools/mesh/show_handles", true));
- bool edit_fill = abs(prefs->getBool("/tools/mesh/edit_fill", true));
- bool edit_stroke = abs(prefs->getBool("/tools/mesh/edit_stroke", true));
+ bool show_handles = (prefs->getBool("/tools/mesh/show_handles", true));
+ bool edit_fill = (prefs->getBool("/tools/mesh/edit_fill", true));
+ bool edit_stroke = (prefs->getBool("/tools/mesh/edit_stroke", true));
// Make sure we have at least one patch defined.
if( mg->array.patch_rows() == 0 || mg->array.patch_columns() == 0 ) {
@@ -2293,7 +2293,7 @@ void GrDrag::refreshDraggersMesh(SPMeshGradient *mg, SPItem *item, Inkscape::Pai
std::vector< std::vector< SPMeshNode* > > nodes = mg->array.nodes;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- bool show_handles = abs(prefs->getBool("/tools/mesh/show_handles", true));
+ bool show_handles = (prefs->getBool("/tools/mesh/show_handles", true));
// Make sure we have at least one patch defined.
if( mg->array.patch_rows() == 0 || mg->array.patch_columns() == 0 ) {
@@ -2531,7 +2531,7 @@ void GrDrag::updateLines()
} else if ( SP_IS_MESHGRADIENT(server) ) {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- bool edit_fill = abs(prefs->getBool("/tools/mesh/edit_fill", true));
+ bool edit_fill = (prefs->getBool("/tools/mesh/edit_fill", true));
SPMeshGradient *mg = SP_MESHGRADIENT(server);
@@ -2613,7 +2613,7 @@ void GrDrag::updateLines()
} else if ( SP_IS_MESHGRADIENT(server) ) {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- bool edit_stroke = abs(prefs->getBool("/tools/mesh/edit_stroke", true));
+ bool edit_stroke = (prefs->getBool("/tools/mesh/edit_stroke", true));
if (edit_stroke) {
diff --git a/src/inkview-window.cpp b/src/inkview-window.cpp
index d69734131..441d1e3c0 100644
--- a/src/inkview-window.cpp
+++ b/src/inkview-window.cpp
@@ -107,7 +107,7 @@ InkviewWindow::create_file_list(const std::vector<Glib::RefPtr<Gio::File > >& fi
Glib::RefPtr<Gio::FileEnumerator> children = file->enumerate_children();
Glib::RefPtr<Gio::FileInfo> info;
std::vector<Glib::RefPtr<Gio::File> > input;
- while (info = children->next_file()) {
+ while ((info = children->next_file())) {
input.push_back(children->get_child(info));
}
auto new_files = create_file_list(input);
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index 1dda91e6f..3632d3a62 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -135,8 +135,8 @@ LPECopyRotate::doAfterEffect (SPLPEItem const* lpeitem)
if (id.empty()) {
return;
}
- SPObject *elemref = nullptr;
- if (elemref = document->getObjectById(id.c_str())) {
+ SPObject *elemref = document->getObjectById(id.c_str());
+ if (elemref) {
SP_ITEM(elemref)->setHidden(true);
}
counter++;
@@ -277,16 +277,14 @@ LPECopyRotate::toItem(Geom::Affine transform, size_t i, bool reset)
elemref_id += "-";
elemref_id += this->lpeobj->getId();
items.push_back(elemref_id);
- SPObject *elemref= nullptr;
+ SPObject *elemref = document->getObjectById(elemref_id.c_str());
Inkscape::XML::Node *phantom = nullptr;
- if (elemref = document->getObjectById(elemref_id.c_str())) {
+ if (elemref) {
phantom = elemref->getRepr();
} else {
phantom = createPathBase(sp_lpe_item);
phantom->setAttribute("id", elemref_id.c_str());
reset = true;
- }
- if (!elemref) {
elemref = container->appendChildRepr(phantom);
Inkscape::GC::release(phantom);
}
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index 399f1de97..f5359ab85 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -347,16 +347,14 @@ LPEMirrorSymmetry::toMirror(Geom::Affine transform, bool reset)
elemref_id += this->lpeobj->getId();
items.clear();
items.push_back(elemref_id);
- SPObject *elemref = nullptr;
+ SPObject *elemref = document->getObjectById(elemref_id.c_str());
Inkscape::XML::Node *phantom = nullptr;
- if (elemref = document->getObjectById(elemref_id.c_str())) {
+ if (elemref) {
phantom = elemref->getRepr();
} else {
phantom = createPathBase(sp_lpe_item);
phantom->setAttribute("id", elemref_id.c_str());
reset = true;
- }
- if (!elemref) {
elemref = container->appendChildRepr(phantom);
Inkscape::GC::release(phantom);
}
diff --git a/src/live_effects/lpe-powerclip.cpp b/src/live_effects/lpe-powerclip.cpp
index c710de00f..432f2a40d 100644
--- a/src/live_effects/lpe-powerclip.cpp
+++ b/src/live_effects/lpe-powerclip.cpp
@@ -211,8 +211,8 @@ LPEPowerClip::updateInverse (SPItem * clip_data) {
updateInverse(subitem);
}
} else if (SP_IS_SHAPE(clip_data)) {
- SPObject *elemref = nullptr;
- if (elemref = document->getObjectById(Glib::ustring("lpe_") + Glib::ustring(this->getLPEObj()->getId()))) {
+ SPObject *elemref = document->getObjectById(Glib::ustring("lpe_") + Glib::ustring(this->getLPEObj()->getId()));
+ if (elemref) {
SPCurve * c = nullptr;
c = SP_SHAPE(elemref)->getCurve();
if (c) {
@@ -258,8 +258,8 @@ LPEPowerClip::removeInverse (SPItem * clip_data){
is_inverse.param_setValue((Glib::ustring)"false", true);
}
}
- SPObject *elemref = nullptr;
- if (elemref = document->getObjectById(Glib::ustring("lpe_") + Glib::ustring(this->getLPEObj()->getId()))) {
+ SPObject *elemref = document->getObjectById(Glib::ustring("lpe_") + Glib::ustring(this->getLPEObj()->getId()));
+ if (elemref) {
elemref ->deleteObject(false);
}
}
@@ -298,8 +298,8 @@ LPEPowerClip::doEffect_path(Geom::PathVector const & path_in){
if (!document) {
return path_out;
}
- SPObject *elemref = nullptr;
- if (elemref = document->getObjectById(Glib::ustring("lpe_") + Glib::ustring(this->getLPEObj()->getId()))) {
+ SPObject *elemref = document->getObjectById(Glib::ustring("lpe_") + Glib::ustring(this->getLPEObj()->getId()));
+ if (elemref) {
SPCurve * c = nullptr;
c = SP_SHAPE(elemref)->getCurve();
if (c) {
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index b58fa4f15..56c93289d 100644
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
@@ -401,10 +401,9 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>&
if (lpeitem) {
selected.erase(remove(selected.begin(), selected.end(), item), selected.end());
lpeitem->removeAllPathEffects(true);
- SPObject *elemref = nullptr;
- if (elemref = document->getObjectById(id)) {
+ SPObject *elemref = document->getObjectById(id);
+ if (elemref) {
//If the LPE item is a shape is converted to a path so we need to reupdate the item
-
item = dynamic_cast<SPItem *>(elemref);
selected.push_back(item);
}
diff --git a/src/text-editing.cpp b/src/text-editing.cpp
index 0d0fcb682..145e5a4b4 100644
--- a/src/text-editing.cpp
+++ b/src/text-editing.cpp
@@ -1241,7 +1241,7 @@ sp_te_adjust_line_height (SPObject *object, double amount, double average, bool
// Always set if top level true.
// Also set if line_height is set to a non-zero value.
if (top_level ||
- (style->line_height.set && !style->line_height.inherit && !style->line_height.computed == 0)){
+ (style->line_height.set && !style->line_height.inherit && (!(style->line_height.computed) == 0))){
// Scale default values
if (!style->line_height.set || style->line_height.inherit || style->line_height.normal) {
diff --git a/src/ui/widget/font-variants.cpp b/src/ui/widget/font-variants.cpp
index 8f99bd74c..a8ff3893f 100644
--- a/src/ui/widget/font-variants.cpp
+++ b/src/ui/widget/font-variants.cpp
@@ -1046,7 +1046,7 @@ namespace Widget {
for (auto table: res->openTypeTables) {
if (table.first == "case" ||
table.first == "hist" ||
- table.first[0] == 's' && table.first[1] == 's' && !(table.first[2] == 't')) {
+ (table.first[0] == 's' && table.first[1] == 's' && !(table.first[2] == 't'))) {
if( (it = table_copy.find(table.first)) != table_copy.end() ) table_copy.erase( it );
@@ -1063,7 +1063,7 @@ namespace Widget {
table.first == "cwsh" ||
table.first == "ornm" ||
table.first == "nalt" ||
- table.first[0] == 'c' && table.first[1] == 'v') {
+ (table.first[0] == 'c' && table.first[1] == 'v')) {
if (table.second.input.length() == 0) {
// This can happen if a table is not in the 'DFLT' script and 'dflt' language.
diff --git a/src/ui/widget/ink-color-wheel.cpp b/src/ui/widget/ink-color-wheel.cpp
index db3890548..cc2c8f688 100644
--- a/src/ui/widget/ink-color-wheel.cpp
+++ b/src/ui/widget/ink-color-wheel.cpp
@@ -528,7 +528,7 @@ ColorWheel::on_button_press_event(GdkEventButton* event)
bool
ColorWheel::on_button_release_event(GdkEventButton* event)
{
- _mode == DRAG_NONE;
+ _mode = DRAG_NONE;
return true;
}
diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp
index 920bae744..6b63905c0 100644
--- a/src/widgets/paint-selector.cpp
+++ b/src/widgets/paint-selector.cpp
@@ -678,7 +678,7 @@ static void sp_paint_selector_set_mode_color(SPPaintSelector *psel, SPPaintSelec
sp_paint_selector_set_style_buttons(psel, psel->solid);
gtk_widget_set_sensitive(psel->style, TRUE);
- if ((psel->mode == SPPaintSelector::MODE_SOLID_COLOR)) {
+ if (psel->mode == SPPaintSelector::MODE_SOLID_COLOR) {
/* Already have color selector */
// Do nothing
} else {