mirror of
https://github.com/tecnickcom/TCPDF.git
synced 2025-03-21 22:49:39 +01:00
Merge pull request #74 from emielmolenaar/master
Refactor deprecated each() calls to foreach()
This commit is contained in:
commit
ee2fcaf7a4
16
tcpdf.php
16
tcpdf.php
@ -12582,7 +12582,7 @@ class TCPDF {
|
||||
$k = $this->k;
|
||||
$this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%u,[%F,%F,%F,%F]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n";
|
||||
$this->javascript .= 'f'.$name.'.textSize='.$this->FontSizePt.";\n";
|
||||
while (list($key, $val) = each($prop)) {
|
||||
foreach($prop as $key => $val) {
|
||||
if (strcmp(substr($key, -5), 'Color') == 0) {
|
||||
$val = TCPDF_COLORS::_JScolor($val);
|
||||
} else {
|
||||
@ -16545,9 +16545,9 @@ class TCPDF {
|
||||
// get attributes
|
||||
preg_match_all('/([^=\s]*)[\s]*=[\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER);
|
||||
$dom[$key]['attribute'] = array(); // reset attribute array
|
||||
while (list($id, $name) = each($attr_array[1])) {
|
||||
$dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id];
|
||||
}
|
||||
foreach($attr_array[1] as $id => $name) {
|
||||
$dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id];
|
||||
}
|
||||
if (!empty($css)) {
|
||||
// merge CSS style to current style
|
||||
list($dom[$key]['csssel'], $dom[$key]['cssdata']) = TCPDF_STATIC::getCSSdataArray($dom, $key, $css);
|
||||
@ -16558,10 +16558,10 @@ class TCPDF {
|
||||
// get style attributes
|
||||
preg_match_all('/([^;:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER);
|
||||
$dom[$key]['style'] = array(); // reset style attribute array
|
||||
while (list($id, $name) = each($style_array[1])) {
|
||||
// in case of duplicate attribute the last replace the previous
|
||||
$dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]);
|
||||
}
|
||||
foreach($style_array[1] as $id => $name) {
|
||||
// in case of duplicate attribute the last replace the previous
|
||||
$dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]);
|
||||
}
|
||||
// --- get some style attributes ---
|
||||
// text direction
|
||||
if (isset($dom[$key]['style']['direction'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user