[Uml-devel] KDE/kdesdk/umbrello/umbrello/widgets

Oliver Kellogg okellogg at users.sourceforge.net
Tue Feb 28 07:32:38 UTC 2012


SVN commit 1282627 by okellogg:

minimumSize(): On loading, apparently it can happen that m_pObject is not
set - as witnessed by following crash:

Program received signal SIGSEGV, Segmentation fault.
UMLObject::name (this=0x0) at /trunk/KDE/kdesdk/umbrello/umbrello/umlobject.cpp:185
185         return m_name;                                                                                
(gdb) bt                                                                                                  
#0  UMLObject::name (this=0x0) at /trunk/KDE/kdesdk/umbrello/umbrello/umlobject.cpp:185
#1  0x083213ff in ObjectWidget::minimumSize (this=0x8857d68)                                                  
    at /trunk/KDE/kdesdk/umbrello/umbrello/widgets/objectwidget.cpp:132                
#2  0x0832f3bd in UMLWidget::constrain (this=0x8857d68, width=@0xbfffcafc, height=@0xbfffcaf8)                
    at /trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp:257                   
#3  0x08332add in UMLWidget::clipSize (this=0x8857d68)                                                        
    at /trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp:1251                  
#4  0x0840bc63 in UMLView::loadWidgetsFromXMI (this=0x8854948, qElement=...)                                  
    at /trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp:3464                            
#5  0x0841d917 in UMLView::loadFromXMI (this=0x8854948, qElement=...)                                         
    at /trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp:3431                            
#6  0x08369b8e in UMLFolder::loadDiagramsFromXMI (this=0x8642658, diagrams=...)                               
    at /trunk/KDE/kdesdk/umbrello/umbrello/folder.cpp:381                              
#7  0x0836b2c9 in UMLFolder::load (this=0x8642658, element=...)
    at /trunk/KDE/kdesdk/umbrello/umbrello/folder.cpp:473
#8  0x084002cf in UMLObject::loadFromXMI (this=0x8642658, element=...)                                                                      
    at /trunk/KDE/kdesdk/umbrello/umbrello/umlobject.cpp:1067                                                        
#9  0x083dbf39 in UMLDoc::loadUMLObjectsFromXMI (this=0x8620670, element=...)                                                               
    at /trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp:2111                                                           
#10 0x083dba27 in UMLDoc::loadUMLObjectsFromXMI (this=0x8620670, element=...)                                                               
    at /trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp:2130                                                           
#11 0x083dd391 in UMLDoc::loadFromXMI (this=0x8620670, file=..., encode=<value optimized out>)                                              
    at /trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp:1938                                                           
#12 0x083da8a0 in UMLDoc::openDocument (this=0x8620670, url=..., format=0x0)                                                                
    at /trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp:544                                                            


 M  +6 -1      objectwidget.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/objectwidget.cpp #1282626:1282627
@@ -129,7 +129,12 @@
     int width, height;
     const QFontMetrics &fm = getFontMetrics(FT_UNDERLINE);
     const int fontHeight  = fm.lineSpacing();
-    const QString t = m_InstanceName + " : " + m_pObject->name();
+    QString objName;
+    if (m_pObject)
+        objName = m_pObject->name();
+    else
+        objName = "1234567";
+    const QString t = m_InstanceName + " : " + objName;
     const int textWidth = fm.width(t);
     if ( m_drawAsActor ) {
         width = textWidth > A_WIDTH?textWidth:A_WIDTH;




More information about the umbrello-devel mailing list