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 / TableRowGroup.php

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

72 lines 2.0 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\TableRowGroup as TableRowGroupFrameDecorator;
12
13 /**
14 * Reflows table row groups (e.g. tbody tags)
15 *
16 * @package dompdf
17 */
18 class TableRowGroup extends AbstractFrameReflower
19 {
20
21 /**
22 * TableRowGroup constructor.
23 * @param TableRowGroupFrameDecorator $frame
24 */
25 function __construct(TableRowGroupFrameDecorator $frame)
26 {
27 parent::__construct($frame);
28 }
29
30 /**
31 * @param BlockFrameDecorator|null $block
32 */
33 function reflow(BlockFrameDecorator $block = null)
34 {
35 /** @var TableRowGroupFrameDecorator */
36 $frame = $this->_frame;
37 $page = $frame->get_root();
38
39 // Counters and generated content
40 $this->_set_content();
41
42 $style = $frame->get_style();
43 $cb = $frame->get_containing_block();
44
45 foreach ($frame->get_children() as $child) {
46 $child->set_containing_block($cb["x"], $cb["y"], $cb["w"], $cb["h"]);
47 $child->reflow();
48
49 // Check if a split has occurred
50 $page->check_page_break($child);
51
52 if ($page->is_full()) {
53 break;
54 }
55 }
56
57 $table = TableFrameDecorator::find_parent_table($frame);
58 $cellmap = $table->get_cellmap();
59
60 // Stop reflow if a page break has occurred before the frame, in which
61 // case it is not part of its parent table's cell map yet
62 if ($page->is_full() && !$cellmap->frame_exists_in_cellmap($frame)) {
63 return;
64 }
65
66 $style->set_used("width", $cellmap->get_frame_width($frame));
67 $style->set_used("height", $cellmap->get_frame_height($frame));
68
69 $frame->set_position($cellmap->get_frame_position($frame));
70 }
71 }
72