This commit is contained in:
parent
16495a0a0d
commit
28f801b5d0
|
|
@ -63,7 +63,8 @@ Paragraph
|
|||
|
||||
Available Paragraph style options:
|
||||
|
||||
- ``alignment``. Supports all alignment modes provided by third edition of ISO/IEC 29500 standard. See ``\PhpOffice\PhpWord\SimpleType\Jc`` class for the details.
|
||||
- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
|
||||
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class for the details.
|
||||
- ``basedOn``. Parent style.
|
||||
- ``hanging``. Hanging by how much.
|
||||
- ``indent``. Indent by how much.
|
||||
|
|
@ -84,7 +85,8 @@ Table
|
|||
|
||||
Available Table style options:
|
||||
|
||||
- ``alignment``. Supports all alignment modes provided by third edition of ISO/IEC 29500 standard. See ``\PhpOffice\PhpWord\SimpleType\JcTable`` class for the details.
|
||||
- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
|
||||
See ``\PhpOffice\PhpWord\SimpleType\JcTable`` and ``\PhpOffice\PhpWord\SimpleType\Jc`` classes for the details.
|
||||
- ``bgColor``. Background color, e.g. '9966CC'.
|
||||
- ``border(Top|Right|Bottom|Left)Color``. Border color, e.g. '9966CC'.
|
||||
- ``border(Top|Right|Bottom|Left)Size``. Border size in twips.
|
||||
|
|
@ -129,7 +131,8 @@ Numbering level
|
|||
|
||||
Available NumberingLevel style options:
|
||||
|
||||
- ``alignment``. Supports all alignment modes provided by third edition of ISO/IEC 29500 standard. See ``\PhpOffice\PhpWord\SimpleType\Jc`` class for the details.
|
||||
- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
|
||||
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class for the details.
|
||||
- ``font``. Font name.
|
||||
- ``format``. Numbering format bullet\|decimal\|upperRoman\|lowerRoman\|upperLetter\|lowerLetter.
|
||||
- ``hanging``. See paragraph style.
|
||||
|
|
|
|||
|
|
@ -22,8 +22,13 @@ use Zend\Validator\InArray;
|
|||
/**
|
||||
* Horizontal Alignment Type.
|
||||
*
|
||||
* Introduced in 1st Edition of ECMA-376. Initially it was intended to align paragraphs and tables.
|
||||
* Since ISO/IEC-29500:2008 the type must not be used for table alignment.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*
|
||||
* @see \PhpOffice\PhpWord\SimpleType\JcTable For table alignment modes available since ISO/IEC-29500:2008.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
final class Jc
|
||||
|
|
@ -40,15 +45,24 @@ final class Jc
|
|||
const THAI_DISTRIBUTE = 'thaiDistribute';
|
||||
|
||||
/**
|
||||
* @deprecated 0.13.0 Use `START` instead.
|
||||
* Kept for compatibility with 1st edition of ECMA-376 standard.
|
||||
* Microsoft Word 2007 and WPS Writer 2016 still rely on it.
|
||||
*
|
||||
* @deprecated 0.13.0 For documents based on ISO/IEC 29500:2008 and later use `START` instead.
|
||||
*/
|
||||
const LEFT = 'left';
|
||||
/**
|
||||
* @deprecated 0.13.0 Use `END` instead.
|
||||
* Kept for compatibility with 1st edition of ECMA-376 standard.
|
||||
* Microsoft Word 2007 and WPS Writer 2016 still rely on it.
|
||||
*
|
||||
* @deprecated 0.13.0 For documents based on ISO/IEC 29500:2008 and later use `END` instead.
|
||||
*/
|
||||
const RIGHT = 'right';
|
||||
/**
|
||||
* @deprecated 0.13.0 Use `BOTH` instead.
|
||||
* Kept for compatibility with 1st edition of ECMA-376 standard.
|
||||
* Microsoft Word 2007 and WPS Writer 2016 still rely on it.
|
||||
*
|
||||
* @deprecated 0.13.0 For documents based on ISO/IEC 29500:2008 and later use `BOTH` instead.
|
||||
*/
|
||||
const JUSTIFY = 'justify';
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ use Zend\Validator\InArray;
|
|||
/**
|
||||
* Table Alignment Type.
|
||||
*
|
||||
* Introduced in ISO/IEC-29500:2008.
|
||||
*
|
||||
* @since 0.13.0
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
|
|
@ -32,19 +34,6 @@ final class JcTable
|
|||
const CENTER = 'center';
|
||||
const END = 'end';
|
||||
|
||||
/**
|
||||
* @deprecated 0.13.0 Use `START` instead.
|
||||
*/
|
||||
const LEFT = 'left';
|
||||
/**
|
||||
* @deprecated 0.13.0 Use `END` instead.
|
||||
*/
|
||||
const RIGHT = 'right';
|
||||
/**
|
||||
* @deprecated 0.13.0 Use `CENTER` instead.
|
||||
*/
|
||||
const JUSTIFY = 'justify';
|
||||
|
||||
/**
|
||||
* @since 0.13.0
|
||||
*
|
||||
|
|
@ -55,7 +44,7 @@ final class JcTable
|
|||
// todo: consider caching validator instances.
|
||||
return new InArray(
|
||||
array (
|
||||
'haystack' => array(self::START, self::CENTER, self::END, self::LEFT, self::RIGHT, self::JUSTIFY),
|
||||
'haystack' => array(self::START, self::CENTER, self::END),
|
||||
'strict' => InArray::COMPARE_STRICT,
|
||||
)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -201,24 +201,7 @@ class Frame extends AbstractStyle
|
|||
public function setAlignment($value)
|
||||
{
|
||||
if (Jc::getValidator()->isValid($value)) {
|
||||
$alignment = '';
|
||||
|
||||
switch ($value) {
|
||||
case Jc::LEFT:
|
||||
$alignment = Jc::START;
|
||||
break;
|
||||
case Jc::RIGHT:
|
||||
$alignment = Jc::END;
|
||||
break;
|
||||
case Jc::JUSTIFY:
|
||||
$alignment = Jc::BOTH;
|
||||
break;
|
||||
default:
|
||||
$alignment = $value;
|
||||
break;
|
||||
}
|
||||
|
||||
$this->alignment = $alignment;
|
||||
$this->alignment = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
|||
|
|
@ -299,24 +299,7 @@ class NumberingLevel extends AbstractStyle
|
|||
public function setAlignment($value)
|
||||
{
|
||||
if (Jc::getValidator()->isValid($value)) {
|
||||
$alignment = '';
|
||||
|
||||
switch ($value) {
|
||||
case Jc::LEFT:
|
||||
$alignment = Jc::START;
|
||||
break;
|
||||
case Jc::RIGHT:
|
||||
$alignment = Jc::END;
|
||||
break;
|
||||
case Jc::JUSTIFY:
|
||||
$alignment = Jc::BOTH;
|
||||
break;
|
||||
default:
|
||||
$alignment = $value;
|
||||
break;
|
||||
}
|
||||
|
||||
$this->alignment = $alignment;
|
||||
$this->alignment = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
|||
|
|
@ -233,24 +233,7 @@ class Paragraph extends Border
|
|||
public function setAlignment($value)
|
||||
{
|
||||
if (Jc::getValidator()->isValid($value)) {
|
||||
$alignment = '';
|
||||
|
||||
switch ($value) {
|
||||
case Jc::LEFT:
|
||||
$alignment = Jc::START;
|
||||
break;
|
||||
case Jc::RIGHT:
|
||||
$alignment = Jc::END;
|
||||
break;
|
||||
case Jc::JUSTIFY:
|
||||
$alignment = Jc::BOTH;
|
||||
break;
|
||||
default:
|
||||
$alignment = $value;
|
||||
break;
|
||||
}
|
||||
|
||||
$this->alignment = $alignment;
|
||||
$this->alignment = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
namespace PhpOffice\PhpWord\Style;
|
||||
|
||||
use PhpOffice\PhpWord\SimpleType\Jc;
|
||||
use PhpOffice\PhpWord\SimpleType\JcTable;
|
||||
|
||||
class Table extends Border
|
||||
|
|
@ -509,25 +510,8 @@ class Table extends Border
|
|||
*/
|
||||
public function setAlignment($value)
|
||||
{
|
||||
if (JcTable::getValidator()->isValid($value)) {
|
||||
$alignment = '';
|
||||
|
||||
switch ($value) {
|
||||
case JcTable::LEFT:
|
||||
$alignment = JcTable::START;
|
||||
break;
|
||||
case JcTable::RIGHT:
|
||||
$alignment = JcTable::END;
|
||||
break;
|
||||
case JcTable::JUSTIFY:
|
||||
$alignment = JcTable::CENTER;
|
||||
break;
|
||||
default:
|
||||
$alignment = $value;
|
||||
break;
|
||||
}
|
||||
|
||||
$this->alignment = $alignment;
|
||||
if (JcTable::getValidator()->isValid($value) || Jc::getValidator()->isValid($value)) {
|
||||
$this->alignment = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
|||
Loading…
Reference in New Issue