protected function parseControlSymbol() { $this->getChar(); $symbol = $this->char; if ($symbol == '\'') { $this->getChar(); $parameter = $this->char; $this->getChar(); $parameter = $parameter . $this->char; $rtfsymbol = new RtfHexaControlSymbol(); $rtfsymbol->setValueFromHex($parameter); $this->group->children[] = $rtfsymbol; } else { $rtfsymbol = new RtfControlSymbol(); $rtfsymbol->symbol = $symbol; $this->group->children[] = $rtfsymbol; } }
protected function parseControlSymbol() { // Read symbol (one character only). $this->getChar(); $symbol = $this->char; if ($symbol === '\'') { // Symbols ordinarily have no parameter. However, // if this is \', then it is followed by a 2-digit hex-code: $this->getChar(); $parameter = $this->char; $this->getChar(); $parameter .= $this->char; $rtfsymbol = new RtfHexaControlSymbol(); $rtfsymbol->setSymbol($symbol); $rtfsymbol->setValueFromHex($parameter); $this->group->children[] = $rtfsymbol; } else { $rtfsymbol = new RtfControlSymbol(); $rtfsymbol->setSymbol($symbol); $this->group->children[] = $rtfsymbol; } }
public function test_setHexValue() { $this->_object->setValueFromHex('e9'); $this->assertEquals('233', $this->_object->getValue()); }