[commit] r2400 - in trunk: Doc GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu Nov 14 14:16:43 CST 2013


Author: ksmyth
Date: Thu Nov 14 14:16:43 2013
New Revision: 2400

Log:
Fix gme.OleIt.DumpModelGeometryXML

Modified:
   trunk/Doc/README_in.txt
   trunk/GME/Gme/GMEOLEIt.cpp
   trunk/GME/Gme/GMEOLEIt.h
   trunk/GME/Gme/GMEView.cpp

Modified: trunk/Doc/README_in.txt
==============================================================================
--- trunk/Doc/README_in.txt	Thu Nov 14 13:33:24 2013	(r2399)
+++ trunk/Doc/README_in.txt	Thu Nov 14 14:16:43 2013	(r2400)
@@ -1,5 +1,5 @@
               Generic Modeling Environment
-                 GME 13.10.8
+                 GME 13.11.14
        Copyright © 2000-2013 Vanderbilt University
 
 
@@ -26,6 +26,13 @@
 1. Release Notes
 ************************************************
 
+Release Notes of Release 13.11.14
+----------------------------------
+  - Binary compatibility with 11.12.2
+  - Fix gme.OleIt.DumpModelGeometryXML
+  - TableEditor: Excel Import/Export has been re-enabled
+  - VS 2012: Register PIAs and ISIS.GME.Common in Add Reference dialog
+
 Release Notes of Release 13.10.8
 ----------------------------------
   - Binary compatibility with 11.12.2

Modified: trunk/GME/Gme/GMEOLEIt.cpp
==============================================================================
--- trunk/GME/Gme/GMEOLEIt.cpp	Thu Nov 14 13:33:24 2013	(r2399)
+++ trunk/GME/Gme/GMEOLEIt.cpp	Thu Nov 14 14:16:43 2013	(r2400)
@@ -626,7 +626,7 @@
 	DISP_FUNCTION(CGMEOLEIt, "Zoom", Zoom, VT_EMPTY, VTS_I4)
 	DISP_FUNCTION(CGMEOLEIt, "ZoomTo", ZoomTo, VT_EMPTY, VTS_DISPATCH)
 	DISP_FUNCTION(CGMEOLEIt, "Scroll", Scroll, VT_EMPTY, VTS_I2 VTS_I2)
-	DISP_FUNCTION(CGMEOLEIt, "DumpModelGeometryXML", DumpModelGeometryXML, VT_HRESULT, VTS_BSTR)
+	DISP_FUNCTION(CGMEOLEIt, "DumpModelGeometryXML", DumpModelGeometryXML, VT_EMPTY, VTS_BSTR)
 
 
 	DISP_FUNCTION(CGMEOLEIt, "ShowFCO", ShowFCO, VT_EMPTY, VTS_BSTR VTS_BOOL)
@@ -1082,13 +1082,20 @@
 	m_theView->Invalidate();
 }
 
-HRESULT CGMEOLEIt::DumpModelGeometryXML(LPCTSTR filePath) 
+void CGMEOLEIt::DumpModelGeometryXML(LPCTSTR filePath) 
 {
 	CGMEEventLogger::LogGMEEvent(_T("CGMEOLEIt::DumpModelGeometryXML()\r\n"));
 
 	PRECONDITION_VALID_MODEL
 
-	return m_theView->DumpModelGeometryXML(filePath);
+	HRESULT hr = m_theView->DumpModelGeometryXML(filePath);
+	if (FAILED(hr))
+	{
+		_bstr_t err;
+		GetErrorInfo(err.GetAddress());
+		if (err.length())
+			AfxThrowOleDispatchException(201, err);
+	}
 }
 
 //static
@@ -3171,7 +3178,8 @@
 
 	TRY_DUAL(__uuidof(IGMEOLEIt))
 	{
-		return pThis->DumpModelGeometryXML(CString(filePath));
+		pThis->DumpModelGeometryXML(CString(filePath));
+		return NOERROR;
 	}
 	CATCH_ALL_DUAL
 }

Modified: trunk/GME/Gme/GMEOLEIt.h
==============================================================================
--- trunk/GME/Gme/GMEOLEIt.h	Thu Nov 14 13:33:24 2013	(r2399)
+++ trunk/GME/Gme/GMEOLEIt.h	Thu Nov 14 14:16:43 2013	(r2400)
@@ -97,7 +97,7 @@
 	afx_msg void Zoom(long percent);
 	afx_msg void ZoomTo(LPDISPATCH mgaFCOs);
 	afx_msg void Scroll(long bar, long scroll);
-	afx_msg HRESULT DumpModelGeometryXML(LPCTSTR filePath);
+	afx_msg void DumpModelGeometryXML(LPCTSTR filePath);
 
 	afx_msg BOOL GetValid();
 	afx_msg void SetValid(BOOL);

Modified: trunk/GME/Gme/GMEView.cpp
==============================================================================
--- trunk/GME/Gme/GMEView.cpp	Thu Nov 14 13:33:24 2013	(r2399)
+++ trunk/GME/Gme/GMEView.cpp	Thu Nov 14 14:16:43 2013	(r2400)
@@ -7,6 +7,7 @@
 #include <algorithm>
 #include <deque>
 #include <new>
+#include <sstream>
 #include "GMEstd.h"
 
 #include "GuiMeta.h"
@@ -39,6 +40,7 @@
 #include <xercesc/dom/DOM.hpp>
 #include <xercesc/sax/HandlerBase.hpp>
 #include <xercesc/framework/LocalFileFormatTarget.hpp>
+#include <xercesc/util/IOException.hpp>
 #if defined(XERCES_NEW_IOSTREAMS)
 #include <iostream>
 #else
@@ -7797,7 +7799,7 @@
 
 	XStr(const wchar_t* const toTranscode)
 	{
-		XMLString::copyString(fUnicodeForm, toTranscode);
+		fUnicodeForm = XMLString::replicate(toTranscode);
 	}
 	~XStr()
 	{
@@ -7844,7 +7846,7 @@
 
 				DOMElement* rootElem = doc->getDocumentElement();
 				rootElem->setAttribute(X("name"), X(name));
-				rootElem->setAttribute(X("id"), X(CString(currentModId)));
+				rootElem->setAttribute(X("id"), X(currentModId));
 
 				DOMElement* aspectsElem = doc->createElement(X("aspects"));
 				rootElem->appendChild(aspectsElem);
@@ -7988,22 +7990,31 @@
 			catch (const OutOfMemoryException&)
 			{
 				XERCES_STD_QUALIFIER cerr << "OutOfMemoryException" << XERCES_STD_QUALIFIER endl;
-				hr = E_FAIL;
+				SetStandardOrGMEErrorInfo(E_OUTOFMEMORY);
+				hr = E_OUTOFMEMORY;
 			}
 			catch (const DOMException& e)
 			{
 				XERCES_STD_QUALIFIER cerr << "DOMException code is:  " << e.code << XERCES_STD_QUALIFIER endl;
+				SetErrorInfo(E_FAIL, L"DOMException");
+				hr = E_FAIL;
+			}
+			catch (const IOException& e)
+			{
+				SetErrorInfo(E_FAIL, (wchar_t*)e.getMessage());
 				hr = E_FAIL;
 			}
 			catch (...)
 			{
 				XERCES_STD_QUALIFIER cerr << "An error occurred creating the document" << XERCES_STD_QUALIFIER endl;
+				SetStandardOrGMEErrorInfo(E_FAIL);
 				hr = E_FAIL;
 			}
 		} // (inpl != NULL)
 		else
 		{
 			XERCES_STD_QUALIFIER cerr << "Requested implementation is not supported" << XERCES_STD_QUALIFIER endl;
+			SetStandardOrGMEErrorInfo(E_FAIL);
 			hr = E_FAIL;
 		}
 
@@ -8011,11 +8022,12 @@
 	}
 	catch(const XMLException& toCatch)
 	{
-		char *pMsg = XMLString::transcode(toCatch.getMessage());
-		XERCES_STD_QUALIFIER cerr << "Error during Xerces-c Initialization.\n"
-			 << "  Exception message:"
-			 << pMsg;
-		XMLString::release(&pMsg);
+		// FIXME does this leak XMLPlatformUtils::Terminate();
+		std::basic_stringstream<wchar_t> err;
+		err << L"Error during Xerces-c Initialization.\n"
+			 << L"  Exception message:"
+			 << (wchar_t*)toCatch.getMessage();
+		SetErrorInfo(err.str().c_str());
 	}
 
 	return hr;


More information about the gme-commit mailing list