[GME-commit] GMESRC/GME/Gme GuiMeta.cpp, 1.13, 1.14 GME.rc, 1.157,
1.158
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Sat Jun 2 10:29:01 CDT 2007
Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv5569
Modified Files:
GuiMeta.cpp GME.rc
Log Message:
Do not exit from the middle of an iteration over a com collection.
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: GuiMeta.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GuiMeta.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** GuiMeta.cpp 25 Feb 2004 18:18:36 -0000 1.13
--- GuiMeta.cpp 2 Jun 2007 15:28:58 -0000 1.14
***************
*** 538,541 ****
--- 538,542 ----
bool CGuiMetaModel::GetPartByRole(CComPtr<IMgaMetaRole> &theRole,CComPtr<IMgaMetaAspect> &theAspect,CComPtr<IMgaMetaPart> &thePart)
{
+ bool res = false;
try {
CComPtr<IMgaMetaParts> mmParts;
***************
*** 547,553 ****
CComPtr<IMgaMetaAspect> mmAspect;
COMTHROW(mmPart->get_ParentAspect(&mmAspect));
! if(mmAspect == theAspect) {
thePart = mmPart;
! return true;
}
}
--- 548,554 ----
CComPtr<IMgaMetaAspect> mmAspect;
COMTHROW(mmPart->get_ParentAspect(&mmAspect));
! if( !res && mmAspect == theAspect) {
thePart = mmPart;
! res = true;// we will not return any more from the middle of an iteration
}
}
***************
*** 556,560 ****
catch(hresult_exception &) {
}
! return false;
}
////////////////////////////// CGuiMetaAspect /////////////////////////////
--- 557,561 ----
catch(hresult_exception &) {
}
! return res;
}
////////////////////////////// CGuiMetaAspect /////////////////////////////
***************
*** 742,745 ****
--- 743,747 ----
bool CGuiMetaAspect::GetPartByRole(CComPtr<IMgaMetaRole> &theRole,CComPtr<IMgaMetaPart> &thePart)
{
+ bool res = false;
CComPtr<IMgaMetaAspect> aspPt;
try {
***************
*** 754,760 ****
CComPtr<IMgaMetaRole> mmRole;
COMTHROW(mmPart->get_Role(&mmRole));
! if(mmRole == theRole) {
thePart = mmPart;
! return true;
}
}
--- 756,762 ----
CComPtr<IMgaMetaRole> mmRole;
COMTHROW(mmPart->get_Role(&mmRole));
! if( !res && mmRole == theRole) {
thePart = mmPart;
! res = true; // we will not return any more from the middle of an iteration
}
}
***************
*** 763,767 ****
catch(hresult_exception &) {
}
! return false;
}
--- 765,769 ----
catch(hresult_exception &) {
}
! return res;
}
Index: GME.rc
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/GME.rc,v
retrieving revision 1.157
retrieving revision 1.158
diff -C2 -d -r1.157 -r1.158
*** GME.rc 3 May 2007 18:48:09 -0000 1.157
--- GME.rc 2 Jun 2007 15:28:58 -0000 1.158
***************
*** 670,674 ****
7,135,165,8
DEFPUSHBUTTON "OK",IDOK,65,151,43,12,WS_GROUP
! CTEXT "GENERIC MODELING ENVIRONMENT 6",IDC_STATIC,7,55,165,8
CONTROL 184,IDC_BMPABOUT,"Static",SS_BITMAP | SS_NOTIFY,7,7,165,
45
--- 670,674 ----
7,135,165,8
DEFPUSHBUTTON "OK",IDOK,65,151,43,12,WS_GROUP
! CTEXT "GENERIC MODELING ENVIRONMENT 7",IDC_STATIC,7,55,165,8
CONTROL 184,IDC_BMPABOUT,"Static",SS_BITMAP | SS_NOTIFY,7,7,165,
45
More information about the GME-commit
mailing list