summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-03-16 22:29:49 +0000
committerJabiertxof <jtx@jtx>2017-03-16 22:29:49 +0000
commitfdd8ce77fa742072a1cea8136acaeed1dae079b5 (patch)
tree6418cb90555b397b3c39ed8a07e5f3f0dd158a6a /src
parentFix rendering when canvas rotated. General code clean-up and documentation. (diff)
downloadinkscape-fdd8ce77fa742072a1cea8136acaeed1dae079b5.tar.gz
inkscape-fdd8ce77fa742072a1cea8136acaeed1dae079b5.zip
Remove some compiling warns
(bzr r15599)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/effect.cpp2
-rw-r--r--src/live_effects/lpe-clone-original.cpp2
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp6
-rw-r--r--src/live_effects/lpe-measure-line.cpp8
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp2
-rw-r--r--src/live_effects/lpeobject.h6
6 files changed, 12 insertions, 14 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index f664870ec..017947cda 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -440,7 +440,7 @@ Effect::processObjects(LpeAction lpe_action)
return;
}
SPObject *elemref = NULL;
- if (elemref = document->getObjectById(id)) {
+ if ((elemref = document->getObjectById(id))) {
Inkscape::XML::Node * elemnode = elemref->getRepr();
std::vector<SPItem*> item_list;
item_list.push_back(SP_ITEM(elemref));
diff --git a/src/live_effects/lpe-clone-original.cpp b/src/live_effects/lpe-clone-original.cpp
index 440af6f9c..c41b1ef95 100644
--- a/src/live_effects/lpe-clone-original.cpp
+++ b/src/live_effects/lpe-clone-original.cpp
@@ -193,7 +193,7 @@ LPECloneOriginal::cloneAttrbutes(SPObject *origin, SPObject *dest, bool live, co
while (*styleiter != NULL) {
const char* attribute = (*styleiter);
const char* origin_attribute = sp_repr_css_property(css_origin, attribute, "");
- if (origin_attribute == "") {
+ if (!strlen(origin_attribute)) { //==0
sp_repr_css_set_property (css_dest, attribute, NULL);
} else {
sp_repr_css_set_property (css_dest, attribute, origin_attribute);
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index 9ba680cd4..bf82b5deb 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -112,7 +112,7 @@ LPECopyRotate::doAfterEffect (SPLPEItem const* lpeitem)
return;
}
SPObject *elemref = NULL;
- if (elemref = document->getObjectById(id)) {
+ if ((elemref = document->getObjectById(id))) {
SP_ITEM(elemref)->setHidden(true);
}
counter++;
@@ -124,7 +124,7 @@ LPECopyRotate::doAfterEffect (SPLPEItem const* lpeitem)
SPObject *elemref = NULL;
char * id = g_strdup(Glib::ustring("rotated-").append("1").append("-").append(sp_lpe_item->getRepr()->attribute("id")).c_str());
guint counter = 0;
- while(elemref = document->getObjectById(id)) {
+ while((elemref = document->getObjectById(id))) {
if (SP_ITEM(elemref)->isHidden()) {
items.push_back(id);
}
@@ -229,7 +229,7 @@ LPECopyRotate::toItem(Geom::Affine transform, size_t i, bool reset)
items.push_back(elemref_id);
SPObject *elemref= NULL;
Inkscape::XML::Node *phantom = NULL;
- if (elemref = document->getObjectById(elemref_id)) {
+ if ((elemref = document->getObjectById(elemref_id))) {
phantom = elemref->getRepr();
} else {
phantom = sp_lpe_item->getRepr()->duplicate(xml_doc);
diff --git a/src/live_effects/lpe-measure-line.cpp b/src/live_effects/lpe-measure-line.cpp
index 83ae60fc4..86d72615c 100644
--- a/src/live_effects/lpe-measure-line.cpp
+++ b/src/live_effects/lpe-measure-line.cpp
@@ -177,7 +177,7 @@ LPEMeasureLine::createArrowMarker(const char * mode)
Inkscape::XML::Document *xml_doc = document->getReprDoc();
SPObject *elemref = NULL;
Inkscape::XML::Node *arrow = NULL;
- if (elemref = document->getObjectById(mode)) {
+ if ((elemref = document->getObjectById(mode))) {
Inkscape::XML::Node *arrow= elemref->getRepr();
if (arrow) {
arrow->setAttribute("sodipodi:insensitive", "true");
@@ -257,7 +257,7 @@ LPEMeasureLine::createTextLabel(Geom::Point pos, double length, Geom::Coord angl
const char * id = g_strdup(Glib::ustring("text-on-").append(this->getRepr()->attribute("id")).c_str());
SPObject *elemref = NULL;
Inkscape::XML::Node *rtspan = NULL;
- if (elemref = document->getObjectById(id)) {
+ if ((elemref = document->getObjectById(id))) {
if (remove) {
elemref->deleteObject();
return;
@@ -422,7 +422,7 @@ LPEMeasureLine::createLine(Geom::Point start,Geom::Point end, const char * id, b
line_path.appendNew<Geom::LineSegment>(end);
line_pathv.push_back(line_path);
}
- if (elemref = document->getObjectById(id)) {
+ if ((elemref = document->getObjectById(id))) {
if (remove) {
elemref->deleteObject();
return;
@@ -625,7 +625,7 @@ LPEMeasureLine::doBeforeEffect (SPLPEItem const* lpeitem)
if ((anotation_width/2) + std::abs(text_right_left) > Geom::distance(start,end)/2.0) {
Geom::Point sstart = end - Point::polar(angle_cross, position);
Geom::Point send = end - Point::polar(angle_cross, position);
- if (text_right_left < 0 && flip_side || text_right_left > 0 && !flip_side) {
+ if ((text_right_left < 0 && flip_side) || (text_right_left > 0 && !flip_side)) {
sstart = start - Point::polar(angle_cross, position);
send = start - Point::polar(angle_cross, position);
}
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index c31ce7c01..97015c34d 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -244,7 +244,7 @@ LPEMirrorSymmetry::toMirror(Geom::Affine transform)
items.push_back(elemref_id);
SPObject *elemref= NULL;
Inkscape::XML::Node *phantom = NULL;
- if (elemref = document->getObjectById(elemref_id)) {
+ if ((elemref = document->getObjectById(elemref_id))) {
phantom = elemref->getRepr();
} else {
phantom = sp_lpe_item->getRepr()->duplicate(xml_doc);
diff --git a/src/live_effects/lpeobject.h b/src/live_effects/lpeobject.h
index 087223947..e468b4080 100644
--- a/src/live_effects/lpeobject.h
+++ b/src/live_effects/lpeobject.h
@@ -39,12 +39,10 @@ public:
/* Note that the returned pointer can be NULL in a valid LivePathEffectObject contained in a valid list of lpeobjects in an lpeitem!
* So one should always check whether the returned value is NULL or not */
Inkscape::LivePathEffect::Effect * get_lpe() {
- if(this) return lpe;
- else return NULL;
+ return lpe;
}
Inkscape::LivePathEffect::Effect const * get_lpe() const {
- if(this) return lpe;
- else return NULL;
+ return lpe;
};
Inkscape::LivePathEffect::Effect *lpe; // this can be NULL in a valid LivePathEffectObject