Remove page number for Multi plots with only one page

This commit is contained in:
Gaute Lindkvist 2020-09-17 09:10:26 +02:00 committed by Magne Sjaastad
parent 93baf776a1
commit 377274cdec

View File

@ -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 ) );
}
}
}