From 377274cdec6f294445950c4d39a136b73ff0ff18 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Thu, 17 Sep 2020 09:10:26 +0200 Subject: [PATCH] Remove page number for Multi plots with only one page --- ApplicationCode/UserInterface/RiuMultiPlotBook.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/UserInterface/RiuMultiPlotBook.cpp b/ApplicationCode/UserInterface/RiuMultiPlotBook.cpp index cbf07685ac..f9d1105887 100644 --- a/ApplicationCode/UserInterface/RiuMultiPlotBook.cpp +++ b/ApplicationCode/UserInterface/RiuMultiPlotBook.cpp @@ -206,7 +206,16 @@ void RiuMultiPlotBook::setPlotTitle( const QString& plotTitle ) m_plotTitle = plotTitle; for ( int i = 0; i < m_pages.size(); ++i ) { - m_pages[i]->setPlotTitle( QString( "%1 %2/%3" ).arg( m_plotTitle ).arg( i + 1 ).arg( m_pages.size() ) ); + int pageIndex = i + 1; + int pageCount = (int)m_pages.size(); + if ( pageCount > pageIndex ) + { + m_pages[i]->setPlotTitle( QString( "%1 %2/%3" ).arg( m_plotTitle ).arg( i + 1 ).arg( m_pages.size() ) ); + } + else + { + m_pages[i]->setPlotTitle( QString( "%1" ).arg( m_plotTitle ) ); + } } }