[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Feb 9 16:56:43 UTC 2007
SVN commit 631974 by okellogg:
More lists returned by value evaporating before use, see
http://sourceforge.net/mailarchive/forum.php?thread_id=31622063&forum_id=472
M +6 -4 dialogs/pkgcontentspage.cpp
M +2 -2 umldoc.cpp
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/dialogs/pkgcontentspage.cpp #631973:631974
@@ -64,14 +64,16 @@
if (!i)
return;
int item = m_pContentLB -> currentItem();
- UMLObject *o = m_pPackage->containedObjects().at(item);
+ UMLObjectList contents = m_pPackage->containedObjects();
+ UMLObject *o = contents.at(item);
ClassPropDlg dlg(this, o, item, true);
dlg.exec();
}
void PkgContentsPage::fillListBox() {
m_pContentLB->clear();
- UMLObjectListIt objList_it(m_pPackage->containedObjects());
+ UMLObjectList contents = m_pPackage->containedObjects();
+ UMLObjectListIt objList_it(contents);
UMLObject* umlo = NULL;
int i = 0;
while ((umlo = objList_it.current()) != NULL) {
@@ -107,8 +109,8 @@
switch(id) {
case ListPopupMenu::mt_Delete:
{
- UMLObject *o = m_pPackage->containedObjects().at(
- m_pContentLB->currentItem() );
+ UMLObjectList contents = m_pPackage->containedObjects();
+ UMLObject *o = contents.at( m_pContentLB->currentItem() );
UMLApp::app()->getDocument()->removeUMLObject(o);
fillListBox();
}
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.cpp #631973:631974
@@ -1884,9 +1884,9 @@
UMLAssociationList UMLDoc::getAssociations() {
UMLAssociationList associationList;
for (int i = 0; i < Uml::N_MODELTYPES; i++) {
+ UMLAssociationList assocs = m_root[i]->getAssociations();
UMLAssociation *a;
- for (UMLAssociationListIt ait(m_root[i]->getAssociations());
- (a = ait.current()) != NULL; ++ait)
+ for (UMLAssociationListIt ait(assocs); (a = ait.current()) != NULL; ++ait)
associationList.append(a);
}
return associationList;
More information about the umbrello-devel
mailing list