summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <[email protected]>2015-06-08 12:48:07 +0200
committerRalf Habacker <[email protected]>2015-06-08 12:48:07 +0200
commit7835b6b292c42db370307e2ce06c84f1b3873ead (patch)
treed087101da33f72ec49a06319378d9737166179e3
parentf7c8ccdf02e57a5541477784c4e285616cbe56d0 (diff)
Fix not working "Shift"+"Key_Right" and "Shift"+"Key_Left" shortcut in non tabbed diagram mode (CID 71474).
This issue has been initial reported by coverity CID 71474: Logically dead code (DEADCODE) Execution cannot reach this statement: this->setCurrentView(currVi....)
-rw-r--r--umbrello/uml.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/umbrello/uml.cpp b/umbrello/uml.cpp
index 0b01ba3..80af85b 100644
--- a/umbrello/uml.cpp
+++ b/umbrello/uml.cpp
@@ -3101,7 +3101,7 @@ void UMLApp::slotTabChanged(QWidget* tab)
void UMLApp::slotChangeTabLeft()
{
//DEBUG(DBG_SRC) << "currentIndex = " << m_tabWidget->currentIndex() << " of " << m_tabWidget->count();
- if (m_tabWidget) {
+ if (Settings::optionState().generalState.tabdiagrams && m_tabWidget) {
m_tabWidget->setCurrentIndex(m_tabWidget->currentIndex() - 1);
return;
}
@@ -3131,7 +3131,7 @@ void UMLApp::slotChangeTabLeft()
void UMLApp::slotChangeTabRight()
{
//DEBUG(DBG_SRC) << "currentIndex = " << m_tabWidget->currentIndex() << " of " << m_tabWidget->count();
- if (m_tabWidget) {
+ if (Settings::optionState().generalState.tabdiagrams && m_tabWidget) {
m_tabWidget->setCurrentIndex(m_tabWidget->currentIndex() + 1);
return;
}
@@ -3143,16 +3143,12 @@ void UMLApp::slotChangeTabRight()
return;
}
UMLView* nextView = NULL;
- if (viewIndex!= views.count()) {
- views.begin()[viewIndex + 1];
+ if (viewIndex < views.count()-1) {
+ nextView = views.begin()[viewIndex + 1];
+ setCurrentView(nextView);
}
-
- if ((currView = nextView) != NULL) {
- setCurrentView(currView);
- }
- else {
+ else
setCurrentView(views.first());
- }
}
/* for debugging only