raunakbinani / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

WHILE in context where it is not needed at all? #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
3 methods are using while command, but are those needed on this context at all?

    function get_parent() {

        $p = $this->_frame->get_parent ();

        if ($p && $deco = $p->get_decorator ()) {
            while ( $tmp = $deco->get_decorator () )
                $deco = $tmp;
            return $deco;
        } else if ($p)
            return $p;
        else
            return null;
    }

    function get_first_child() {
        $c = $this->_frame->get_first_child ();
        if ($c && $deco = $c->get_decorator ()) {
            while ( $tmp = $deco->get_decorator () )
                $deco = $tmp;
            return $deco;
        } else if ($c)
            return $c;
        else
            return null;
    }

    function get_last_child() {
        $c = $this->_frame->get_last_child ();
        if ($c && $deco = $c->get_decorator ()) {
            while ( $tmp = $deco->get_decorator () )
                $deco = $tmp;
            return $deco;
        } else if ($c)
            return $c;
        else
            return null;
    }

Original issue reported on code.google.com by holyfi...@devbau.com on 8 Sep 2009 at 10:13

GoogleCodeExporter commented 9 years ago
version: dompdf 0.5.1

Original comment by holyfi...@devbau.com on 8 Sep 2009 at 10:15

GoogleCodeExporter commented 9 years ago
File: frame_decorator.cls.php

Original comment by holyfi...@devbau.com on 8 Sep 2009 at 10:17

GoogleCodeExporter commented 9 years ago
Why wouldn't it be needed? The code here is to find the furthest decorator.

Original comment by fabien.menager on 27 Jul 2010 at 8:21

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:15