dabo Commit
Revision 6994
Date: 2011-11-29 17:16:49 -0800 (Tue, 29 Nov 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6994

Changed:
U   trunk/dabo/lib/reportWriter.py

Log:
Fixed a problem I introduced: popping the last paragraph off but not adding it
back if possible.


Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py      2011-11-29 22:20:07 UTC (rev 6993)
+++ trunk/dabo/lib/reportWriter.py      2011-11-30 01:16:49 UTC (rev 6994)
@@ -1887,7 +1887,7 @@
                                                                        word = 
word.replace("<", "&lt;")
                                                                words[idx] = 
word
                                                        return " ".join(words)
-                                               para = prior_para = 
escapePara(para)
+                                               para = escapePara(para)
                                                p = ParaClass(para, s)
                                        p_height = 
p.wrap(columnWidth-padLeft-padRight, None)[1]
                                        if height is not None and 
objNeededHeight + p_height > height and not overrideExpr:
@@ -1911,6 +1911,11 @@
                                                                objNeededHeight 
+= p_height
                                                                
story.append((p, p_height))
                                                                break
+                                                       else:
+                                                               # the trial is 
good:
+                                                               objNeededHeight 
+= trial_height
+                                                               
story.append((trial_p, trial_height))
+                                                               break
                                                else:
                                                        # Get the max. chars to 
print in the alloted space that we can:
                                                        for trial_len in 
range(len(para)):
@@ -1923,7 +1928,7 @@
                                                        objNeededHeight += 
p_height
                                                        story.append((p, 
p_height))
                                                        break
-
+                                       prior_para = para
                                        objNeededHeight += p_height
                                        story.append((p, p_height))
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to