add anchor to help URL only if necessary

This commit is contained in:
Alexander Bruy 2017-02-14 20:59:07 +02:00
parent 23c09fc121
commit eaa97f367e

View File

@ -87,7 +87,11 @@ QUrl QgsHelp::helpUrl( const QString& key )
continue;
}
helpUrl = QUrl::fromLocalFile( filePath );
helpUrl.setFragment( helpPath.mid( helpPath.lastIndexOf( "#" ) + 1, -1 ) );
int pos = helpPath.lastIndexOf( "#" );
if ( pos != -1 )
{
helpUrl.setFragment( helpPath.mid( helpPath.lastIndexOf( "#" ) + 1, -1 ) );
}
}
helpFound = true;