Any chance of getting the patch related to this issue included in the next release?



Justin Lipton wrote:
Hi,
Agreed. When "a" is checked against an (a ,b) construct a value of 1 should be returned indicating that there is a problem at child 1 (missing or incorrect).


However when "x" is checked against the same (a, b) construct surely a value of 0 should be returned rather than 1 (in the current code) as the problem is at child 0 rather than 1. This implies that child 0 is correct where it is clearly not.


Regards, Justin.

Glenn Marcy wrote:


I believe that it was pointed out before that a return value of -1, not 1, indicates a successful match against the content model. The return value of 1 indicates that the child at children[offset + 1] is either incorrect or missing. In your example it is missing.

Regards,
Glenn




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Justin Lipton wrote:


> Hi,
>
> I just found a bug in the SimpleContentModel class - looks like it had been lurking for a while.
> The bug rears it's head when attempting to check the allowable content for the following simple content scenario:
>
> a, b
>
> when only one child is passed in (eg x) the SimpleContentModel returns 1 (a valid state) regardless of whether not x is valid.
>
> Here's a patch that should work:
>
> @@ -297,7 +297,11 @@
> }
> }
> else {
> - if (length > 2) {
> + if (length == 1) {
> + if (children[offset].rawname != fFirstChild.rawname) {
> + return 0;
> + }
> + } else if (length > 2) {
> return 2;
> }
>
> Cheers,
> Justin.



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to