Explorar el Código

2003-09-23 Atsushi Enomoto <[email protected]>

	* XmlNamespaceManager.cs: Rewrote PopScope() because its namespace
	  recovery was still not enough. Fixed GrowScopes() (incorrect index).

svn path=/trunk/mcs/; revision=18271
Atsushi Eno hace 22 años
padre
commit
9d37f0560b

+ 5 - 0
mcs/class/System.XML/System.Xml/ChangeLog

@@ -1,3 +1,8 @@
+2003-09-23  Atsushi Enomoto <[email protected]>
+
+	* XmlNamespaceManager.cs: Rewrote PopScope() because its namespace
+	  recovery was still not enough. Fixed GrowScopes() (incorrect index).
+
 2003-09-21  Atsushi Enomoto <[email protected]>
 
 	* XmlTextReader.cs : 

+ 7 - 12
mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs

@@ -54,7 +54,7 @@ namespace System.Xml
 		{
 			NsScope [] old = scopes;
 			scopes = new NsScope [scopePos * 2 + 1];
-			if (declPos > 0)
+			if (scopePos > 0)
 				Array.Copy (old, 0, scopes, 0, scopePos);
 		}
 		
@@ -230,18 +230,13 @@ namespace System.Xml
 
 		public virtual bool PopScope ()
 		{
-			if (scopePos == -1) return false;
-			scopePos --;
-			
+			if (scopePos == -1)
+				return false;
+
 			declPos -= count;
-			if (scopePos == -1) {
-				defaultNamespace = string.Empty;
-				count = declPos + 1;
-			} else {
-				defaultNamespace = scopes [scopePos].DefaultNamespace;
-				count = scopes [scopePos].DeclCount;
-				declPos += count;
-			}
+			defaultNamespace = scopes [scopePos].DefaultNamespace;
+			count = scopes [scopePos].DeclCount;
+			scopePos --;
 			return true;
 		}