owner = $owner; } /** * Determine and set the parent for this element. * The parent is the previous element. * * If the container is nested in another table or frame, * then the surrounding table or frame is the parent! * * @param ODTStateElement $previous */ public function determineParent(ODTStateElement $previous) { $container = $previous; while (isset($container)) { if ($container->getClass() == 'table-cell') { $cell = $container; } if ($container->getClass() == 'table') { break; } if ($container->getClass() == 'frame') { break; } $container = $container->getParent(); } if (!isset($container)) { $this->owner->setParent($previous); } else { $this->owner->setParent($container); $container->addNestedContainer ($this->owner); $this->is_nested = true; } } /** * Is this container nested in another container * (inserted into another table or frame)? * * @return boolean */ public function isNested () { return $this->is_nested; } public function addNestedContainer (iContainerAccess $nested) { $this->nestedContainers [] = $nested; } public function getNestedContainers () { return $this->nestedContainers; } }