break;
}
- HelpViewer *viewer = m_centralWidget->currentHelpViewer();
if (placeHolder && showSideBySide) {
RightPaneWidget::instance()->setShown(true);
-
createRightPaneContextViewer();
- viewer = m_helpViewerForSideBar;
- } else {
- activateHelpMode();
- if (!viewer)
- viewer = OpenPagesManager::instance().createPage();
+ return m_helpViewerForSideBar;
}
+
+ activateHelpMode(); // should trigger an createPage...
+ HelpViewer *viewer = m_centralWidget->currentHelpViewer();
+ if (!viewer)
+ viewer = OpenPagesManager::instance().createPage();
return viewer;
}
CentralWidget::instance()->addPage(m_model->pageAt(i));
emit pagesChanged();
- setCurrentPage(initialPage);
+ setCurrentPage((initialPage >= m_model->rowCount())
+ ? m_model->rowCount() - 1 : initialPage);
m_openPagesSwitcher->selectCurrentPage();
}