summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-12-01 16:47:43 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-12-01 16:47:43 +0000
commit16b6bdbb7c160d95473256c7b414125310af25fe (patch)
tree0cb2b056c6f7ff7bf1ce50aac8cea8f064af1a0f /src
parentFix merging (diff)
downloadinkscape-16b6bdbb7c160d95473256c7b414125310af25fe.tar.gz
inkscape-16b6bdbb7c160d95473256c7b414125310af25fe.zip
Fix merging
Diffstat (limited to 'src')
-rw-r--r--src/desktop.cpp2
-rw-r--r--src/display/drawing-item.cpp9
-rw-r--r--src/display/drawing-item.h7
-rw-r--r--src/object/sp-item.cpp2
-rw-r--r--src/ui/view/svg-view.cpp2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index f857ed236..2f9d6c20a 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -1818,7 +1818,7 @@ static gint
_arena_handler (SPCanvasArena */*arena*/, Inkscape::DrawingItem *ai, GdkEvent *event, SPDesktop *desktop)
{
if (ai) {
- SPItem *spi = (ai) ? static_cast<SPItem *>(ai->data()) : nullptr;
+ SPItem *spi = ai->getItem();
return sp_event_context_item_handler (desktop->event_context, spi, event);
} else {
return sp_event_context_root_handler (desktop->event_context, event);
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp
index 922576ec5..d3729da94 100644
--- a/src/display/drawing-item.cpp
+++ b/src/display/drawing-item.cpp
@@ -121,7 +121,7 @@ DrawingItem::DrawingItem(Drawing &drawing)
, _fill_pattern(nullptr)
, _stroke_pattern(nullptr)
, _filter(nullptr)
- , _user_data(nullptr)
+ , _item(nullptr)
, _cache(nullptr)
, _state(0)
, _child_type(CHILD_ORPHAN)
@@ -1031,10 +1031,9 @@ DrawingItem::pick(Geom::Point const &p, double delta, unsigned flags)
Glib::ustring
DrawingItem::name()
{
- SPObject *object = static_cast<SPObject *>(_user_data);
- if (object) {
- if(object->getId())
- return object->getId();
+ if (_item) {
+ if (_item->getId())
+ return _item->getId();
else
return "No object id";
} else {
diff --git a/src/display/drawing-item.h b/src/display/drawing-item.h
index 8cf7604c9..f0107cdc7 100644
--- a/src/display/drawing-item.h
+++ b/src/display/drawing-item.h
@@ -131,8 +131,9 @@ public:
void setKey(unsigned key) { _key = key; }
unsigned key() const { return _key; }
- void setData(void *data) { _user_data = data; }
- void *data() const { return _user_data; }
+ void setItem(SPItem *item) { _item = item; }
+ SPItem* getItem() const { return _item; } // SPItem
+
void update(Geom::IntRect const &area = Geom::IntRect::infinite(), UpdateContext const &ctx = UpdateContext(), unsigned flags = STATE_ALL, unsigned reset = 0);
unsigned render(DrawingContext &dc, Geom::IntRect const &area, unsigned flags = 0, DrawingItem *stop_at = nullptr);
@@ -204,7 +205,7 @@ protected:
DrawingPattern *_fill_pattern;
DrawingPattern *_stroke_pattern;
Inkscape::Filters::Filter *_filter;
- void *_user_data; ///< Used to associate DrawingItems with SPItems that created them
+ SPItem *_item; ///< Used to associate DrawingItems with SPItems that created them
DrawingCache *_cache;
CacheList::iterator _cache_iterator;
diff --git a/src/object/sp-item.cpp b/src/object/sp-item.cpp
index e9ec95252..6a9bd9615 100644
--- a/src/object/sp-item.cpp
+++ b/src/object/sp-item.cpp
@@ -1179,7 +1179,7 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned
stroke_ps->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
}
}
- ai->setData(this);
+ ai->setItem(this);
ai->setItemBounds(geometricBounds());
}
diff --git a/src/ui/view/svg-view.cpp b/src/ui/view/svg-view.cpp
index 5e388f71b..14ced7fac 100644
--- a/src/ui/view/svg-view.cpp
+++ b/src/ui/view/svg-view.cpp
@@ -142,7 +142,7 @@ static gint arena_handler(SPCanvasArena */*arena*/, Inkscape::DrawingItem *ai, G
static gboolean active = FALSE;
SPEvent spev;
- SPItem *spitem = (ai) ? static_cast<SPItem *>(ai->data()) : nullptr;
+ SPItem *spitem = (ai) ? ai->getItem() : nullptr;
switch (event->type) {
case GDK_BUTTON_PRESS: