diff --git a/GraphicsView/include/CGAL/Qt/Converter.h b/GraphicsView/include/CGAL/Qt/Converter.h index 7485e74fc42..ee23518b30d 100644 --- a/GraphicsView/include/CGAL/Qt/Converter.h +++ b/GraphicsView/include/CGAL/Qt/Converter.h @@ -84,12 +84,12 @@ public: { CGAL_assertion(clippingRectIsInitialized); Object o = CGAL::intersection(r, clippingRect); - typename K::Segment_2 s; - typename K::Point_2 p; - if(CGAL::assign(s,o)){ - return this->operator()(s); - } else if(CGAL::assign(p,o)){ - return QLineF(operator()(p), operator()(p)); + typedef typename K::Segment_2 Segment_2; + typedef typename K::Point_2 Point_2; + if(const Segment_2 *s = CGAL::object_cast(&o)){ + return this->operator()(*s); + } else if(const Point_2 *p = CGAL::object_cast(&o)){ + return QLineF(operator()(*p), operator()(*p)); } return QLineF(); } @@ -98,11 +98,11 @@ public: { CGAL_assertion(clippingRectIsInitialized); Object o = CGAL::intersection(l, clippingRect); - typename K::Segment_2 s; - typename K::Point_2 p; - if(CGAL::assign(s,o)){ - return this->operator()(s); - } else if(CGAL::assign(p,o)){ + typedef typename K::Segment_2 Segment_2; + typedef typename K::Point_2 Point_2; + if(const Segment_2 *s = CGAL::object_cast(&o)){ + return this->operator()(*s); + } else if(const Point_2 *p = CGAL::object_cast(&o)){ return QLineF(operator()(p), operator()(p)); } return QLineF();