public $tags = array();\r
\r
protected $currentTag;\r
-\r
protected $processed = false;\r
\r
public function __construct($dump)\r
{\r
$this->lines = explode("\n", $dump);\r
- $this->lastIndex = count($this->lines)-1;\r
}\r
\r
public function process()\r
return;\r
}\r
\r
- foreach($lines as $line) {\r
+ foreach($this->lines as $line) {\r
if (preg_match('|^\[([0-9A-Z]{3})\]\s+(.*)$|i', $line, $matches)) {\r
- $currentTag = $this->addTag($matches[1], $matches[2]);\r
- } else {\r
- $currentTag->addLine($line);\r
+ $this->currentTag = $this->addTag($matches[1], $matches[2]);\r
+ } elseif (!is_null($this->currentTag)) {\r
+ $this->currentTag->addLine($line);\r
}\r
}\r
+\r
+ $this->lines = null;\r
}\r
\r
protected function addTag($tag, $line)\r
{\r
$tag = wsSWF2HTMLTag::factory($tag, $line);\r
- $this->tags[] = $tag;\r
+ if (!is_null($tag)) {\r
+ $this->tags[] = $tag;\r
+ }\r
return $tag;\r
}\r
\r
} else if ($tag == wsSWF2HTML::TEXT_TAG) {\r
return new wsSWF2HTMLParagraph($line);\r
} else {\r
- return new wsSWF2HTMLTag($line);\r
+ return null;\r
}\r
}\r
public $complete = false;\r
\r
public function addLine($line)\r
{\r
- $line = trim($line);\r
- return $line;\r
+ return ltrim($line);\r
}\r
}\r
\r
{\r
$line = parent::addLine($line);\r
if (substr($line, 0, 1) == '|') {\r
- if (preg_match('|^\|\s([0-9.]*)\s([0-9.]*)\s([0-9.]*)$|i', $line, $m)) {\r
+ if (preg_match('|\|\s([0-9.-]+)\s([0-9.-]+)\s([0-9.-]+)|i', $line, $m)) {\r
if (is_null($this->matrix->a)) {\r
- $this->matrix->a = parseFloat($m[1]);\r
- $this->matrix->c = parseFloat($m[2]);\r
- $this->matrix->tx = parseFloat($m[3]);\r
+ $this->matrix->a = floatval($m[1]);\r
+ $this->matrix->c = floatval($m[2]);\r
+ $this->matrix->tx = floatval($m[3]);\r
} else {\r
- $this->matrix->b = parseFloat($m[1]);\r
- $this->matrix->d = parseFloat($m[2]);\r
- $this->matrix->ty = parseFloat($m[3]);\r
+ $this->matrix->b = floatval($m[1]);\r
+ $this->matrix->d = floatval($m[2]);\r
+ $this->matrix->ty = floatval($m[3]);\r
}\r
+ }else{\r
+ fb($line);\r
}\r
} else if (substr($line, 0, 1) == '<') {\r
$text = new wsSWF2HTMLText($line);\r
public $valid = false;\r
public function __construct($line)\r
{\r
- if (preg_match('|^\<\d+ glyphs in font (\d+) size (\d+), color (#[0-9a-f]+) at ([0-9.]+),([0-9.]+)\>\s(.*)|i', $line, $matches)) {\r
+ if (preg_match('|^\<\s?\d+ glyphs in font (\d+) size (\d+), color (#[0-9a-f]+) at ([0-9.-]+),([0-9.-]+)\>\s(.*)|ui', $line, $matches)) {\r
$this->font = intval($matches[1]);\r
$this->size = intval($matches[2]);\r
$this->color = $matches[3];\r
$this->valid = true;\r
} else {\r
$this->valid = false;\r
+ fb($line,'invalid text');\r
}\r
}\r
}\r