From 07b435b2b9289ca3bb3046aeeab996f7810f7bcd Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Thu, 23 Apr 2009 14:38:55 +0000 Subject: From: Alan Webb Cleanup tabs and spacing. --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 136 ++++++++++----------- .../Framework/Scenes/SceneObjectPartInventory.cs | 4 +- 2 files changed, 70 insertions(+), 70 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 364da72..f8b4483 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -443,49 +443,49 @@ namespace OpenSim.Region.Framework.Scenes try { - StringReader sr; - XmlTextReader reader; - XmlNodeList parts; - XmlDocument doc; + StringReader sr; + XmlTextReader reader; + XmlNodeList parts; + XmlDocument doc; int linkNum; - doc = new XmlDocument(); - doc.LoadXml(xmlData); - parts = doc.GetElementsByTagName("RootPart"); + doc = new XmlDocument(); + doc.LoadXml(xmlData); + parts = doc.GetElementsByTagName("RootPart"); - if(parts.Count == 0) + if (parts.Count == 0) { throw new Exception("[SCENE] Invalid Xml format - no root part"); } else { - sr = new StringReader(parts[0].InnerXml); - reader = new XmlTextReader(sr); + sr = new StringReader(parts[0].InnerXml); + reader = new XmlTextReader(sr); SetRootPart(SceneObjectPart.FromXml(fromUserInventoryItemID, reader)); - reader.Close(); - sr.Close(); + reader.Close(); + sr.Close(); } - parts = doc.GetElementsByTagName("Part"); + parts = doc.GetElementsByTagName("Part"); for (int i=0; i 0) - { - StringReader sr = new StringReader(parts[0].OuterXml); - XmlTextReader reader = new XmlTextReader(sr); - SetRootPart(CreatePartFromXml(reader)); - reader.Close(); - sr.Close(); - } + // Process the root part first + if (parts.Count > 0) + { + StringReader sr = new StringReader(parts[0].OuterXml); + XmlTextReader reader = new XmlTextReader(sr); + SetRootPart(CreatePartFromXml(reader)); + reader.Close(); + sr.Close(); + } - // Then deal with the rest - for(int i=1; i 0) + XmlNodeList nodes = doc.GetElementsByTagName("SavedScriptState"); + if (nodes.Count > 0) { m_savedScriptState = new Dictionary(); - foreach(XmlNode node in nodes) - { - if(node.Attributes["UUID"] != null) - { - UUID itemid = new UUID(node.Attributes["UUID"].Value); - m_savedScriptState.Add(itemid, node.InnerXml); - } - } + foreach (XmlNode node in nodes) + { + if (node.Attributes["UUID"] != null) + { + UUID itemid = new UUID(node.Attributes["UUID"].Value); + m_savedScriptState.Add(itemid, node.InnerXml); + } + } } } @@ -851,19 +851,19 @@ namespace OpenSim.Region.Framework.Scenes } } - if(states.Count > 0) + if (states.Count > 0) { - // Now generate the necessary XML wrappings - writer.WriteStartElement(String.Empty, "GroupScriptStates", String.Empty); - foreach(UUID itemid in states.Keys) - { - doc.LoadXml(states[itemid]); - writer.WriteStartElement(String.Empty, "SavedScriptState", String.Empty); - writer.WriteAttributeString(String.Empty, "UUID", String.Empty, itemid.ToString()); - writer.WriteRaw(doc.DocumentElement.OuterXml); // Writes ScriptState element - writer.WriteEndElement(); // End of SavedScriptState - } - writer.WriteEndElement(); // End of GroupScriptStates + // Now generate the necessary XML wrappings + writer.WriteStartElement(String.Empty, "GroupScriptStates", String.Empty); + foreach (UUID itemid in states.Keys) + { + doc.LoadXml(states[itemid]); + writer.WriteStartElement(String.Empty, "SavedScriptState", String.Empty); + writer.WriteAttributeString(String.Empty, "UUID", String.Empty, itemid.ToString()); + writer.WriteRaw(doc.DocumentElement.OuterXml); // Writes ScriptState element + writer.WriteEndElement(); // End of SavedScriptState + } + writer.WriteEndElement(); // End of GroupScriptStates } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index e952799..6bf1654 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -265,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - if(m_part.ParentGroup.m_savedScriptState != null) + if (m_part.ParentGroup.m_savedScriptState != null) RestoreSavedScriptState(item.OldItemID, item.ItemID); m_items[item.ItemID].PermsMask = 0; m_items[item.ItemID].PermsGranter = UUID.Zero; @@ -283,7 +283,7 @@ namespace OpenSim.Region.Framework.Scenes private void RestoreSavedScriptState(UUID oldID, UUID newID) { - if(m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) + if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) { string fpath = Path.Combine("ScriptEngines/"+m_part.ParentGroup.Scene.RegionInfo.RegionID.ToString(), newID.ToString()+".state"); -- cgit v1.1