ソースを参照

Zend_Pdf: tabs -> spaces correction.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@17300 44c647ce-9c0f-0410-b52a-842ac1e357ba
alexander 16 年 前
コミット
a67e989a86

+ 103 - 103
library/Zend/Pdf/Annotation.php

@@ -38,112 +38,112 @@ require_once 'Zend/Pdf/ElementFactory.php';
  */
 abstract class Zend_Pdf_Annotation
 {
-	/**
-	 * Annotation dictionary
-	 *
-	 * @var Zend_Pdf_Element_Dictionary|Zend_Pdf_Element_Object|Zend_Pdf_Element_Reference
-	 */
-	protected $_annotationDictionary;
-
-	/**
-	 * Get annotation dictionary
-	 *
-	 * @internal
-	 * @return Zend_Pdf_Element
-	 */
-	public function getResource()
-	{
-		return $this->_annotationDictionary;
-	}
-
-
-	/**
-	 * Set bottom edge of the annotation rectangle.
-	 *
-	 * @param float $bottom
-	 * @return Zend_Pdf_Annotation
-	 */
-	public function setBottom($bottom) {
-		$this->_annotationDictionary->Rect->items[1]->touch();
-		$this->_annotationDictionary->Rect->items[1]->value = $bottom;
+    /**
+     * Annotation dictionary
+     *
+     * @var Zend_Pdf_Element_Dictionary|Zend_Pdf_Element_Object|Zend_Pdf_Element_Reference
+     */
+    protected $_annotationDictionary;
+
+    /**
+     * Get annotation dictionary
+     *
+     * @internal
+     * @return Zend_Pdf_Element
+     */
+    public function getResource()
+    {
+        return $this->_annotationDictionary;
+    }
+
+
+    /**
+     * Set bottom edge of the annotation rectangle.
+     *
+     * @param float $bottom
+     * @return Zend_Pdf_Annotation
+     */
+    public function setBottom($bottom) {
+        $this->_annotationDictionary->Rect->items[1]->touch();
+        $this->_annotationDictionary->Rect->items[1]->value = $bottom;
 
         return $this;
-	}
-
-	/**
-	 * Get bottom edge of the annotation rectangle.
-	 *
-	 * @return float
-	 */
-	public function getBottom() {
-		return $this->_annotationDictionary->Rect->items[1]->value;
-	}
-
-	/**
-	 * Set top edge of the annotation rectangle.
-	 *
-	 * @param float $top
+    }
+
+    /**
+     * Get bottom edge of the annotation rectangle.
+     *
+     * @return float
+     */
+    public function getBottom() {
+        return $this->_annotationDictionary->Rect->items[1]->value;
+    }
+
+    /**
+     * Set top edge of the annotation rectangle.
+     *
+     * @param float $top
      * @return Zend_Pdf_Annotation
-	 */
-	public function setTop($top) {
+     */
+    public function setTop($top) {
         $this->_annotationDictionary->Rect->items[3]->touch();
         $this->_annotationDictionary->Rect->items[3]->value = $top;
 
         return $this;
-	}
-
-	/**
-	 * Get top edge of the annotation rectangle.
-	 *
-	 * @return float
-	 */
-	public function getTop() {
-		return $this->_annotationDictionary->Rect->items[3]->value;
-	}
-
-	/**
-	 * Set right edge of the annotation rectangle.
-	 *
-	 * @param float $right
+    }
+
+    /**
+     * Get top edge of the annotation rectangle.
+     *
+     * @return float
+     */
+    public function getTop() {
+        return $this->_annotationDictionary->Rect->items[3]->value;
+    }
+
+    /**
+     * Set right edge of the annotation rectangle.
+     *
+     * @param float $right
      * @return Zend_Pdf_Annotation
-	 */
-	public function setRight($right) {
+     */
+    public function setRight($right) {
         $this->_annotationDictionary->Rect->items[2]->touch();
         $this->_annotationDictionary->Rect->items[2]->value = $right;
 
         return $this;
-	}
-
-	/**
-	 * Get right edge of the annotation rectangle.
-	 *
-	 * @return float
-	 */
-	public function getRight() {
-		return $this->_annotationDictionary->Rect->items[2]->value;
-	}
-
-	/**
-	 * Set left edge of the annotation rectangle.
-	 *
-	 * @param float $left
+    }
+
+    /**
+     * Get right edge of the annotation rectangle.
+     *
+     * @return float
+     */
+    public function getRight() {
+        return $this->_annotationDictionary->Rect->items[2]->value;
+    }
+
+    /**
+     * Set left edge of the annotation rectangle.
+     *
+     * @param float $left
      * @return Zend_Pdf_Annotation
-	 */
-	public function setLeft($left) {
+     */
+    public function setLeft($left) {
         $this->_annotationDictionary->Rect->items[0]->touch();
         $this->_annotationDictionary->Rect->items[0]->value = $left;
 
-		return $this;
-	}
+        return $this;
+    }
 
-	/**
-	 * Get left edge of the annotation rectangle.
-	 *
-	 * @return float
-	 */
-	public function getLeft() {
-		return $this->_annotationDictionary->Rect->items[0]->value;
-	}
+    /**
+     * Get left edge of the annotation rectangle.
+     *
+     * @return float
+     */
+    public function getLeft() {
+        return $this->_annotationDictionary->Rect->items[0]->value;
+    }
 
     /**
      * Return text to be displayed for the annotation or, if this type of annotation
@@ -153,9 +153,9 @@ abstract class Zend_Pdf_Annotation
      * @return string
      */
     public function getText() {
-    	if ($this->_annotationDictionary->Contents === null) {
-    		return '';
-    	}
+        if ($this->_annotationDictionary->Contents === null) {
+            return '';
+        }
 
         return $this->_annotationDictionary->Contents->value;
     }
@@ -170,23 +170,23 @@ abstract class Zend_Pdf_Annotation
      */
     public function setText($text) {
         if ($this->_annotationDictionary->Contents === null) {
-        	$this->_annotationDictionary->touch();
+            $this->_annotationDictionary->touch();
             $this->_annotationDictionary->Contents = new Zend_Pdf_Element_String($text);
         } else {
-        	$this->_annotationDictionary->Contents->touch();
-        	$this->_annotationDictionary->Contents->value = new Zend_Pdf_Element_String($text);
+            $this->_annotationDictionary->Contents->touch();
+            $this->_annotationDictionary->Contents->value = new Zend_Pdf_Element_String($text);
         }
 
         return $this;
     }
 
     /**
-	 * Annotation object constructor
-	 *
-	 * @throws Zend_Pdf_Exception
-	 */
-	public function __construct(Zend_Pdf_Element $annotationDictionary)
-	{
+     * Annotation object constructor
+     *
+     * @throws Zend_Pdf_Exception
+     */
+    public function __construct(Zend_Pdf_Element $annotationDictionary)
+    {
         if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
@@ -213,7 +213,7 @@ abstract class Zend_Pdf_Annotation
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('\'Rect\' dictionary entry must be an array of four numeric elements.');
         }
-	}
+    }
 
     /**
      * Load Annotation object from a specified resource
@@ -224,6 +224,6 @@ abstract class Zend_Pdf_Annotation
      */
     public static function load(Zend_Pdf_Element $resource)
     {
-    	/** @todo implementation */
+        /** @todo implementation */
     }
 }

+ 18 - 18
library/Zend/Pdf/Annotation/Link.php

@@ -84,23 +84,23 @@ class Zend_Pdf_Annotation_Link extends Zend_Pdf_Annotation
             throw new Zend_Pdf_Exception('$target parameter must be a Zend_Pdf_Target object or a string.');
         }
 
-    	$annotationDictionary = new Zend_Pdf_Element_Dictionary();
+        $annotationDictionary = new Zend_Pdf_Element_Dictionary();
 
-    	$annotationDictionary->Type    = new Zend_Pdf_Element_Name('Annot');
-    	$annotationDictionary->Subtype = new Zend_Pdf_Element_Name('Link');
+        $annotationDictionary->Type    = new Zend_Pdf_Element_Name('Annot');
+        $annotationDictionary->Subtype = new Zend_Pdf_Element_Name('Link');
 
-    	$rectangle = new Zend_Pdf_Element_Array();
-    	$rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
-    	$rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
-    	$rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
-    	$rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
-    	$annotationDictionary->Rect = $rectangle;
+        $rectangle = new Zend_Pdf_Element_Array();
+        $rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
+        $rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
+        $rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
+        $rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
+        $annotationDictionary->Rect = $rectangle;
 
-    	if ($target instanceof Zend_Pdf_Destination) {
+        if ($target instanceof Zend_Pdf_Destination) {
             $annotationDictionary->Dest = $target->getResource();
-    	} else {
+        } else {
             $annotationDictionary->A = $target->getResource();
-    	}
+        }
 
         return new Zend_Pdf_Annotation_Link($annotationDictionary);
     }
@@ -142,15 +142,15 @@ class Zend_Pdf_Annotation_Link extends Zend_Pdf_Annotation
      */
     public function getDestination()
     {
-    	if ($this->_annotationDictionary->Dest === null  &&
-    	    $this->_annotationDictionary->A    === null) {
-    		return null;
-    	}
+        if ($this->_annotationDictionary->Dest === null  &&
+            $this->_annotationDictionary->A    === null) {
+            return null;
+        }
 
         if ($this->_annotationDictionary->Dest !== null) {
-        	return Zend_Pdf_Destination::load($this->_annotationDictionary->Dest);
+            return Zend_Pdf_Destination::load($this->_annotationDictionary->Dest);
         } else {
-        	return Zend_Pdf_Action::load($this->_annotationDictionary->A);
+            return Zend_Pdf_Action::load($this->_annotationDictionary->A);
         }
     }
 }

+ 3 - 3
library/Zend/Pdf/Element/Array.php

@@ -74,7 +74,7 @@ class Zend_Pdf_Element_Array extends Zend_Pdf_Element
      * @throws Zend_Pdf_Exception
      */
     public function __get($property) {
-    	require_once 'Zend/Pdf/Exception.php';
+        require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Undefined property: Zend_Pdf_Element_Array::$' . $property);
     }
 
@@ -135,9 +135,9 @@ class Zend_Pdf_Element_Array extends Zend_Pdf_Element
      */
     public function toPhp()
     {
-    	$phpArray = array();
+        $phpArray = array();
 
-    	foreach ($this->items as $item) {
+        foreach ($this->items as $item) {
             $phpArray[] = $item->toPhp();
         }
 

+ 6 - 6
library/Zend/Pdf/Page.php

@@ -1455,13 +1455,13 @@ class Zend_Pdf_Page
         }
 
         if ($this->_pageDictionary->Annots === null) {
-    		$this->_pageDictionary->touch();
-    		$this->_pageDictionary->Annots = new Zend_Pdf_Element_Array();
-    	} else {
-    		$this->_pageDictionary->Annots->touch();
-    	}
+            $this->_pageDictionary->touch();
+            $this->_pageDictionary->Annots = new Zend_Pdf_Element_Array();
+        } else {
+            $this->_pageDictionary->Annots->touch();
+        }
 
-    	$this->_pageDictionary->Annots->items[] = $annotationDictionary;
+        $this->_pageDictionary->Annots->items[] = $annotationDictionary;
 
         $annotationDictionary->touch();
         $annotationDictionary->P = $this->_pageDictionary;

+ 3 - 3
library/Zend/Pdf/StringParser.php

@@ -250,12 +250,12 @@ class Zend_Pdf_StringParser
             if ($this->data[$this->offset] == '%') {
                 preg_match('/[\r\n]/', $this->data, $matches, PREG_OFFSET_CAPTURE, $this->offset);
                 if (count($matches) > 0) {
-                	$this->offset += strlen($matches[0][0]) + $matches[0][1];
+                    $this->offset += strlen($matches[0][0]) + $matches[0][1];
                 } else {
-                	$this->offset = strlen($this->data);
+                    $this->offset = strlen($this->data);
                 }
             } else {
-            	break;
+                break;
             }
         }