File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,15 @@ public function getVariables()
128
128
* @param mixed $offset
129
129
*/
130
130
private function _findRowStart ($ offset ) {
131
- return strrpos ($ this ->_documentXML , "<w:tr " , ((strlen ($ this ->_documentXML ) - $ offset ) * -1 ));
131
+ $ rowStart = strrpos ($ this ->_documentXML , "<w:tr " , ((strlen ($ this ->_documentXML ) - $ offset ) * -1 ));
132
+ if (!$ rowStart ) {
133
+ $ rowStart = strrpos ($ this ->_documentXML , "<w:tr> " , ((strlen ($ this ->_documentXML ) - $ offset ) * -1 ));
134
+ }
135
+ if (!$ rowStart ) {
136
+ trigger_error ("Can not find the start position of the row to clone. " );
137
+ return false ;
138
+ }
139
+ return $ rowStart ;
132
140
}
133
141
134
142
/**
@@ -137,7 +145,8 @@ private function _findRowStart($offset) {
137
145
* @param mixed $offset
138
146
*/
139
147
private function _findRowEnd ($ offset ) {
140
- return strpos ($ this ->_documentXML , "</w:tr> " , $ offset ) + 7 ;
148
+ $ rowEnd = strpos ($ this ->_documentXML , "</w:tr> " , $ offset ) + 7 ;
149
+ return $ rowEnd ;
141
150
}
142
151
143
152
/**
You can’t perform that action at this time.
0 commit comments