View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011450 | Scribus | Scripter | public | 2013-03-05 22:55 | 2013-03-07 20:25 |
Reporter | FrViPofm | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | Ubuntu 12.04 | ||||
Product Version | 1.4.2 | ||||
Summary | 0011450: In Scripter newPage(-2) should insert a page before last | ||||
Description | In the Scripter, newPage(1) insterts a page at pos 1 newPage(2) insterts a page at pos 2 ... newPage(-1) insterts a page at end It would be nice to have newPage(-2) insterts a page at pos 1 before last | ||||
Steps To Reproduce | In a document having several pages, in the console : newPage(-2) add a page at the end | ||||
Additional Information | tested in fact on Scribus 1.4.0 (no heigher version on ubuntu) | ||||
Tags | No tags attached. | ||||
Patch | |||||
|
That sounds wrong to me because its mixing up the purpose of the task. One being insert at position 2 Other being insert at relative position N-2 or N-(the last page). Better to split into newPage() and newPageAt(), or similar. |
|
According to frvipofm, newPage(-1) allready inserts at the end. In PHP, using negative numbers as offset is a common way to stay "offset starts from end". See substr for example : http://www.php.net/manual/en/function.substr.php This convention might be a good compromise between having strange use of args and having lot of similar functions to remember... |