Merge pull request #1178 from lightbringer1991/489-fix-wrappingStyle-z-index-in-64bit-OS

489: Fix z-index size too big in 64bit OS
This commit is contained in:
troosan 2017-11-04 22:44:44 +01:00 committed by GitHub
commit f4697ab6e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -28,6 +28,8 @@ use PhpOffice\PhpWord\Writer\Word2007\Element\ParagraphAlignment;
*/
class Frame extends AbstractStyle
{
const PHP_32BIT_INT_MAX = 2147483647;
/**
* Write style.
*/
@ -39,7 +41,8 @@ class Frame extends AbstractStyle
}
$xmlWriter = $this->getXmlWriter();
$zIndices = array(FrameStyle::WRAP_INFRONT => PHP_INT_MAX, FrameStyle::WRAP_BEHIND => -PHP_INT_MAX);
$maxZIndex = min(PHP_INT_MAX, self::PHP_32BIT_INT_MAX);
$zIndices = array(FrameStyle::WRAP_INFRONT => $maxZIndex, FrameStyle::WRAP_BEHIND => -$maxZIndex);
$properties = array(
'width' => 'width',