(In reply to Ulf Zibis from comment #108) > (In reply to <email address hidden> from comment #107) > > Hi, why not using for statements: > > > >+ newFolderName.Assign(folderName); > > >+ bool containsChild = true; > > >+ for (uint32_t i=2; ; i++) { > > >+ rv = ContainsChildNamed(newFolderName, &containsChild); > > >+ NS_ENSURE_SUCCESS(rv, rv); > > >+ if (!containsChild) > > >+ break; > > >+ // This could be localizable but Toolkit is fine without it, see > > >+ // mozilla/toolkit/content/contentAreaUtils.js::uniqueFile() > > >+ newFolderName.Assign(folderName); > > >+ newFolderName.AppendLiteral("("); > > >+ newFolderName.AppendInt(i); > > >+ newFolderName.AppendLiteral(")"); > > >+ }
For is never used for such a purpose. That's the point of a while(condition).
(In reply to Ulf Zibis from comment #108) Assign( folderName) ; med(newFolderNa me, &containsChild); SUCCESS( rv, rv); toolkit/ content/ contentAreaUtil s.js::uniqueFil e() Assign( folderName) ; AppendLiteral( "("); AppendInt( i); AppendLiteral( ")");
> (In reply to <email address hidden> from comment #107)
>
> Hi, why not using for statements:
>
> > >+ newFolderName.
> > >+ bool containsChild = true;
> > >+ for (uint32_t i=2; ; i++) {
> > >+ rv = ContainsChildNa
> > >+ NS_ENSURE_
> > >+ if (!containsChild)
> > >+ break;
> > >+ // This could be localizable but Toolkit is fine without it, see
> > >+ // mozilla/
> > >+ newFolderName.
> > >+ newFolderName.
> > >+ newFolderName.
> > >+ newFolderName.
> > >+ }
For is never used for such a purpose. That's the point of a while(condition).