Skip to content

Commit d0bcfea

Browse files
authored
Merge branch 'develop' into fix-sharepoint
2 parents a2a7073 + 586f45e commit d0bcfea

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ v0.16.0 (xx xxx 2018)
1111
- Fix regex in `cloneBlock` function @nicoder #1269
1212
- HTML Title Writer loses text when Title contains a TextRun instead a string. @begnini #1436
1313
- Fix loading of Sharepoint document @Garrcomm #1498
14+
- RTF writer: Round getPageSizeW and getPageSizeH to avoid decimals @Patrick64 #1493
1415

1516
v0.15.0 (14 Jul 2018)
1617
----------------------

docs/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Fixes # (issue)
88

99
- [ ] I have run `composer run-script check --timeout=0` and no errors were reported
1010
- [ ] The new code is covered by unit tests (check build/coverage for coverage report)
11-
- [ ] I have update the documentation to describe the changes
11+
- [ ] I have updated the documentation to describe the changes

docs/styles.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Available Section style options:
2929
- ``marginRight``. Page margin right in *twip*.
3030
- ``marginBottom``. Page margin bottom in *twip*.
3131
- ``orientation``. Page orientation (``portrait``, which is default, or ``landscape``).
32+
See ``\PhpOffice\PhpWord\Style\Section::ORIENTATION_...`` class constants for possible values
3233
- ``pageSizeH``. Page height in *twip*. Implicitly defined by ``orientation`` option. Any changes are discouraged.
3334
- ``pageSizeW``. Page width in *twip*. Implicitly defined by ``orientation`` option. Any changes are discouraged.
3435

@@ -45,7 +46,7 @@ Available Font style options:
4546
- ``color``. Font color, e.g. *FF0000*.
4647
- ``doubleStrikethrough``. Double strikethrough, *true* or *false*.
4748
- ``fgColor``. Font highlight color, e.g. *yellow*, *green*, *blue*.
48-
See ``\PhpOffice\PhpWord\Style\Font::FGCOLOR_...`` constants for more values
49+
See ``\PhpOffice\PhpWord\Style\Font::FGCOLOR_...`` class constants for possible values
4950
- ``hint``. Font content type, *default*, *eastAsia*, or *cs*.
5051
- ``italic``. Italic, *true* or *false*.
5152
- ``name``. Font name, e.g. *Arial*.
@@ -56,7 +57,7 @@ Available Font style options:
5657
- ``subScript``. Subscript, *true* or *false*.
5758
- ``superScript``. Superscript, *true* or *false*.
5859
- ``underline``. Underline, *single*, *dash*, *dotted*, etc.
59-
See ``\PhpOffice\PhpWord\Style\Font::UNDERLINE_...`` constants for more values
60+
See ``\PhpOffice\PhpWord\Style\Font::UNDERLINE_...`` class constants for possible values
6061
- ``lang``. Language, either a language code like *en-US*, *fr-BE*, etc. or an object (or as an array) if you need to set eastAsian or bidirectional languages
6162
See ``\PhpOffice\PhpWord\Style\Language`` class for some language codes.
6263
- ``position``. The text position, raised or lowered, in half points
@@ -69,7 +70,7 @@ Paragraph
6970
Available Paragraph style options:
7071

7172
- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
72-
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class for the details.
73+
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values.
7374
- ``basedOn``. Parent style.
7475
- ``hanging``. Hanging in *twip*.
7576
- ``indent``. Indent in *twip*.
@@ -82,14 +83,15 @@ Available Paragraph style options:
8283
- ``spaceAfter``. Space after paragraph in *twip*.
8384
- ``spacing``. Space between lines.
8485
- ``spacingLineRule``. Line Spacing Rule. *auto*, *exact*, *atLeast*
86+
See ``\PhpOffice\PhpWord\SimpleType\LineSpacingRule`` class constants for possible values.
8587
- ``suppressAutoHyphens``. Hyphenation for paragraph, *true* or *false*.
8688
- ``tabs``. Set of custom tab stops.
8789
- ``widowControl``. Allow first/last line to display on a separate page, *true* or *false*.
8890
- ``contextualSpacing``. Ignore Spacing Above and Below When Using Identical Styles, *true* or *false*.
8991
- ``bidi``. Right to Left Paragraph Layout, *true* or *false*.
9092
- ``shading``. Paragraph Shading.
9193
- ``textAlignment``. Vertical Character Alignment on Line.
92-
See ``\PhpOffice\PhpWord\SimpleType\TextAlignment`` class for possible values.
94+
See ``\PhpOffice\PhpWord\SimpleType\TextAlignment`` class constants for possible values.
9395

9496
.. _table-style:
9597

@@ -99,7 +101,7 @@ Table
99101
Available Table style options:
100102

101103
- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
102-
See ``\PhpOffice\PhpWord\SimpleType\JcTable`` and ``\PhpOffice\PhpWord\SimpleType\Jc`` classes for the details.
104+
See ``\PhpOffice\PhpWord\SimpleType\JcTable`` and ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values.
103105
- ``bgColor``. Background color, e.g. '9966CC'.
104106
- ``border(Top|Right|Bottom|Left)Color``. Border color, e.g. '9966CC'.
105107
- ``border(Top|Right|Bottom|Left)Size``. Border size in *twip*.
@@ -168,7 +170,7 @@ Numbering level
168170
Available NumberingLevel style options:
169171

170172
- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
171-
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class for the details.
173+
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values.
172174
- ``font``. Font name.
173175
- ``format``. Numbering format bullet\|decimal\|upperRoman\|lowerRoman\|upperLetter\|lowerLetter.
174176
- ``hanging``. See paragraph style.

src/PhpWord/Writer/RTF/Style/Section.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public function write()
4343
$content .= '\sectd ';
4444

4545
// Size & margin
46-
$content .= $this->getValueIf($style->getPageSizeW() !== null, '\pgwsxn' . $style->getPageSizeW());
47-
$content .= $this->getValueIf($style->getPageSizeH() !== null, '\pghsxn' . $style->getPageSizeH());
46+
$content .= $this->getValueIf($style->getPageSizeW() !== null, '\pgwsxn' . round($style->getPageSizeW()));
47+
$content .= $this->getValueIf($style->getPageSizeH() !== null, '\pghsxn' . round($style->getPageSizeH()));
4848
$content .= ' ';
4949
$content .= $this->getValueIf($style->getMarginTop() !== null, '\margtsxn' . $style->getMarginTop());
5050
$content .= $this->getValueIf($style->getMarginRight() !== null, '\margrsxn' . $style->getMarginRight());

0 commit comments

Comments
 (0)