[mapguide-commits] r7264 - trunk/MgDev/Common/CoordinateSystem
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Dec 13 03:43:53 PST 2012
Author: baertelchen
Date: 2012-12-13 03:43:53 -0800 (Thu, 13 Dec 2012)
New Revision: 7264
Modified:
trunk/MgDev/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp
Log:
Fix "Remove redundant call to CS-Map's CSupdCategories() function in MgCoordinateSystemCategoryDictionary::Remove" (as part of RFC 127)
I've changed CS-Map's [CS_ctdel()] function to write all content into the CSD file. That is, calling CSupdCategories(NULL) isn't required anymore.
I've also fixed another problem in [MgCoordinateSystemCategoryDictionary::Modify] which got modified due to RFC127. An category which got updated a 2nd time got actually never written to disk. Instead, the code basically picked the category definition from CSMAP and then did write that one again - instead of taking the category instance that was passed to [MgCoordinateSystemCategoryDictionary::Modify].
Changes reviewed by Hugues.
Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp 2012-12-13 05:51:31 UTC (rev 7263)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp 2012-12-13 11:43:53 UTC (rev 7264)
@@ -375,14 +375,6 @@
throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemInternalException", NULL);
}
- int updateCategoriesResult = CSupdCategories(NULL);
- if (updateCategoriesResult)
- {
- MgStringCollection arguments;
- arguments.Add(sName);
- throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemInternalException", NULL);
- }
-
long position = iter->second;
CCategoryName const& categoryName = List().at(position);
if (0 != CS_stricmp(categoryName.Name(), pName)) //is the category name at the index what we think it is?
@@ -454,15 +446,8 @@
invalidIndexOnFailure = true;
- pCategory = CS_ctdef(pName);
- if (NULL == pCategory)
- {
- MgStringCollection arguments;
- arguments.Add(str);
- throw new MgCoordinateSystemLoadFailedException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
- }
-
- int updateResult = CS_ctupd(pCategory);
+ cs_Ctdef_ const* pDef = pCategoryDef->GetCategoryDef();
+ int updateResult = CS_ctupd(pDef);
if (updateResult < 0)
{
MgStringCollection arguments;
More information about the mapguide-commits
mailing list