Inner repeats should initialize to startindex on update

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
12 years ago
10 months ago

People

(Reporter: Allan Beaufour, Assigned: Allan Beaufour)

Tracking

({fixed1.8})

Trunk
fixed1.8
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Assignee)

Description

12 years ago
If setindex, insert, or delete modify the index of a repeat parent the inner
repeats should per the errata re-initialize to their startindex attribute (and
not 1 as it is now).
(Assignee)

Updated

12 years ago
Blocks: 264329
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

12 years ago
Created attachment 197407 [details] [diff] [review]
Patch

Created a getStartingIndex() on nsXFormsRepeatElement, used to set the index to
"startindex" or 1 if it's not present.
Attachment #197407 - Flags: review?(smaug)
(Assignee)

Comment 2

12 years ago
btw, attachment 197407 [details] [diff] [review] depends on bug 302918
Depends on: 302918
(Assignee)

Comment 3

12 years ago
Created attachment 197408 [details]
Testcase

Updated

12 years ago
Attachment #197407 - Flags: review?(smaug)
Attachment #197407 - Flags: review?(aaronr)
Attachment #197407 - Flags: review+

Comment 4

12 years ago
Comment on attachment 197407 [details] [diff] [review]
Patch


>--- xforms/nsXFormsRepeatElement.cpp	2005-09-26 14:46:07.000000000 +0200
>+++ xforms.repeatfix/nsXFormsRepeatElement.cpp	2005-09-26 14:51:43.000000000 +0200

> NS_IMETHODIMP
>+nsXFormsRepeatElement::GetStartingIndex(PRUint32 *aRes)
>+{
>+  nsresult rv = GetIntAttr(NS_LITERAL_STRING("startindex"),
>+                           (PRInt32*) aRes,
>+                           nsISchemaBuiltinType::BUILTIN_TYPE_POSITIVEINTEGER);
>+  if (NS_FAILED(rv)) {
>+    *aRes = 1;
>+  }
>+  if (*aRes < 1) {
>+    *aRes = 1;
>+  } else if (*aRes > mMaxIndex) {
>+    *aRes = mMaxIndex;
>+  }
>+  return NS_OK;
>+}
>+
>+

You should probably have a NS_ENSURE_ARG(aRes) at the beginning of this
function.  Might want to add one to ::GetIsParent while you are at it.


With that, r=me
Attachment #197407 - Flags: review?(aaronr) → review+
(Assignee)

Comment 5

12 years ago
Checked in to trunk with smaug's comments
Whiteboard: xf-to-branch
(Assignee)

Comment 6

12 years ago
(In reply to comment #5)
> Checked in to trunk with smaug's comments

Aaron's comments from comment 4, that is...

Comment 7

12 years ago
checked into branch 20051004
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch

Updated

12 years ago
Keywords: fixed1.8
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.