[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Sun Dec 12 12:28:45 CET 2010
SVN commit 1205742 by tgridel:
PlacemarkLayout: test for placemark before blindlingly using it
M +2 -0 PlacemarkLayout.cpp
--- trunk/KDE/kdeedu/marble/src/lib/PlacemarkLayout.cpp #1205741:1205742
@@ -168,12 +168,14 @@
for ( int i = 0; i < m_placemarkModel->rowCount(); ++i ) {
QModelIndex index = m_placemarkModel->index( i, 0 );
GeoDataPlacemark *placemark = dynamic_cast<GeoDataPlacemark*>(qvariant_cast<GeoDataObject*>(index.data( MarblePlacemarkModel::ObjectPointerRole ) ));
+ if ( placemark ) {
GeoDataStyle* style = placemark->style();
QFont labelFont = style->labelStyle().font();
int textHeight = QFontMetrics( labelFont ).height();
if ( textHeight > maxLabelHeight )
maxLabelHeight = textHeight;
}
+ }
//mDebug() <<"Detected maxLabelHeight: " << maxLabelHeight;
return maxLabelHeight;
More information about the Marble-commits
mailing list