PluginProbe
MBE eShip / trunk
MBE eShip vtrunk
2.8.1 trunk 1.0.0 1.1.0 1.1.3 1.2.1 1.2.2 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.7.1 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1.0 2.1.1 2.1.2 2.2.1 All 37 releases
mail-boxes-etc / lib / dompdf / src / FrameReflower / TableRow.php

TableRow.php in MBE eShip trunk, at lib/dompdf/src/FrameReflower/TableRow.php

83 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package dompdf
4 * @link https://github.com/dompdf/dompdf
5 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
6 */
7 namespace Dompdf\FrameReflower;
8
9 use Dompdf\FrameDecorator\Block as BlockFrameDecorator;
10 use Dompdf\FrameDecorator\Table as TableFrameDecorator;
11 use Dompdf\FrameDecorator\TableRow as TableRowFrameDecorator;
12 use Dompdf\Exception;
13
14 /**
15 * Reflows table rows
16 *
17 * @package dompdf
18 */
19 class TableRow extends AbstractFrameReflower
20 {
21 /**
22 * TableRow constructor.
23 * @param TableRowFrameDecorator $frame
24 */
25 function __construct(TableRowFrameDecorator $frame)
26 {
27 parent::__construct($frame);
28 }
29
30 /**
31 * @param BlockFrameDecorator|null $block
32 */
33 function reflow(BlockFrameDecorator $block = null)
34 {
35 /** @var TableRowFrameDecorator */
36 $frame = $this->_frame;
37
38 // Check if a page break is forced
39 $page = $frame->get_root();
40 $page->check_forced_page_break($frame);
41
42 // Bail if the page is full
43 if ($page->is_full()) {
44 return;
45 }
46
47 // Counters and generated content
48 $this->_set_content();
49
50 $this->_frame->position();
51 $style = $this->_frame->get_style();
52 $cb = $this->_frame->get_containing_block();
53
54 foreach ($this->_frame->get_children() as $child) {
55 $child->set_containing_block($cb);
56 $child->reflow();
57
58 if ($page->is_full()) {
59 break;
60 }
61 }
62
63 if ($page->is_full()) {
64 return;
65 }
66
67 $table = TableFrameDecorator::find_parent_table($this->_frame);
68 $cellmap = $table->get_cellmap();
69 $style->set_used("width", $cellmap->get_frame_width($this->_frame));
70 $style->set_used("height", $cellmap->get_frame_height($this->_frame));
71
72 $this->_frame->set_position($cellmap->get_frame_position($this->_frame));
73 }
74
75 /**
76 * @throws Exception
77 */
78 public function get_min_max_width(): array
79 {
80 throw new Exception("Min/max width is undefined for table rows");
81 }
82 }
83