Author: rfm
Date: Tue Dec 22 19:35:37 2015
New Revision: 39239
URL: http://svn.gna.org/viewcvs/gnustep?rev=39239&view=rev
Log:
OSX copmpatibility tweak.
Modified:
libs/base/trunk/ChangeLog
libs/base/trunk/Source/NSXMLElement.m
libs/base/trunk/Tests/base/NSXMLElement/children.m
Modified: libs/base/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=39239&r1=39238&r2=39239&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog (original)
+++ libs/base/trunk/ChangeLog Tue Dec 22 19:35:37 2015
@@ -1,3 +1,9 @@
+2015-12-22 Richard Frith-Macdonald <[email protected]>
+
+ * Source/NSXMLElement.m: For OSX compatibility, raise an exception
+ it we attempt to insert an element which is already the child of
+ some other element.
+
2015-11-30: Niels Grewe <[email protected]>
* Source/NSCalendar.h
@@ -10,12 +16,14 @@
2015-11-22 Riccardo Mottola <[email protected]>
* Source/NSFileManager.m (createDirectoryAtPath)
- Should return success even if all path components do exist, as by Apple
spec.
+ Should return success even if all path components do exist,
+ as by Apple spec.
2015-11-13 Riccardo Mottola <[email protected]>
* Source/NSRange.m: (NSRangeFromString)
- Parse length and location with scanInteger and not scanInt (suggested
by Fred Kiefer to fix 64bit)
+ Parse length and location with scanInteger and not scanInt
+ (suggested by Fred Kiefer to fix 64bit)
2015-11-02 Richard Frith-Macdonald <[email protected]>
Modified: libs/base/trunk/Source/NSXMLElement.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSXMLElement.m?rev=39239&r1=39238&r2=39239&view=diff
==============================================================================
--- libs/base/trunk/Source/NSXMLElement.m (original)
+++ libs/base/trunk/Source/NSXMLElement.m Tue Dec 22 19:35:37 2015
@@ -657,10 +657,16 @@
NSAssert(NSXMLNamespaceKind != theKind, NSInvalidArgumentException);
NSAssert(NSXMLNotationDeclarationKind != theKind,
NSInvalidArgumentException);
- if (nil != [child parent])
- {
- [child detach];
- }
+/* On OSX we get NSInternalInconsistencyException if we try to add an element
+ * which is already a child of some other parent. So presumably we shouldn't
+ * be auto-removing...
+ *
+ * if (nil != [child parent])
+ * {
+ * [child detach];
+ * }
+ */
+ NSAssert(nil == [child parent], NSInternalInconsistencyException);
[self _insertChild: child atIndex: index];
}
Modified: libs/base/trunk/Tests/base/NSXMLElement/children.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Tests/base/NSXMLElement/children.m?rev=39239&r1=39238&r2=39239&view=diff
==============================================================================
--- libs/base/trunk/Tests/base/NSXMLElement/children.m (original)
+++ libs/base/trunk/Tests/base/NSXMLElement/children.m Tue Dec 22 19:35:37 2015
@@ -45,7 +45,7 @@
PASS_EXCEPTION([root2 insertChild: child1 atIndex: 0],
NSInternalInconsistencyException,
- "cannot add a child to to parents");
+ "cannot add a child if it has a parent");
{
NSXMLNode *c;
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs