summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2013-04-29 00:51:29 +0000
committerJon A. Cruz <jon@joncruz.org>2013-04-29 00:51:29 +0000
commitc317c1f79519f0ee961842ffb9feac4494af5377 (patch)
tree28187bf8ccee447689430f1c0243700e0565e958
parentTemporily fix abiguous macros before later removal. (diff)
downloadinkscape-c317c1f79519f0ee961842ffb9feac4494af5377.tar.gz
inkscape-c317c1f79519f0ee961842ffb9feac4494af5377.zip
Fixed logic error confusing bitwise and with logical and.
Whitespace cleanup to make the issue easier to spot. (bzr r12311)
-rw-r--r--src/display/sp-canvas.cpp4
-rw-r--r--src/extension/internal/cairo-render-context.cpp16
-rw-r--r--src/selection-chemistry.cpp2
-rw-r--r--src/selection-describer.cpp2
-rw-r--r--src/sp-item-group.cpp5
-rw-r--r--src/sp-pattern.cpp2
-rw-r--r--src/text-context.cpp4
-rw-r--r--src/widgets/sp-attribute-widget.cpp4
-rw-r--r--src/widgets/sp-color-notebook.cpp4
9 files changed, 22 insertions, 21 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index 9d4049512..9adb96642 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1095,8 +1095,8 @@ double SPCanvasGroup::point(SPCanvasItem *item, Geom::Point p, SPCanvasItem **ac
SPCanvasItem *point_item = NULL; // cater for incomplete item implementations
int has_point;
- if (child->visible && SP_CANVAS_ITEM_GET_CLASS (child)->point) {
- dist = sp_canvas_item_invoke_point (child, p, &point_item);
+ if (child->visible && SP_CANVAS_ITEM_GET_CLASS(child)->point) {
+ dist = sp_canvas_item_invoke_point(child, p, &point_item);
has_point = TRUE;
} else {
has_point = FALSE;
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index cf6730650..d7a560f04 100644
--- a/src/extension/internal/cairo-render-context.cpp
+++ b/src/extension/internal/cairo-render-context.cpp
@@ -1080,11 +1080,11 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
// show items and render them
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
- if (pat_i && SP_IS_OBJECT (pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
+ if (pat_i && SP_IS_OBJECT(pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
for ( SPObject *child = pat_i->firstChild() ; child; child = child->getNext() ) {
- if (SP_IS_ITEM (child)) {
- SP_ITEM (child)->invoke_show (drawing, dkey, SP_ITEM_REFERENCE_FLAGS);
- _renderer->renderItem(pattern_ctx, SP_ITEM (child));
+ if (SP_IS_ITEM(child)) {
+ SP_ITEM(child)->invoke_show(drawing, dkey, SP_ITEM_REFERENCE_FLAGS);
+ _renderer->renderItem(pattern_ctx, SP_ITEM(child));
}
}
break; // do not go further up the chain if children are found
@@ -1109,10 +1109,10 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
// hide all items
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
- if (pat_i && SP_IS_OBJECT (pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
+ if (pat_i && SP_IS_OBJECT(pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
for ( SPObject *child = pat_i->firstChild() ; child; child = child->getNext() ) {
- if (SP_IS_ITEM (child)) {
- SP_ITEM (child)->invoke_hide (dkey);
+ if (SP_IS_ITEM(child)) {
+ SP_ITEM(child)->invoke_hide(dkey);
}
}
break; // do not go further up the chain if children are found
@@ -1181,7 +1181,7 @@ CairoRenderContext::_createPatternForPaintServer(SPPaintServer const *const pain
return NULL;
}
- if (pattern && SP_IS_GRADIENT (paintserver)) {
+ if (pattern && SP_IS_GRADIENT(paintserver)) {
SPGradient *g = SP_GRADIENT(paintserver);
// set extend type
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index beafc59a5..d94b085a0 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -3765,7 +3765,7 @@ void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path) {
}
// collect distinct mask object (and associate with item to apply transform)
- if (NULL != uri_ref && NULL != uri_ref->getObject()) {
+ if ((NULL != uri_ref) && (NULL != uri_ref->getObject())) {
referenced_objects[uri_ref->getObject()] = item;
}
}
diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp
index 391db8950..968a8bd22 100644
--- a/src/selection-describer.cpp
+++ b/src/selection-describer.cpp
@@ -197,7 +197,7 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select
_context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.",
item_desc, in_phrase,
_("Convert symbol to group to edit"), _when_selected);
- } else if (SP_IS_USE(item) || (SP_IS_OFFSET(item) && SP_OFFSET (item)->sourceHref)) {
+ } else if (SP_IS_USE(item) || (SP_IS_OFFSET(item) && SP_OFFSET(item)->sourceHref)) {
_context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.",
item_desc, in_phrase,
_("Use <b>Shift+D</b> to look up original"), _when_selected);
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 4df20b439..3ba1ecd5f 100644
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
@@ -465,8 +465,9 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done)
item->doWriteTransform(repr, item->transform, NULL, false);
Inkscape::GC::release(repr);
- if (children && SP_IS_ITEM (item))
- *children = g_slist_prepend (*children, item);
+ if (children && SP_IS_ITEM(item)) {
+ *children = g_slist_prepend(*children, item);
+ }
items = g_slist_remove (items, items->data);
}
diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp
index 23cd3d32e..c4308a1a9 100644
--- a/src/sp-pattern.cpp
+++ b/src/sp-pattern.cpp
@@ -591,7 +591,7 @@ sp_pattern_create_pattern(SPPaintServer *ps,
SPPattern *shown = NULL;
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
// find the first one with item children
- if (pat_i && SP_IS_OBJECT (pat_i) && pattern_hasItemChildren(pat_i)) {
+ if (pat_i && SP_IS_OBJECT(pat_i) && pattern_hasItemChildren(pat_i)) {
shown = pat_i;
break; // do not go further up the chain if children are found
}
diff --git a/src/text-context.cpp b/src/text-context.cpp
index 80f568830..d137b673d 100644
--- a/src/text-context.cpp
+++ b/src/text-context.cpp
@@ -219,7 +219,7 @@ static void sp_text_context_setup(SPEventContext *ec)
ec->shape_editor = new ShapeEditor(ec->desktop);
SPItem *item = sp_desktop_selection(ec->desktop)->singleItem();
- if (item && SP_IS_FLOWTEXT (item) && SP_FLOWTEXT(item)->has_internal_frame()) {
+ if (item && SP_IS_FLOWTEXT(item) && SP_FLOWTEXT(item)->has_internal_frame()) {
ec->shape_editor->set_item(item, SH_KNOTHOLDER);
}
@@ -1453,7 +1453,7 @@ sp_text_context_selection_changed(Inkscape::Selection *selection, SPTextContext
ec->shape_editor->unset_item(SH_KNOTHOLDER);
SPItem *item = selection->singleItem();
- if (item && SP_IS_FLOWTEXT (item) && SP_FLOWTEXT(item)->has_internal_frame()) {
+ if (item && SP_IS_FLOWTEXT(item) && SP_FLOWTEXT(item)->has_internal_frame()) {
ec->shape_editor->set_item(item, SH_KNOTHOLDER);
}
diff --git a/src/widgets/sp-attribute-widget.cpp b/src/widgets/sp-attribute-widget.cpp
index 4196e62bf..fb7eb1420 100644
--- a/src/widgets/sp-attribute-widget.cpp
+++ b/src/widgets/sp-attribute-widget.cpp
@@ -259,7 +259,7 @@ static void sp_attribute_table_object_modified ( SPObject */*object*/,
guint flags,
SPAttributeTable *spat )
{
- if (flags && SP_OBJECT_MODIFIED_FLAG)
+ if (flags & SP_OBJECT_MODIFIED_FLAG)
{
std::vector<Glib::ustring> attributes = spat->get_attributes();
std::vector<Gtk::Entry *> entries = spat->get_entries();
@@ -270,7 +270,7 @@ static void sp_attribute_table_object_modified ( SPObject */*object*/,
text = e->get_text ();
if (val || !text.empty()) {
if (text != val) {
- /* We are different */
+ // We are different
spat->blocked = true;
e->set_text (val ? val : (const gchar *) "");
spat->blocked = false;
diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp
index 89c5ed76a..f75521e2c 100644
--- a/src/widgets/sp-color-notebook.cpp
+++ b/src/widgets/sp-color-notebook.cpp
@@ -129,7 +129,7 @@ void ColorNotebook::switchPage(GtkNotebook*,
csel->base->getColorAlpha(_color, _alpha);
}
widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (_book), page_num);
- if ( widget && SP_IS_COLOR_SELECTOR (widget) )
+ if ( widget && SP_IS_COLOR_SELECTOR(widget) )
{
csel = SP_COLOR_SELECTOR (widget);
csel->base->setColorAlpha( _color, _alpha );
@@ -232,7 +232,7 @@ void ColorNotebook::init()
{
guint howmany = 1;
gpointer klass = g_type_class_ref (selector_types[i]);
- if ( klass && SP_IS_COLOR_SELECTOR_CLASS (klass) )
+ if ( klass && SP_IS_COLOR_SELECTOR_CLASS(klass) )
{
SPColorSelectorClass *ck = SP_COLOR_SELECTOR_CLASS (klass);
howmany = MAX (1, ck->submode_count);