Merge branch 'develop' of https://github.com/PHPOffice/PHPWord.git into develop

This commit is contained in:
Bas-Jan 't Jong 2014-05-26 21:25:07 +02:00
commit 3085445081
3 changed files with 10 additions and 9 deletions

View File

@ -36,6 +36,7 @@ This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3; new r
- Header: All images added to the second header were assigned to the first header - @basjan GH-222 - Header: All images added to the second header were assigned to the first header - @basjan GH-222
- Conversion: Fix conversion from cm to pixel, pixel to cm, and pixel to point - @basjan GH-233 GH-234 - Conversion: Fix conversion from cm to pixel, pixel to cm, and pixel to point - @basjan GH-233 GH-234
- PageBreak: Page break adds new line in the beginning of the new page - @ivanlanin GH-150 - PageBreak: Page break adds new line in the beginning of the new page - @ivanlanin GH-150
- Image: `marginLeft` and `marginTop` cannot accept float value - @ivanlanin GH-248
### Deprecated ### Deprecated

View File

@ -245,7 +245,7 @@ abstract class AbstractStyle
if (is_string($value) && (preg_match('/[^\d\.\,]/', $value) == 0)) { if (is_string($value) && (preg_match('/[^\d\.\,]/', $value) == 0)) {
$value = floatval($value); $value = floatval($value);
} }
if (!is_float($value)) { if (!is_numeric($value)) {
$value = $default; $value = $default;
} }

View File

@ -102,14 +102,14 @@ class Image extends AbstractStyle
/** /**
* Margin Top * Margin Top
* *
* @var int * @var int|float
*/ */
private $marginTop = 0; private $marginTop = 0;
/** /**
* Margin Left * Margin Left
* *
* @var int * @var int|float
*/ */
private $marginLeft = 0; private $marginLeft = 0;
@ -235,7 +235,7 @@ class Image extends AbstractStyle
/** /**
* Get margin top * Get margin top
* *
* @return int * @return int|float
*/ */
public function getMarginTop() public function getMarginTop()
{ {
@ -245,12 +245,12 @@ class Image extends AbstractStyle
/** /**
* Set margin top * Set margin top
* *
* @param int $value * @param int|float $value
* @return self * @return self
*/ */
public function setMarginTop($value = 0) public function setMarginTop($value = 0)
{ {
$this->marginTop = $this->setIntVal($value, 0); $this->marginTop = $this->setNumericVal($value, 0);
return $this; return $this;
} }
@ -258,7 +258,7 @@ class Image extends AbstractStyle
/** /**
* Get margin left * Get margin left
* *
* @return int * @return int|float
*/ */
public function getMarginLeft() public function getMarginLeft()
{ {
@ -268,12 +268,12 @@ class Image extends AbstractStyle
/** /**
* Set margin left * Set margin left
* *
* @param int $value * @param int|float $value
* @return self * @return self
*/ */
public function setMarginLeft($value = 0) public function setMarginLeft($value = 0)
{ {
$this->marginLeft = $this->setIntVal($value, 0); $this->marginLeft = $this->setNumericVal($value, 0);
return $this; return $this;
} }