Exemplo n.º 1
0
 protected function FormatControlSymbol(RtfControlSymbol $symbol)
 {
     if ($symbol->getSymbol() === '\'') {
         $this->BeginState();
         switch ($this->root->getCharset()) {
             default:
             case "ansi":
             case "pc":
             case "pca":
                 $encoding = 'windows-1252';
                 break;
             case "mac":
                 $encoding = 'macroman';
                 break;
         }
         $this->output .= htmlentities(chr($symbol->getValue()), ENT_QUOTES, $encoding);
         $this->EndState();
     } else {
         $this->BeginState();
         $this->output .= $symbol->__toHtml();
         $this->EndState();
     }
 }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
 public function test_ign__toRtf()
 {
     $this->_object->setSymbol('*');
     $this->assertSame('\\*', $this->_object->__toRtf());
 }
Exemplo n.º 4
0
 public function __destruct()
 {
     parent::__destruct();
     $this->_value = null;
 }