From 5db362fb2600535a00d4d6fde1b54ce300dfcefe Mon Sep 17 00:00:00 2001 From: Michel Ludwig Date: Tue, 8 Nov 2011 08:25:36 +0000 Subject: [PATCH] Use the correct line number in 'Part::showSourceLocation' --- interfaces/viewerinterface.h | 3 +++ part.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/interfaces/viewerinterface.h b/interfaces/viewerinterface.h index 13430f9d5..839a45395 100644 --- a/interfaces/viewerinterface.h +++ b/interfaces/viewerinterface.h @@ -31,6 +31,9 @@ class OKULAR_EXPORT ViewerInterface /** * Show the specified source location centrally in the viewer. * + * @param fileName source file name + * @param line in the source file, starts from 0 + * @param column in the source file, starts from 0 * @param showGraphically controls whether the given source location will be * shown graphically in the viewer (if that feature is globally activated) */ diff --git a/part.cpp b/part.cpp index 0099d7a76..2c0c70be4 100644 --- a/part.cpp +++ b/part.cpp @@ -836,7 +836,7 @@ KUrl Part::realUrl() const void Part::showSourceLocation(const QString& fileName, int line, int column, bool showGraphically) { - const QString u = QString( "src:%1 %2" ).arg( line ).arg( fileName ); + const QString u = QString( "src:%1 %2" ).arg( line + 1 ).arg( fileName ); GotoAction action( QString(), u ); m_document->processAction( &action ); if( showGraphically )