summaryrefslogtreecommitdiffstats
path: root/src/widgets/stroke-style.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-07-16 07:42:39 +0000
committerJon A. Cruz <jon@joncruz.org>2011-07-16 07:42:39 +0000
commit2be2cf32db0668dc64512a98f6c2394152bd10cc (patch)
tree8e25abb2f884e06692d861e6a1471440d6554946 /src/widgets/stroke-style.cpp
parentadded WITH_GNOME_VFS as an option for cmake (diff)
downloadinkscape-2be2cf32db0668dc64512a98f6c2394152bd10cc.tar.gz
inkscape-2be2cf32db0668dc64512a98f6c2394152bd10cc.zip
Cleanup of oudated/redundant SP_ITEM() macro use.
(bzr r10461)
Diffstat (limited to 'src/widgets/stroke-style.cpp')
-rw-r--r--src/widgets/stroke-style.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp
index 8544c8cad..8b5582163 100644
--- a/src/widgets/stroke-style.cpp
+++ b/src/widgets/stroke-style.cpp
@@ -157,8 +157,9 @@ sp_marker_prev_new(unsigned psize, gchar const *mname,
{
// Retrieve the marker named 'mname' from the source SVG document
SPObject const *marker = source->getObjectById(mname);
- if (marker == NULL)
+ if (marker == NULL) {
return NULL;
+ }
// Create a copy repr of the marker with id="sample"
Inkscape::XML::Document *xml_doc = sandbox->getReprDoc();
@@ -168,8 +169,9 @@ sp_marker_prev_new(unsigned psize, gchar const *mname,
// Replace the old sample in the sandbox by the new one
Inkscape::XML::Node *defsrepr = sandbox->getObjectById("defs")->getRepr();
SPObject *oldmarker = sandbox->getObjectById("sample");
- if (oldmarker)
+ if (oldmarker) {
oldmarker->deleteObject(false);
+ }
defsrepr->appendChild(mrepr);
Inkscape::GC::release(mrepr);
@@ -183,12 +185,14 @@ sp_marker_prev_new(unsigned psize, gchar const *mname,
sandbox->getRoot()->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
sandbox->ensureUpToDate();
- if (object == NULL || !SP_IS_ITEM(object))
+ if (object == NULL || !SP_IS_ITEM(object)) {
return NULL; // sandbox broken?
+ }
+ SPItem *item = SP_ITEM(object);
// Find object's bbox in document
- Geom::Affine const i2doc(SP_ITEM(object)->i2doc_affine());
- Geom::OptRect dbox = SP_ITEM(object)->getBounds(i2doc);
+ Geom::Affine const i2doc(item->i2doc_affine());
+ Geom::OptRect dbox = item->getBounds(i2doc);
if (!dbox) {
return NULL;
@@ -246,7 +250,7 @@ sp_marker_menu_build (Gtk::Menu *m, GSList *marker_list, SPDocument *source, SPD
// Do this here, outside of loop, to speed up preview generation:
NRArena const *arena = NRArena::create();
unsigned const visionkey = SPItem::display_key_new(1);
- NRArenaItem *root = SP_ITEM(sandbox->getRoot())->invoke_show((NRArena *) arena, visionkey, SP_ITEM_SHOW_DISPLAY);
+ NRArenaItem *root = sandbox->getRoot()->invoke_show((NRArena *) arena, visionkey, SP_ITEM_SHOW_DISPLAY);
for (; marker_list != NULL; marker_list = marker_list->next) {
Inkscape::XML::Node *repr = reinterpret_cast<SPItem *>(marker_list->data)->getRepr();
@@ -284,7 +288,7 @@ sp_marker_menu_build (Gtk::Menu *m, GSList *marker_list, SPDocument *source, SPD
m->append(*i);
}
- SP_ITEM(sandbox->getRoot())->invoke_hide(visionkey);
+ sandbox->getRoot()->invoke_hide(visionkey);
nr_object_unref((NRObject *) arena);
}