Bug 93696 - setting zoom without any diagram
Summary: setting zoom without any diagram
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 1.3.1
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-21 23:22 UTC by Piotr Michalczyk (PL)
Modified: 2004-11-23 23:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Michalczyk (PL) 2004-11-21 23:22:13 UTC
Version:           1.3.1 (using KDE 3.2.3,  (testing/unstable))
Compiler:          gcc version 3.3.3 (Debian 20040422)
OS:                Linux (i686) release 2.6.7

When trying to set zoom (menubar 'diagram\zoom') with no diagram created 'Umbrello' crashes.
Comment 1 Jonathan Riddell 2004-11-23 23:25:20 UTC
CVS commit by jriddell: 

Don't allow no diagram
BUG:93696


  M +1 -0      umldoc.cpp   1.207
  M +7 -4      dialogs/settingsdlg.cpp   1.35


--- kdesdk/umbrello/umbrello/umldoc.cpp  #1.206:1.207
@@ -311,4 +311,5 @@ bool UMLDoc::newDocument() {
                         break;
 
+                case Settings::diagram_no: //don't allow no diagram
                 case Settings::diagram_class:
                         createDiagram( Uml::dt_Class, false );

--- kdesdk/umbrello/umbrello/dialogs/settingsdlg.cpp  #1.34:1.35
@@ -168,8 +168,11 @@ void SettingsDlg::setupGeneralPage() {
                                 i18n("Activity Diagram"), i18n("Component Diagram"),
                                 i18n("Deployment Diagram") };
-        for( int i=0; i<9; i++)
-                m_GeneralWidgets.diagramKB -> insertItem( diagrams[i] );
 
-        m_GeneralWidgets.diagramKB -> setCurrentItem( (int) m_pOptionState->generalState.diagram );
+        //start at 1 because we don't allow No Diagram any more
+        for (int i=1; i<9; i++) {
+                m_GeneralWidgets.diagramKB->insertItem( diagrams[i] );
+        }
+
+        m_GeneralWidgets.diagramKB->setCurrentItem( (int)m_pOptionState->generalState.diagram-1 );
         connect( m_GeneralWidgets.autosaveCB, SIGNAL(clicked()), this, SLOT(slotAutosaveCBClicked()) );
 }
@@ -337,5 +340,5 @@ void SettingsDlg::applyPage( Settings::P
                         m_pOptionState->generalState.tip = m_GeneralWidgets.tipCB -> isChecked();
                         m_pOptionState->generalState.loadlast = m_GeneralWidgets.loadlastCB -> isChecked();
-                        m_pOptionState->generalState.diagram  = ( Settings::Diagram ) m_GeneralWidgets.diagramKB -> currentItem();
+                        m_pOptionState->generalState.diagram  = (Settings::Diagram)(m_GeneralWidgets.diagramKB->currentItem() + 1);
                         break;