+}
+
+void WaypointList::drawRowText(int x, int baseline, int rowIndex, const RoutePath& path)
+{
+ flightgear::Waypt* wp(_model->waypointAt(rowIndex));
+ const bool isDiscontinuity = (wp->type() == "discontinuity");
+ const bool isVia = (wp->type() == "via");
+
+ char buffer[128];
+ int count;
+
+ if (isVia) {
+ // VIA has long ident but no name
+ count = ::snprintf(buffer, 128, "%03d %s", rowIndex, wp->ident().c_str());
+ drawClippedString(legendFont, buffer, x, baseline, 300);
+ x += 300 + PUSTR_LGAP;
+ } else {
+ count = ::snprintf(buffer, 128, "%03d %-5s", rowIndex, wp->ident().c_str());
+
+ FGPositioned* src = wp->source();
+ if (src && !src->name().empty() && (src->name() != wp->ident())) {
+ // append name if present, and different to id
+ ::snprintf(buffer + count, 128 - count, " (%s)", src->name().c_str());
+ }
+
+ drawClippedString(legendFont, buffer, x, baseline, 300);
+ x += 300 + PUSTR_LGAP;