summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14a3443)
raw | patch | inline | side by side (parent: 14a3443)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 1 Sep 2008 23:04:44 +0000 (23:04 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 1 Sep 2008 23:04:44 +0000 (23:04 +0000) |
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index 29b429b2ec6e271b4fa24e8923c8ea44436c6ca2..90acb7f299b91f63c1de6c98eef9ada21e47a37d 100644 (file)
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
// Oh oh, this will get ugly. We cannot use sp_item_i2d_affine directly because we need to
// insert an additional transformation in document coordinates (code copied from sp_item_i2d_affine)
sp_item_invoke_bbox(item,
- &bbox_of_item,
+ bbox_of_item,
from_2geom(to_2geom(sp_item_i2doc_affine(item)) * matrix_to_desktop(additional_affine, item)),
true);
} else {
- sp_item_invoke_bbox(item, &bbox_of_item, sp_item_i2d_affine(item), true);
+ sp_item_invoke_bbox(item, bbox_of_item, sp_item_i2d_affine(item), true);
}
if (bbox_of_item) {
// See if the item is within range
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 4cea8aad5fde6d52f32aa49dd0809c4acb4d55fe..38bf03bdccc2ecfadae582530ecd388c0d877f4d 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
@@ -708,7 +708,7 @@ void CGroup::calculateBBox(NRRect *bbox, NR::Matrix const &transform, unsigned c
if (SP_IS_ITEM(o) && !SP_ITEM(o)->isHidden()) {
SPItem *child = SP_ITEM(o);
NR::Matrix const ct(child->transform * transform);
- sp_item_invoke_bbox_full(child, &dummy_bbox, ct, flags, FALSE);
+ sp_item_invoke_bbox_full(child, dummy_bbox, ct, flags, FALSE);
}
l = g_slist_remove (l, o);
}
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 0d285c3f0f3c970b5b80548d4734282bf21e6df6..706469d3cad42440c3d846f5630d338e4befb96e 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
unsigned int /*dkey*/) const
{
boost::optional<NR::Rect> r;
- sp_item_invoke_bbox_full(this, &r, transform, type, TRUE);
+ sp_item_invoke_bbox_full(this, r, transform, type, TRUE);
return r;
}
void
-sp_item_invoke_bbox(SPItem const *item, boost::optional<NR::Rect> *bbox, NR::Matrix const &transform, unsigned const clear, SPItem::BBoxType type)
+sp_item_invoke_bbox(SPItem const *item, boost::optional<NR::Rect> &bbox, NR::Matrix const &transform, unsigned const clear, SPItem::BBoxType type)
{
sp_item_invoke_bbox_full(item, bbox, transform, type, clear);
}
@@ -746,14 +746,13 @@ sp_item_invoke_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transfor
* transform and the flags to the actual bbox methods. Note that many of subclasses (e.g. groups,
* clones), in turn, call this function in their bbox methods. */
void
-sp_item_invoke_bbox_full(SPItem const *item, boost::optional<NR::Rect> *bbox, NR::Matrix const &transform, unsigned const flags, unsigned const clear)
+sp_item_invoke_bbox_full(SPItem const *item, boost::optional<NR::Rect> &bbox, NR::Matrix const &transform, unsigned const flags, unsigned const clear)
{
g_assert(item != NULL);
g_assert(SP_IS_ITEM(item));
- g_assert(bbox != NULL);
if (clear) {
- *bbox = boost::optional<NR::Rect>();
+ bbox = boost::optional<NR::Rect>();
}
// TODO: replace NRRect by NR::Rect, for all SPItemClasses, and for SP_CLIPPATH
@@ -846,7 +845,7 @@ sp_item_invoke_bbox_full(SPItem const *item, boost::optional<NR::Rect> *bbox, NR
// would therefore be translated into empty boost::optional<NR::Rect>() (see bug https://bugs.launchpad.net/inkscape/+bug/168684)
boost::optional<NR::Rect> temp_bbox_new = NR::Rect(NR::Point(temp_bbox.x0, temp_bbox.y0), NR::Point(temp_bbox.x1, temp_bbox.y1));
- *bbox = NR::union_bounds(*bbox, temp_bbox_new);
+ bbox = NR::union_bounds(bbox, temp_bbox_new);
}
// DEPRECATED to phase out the use of NRRect in favor of boost::optional<NR::Rect>
boost::optional<NR::Rect> sp_item_bbox_desktop(SPItem *item, SPItem::BBoxType type)
{
boost::optional<NR::Rect> rect = boost::optional<NR::Rect>();
- sp_item_invoke_bbox(item, &rect, sp_item_i2d_affine(item), TRUE, type);
+ sp_item_invoke_bbox(item, rect, sp_item_i2d_affine(item), TRUE, type);
return rect;
}
diff --git a/src/sp-item.h b/src/sp-item.h
index 358f3d75c7566e3f227766e65f1a3f0fe4b50ba5..dd2a995f7e5370ed759e6a262c00b284d32eb374 100644 (file)
--- a/src/sp-item.h
+++ b/src/sp-item.h
/* Methods */
-void sp_item_invoke_bbox(SPItem const *item, boost::optional<NR::Rect> *bbox, NR::Matrix const &transform, unsigned const clear, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX);
+void sp_item_invoke_bbox(SPItem const *item, boost::optional<NR::Rect> &bbox, NR::Matrix const &transform, unsigned const clear, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX);
void sp_item_invoke_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const clear, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) __attribute__ ((deprecated));
-void sp_item_invoke_bbox_full(SPItem const *item, boost::optional<NR::Rect> *bbox, NR::Matrix const &transform, unsigned const flags, unsigned const clear);
+void sp_item_invoke_bbox_full(SPItem const *item, boost::optional<NR::Rect> &bbox, NR::Matrix const &transform, unsigned const flags, unsigned const clear);
void sp_item_invoke_bbox_full(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags, unsigned const clear) __attribute__ ((deprecated));
unsigned sp_item_pos_in_parent(SPItem *item);
index 4f9c33ff5946c642a33517184a65eaca0c26c36d..1f714c3db413b7cee5decf2e519e3beba50eb13a 100644 (file)
// write object bbox to area
boost::optional<NR::Rect> maybeArea(from_2geom(area));
sp_document_ensure_up_to_date (svgDoc);
- sp_item_invoke_bbox((SPItem *) svgDoc->root, &maybeArea,
+ sp_item_invoke_bbox((SPItem *) svgDoc->root, maybeArea,
sp_item_i2r_affine((SPItem *)(svgDoc->root)), TRUE);
NRArena *const arena = NRArena::create();