#25 Small bug

closed-fixed
nobody
None
5
2009-09-02
2009-08-29
No

For some reason one of my test documents is creating an empty paragraph. I expect that is not very useful, but it shouldn't be disallowed, either.

However, wordaxe throws an exception:

File "/usr/lib/python2.6/site-packages/wordaxe/rl/NewParagraph.py", line 1100, in minWidth
return max([frag.width for frag in self.frags])

It's easily fixed by this minWidth:

def minWidth(self):
"""Attempt to determine a minimum sensible width"""
if self.frags:
return max([frag.width for frag in self.frags])
return 0

And I see no obvious evil side effects...

Discussion

  • H. von Bargen

    H. von Bargen - 2009-09-01

    Hmm, I'm not sure.
    What's the intention of an empty paragraph?
    I agree that a minimum width of 0 seems reasonable, thus I'll use your fix. It's included in revision 90.
    Can you please verify it's fixed?

     
  • H. von Bargen

    H. von Bargen - 2009-09-01
    • status: open --> open-fixed
     
  • Roberto Alsina

    Roberto Alsina - 2009-09-01

    It's what happens when a program creates your flowables. Sometimes you get corner cases noone would do on purpose. revision 90 works perfect.

     
  • H. von Bargen

    H. von Bargen - 2009-09-02
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks