summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2011-10-15 20:03:44 +0000
committerKris <Kris.De.Gussem@hotmail.com>2011-10-15 20:03:44 +0000
commit47b55c0d9fccf3994f86fd764cefca3a2f734dbe (patch)
treefae67e17d41b9848ab204db00cc37ecbd2b9098b
parentUse desktop coordinates for finding snap candidates (regression introduced in... (diff)
downloadinkscape-47b55c0d9fccf3994f86fd764cefca3a2f734dbe.tar.gz
inkscape-47b55c0d9fccf3994f86fd764cefca3a2f734dbe.zip
cppcheck
(bzr r10678)
-rw-r--r--src/color-rgba.h4
-rw-r--r--src/composite-undo-stack-observer.cpp4
-rw-r--r--src/display/curve.cpp8
-rw-r--r--src/display/snap-indicator.cpp2
-rw-r--r--src/extension/db.cpp2
-rw-r--r--src/extension/execution-env.cpp2
-rw-r--r--src/extension/implementation/script.cpp2
-rw-r--r--src/extension/internal/bluredge.cpp2
-rw-r--r--src/extension/internal/cairo-render-context.cpp2
-rw-r--r--src/extension/internal/odf.cpp12
-rw-r--r--src/livarot/Shape.h2
-rw-r--r--src/main-cmdlineact.cpp4
-rw-r--r--src/selcue.cpp8
-rw-r--r--src/snapped-curve.cpp16
-rw-r--r--src/snapped-point.cpp2
15 files changed, 36 insertions, 36 deletions
diff --git a/src/color-rgba.h b/src/color-rgba.h
index 8c21d5e52..543ef5926 100644
--- a/src/color-rgba.h
+++ b/src/color-rgba.h
@@ -111,7 +111,7 @@ public:
Check each value to see if they are equal. If they all are,
return TRUE.
*/
- bool operator== (const ColorRGBA other) const {
+ bool operator== (const ColorRGBA &other) const {
for (int i = 0; i < 4; i++) {
if (_c[i] != other[i])
return false;
@@ -135,7 +135,7 @@ public:
value are multiplied by 1.0 - weight and the second object by weight.
This means that they should always be balanced by the parameter.
*/
- ColorRGBA average (const ColorRGBA second, const float weight = 0.5) const {
+ ColorRGBA average (const ColorRGBA &second, const float weight = 0.5) const {
float returnval[4];
for (int i = 0; i < 4; i++) {
diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp
index 03e4796bd..6af34d92a 100644
--- a/src/composite-undo-stack-observer.cpp
+++ b/src/composite-undo-stack-observer.cpp
@@ -139,14 +139,14 @@ CompositeUndoStackObserver::_unlock()
if (!--this->_iterating) {
// Remove marked observers
UndoObserverRecordList::iterator i = this->_active.begin();
- for(; i != this->_active.begin(); i++) {
+ for(; i != this->_active.begin(); ++i) {
if (i->to_remove) {
this->_active.erase(i);
}
}
i = this->_pending.begin();
- for(; i != this->_pending.begin(); i++) {
+ for(; i != this->_pending.begin(); ++i) {
if (i->to_remove) {
this->_active.erase(i);
}
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 5c18324eb..d52ee1fba 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -322,7 +322,7 @@ SPCurve::is_closed() const
return false;
} else {
bool closed = true;
- for (Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); it++) {
+ for (Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) {
if ( ! it->closed() ) {
closed = false;
break;
@@ -506,11 +506,11 @@ SPCurve::append(SPCurve const *curve2,
_pathv.push_back( (*it) );
}
- for (it++; it != curve2->_pathv.end(); it++) {
+ for (it++; it != curve2->_pathv.end(); ++it) {
_pathv.push_back( (*it) );
}
} else {
- for (Geom::PathVector::const_iterator it = curve2->_pathv.begin(); it != curve2->_pathv.end(); it++) {
+ for (Geom::PathVector::const_iterator it = curve2->_pathv.begin(); it != curve2->_pathv.end(); ++it) {
_pathv.push_back( (*it) );
}
}
@@ -553,7 +553,7 @@ SPCurve::append_continuous(SPCurve const *c1, gdouble tolerance)
newfirstpath.setInitial(lastpath.finalPoint());
lastpath.append( newfirstpath );
- for (path_it++; path_it != c1->_pathv.end(); path_it++) {
+ for (++path_it; path_it != c1->_pathv.end(); ++path_it) {
_pathv.push_back( (*path_it) );
}
diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp
index 72fdfbee7..e542d0c88 100644
--- a/src/display/snap-indicator.cpp
+++ b/src/display/snap-indicator.cpp
@@ -362,7 +362,7 @@ SnapIndicator::remove_snapsource()
void
SnapIndicator::remove_debugging_points()
{
- for (std::list<TemporaryItem *>::const_iterator i = _debugging_points.begin(); i != _debugging_points.end(); i++) {
+ for (std::list<TemporaryItem *>::const_iterator i = _debugging_points.begin(); i != _debugging_points.end(); ++i) {
_desktop->remove_temporary_canvasitem(*i);
}
_debugging_points.clear();
diff --git a/src/extension/db.cpp b/src/extension/db.cpp
index 342a18b84..a3c54915d 100644
--- a/src/extension/db.cpp
+++ b/src/extension/db.cpp
@@ -109,7 +109,7 @@ DB::foreach (void (*in_func)(Extension * in_plug, gpointer in_data), gpointer in
{
std::list <Extension *>::iterator cur;
- for (cur = modulelist.begin(); cur != modulelist.end(); cur++) {
+ for (cur = modulelist.begin(); cur != modulelist.end(); ++cur) {
// printf("foreach: %s\n", (*cur)->get_id());
in_func((*cur), in_data);
}
diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp
index b05685902..646caa36a 100644
--- a/src/extension/execution-env.cpp
+++ b/src/extension/execution-env.cpp
@@ -193,7 +193,7 @@ ExecutionEnv::reselect (void) {
Inkscape::Selection * selection = sp_desktop_selection(desktop);
- for (std::list<Glib::ustring>::iterator i = _selected.begin(); i != _selected.end(); i++) {
+ for (std::list<Glib::ustring>::iterator i = _selected.begin(); i != _selected.end(); ++i) {
SPObject * obj = doc->getObjectById(i->c_str());
if (obj != NULL) {
selection->add(obj);
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index e4d850e5f..ca9c094db 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -821,7 +821,7 @@ void Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newr
}
// Delete the attributes of the old root nodes.
- for (std::vector<gchar const *>::const_iterator it = attribs.begin(); it != attribs.end(); it++) {
+ for (std::vector<gchar const *>::const_iterator it = attribs.begin(); it != attribs.end(); ++it) {
oldroot->setAttribute(*it, NULL);
}
diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp
index 76582ab05..3d4754adc 100644
--- a/src/extension/internal/bluredge.cpp
+++ b/src/extension/internal/bluredge.cpp
@@ -68,7 +68,7 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View
selection->clear();
for(std::list<SPItem *>::iterator item = items.begin();
- item != items.end(); item++) {
+ item != items.end(); ++item) {
SPItem * spitem = *item;
std::vector<Inkscape::XML::Node *> new_items(steps);
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 584942c4f..b8e924926 100644
--- a/src/extension/internal/cairo-render-context.cpp
+++ b/src/extension/internal/cairo-render-context.cpp
@@ -1473,7 +1473,7 @@ unsigned int CairoRenderContext::_showGlyphs(cairo_t *cr, PangoFont * /*font*/,
unsigned int num_invalid_glyphs = 0;
unsigned int i = 0; // is a counter for indexing the glyphs array, only counts the valid glyphs
- for (std::vector<CairoGlyphInfo>::const_iterator it_info = glyphtext.begin() ; it_info != glyphtext.end() ; it_info++) {
+ for (std::vector<CairoGlyphInfo>::const_iterator it_info = glyphtext.begin() ; it_info != glyphtext.end() ; ++it_info) {
// skip glyphs which are PANGO_GLYPH_EMPTY (0x0FFFFFFF)
// or have the PANGO_GLYPH_UNKNOWN_FLAG (0x10000000) set
if (it_info->index == 0x0FFFFFFF || it_info->index & 0x10000000) {
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index 735c57798..2c6a1a80b 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -1161,7 +1161,7 @@ bool OdfOutput::writeManifest(ZipFile &zf)
outs.printf(" <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"meta.xml\"/>\n");
outs.printf(" <!--List our images here-->\n");
std::map<Glib::ustring, Glib::ustring>::iterator iter;
- for (iter = imageTable.begin() ; iter!=imageTable.end() ; iter++)
+ for (iter = imageTable.begin() ; iter!=imageTable.end() ; ++iter)
{
Glib::ustring oldName = iter->first;
Glib::ustring newName = iter->second;
@@ -1241,7 +1241,7 @@ bool OdfOutput::writeMeta(ZipFile &zf)
outs.printf(" <meta:initial-creator>%#s</meta:initial-creator>\n",
creator.c_str());
outs.printf(" <meta:creation-date>%#s</meta:creation-date>\n", date.c_str());
- for (iter = metadata.begin() ; iter != metadata.end() ; iter++)
+ for (iter = metadata.begin() ; iter != metadata.end() ; ++iter)
{
Glib::ustring name = iter->first;
Glib::ustring value = iter->second;
@@ -1303,7 +1303,7 @@ bool OdfOutput::writeStyle(ZipFile &zf)
*/
outs.printf("<!-- ####### Styles from Inkscape document ####### -->\n");
std::vector<StyleInfo>::iterator iter;
- for (iter = styleTable.begin() ; iter != styleTable.end() ; iter++)
+ for (iter = styleTable.begin() ; iter != styleTable.end() ; ++iter)
{
outs.printf("<style:style style:name=\"%s\"", iter->name.c_str());
StyleInfo s(*iter);
@@ -1331,7 +1331,7 @@ bool OdfOutput::writeStyle(ZipFile &zf)
outs.printf("\n");
outs.printf("<!-- ####### Gradients from Inkscape document ####### -->\n");
std::vector<GradientInfo>::iterator giter;
- for (giter = gradientTable.begin() ; giter != gradientTable.end() ; giter++)
+ for (giter = gradientTable.begin() ; giter != gradientTable.end() ; ++giter)
{
GradientInfo gi(*giter);
if (gi.style == "linear")
@@ -1583,7 +1583,7 @@ bool OdfOutput::processStyle(Writer &outs, SPItem *item,
//Look for existing identical style;
bool styleMatch = false;
std::vector<StyleInfo>::iterator iter;
- for (iter=styleTable.begin() ; iter!=styleTable.end() ; iter++)
+ for (iter=styleTable.begin() ; iter!=styleTable.end() ; ++iter)
{
if (si.equals(*iter))
{
@@ -1701,7 +1701,7 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item,
//Look for existing identical style;
bool gradientMatch = false;
std::vector<GradientInfo>::iterator iter;
- for (iter=gradientTable.begin() ; iter!=gradientTable.end() ; iter++)
+ for (iter=gradientTable.begin() ; iter!=gradientTable.end() ; ++iter)
{
if (gi.equals(*iter))
{
diff --git a/src/livarot/Shape.h b/src/livarot/Shape.h
index 5077a6da1..1a804a48c 100644
--- a/src/livarot/Shape.h
+++ b/src/livarot/Shape.h
@@ -317,7 +317,7 @@ public:
void QuickScan(float &pos, int &curP, float to, AlphaLigne* line, float step);
void Transform(Geom::Affine const &tr)
- {for(std::vector<dg_point>::iterator it=_pts.begin();it!=_pts.end();it++) it->x*=tr;}
+ {for(std::vector<dg_point>::iterator it=_pts.begin();it!=_pts.end();++it) it->x*=tr;}
std::vector<back_data> ebData;
std::vector<voronoi_point> vorpData;
diff --git a/src/main-cmdlineact.cpp b/src/main-cmdlineact.cpp
index dc59e1a93..9f700292e 100644
--- a/src/main-cmdlineact.cpp
+++ b/src/main-cmdlineact.cpp
@@ -71,7 +71,7 @@ CmdLineAction::doIt (Inkscape::UI::View::View * view) {
void
CmdLineAction::doList (Inkscape::UI::View::View * view) {
for (std::list<CmdLineAction *>::iterator i = _list.begin();
- i != _list.end(); i++) {
+ i != _list.end(); ++i) {
CmdLineAction * entry = *i;
entry->doIt(view);
}
@@ -85,7 +85,7 @@ CmdLineAction::idle (void) {
// We're going to assume one desktop per document, because no one
// should have had time to make more at this point.
for (std::list<SPDesktop *>::iterator i = desktops.begin();
- i != desktops.end(); i++) {
+ i != desktops.end(); ++i) {
SPDesktop * desktop = *i;
//Inkscape::UI::View::View * view = dynamic_cast<Inkscape::UI::View::View *>(desktop);
doList(desktop);
diff --git a/src/selcue.cpp b/src/selcue.cpp
index dbcaf4cc3..676031802 100644
--- a/src/selcue.cpp
+++ b/src/selcue.cpp
@@ -46,12 +46,12 @@ Inkscape::SelCue::~SelCue()
_sel_changed_connection.disconnect();
_sel_modified_connection.disconnect();
- for (std::vector<SPCanvasItem*>::iterator i = _item_bboxes.begin(); i != _item_bboxes.end(); i++) {
+ for (std::vector<SPCanvasItem*>::iterator i = _item_bboxes.begin(); i != _item_bboxes.end(); ++i) {
gtk_object_destroy(*i);
}
_item_bboxes.clear();
- for (std::vector<SPCanvasItem*>::iterator i = _text_baselines.begin(); i != _text_baselines.end(); i++) {
+ for (std::vector<SPCanvasItem*>::iterator i = _text_baselines.begin(); i != _text_baselines.end(); ++i) {
gtk_object_destroy(*i);
}
_text_baselines.clear();
@@ -103,7 +103,7 @@ void Inkscape::SelCue::_updateItemBboxes()
void Inkscape::SelCue::_newItemBboxes()
{
- for (std::vector<SPCanvasItem*>::iterator i = _item_bboxes.begin(); i != _item_bboxes.end(); i++) {
+ for (std::vector<SPCanvasItem*>::iterator i = _item_bboxes.begin(); i != _item_bboxes.end(); ++i) {
gtk_object_destroy(*i);
}
_item_bboxes.clear();
@@ -166,7 +166,7 @@ void Inkscape::SelCue::_newItemBboxes()
void Inkscape::SelCue::_newTextBaselines()
{
- for (std::vector<SPCanvasItem*>::iterator i = _text_baselines.begin(); i != _text_baselines.end(); i++) {
+ for (std::vector<SPCanvasItem*>::iterator i = _text_baselines.begin(); i != _text_baselines.end(); ++i) {
gtk_object_destroy(*i);
}
_text_baselines.clear();
diff --git a/src/snapped-curve.cpp b/src/snapped-curve.cpp
index 493925d48..8fdf1d46f 100644
--- a/src/snapped-curve.cpp
+++ b/src/snapped-curve.cpp
@@ -69,7 +69,7 @@ Inkscape::SnappedPoint Inkscape::SnappedCurve::intersect(SnappedCurve const &cur
// There might be multiple intersections: find the closest
Geom::Coord best_dist = Geom::infinity();
Geom::Point best_p = Geom::Point(Geom::infinity(), Geom::infinity());
- for (Geom::Crossings::const_iterator i = cs.begin(); i != cs.end(); i++) {
+ for (Geom::Crossings::const_iterator i = cs.begin(); i != cs.end(); ++i) {
Geom::Point p_ix = this->_curve->pointAt((*i).ta);
Geom::Coord dist = Geom::distance(p_ix, p);
@@ -130,7 +130,7 @@ Inkscape::SnappedPoint Inkscape::SnappedCurve::intersect(SnappedLine const &line
// There might be multiple intersections: find the closest
Geom::Coord best_dist = Geom::infinity();
Geom::Point best_p = Geom::Point(Geom::infinity(), Geom::infinity());
- for (Geom::Crossings::const_iterator i = cs.begin(); i != cs.end(); i++) {
+ for (Geom::Crossings::const_iterator i = cs.begin(); i != cs.end(); ++i) {
Geom::Point p_ix = this->_curve->pointAt((*i).ta);
Geom::Coord dist = Geom::distance(p_ix, p);
@@ -166,7 +166,7 @@ bool getClosestCurve(std::list<Inkscape::SnappedCurve> const &list, Inkscape::Sn
{
bool success = false;
- for (std::list<Inkscape::SnappedCurve>::const_iterator i = list.begin(); i != list.end(); i++) {
+ for (std::list<Inkscape::SnappedCurve>::const_iterator i = list.begin(); i != list.end(); ++i) {
if (exclude_paths && ((*i).getTarget() == Inkscape::SNAPTARGET_PATH)) {
continue;
}
@@ -184,12 +184,12 @@ bool getClosestIntersectionCS(std::list<Inkscape::SnappedCurve> const &list, Geo
{
bool success = false;
- for (std::list<Inkscape::SnappedCurve>::const_iterator i = list.begin(); i != list.end(); i++) {
+ for (std::list<Inkscape::SnappedCurve>::const_iterator i = list.begin(); i != list.end(); ++i) {
if ((*i).getTarget() != Inkscape::SNAPTARGET_BBOX_EDGE) { // We don't support snapping to intersections of bboxes,
// as this would require two bboxes two be flashed in the snap indicator
std::list<Inkscape::SnappedCurve>::const_iterator j = i;
- j++;
- for (; j != list.end(); j++) {
+ ++j;
+ for (; j != list.end(); ++j) {
if ((*j).getTarget() != Inkscape::SNAPTARGET_BBOX_EDGE) { // We don't support snapping to intersections of bboxes
Inkscape::SnappedPoint sp = (*i).intersect(*j, p, dt2doc);
if (sp.getAtIntersection()) {
@@ -219,10 +219,10 @@ bool getClosestIntersectionCL(std::list<Inkscape::SnappedCurve> const &curve_lis
{
bool success = false;
- for (std::list<Inkscape::SnappedCurve>::const_iterator i = curve_list.begin(); i != curve_list.end(); i++) {
+ for (std::list<Inkscape::SnappedCurve>::const_iterator i = curve_list.begin(); i != curve_list.end(); ++i) {
if ((*i).getTarget() != Inkscape::SNAPTARGET_BBOX_EDGE) { // We don't support snapping to intersections of bboxes,
// as this would require two bboxes two be flashed in the snap indicator
- for (std::list<Inkscape::SnappedLine>::const_iterator j = line_list.begin(); j != line_list.end(); j++) {
+ for (std::list<Inkscape::SnappedLine>::const_iterator j = line_list.begin(); j != line_list.end(); ++j) {
if ((*j).getTarget() != Inkscape::SNAPTARGET_BBOX_EDGE) { // We don't support snapping to intersections of bboxes
Inkscape::SnappedPoint sp = (*i).intersect(*j, p, dt2doc);
if (sp.getAtIntersection()) {
diff --git a/src/snapped-point.cpp b/src/snapped-point.cpp
index 83c932539..cffdda5d7 100644
--- a/src/snapped-point.cpp
+++ b/src/snapped-point.cpp
@@ -114,7 +114,7 @@ bool getClosestSP(std::list<Inkscape::SnappedPoint> const &list, Inkscape::Snapp
{
bool success = false;
- for (std::list<Inkscape::SnappedPoint>::const_iterator i = list.begin(); i != list.end(); i++) {
+ for (std::list<Inkscape::SnappedPoint>::const_iterator i = list.begin(); i != list.end(); ++i) {
if ((i == list.begin()) || (*i).getSnapDistance() < result.getSnapDistance()) {
result = *i;
success = true;