From eaa97f367e630c7a9efc4ded06d94e2f08c7bf98 Mon Sep 17 00:00:00 2001 From: Alexander Bruy Date: Tue, 14 Feb 2017 20:59:07 +0200 Subject: [PATCH] add anchor to help URL only if necessary --- src/gui/qgshelp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/qgshelp.cpp b/src/gui/qgshelp.cpp index c4c6b5d4dca..6b0e868f057 100644 --- a/src/gui/qgshelp.cpp +++ b/src/gui/qgshelp.cpp @@ -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;