summaryrefslogtreecommitdiffstats
path: root/src/dialogs
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-02-22 09:17:44 +0000
committerJon A. Cruz <jon@joncruz.org>2011-02-22 09:17:44 +0000
commit0e0ce7571944e0a9d60294b6efdc855e6df52db8 (patch)
tree3cd452f4abfb51a8f4ffbbb08d001f651ff65d29 /src/dialogs
parentFinished cleanup of outdated SP_OBJECT_STYLE C macro. (diff)
downloadinkscape-0e0ce7571944e0a9d60294b6efdc855e6df52db8.tar.gz
inkscape-0e0ce7571944e0a9d60294b6efdc855e6df52db8.zip
Finished cleanup of outdated SP_OBJECT_REPR C macro.
(bzr r10067)
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/find.cpp64
-rw-r--r--src/dialogs/item-properties.cpp2
-rw-r--r--src/dialogs/object-attributes.cpp2
-rw-r--r--src/dialogs/spellcheck.cpp2
4 files changed, 40 insertions, 30 deletions
diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp
index fe264892a..c112b3531 100644
--- a/src/dialogs/find.cpp
+++ b/src/dialogs/find.cpp
@@ -110,15 +110,18 @@ sp_find_squeeze_window()
bool
item_id_match (SPItem *item, const gchar *id, bool exact)
{
- if (SP_OBJECT_REPR (item) == NULL)
+ if (item->getRepr() == NULL) {
return false;
+ }
- if (SP_IS_STRING(item)) // SPStrings have "on demand" ids which are useless for searching
+ if (SP_IS_STRING(item)) { // SPStrings have "on demand" ids which are useless for searching
return false;
+ }
- const gchar *item_id = (SP_OBJECT_REPR (item))->attribute("id");
- if (item_id == NULL)
+ const gchar *item_id = item->getRepr()->attribute("id");
+ if (item_id == NULL) {
return false;
+ }
if (exact) {
return ((bool) !strcmp(item_id, id));
@@ -131,8 +134,9 @@ item_id_match (SPItem *item, const gchar *id, bool exact)
bool
item_text_match (SPItem *item, const gchar *text, bool exact)
{
- if (SP_OBJECT_REPR (item) == NULL)
+ if (item->getRepr() == NULL) {
return false;
+ }
if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) {
const gchar *item_text = sp_te_get_string_multiline (item);
@@ -154,12 +158,14 @@ item_text_match (SPItem *item, const gchar *text, bool exact)
bool
item_style_match (SPItem *item, const gchar *text, bool exact)
{
- if (SP_OBJECT_REPR (item) == NULL)
+ if (item->getRepr() == NULL) {
return false;
+ }
- const gchar *item_text = (SP_OBJECT_REPR (item))->attribute("style");
- if (item_text == NULL)
+ const gchar *item_text = item->getRepr()->attribute("style");
+ if (item_text == NULL) {
return false;
+ }
if (exact) {
return ((bool) !strcmp(item_text, text));
@@ -168,18 +174,18 @@ item_style_match (SPItem *item, const gchar *text, bool exact)
}
}
-bool
-item_attr_match (SPItem *item, const gchar *name, bool exact)
+bool item_attr_match(SPItem *item, const gchar *name, bool exact)
{
- if (SP_OBJECT_REPR (item) == NULL)
- return false;
-
- if (exact) {
- const gchar *attr_value = (SP_OBJECT_REPR (item))->attribute(name);
- return ((bool) (attr_value != NULL));
- } else {
- return SP_OBJECT_REPR (item)->matchAttributeName(name);
+ bool result = false;
+ if (item->getRepr()) {
+ if (exact) {
+ const gchar *attr_value = item->getRepr()->attribute(name);
+ result = (attr_value != NULL);
+ } else {
+ result = item->getRepr()->matchAttributeName(name);
+ }
}
+ return result;
}
@@ -288,17 +294,20 @@ all_items (SPObject *r, GSList *l, bool hidden, bool locked)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- if (SP_IS_DEFS(r))
+ if (SP_IS_DEFS(r)) {
return l; // we're not interested in items in defs
+ }
- if (!strcmp (SP_OBJECT_REPR (r)->name(), "svg:metadata"))
+ if (!strcmp(r->getRepr()->name(), "svg:metadata")) {
return l; // we're not interested in metadata
+ }
for (SPObject *child = r->firstChild(); child; child = child->next) {
- if (SP_IS_ITEM (child) && !SP_OBJECT_IS_CLONED (child) && !desktop->isLayer(SP_ITEM(child))) {
- if ((hidden || !desktop->itemIsHidden(SP_ITEM(child))) && (locked || !SP_ITEM(child)->isLocked())) {
- l = g_slist_prepend (l, child);
- }
+ if ( SP_IS_ITEM(child) && !child->cloned && !desktop->isLayer(child) ) {
+ SPItem *item = SP_ITEM(child);
+ if ((hidden || !desktop->itemIsHidden(item)) && (locked || !item->isLocked())) {
+ l = g_slist_prepend (l, child);
+ }
}
l = all_items (child, l, hidden, locked);
}
@@ -311,9 +320,10 @@ all_selection_items (Inkscape::Selection *s, GSList *l, SPObject *ancestor, bool
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
for (GSList *i = (GSList *) s->itemList(); i != NULL; i = i->next) {
- if (SP_IS_ITEM (i->data) && !SP_OBJECT_IS_CLONED (i->data) && !desktop->isLayer(SP_ITEM(i->data))) {
- if (!ancestor || ancestor->isAncestorOf(SP_OBJECT (i->data))) {
- if ((hidden || !desktop->itemIsHidden(SP_ITEM(i->data))) && (locked || !SP_ITEM(i->data)->isLocked())) {
+ if ( SP_IS_ITEM(i->data) && !reinterpret_cast<SPObject*>(i->data)->cloned && !desktop->isLayer(SP_ITEM(i->data))) {
+ SPItem * item = SP_ITEM(i->data);
+ if (!ancestor || ancestor->isAncestorOf(item)) {
+ if ((hidden || !desktop->itemIsHidden(item)) && (locked || !item->isLocked())) {
l = g_slist_prepend (l, i->data);
}
}
diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp
index 8b5ac1784..94b8b1e98 100644
--- a/src/dialogs/item-properties.cpp
+++ b/src/dialogs/item-properties.cpp
@@ -310,7 +310,7 @@ sp_item_widget_setup ( SPWidget *spw, Inkscape::Selection *selection )
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "hidden"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), item->isExplicitlyHidden());
- if (SP_OBJECT_IS_CLONED (item)) {
+ if (item->cloned) {
/* ID */
w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "id"));
diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp
index d9a0545e1..cbf5f1e89 100644
--- a/src/dialogs/object-attributes.cpp
+++ b/src/dialogs/object-attributes.cpp
@@ -141,7 +141,7 @@ sp_object_attributes_dialog (SPObject *object, const gchar *tag)
if (!strcmp (tag, "Link")) {
sp_object_attr_show_dialog (object, anchor_desc, tag);
} else if (!strcmp (tag, "Image")) {
- Inkscape::XML::Node *ir = SP_OBJECT_REPR(object);
+ Inkscape::XML::Node *ir = object->getRepr();
const gchar *href = ir->attribute("xlink:href");
if ( (!href) || ((strncmp(href, "data:", 5) == 0)) ) {
sp_object_attr_show_dialog (object, image_nohref_desc, tag);
diff --git a/src/dialogs/spellcheck.cpp b/src/dialogs/spellcheck.cpp
index 4712d9926..f72612420 100644
--- a/src/dialogs/spellcheck.cpp
+++ b/src/dialogs/spellcheck.cpp
@@ -210,7 +210,7 @@ all_text_items (SPObject *r, GSList *l, bool hidden, bool locked)
}
for (SPObject *child = r->firstChild(); child; child = child->next) {
- if (SP_IS_ITEM (child) && !SP_OBJECT_IS_CLONED (child) && !_desktop->isLayer(SP_ITEM(child))) {
+ if (SP_IS_ITEM (child) && !child->cloned && !_desktop->isLayer(SP_ITEM(child))) {
if ((hidden || !_desktop->itemIsHidden(SP_ITEM(child))) && (locked || !SP_ITEM(child)->isLocked())) {
if (SP_IS_TEXT(child) || SP_IS_FLOWTEXT(child))
l = g_slist_prepend (l, child);