[mapguide-commits] r6879 - in branches/2.4/MgDev/Desktop: MapViewer MgDesktop/Services UnitTest

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jul 9 01:46:07 PDT 2012


Author: jng
Date: 2012-07-09 01:46:07 -0700 (Mon, 09 Jul 2012)
New Revision: 6879

Modified:
   branches/2.4/MgDev/Desktop/MapViewer/IPropertyPane.cs
   branches/2.4/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp
   branches/2.4/MgDev/Desktop/UnitTest/TestFeatureService.cpp
Log:
#2068: Derp. Fixed rookie mistake of mixing up i's and j's

Modified: branches/2.4/MgDev/Desktop/MapViewer/IPropertyPane.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/IPropertyPane.cs	2012-07-09 03:12:46 UTC (rev 6878)
+++ branches/2.4/MgDev/Desktop/MapViewer/IPropertyPane.cs	2012-07-09 08:46:07 UTC (rev 6879)
@@ -150,13 +150,21 @@
                 for (int i = 0; i < selLayers.GetCount(); i++)
                 {
                     var layer = selLayers.GetItem(i);
+                    var clsName = layer.GetFeatureClassName();
+                    int selCount = selection.GetSelectedFeaturesCount(layer, clsName);
+                    if (selCount == 0)
+                    {
+                        System.Diagnostics.Trace.TraceWarning("No items in selection set for this layer (" + layer.GetName() + "). Layer shouldn't be here then");
+                        continue;
+                    }
+
                     var ldfId = layer.GetLayerDefinition();
                     NameValueCollection mappings = null;
                     if (propertyMappings.ContainsKey(ldfId.ToString()))
                         mappings = propertyMappings[ldfId.ToString()];
 
                     _features[layer.Name] = new List<MgFeature>();
-
+                    
                     var reader = selection.GetSelectedFeatures(layer, layer.GetFeatureClassName(), false);
                     while (reader.ReadNext())
                     {

Modified: branches/2.4/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp
===================================================================
--- branches/2.4/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp	2012-07-09 03:12:46 UTC (rev 6878)
+++ branches/2.4/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp	2012-07-09 08:46:07 UTC (rev 6879)
@@ -1412,7 +1412,7 @@
             bool bIsExtendedClassName = false;
             for (INT32 j = 0; j < extensionCount; j++)
             {
-                MdfModel::Extension* extension = extensions->GetAt(i);
+                MdfModel::Extension* extension = extensions->GetAt(j);
                 CHECKNULL(extension, L"MgdFeatureService::DescribeSchema");
                 STRING extName = (STRING)extension->GetName();
                 if (clsName == extName)

Modified: branches/2.4/MgDev/Desktop/UnitTest/TestFeatureService.cpp
===================================================================
--- branches/2.4/MgDev/Desktop/UnitTest/TestFeatureService.cpp	2012-07-09 03:12:46 UTC (rev 6878)
+++ branches/2.4/MgDev/Desktop/UnitTest/TestFeatureService.cpp	2012-07-09 08:46:07 UTC (rev 6879)
@@ -2638,6 +2638,17 @@
 
         Ptr<MgFeatureReader> reader = pService->SelectFeatures(lFeatureSource, L"Ext1", NULL);
 
+        //With GetIdentityProperties
+        Ptr<MgPropertyDefinitionCollection> idProps = pService->GetIdentityProperties(lFeatureSource, L"SHP_Schema", L"Ext1");
+        CPPUNIT_ASSERT(NULL != idProps);
+        CPPUNIT_ASSERT(1 == idProps->GetCount());
+
+        Ptr<MgStringCollection> findClasses = new MgStringCollection();
+        findClasses->Add(L"Ext1");
+        Ptr<MgClassDefinitionCollection> matches = pService->GetIdentityProperties(lFeatureSource, L"SHP_Schema", findClasses);
+        CPPUNIT_ASSERT(NULL != matches);
+        CPPUNIT_ASSERT(1 == matches->GetCount());
+
         Ptr<MgFeatureSchemaCollection> schemas;
         Ptr<MgFeatureSchema> schema;
         //With GetClasses



More information about the mapguide-commits mailing list