View Issue Details

IDProjectCategoryView StatusLast Update
0008285ScribusScripterpublic2009-08-10 22:14
Reporterciops Assigned Tojghali  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformintelOSwindowsOS Versionxp sp3
Product Version1.3.3.13 
Fixed in Version1.3.3.14svn 
Summary0008285: while loop with textOverflows crashes scribus
DescriptionI do not understand why if I run the following script with a messageBox Command it works, else with the messageBox line commented it halts scribus (I must kill scribus.exe process to stop having 100% Cpu working).
Steps To Reproducerun this script:


from scribus import *
setUnit(1)

descFrameID="DESC_2"
createText(100,100,100,1, descFrameID)
setText("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla ",descFrameID)
H = getSize(descFrameID)[1]
ovfc=textOverflows(descFrameID)

while ovfc>0:
    if ovfc==0:
        break
    else:
        H += 1
        sizeObject(getSize(descFrameID)[0], H ,descFrameID)
        messageBox("caption", "Overflow character: "+str(textOverflows(descFrameID))+"\n new Frame Height:"+str(H), icon=ICON_NONE, button1=BUTTON_OK, button2=BUTTON_NONE, button3=BUTTON_NONE)
    ovfc=textOverflows(descFrameID)
TagsNo tags attached.
Patch

Activities

2009-07-14 14:40

 

new.py (706 bytes)

jghali

2009-07-16 22:41

administrator   ~0022202

The frame layout is tied to redraw in 1.3.3.x. As redraw is normally disabled while script is running, a way to redraw frames is needed. Calling messageBox() allows that indirectly. Here you will need to call redrawAll() after sizeObject(). You will need also latest 1.3.3.14svn snapshot as i fixed a bug which prevented redrawAll() to work as expected :
https://sourceforge.net/projects/scribus/files/scribus-svn/scribus-1.3.3.14svn-090716-snapshot.exe/download

jghali

2009-07-16 22:44

administrator   ~0022203

Forgot a thing : that redrawAll() is not needed in 1.3.5svn as layout and redraw are now recoupled.

Issue History

Date Modified Username Field Change
2009-07-14 14:40 ciops New Issue
2009-07-14 14:40 ciops File Added: new.py
2009-07-16 22:41 jghali Note Added: 0022202
2009-07-16 22:42 jghali Status new => resolved
2009-07-16 22:42 jghali Fixed in Version => 1.3.3.14svn
2009-07-16 22:42 jghali Resolution open => fixed
2009-07-16 22:42 jghali Assigned To => jghali
2009-07-16 22:44 jghali Note Added: 0022203
2009-08-10 22:14 cbradney Status resolved => closed