[commit] r2421 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu Jan 30 10:04:25 CST 2014


Author: ksmyth
Date: Thu Jan 30 10:04:25 2014
New Revision: 2421

Log:
GMEView: call SetSelected in tx, like everywhere else

Modified:
   trunk/GME/Gme/GMEView.cpp

Modified: trunk/GME/Gme/GMEView.cpp
==============================================================================
--- trunk/GME/Gme/GMEView.cpp	Thu Jan 30 10:04:15 2014	(r2420)
+++ trunk/GME/Gme/GMEView.cpp	Thu Jan 30 10:04:25 2014	(r2421)
@@ -2300,6 +2300,39 @@
 				contextAnnotation = ann;
 		}
 
+		SendNow(true);
+
+		try {
+			POSITION pos = selected.GetHeadPosition();
+			while (pos) {
+				CGuiObject* go = selected.GetNext(pos);
+				if (go && go->mgaFco) {
+					// Sending decorator events (for efficiency)
+					CGuiAspect* pAspect = go->GetCurrentAspect();
+					if (pAspect != NULL) {
+						CComQIPtr<IMgaElementDecorator> newDecorator(pAspect->GetDecorator());
+						if (newDecorator)
+							HRESULT retVal = newDecorator->SetSelected(VARIANT_TRUE); // FIXME: decorators expect a transaction to be open
+					}
+				}
+			}
+		}
+		catch (hresult_exception&) {
+			AfxMessageBox(_T("Unable to refresh selected status to decorators"));
+			CGMEEventLogger::LogGMEEvent(_T("CGMEView::Reset - Unable to refresh selected status to decorators.\r\n"));
+		}
+
+		if (selConn != NULL) {
+			POSITION pos = connections.GetHeadPosition();
+			while(pos) {
+				CGuiConnection *conn = connections.GetNext(pos);
+				if (conn->mgaFco == selConn) {
+					selectedConnection = conn;
+					conn->SetSelect(true);
+					break;
+				}
+			}
+		}
 		CommitTransaction();
 	}
 	catch (hresult_exception& e) {
@@ -2314,43 +2347,10 @@
 
 	Invalidate(doInvalidate);
 	AutoRoute();
+	SetScroll(); // TODO: will this work?
 	DoPannWinRefresh();
 
 	EndWaitCursor();
-
-	SendNow(true);
-
-	try {
-		POSITION pos = selected.GetHeadPosition();
-		while (pos) {
-			CGuiObject* go = selected.GetNext(pos);
-			if (go && go->mgaFco) {
-				// Sending decorator events (for efficiency)
-				CGuiAspect* pAspect = go->GetCurrentAspect();
-				if (pAspect != NULL) {
-					CComQIPtr<IMgaElementDecorator> newDecorator(pAspect->GetDecorator());
-					if (newDecorator)
-						HRESULT retVal = newDecorator->SetSelected(VARIANT_TRUE);
-				}
-			}
-		}
-	}
-	catch (hresult_exception&) {
-		AfxMessageBox(_T("Unable to refresh selected status to decorators"));
-		CGMEEventLogger::LogGMEEvent(_T("CGMEView::Reset - Unable to refresh selected status to decorators.\r\n"));
-	}
-
-	if (selConn != NULL) {
-		POSITION pos = connections.GetHeadPosition();
-		while(pos) {
-			CGuiConnection *conn = connections.GetNext(pos);
-			if (conn->mgaFco == selConn) {
-				selectedConnection = conn;
-				conn->SetSelect(true);
-				break;
-			}
-		}
-	}
 }
 
 void CGMEView::InitSets()


More information about the gme-commit mailing list