View Issue Details

IDProjectCategoryView StatusLast Update
0011450ScribusScripterpublic2013-03-07 20:25
ReporterFrViPofm Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformUbuntu 12.04 
Product Version1.4.2 
Summary0011450: In Scripter newPage(-2) should insert a page before last
DescriptionIn 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 ReproduceIn a document having several pages,
in the console :
newPage(-2)
add a page at the end
Additional Informationtested in fact on Scribus 1.4.0 (no heigher version on ubuntu)
TagsNo tags attached.
Patch

Activities

cbradney

2013-03-06 19:43

administrator   ~0029974

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.

JLuc

2013-03-07 20:25

developer   ~0029975

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...

Issue History

Date Modified Username Field Change
2013-03-05 22:55 FrViPofm New Issue
2013-03-06 19:43 cbradney Note Added: 0029974
2013-03-07 20:25 JLuc Note Added: 0029975