table_row_frame_reflower.cls.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * @package dompdf
  4. * @link http://dompdf.github.com/
  5. * @author Benj Carson <benjcarson@digitaljunkies.ca>
  6. * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  7. */
  8. /**
  9. * Reflows table rows
  10. *
  11. * @access private
  12. * @package dompdf
  13. */
  14. class Table_Row_Frame_Reflower extends Frame_Reflower {
  15. function __construct(Table_Row_Frame_Decorator $frame) {
  16. parent::__construct($frame);
  17. }
  18. //........................................................................
  19. function reflow(Block_Frame_Decorator $block = null) {
  20. $page = $this->_frame->get_root();
  21. if ( $page->is_full() )
  22. return;
  23. $this->_frame->position();
  24. $style = $this->_frame->get_style();
  25. $cb = $this->_frame->get_containing_block();
  26. foreach ($this->_frame->get_children() as $child) {
  27. if ( $page->is_full() )
  28. return;
  29. $child->set_containing_block($cb);
  30. $child->reflow();
  31. }
  32. if ( $page->is_full() )
  33. return;
  34. $table = Table_Frame_Decorator::find_parent_table($this->_frame);
  35. $cellmap = $table->get_cellmap();
  36. $style->width = $cellmap->get_frame_width($this->_frame);
  37. $style->height = $cellmap->get_frame_height($this->_frame);
  38. $this->_frame->set_position($cellmap->get_frame_position($this->_frame));
  39. }
  40. //........................................................................
  41. function get_min_max_width() {
  42. throw new DOMPDF_Exception("Min/max width is undefined for table rows");
  43. }
  44. }