[mapguide-commits] r8616 - in trunk/MgDev: . Common/MapGuideCommon/Controller

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Apr 2 04:57:10 PDT 2015


Author: jng
Date: 2015-04-02 04:57:10 -0700 (Thu, 02 Apr 2015)
New Revision: 8616

Modified:
   trunk/MgDev/
   trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
Log:
Merged revision(s) 8563 from sandbox/adsk/3.0m:
#2547: Attribute values are wrong in Selection Panel if feature source is joined.
http://trac.osgeo.org/mapguide/ticket/2547, submit on behalf of Andy Zhang.

In selection panel, the order of attribute names is from 'LayerMetaData', which is same as the order of layer's property mappings. But the order of values is same as the order of properties in class definition. They are same in most cases. However, they may be different if feature source is joined or a view.

Now we use the order of properties in class definition for both cases. 

........



Property changes on: trunk/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/branches/2.6/MgDev:8276-8286,8288-8292,8297,8299,8301,8303,8314-8315,8318,8335,8340,8354-8355,8365,8373
/sandbox/jng/convenience_apis:8262-8268,8271-8363
/sandbox/jng/createruntimemap:7486-7555
/sandbox/jng/dwftk:8321-8324,8328-8329,8331,8352
/sandbox/jng/geos34x:8256-8259
/sandbox/jng/tiling:8174-8208
/sandbox/jng/v30:8212-8227
/sandbox/rfc94:5099-5163
   + /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/branches/2.6/MgDev:8276-8286,8288-8292,8297,8299,8301,8303,8314-8315,8318,8335,8340,8354-8355,8365,8373
/sandbox/adsk/3.0m:8563
/sandbox/jng/convenience_apis:8262-8268,8271-8363
/sandbox/jng/createruntimemap:7486-7555
/sandbox/jng/dwftk:8321-8324,8328-8329,8331,8352
/sandbox/jng/geos34x:8256-8259
/sandbox/jng/tiling:8174-8208
/sandbox/jng/v30:8212-8227
/sandbox/rfc94:5099-5163

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2015-04-02 11:44:03 UTC (rev 8615)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2015-04-02 11:57:10 UTC (rev 8616)
@@ -495,37 +495,41 @@
                     MdfModel::NameStringPairCollection* pmappings = vl->GetPropertyMappings();
                     for (int j=0; j<pmappings->GetCount(); j++)
                     {
-                        STRING pTypeStr;
                         MdfModel::NameStringPair* m = pmappings->GetAt(j);
                         propNames->Add(m->GetName());
                         displayNameMap.insert(std::make_pair(m->GetName(), m->GetValue()));
-                        INT32 pidx = clsProps->IndexOf(m->GetName());
-                        if (pidx >= 0)
+                    }
+                    STRING pTypeStr;
+                    for (int k = 0; k < clsProps->GetCount(); k++)
+                    {
+                        Ptr<MgPropertyDefinition> propDef = clsProps->GetItem(k);
+                        STRING propName = propDef->GetName();
+                        DisplayNameMap::iterator it = displayNameMap.find(propName);
+                        //Skip properties without display mappings
+                        if (it == displayNameMap.end())
+                            continue;
+                        INT32 pdType = propDef->GetPropertyType();
+                        INT32 pType = MgPropertyType::Null;
+                        if (pdType == MgFeaturePropertyType::DataProperty)
                         {
-                            Ptr<MgPropertyDefinition> propDef = clsProps->GetItem(pidx);
-                            INT32 pdType = propDef->GetPropertyType();
-                            INT32 pType = MgPropertyType::Null;
-                            if (pdType == MgFeaturePropertyType::DataProperty)
-                            {
-                                pType = ((MgDataPropertyDefinition*)propDef.p)->GetDataType();
-                            }
-                            else if (pdType == MgFeaturePropertyType::GeometricProperty)
-                            {
-                                pType = MgPropertyType::Geometry;
-                            }
-                            MgUtil::Int32ToString(pType, pTypeStr);
-                            xmlOut.append(L"<Property>\n");
-                            xmlOut.append(L"<Name>");
-                            xmlOut.append(m->GetName());
-                            xmlOut.append(L"</Name>\n");
-                            xmlOut.append(L"<Type>");
-                            xmlOut.append(pTypeStr);
-                            xmlOut.append(L"</Type>\n");
-                            xmlOut.append(L"<DisplayName>");
-                            xmlOut.append(m->GetValue());
-                            xmlOut.append(L"</DisplayName>\n");
-                            xmlOut.append(L"</Property>\n");
+                            pType = ((MgDataPropertyDefinition*)propDef.p)->GetDataType();
                         }
+                        else if (pdType == MgFeaturePropertyType::GeometricProperty)
+                        {
+                            pType = MgPropertyType::Geometry;
+                        }
+                        MgUtil::Int32ToString(pType, pTypeStr);
+                        xmlOut.append(L"<Property>\n");
+                        xmlOut.append(L"<Name>");
+                        xmlOut.append(it->first);
+                        xmlOut.append(L"</Name>\n");
+                        xmlOut.append(L"<Type>");
+                        xmlOut.append(pTypeStr);
+                        xmlOut.append(L"</Type>\n");
+                        xmlOut.append(L"<DisplayName>");
+                        xmlOut.append(it->second);
+                        xmlOut.append(L"</DisplayName>\n");
+                        xmlOut.append(L"</Property>\n");
                     }
                 }
             }



More information about the mapguide-commits mailing list