Try to fix if there is overflow.
(self)
| 125 | return self.nextElement is None or not self.getOverflow() |
| 126 | |
| 127 | def overflow2Next(self): |
| 128 | """Try to fix if there is overflow.""" |
| 129 | result = True |
| 130 | overflow = self.getOverflow() |
| 131 | if overflow and self.nextElement: # If there is text overflow and there is a next element? |
| 132 | result = False |
| 133 | # Find the page of self |
| 134 | page = self.getElementPage() |
| 135 | if page is not None: |
| 136 | # Try next page |
| 137 | nextElement = page.getElementByName(self.nextElement) # Optional search next page too. |
| 138 | if nextElement is None or nextElement.fs and self.nextPage: |
| 139 | # Not found or not empty, search on next page. |
| 140 | page = self.doc.getPage(self.nextPage) |
| 141 | nextElement = page.getElementByName(self.nextElement) |
| 142 | if nextElement is not None and not nextElement.bs: |
| 143 | # Finally found one empty box on this page or next page? |
| 144 | nextElement.fs = overflow |
| 145 | nextElement.prevPage = page.name |
| 146 | nextElement.prevElement = self.name # Remember the back link |
| 147 | score = nextElement.solve() # Solve any overflow on the next element. |
| 148 | result = not score.fails # Test if total flow placement succeeded. |
| 149 | return result |
| 150 | |
| 151 | # D R A W B O T / F L A T S U P P O R T |
| 152 |
nothing calls this directly
no test coverage detected