[mapguide-commits] r7812 - in branches/maestro-5.0.x: Maestro.Base/Templates OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI.Http Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Aug 29 00:15:00 PDT 2013


Author: jng
Date: 2013-08-29 00:15:00 -0700 (Thu, 29 Aug 2013)
New Revision: 7812

Modified:
   branches/maestro-5.0.x/Maestro.Base/Templates/MapDefinitionItemTemplate.cs
   branches/maestro-5.0.x/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
   branches/maestro-5.0.x/OSGeo.MapGuide.MaestroAPI/Enums.cs
   branches/maestro-5.0.x/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui/TextView.cs
Log:
#2336, #2333, #2339, #2311: Backport fixes to 5.0.x

Modified: branches/maestro-5.0.x/Maestro.Base/Templates/MapDefinitionItemTemplate.cs
===================================================================
--- branches/maestro-5.0.x/Maestro.Base/Templates/MapDefinitionItemTemplate.cs	2013-08-29 06:45:03 UTC (rev 7811)
+++ branches/maestro-5.0.x/Maestro.Base/Templates/MapDefinitionItemTemplate.cs	2013-08-29 07:15:00 UTC (rev 7812)
@@ -41,7 +41,7 @@
 
         public override IResource CreateItem(string startPoint, IServerConnection conn)
         {
-            return ObjectFactory.CreateMapDefinition(conn, Strings.NewMap);
+            return ObjectFactory.CreateMapDefinition(conn, new Version(1, 0, 0), Strings.NewMap);
         }
     }
 }

Modified: branches/maestro-5.0.x/OSGeo.MapGuide.MaestroAPI/Enums.cs
===================================================================
--- branches/maestro-5.0.x/OSGeo.MapGuide.MaestroAPI/Enums.cs	2013-08-29 06:45:03 UTC (rev 7811)
+++ branches/maestro-5.0.x/OSGeo.MapGuide.MaestroAPI/Enums.cs	2013-08-29 07:15:00 UTC (rev 7812)
@@ -125,6 +125,10 @@
         /// A watermark
         /// </summary>
         WatermarkDefinition,
+        /// <summary>
+        /// A selection for a runtime map
+        /// </summary>
+        Selection
 	}
 
     /// <summary>

Modified: branches/maestro-5.0.x/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- branches/maestro-5.0.x/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2013-08-29 06:45:03 UTC (rev 7811)
+++ branches/maestro-5.0.x/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2013-08-29 07:15:00 UTC (rev 7812)
@@ -1987,24 +1987,31 @@
                 var fsd = new FeatureSourceDescription(s);
                 //We can't just assume first class item is the one, as ones that do not take
                 //class name hints will return the full schema
-                var schema = fsd.Schemas[0];
-                if (schema.Classes.Count > 1)
+                var schema = fsd.GetSchema(schemaName);
+                if (schema != null)
                 {
-                    //Since we have the full schema anyway, let's cache these other classes
-                    ClassDefinition ret = null;
-                    foreach (var cls in schema.Classes)
+                    if (schema.Classes.Count > 1)
                     {
-                        string key = resourceId + "!" + cls.QualifiedName;
-                        m_classDefinitionCache[key] = cls;
+                        //Since we have the full schema anyway, let's cache these other classes
+                        ClassDefinition ret = null;
+                        foreach (var cls in schema.Classes)
+                        {
+                            string key = resourceId + "!" + cls.QualifiedName;
+                            m_classDefinitionCache[key] = cls;
 
-                        if (cls.Name == className)
-                            ret = cls;
+                            if (cls.Name == className)
+                                ret = cls;
+                        }
+                        return ret;
                     }
-                    return ret;
+                    else
+                    {
+                        return schema.GetClass(className);
+                    }
                 }
                 else
                 {
-                    return schema.GetClass(className);
+                    return null;
                 }
             }
         }

Modified: branches/maestro-5.0.x/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui/TextView.cs
===================================================================
--- branches/maestro-5.0.x/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui/TextView.cs	2013-08-29 06:45:03 UTC (rev 7811)
+++ branches/maestro-5.0.x/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui/TextView.cs	2013-08-29 07:15:00 UTC (rev 7812)
@@ -700,8 +700,6 @@
 			int lineOffset = line.Offset;
 			int tabIndent = Document.TextEditorProperties.TabIndent;
 			int guessedColumn = 0;
-			if (tabIndent == 0)
-				return guessedColumn;
 			for (int i = 0; i < logicalColumn; ++i) {
 				char ch;
 				if (i >= line.Length) {
@@ -711,8 +709,11 @@
 				}
 				switch (ch) {
 					case '\t':
-						guessedColumn += tabIndent;
-						guessedColumn = (guessedColumn / tabIndent) * tabIndent;
+                        if (tabIndent != 0)
+                        {
+                            guessedColumn += tabIndent;
+                            guessedColumn = (guessedColumn / tabIndent) * tabIndent;
+                        }
 						break;
 					default:
 						++guessedColumn;
@@ -832,9 +833,7 @@
 			List<TextWord> words = line.Words;
 			if (words == null) return 0;
 			int wordOffset = 0;
-			if (tabIndent == 0 || WideSpaceWidth == 0)
-				return wordOffset;
-
+			
 			for (int i = 0; i < words.Count; i++) {
 				TextWord word = words[i];
 				if (wordOffset >= end) {
@@ -850,6 +849,8 @@
 							break;
 						case TextWordType.Tab:
 							// go to next tab position
+                            if (tabIndent == 0 || WideSpaceWidth == 0)
+                                return wordOffset;
 							drawingPos = (int)((drawingPos + MinTabWidth) / tabIndent / WideSpaceWidth) * tabIndent * WideSpaceWidth;
 							newDrawingPos = drawingPos + tabIndent * WideSpaceWidth;
 							if (newDrawingPos >= targetVisualPosX)



More information about the mapguide-commits mailing list