Handle the cases were there's no whitespace after <w:tr.
This commit is contained in:
parent
590f08c42b
commit
57f330c099
@ -128,7 +128,15 @@ class PHPWord_Template
|
|||||||
* @param mixed $offset
|
* @param mixed $offset
|
||||||
*/
|
*/
|
||||||
private function _findRowStart($offset) {
|
private function _findRowStart($offset) {
|
||||||
return strrpos($this->_documentXML, "<w:tr ", ((strlen($this->_documentXML) - $offset) * -1));
|
$rowStart = strrpos($this->_documentXML, "<w:tr ", ((strlen($this->_documentXML) - $offset) * -1));
|
||||||
|
if (!$rowStart) {
|
||||||
|
$rowStart = strrpos($this->_documentXML, "<w:tr>", ((strlen($this->_documentXML) - $offset) * -1));
|
||||||
|
}
|
||||||
|
if (!$rowStart) {
|
||||||
|
trigger_error("Can not find the start position of the row to clone.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return $rowStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -137,7 +145,8 @@ class PHPWord_Template
|
|||||||
* @param mixed $offset
|
* @param mixed $offset
|
||||||
*/
|
*/
|
||||||
private function _findRowEnd($offset) {
|
private function _findRowEnd($offset) {
|
||||||
return strpos($this->_documentXML, "</w:tr>", $offset) + 7;
|
$rowEnd = strpos($this->_documentXML, "</w:tr>", $offset) + 7;
|
||||||
|
return $rowEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user