diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-09-01 23:04:44 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-09-01 23:04:44 +0000 |
| commit | d244e4cb5d6e2887807d9c3d105a29cae1baaf63 (patch) | |
| tree | c2a2bf80605f0a0479f03c83c556675cb6ea3d58 /src | |
| parent | Fixes to desktop file from patch. Bug #263233 (diff) | |
| download | inkscape-d244e4cb5d6e2887807d9c3d105a29cae1baaf63.tar.gz inkscape-d244e4cb5d6e2887807d9c3d105a29cae1baaf63.zip | |
removed unnecessary pointer, changed to by reference. (the pointer was not allowed to be NULL, so reference is better)
(bzr r6752)
Diffstat (limited to 'src')
| -rw-r--r-- | src/object-snapper.cpp | 4 | ||||
| -rw-r--r-- | src/sp-item-group.cpp | 2 | ||||
| -rw-r--r-- | src/sp-item.cpp | 13 | ||||
| -rw-r--r-- | src/sp-item.h | 4 | ||||
| -rw-r--r-- | src/ui/dialog/filedialogimpl-win32.cpp | 2 |
5 files changed, 12 insertions, 13 deletions
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 29b429b2e..90acb7f29 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -143,11 +143,11 @@ void Inkscape::ObjectSnapper::_findCandidates(SPObject* parent, // 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 4cea8aad5..38bf03bdc 100644 --- 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 0d285c3f0..706469d3c 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -724,12 +724,12 @@ boost::optional<NR::Rect> SPItem::getBounds(NR::Matrix const &transform, 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> @@ -926,7 +925,7 @@ sp_item_bbox_desktop(SPItem *item, NRRect *bbox, SPItem::BBoxType type) 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 358f3d75c..dd2a995f7 100644 --- a/src/sp-item.h +++ b/src/sp-item.h @@ -213,9 +213,9 @@ struct SPItemClass { /* 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); diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index 4f9c33ff5..1f714c3db 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -868,7 +868,7 @@ bool FileOpenDialogImplWin32::set_svg_preview() // 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(); |
