@@ -244,10 +244,10 @@ public function setValue($search, $replace, $limit = self::MAXIMUM_REPLACEMENTS_
244244 {
245245 if (is_array ($ search )) {
246246 foreach ($ search as &$ item ) {
247- $ item = self ::ensureMacroCompleted ($ item );
247+ $ item = static ::ensureMacroCompleted ($ item );
248248 }
249249 } else {
250- $ search = self ::ensureMacroCompleted ($ search );
250+ $ search = static ::ensureMacroCompleted ($ search );
251251 }
252252
253253 if (is_array ($ replace )) {
@@ -521,7 +521,7 @@ public function setImageValue($search, $replace, $limit = self::MAXIMUM_REPLACEM
521521 $ xmlImage = str_replace (array ('{RID} ' , '{WIDTH} ' , '{HEIGHT} ' ), array ($ rid , $ preparedImageAttrs ['width ' ], $ preparedImageAttrs ['height ' ]), $ imgTpl );
522522
523523 // replace variable
524- $ varNameWithArgsFixed = self ::ensureMacroCompleted ($ varNameWithArgs );
524+ $ varNameWithArgsFixed = static ::ensureMacroCompleted ($ varNameWithArgs );
525525 $ matches = array ();
526526 if (preg_match ('/(<[^<]+>)([^<]*)( ' . preg_quote ($ varNameWithArgsFixed ) . ')([^>]*)(<[^>]+>)/Uu ' , $ partContent , $ matches )) {
527527 $ wholeTag = $ matches [0 ];
@@ -582,9 +582,7 @@ public function getVariables()
582582 */
583583 public function cloneRow ($ search , $ numberOfClones )
584584 {
585- if ('${ ' !== substr ($ search , 0 , 2 ) && '} ' !== substr ($ search , -1 )) {
586- $ search = '${ ' . $ search . '} ' ;
587- }
585+ $ search = static ::ensureMacroCompleted ($ search );
588586
589587 $ tagPos = strpos ($ this ->tempDocumentMainPart , $ search );
590588 if (!$ tagPos ) {
0 commit comments