Skip to content

Commit b188ab9

Browse files
authored
Merge branch 'develop' into add-getVariableCount-method
2 parents 8f85424 + cf3132a commit b188ab9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+501
-59
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ vendor
1818
/.settings
1919
phpword.ini
2020
/.buildpath
21+
/.scannerwork
2122
/.project
2223
/nbproject
2324
/.php_cs.cache

.travis.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,22 @@ php:
1010
- 7.0
1111
- 7.1
1212
- 7.2
13+
- 7.3
1314

1415
matrix:
1516
include:
1617
- php: 7.0
1718
env: COVERAGE=1
19+
- php: 5.3
20+
env: COMPOSER_MEMORY_LIMIT=2G
21+
- php: 7.3
22+
env: DEPENDENCIES="--ignore-platform-reqs"
23+
exclude:
24+
- php: 5.3
25+
- php: 7.0
26+
- php: 7.3
27+
allow_failures:
28+
- php: 7.3
1829

1930
cache:
2031
directories:
@@ -32,10 +43,10 @@ before_install:
3243

3344
before_script:
3445
## Deactivate xdebug if we don't do code coverage
35-
- if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini ; fi
46+
- if [ -z "$COVERAGE" ]; then phpenv config-rm xdebug.ini || echo "xdebug not available" ; fi
3647
## Composer
3748
- composer self-update
38-
- travis_wait composer install --prefer-source
49+
- travis_wait composer install --prefer-source $(if [ -n "$DEPENDENCIES" ]; then echo $DEPENDENCIES; fi)
3950
## PHPDocumentor
4051
##- mkdir -p build/docs
4152
- mkdir -p build/coverage

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,23 @@ Change Log
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6-
v0.16.0 (xx xxx 2018)
6+
v0.16.0 (xx dec 2018)
77
----------------------
88
### Added
99
- Add getVariableCount method in TemplateProcessor. @nicoder #1272
10+
- Add setting Chart Title and Legend visibility @Tom-Magill #1433
11+
- Add ability to pass a Style object in Section constructor @ndench #1416
12+
- Add support for hidden text @Alexmg86 #1527
1013

1114
### Fixed
1215
- Fix regex in `cloneBlock` function @nicoder #1269
1316
- HTML Title Writer loses text when Title contains a TextRun instead a string. @begnini #1436
17+
- Fix regex in fixBrokenMacros, make it less greedy @MuriloSo @brainwood @yurii-sio2 #1502 #1345
18+
- 240 twips are being added to line spacing, should not happen when using lineRule fixed @troosan #1509 #1505
19+
- Adding table layout to the generated HTML @aarangara #1441
20+
- Fix loading of Sharepoint document @Garrcomm #1498
21+
- RTF writer: Round getPageSizeW and getPageSizeH to avoid decimals @Patrick64 #1493
22+
- Fix parsing of Office 365 documents @Timanx #1485
1423

1524
v0.15.0 (14 Jul 2018)
1625
----------------------

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ $objWriter->save('helloWorld.html');
161161
```
162162

163163
More examples are provided in the [samples folder](samples/). For an easy access to those samples launch `php -S localhost:8000` in the samples directory then browse to [http://localhost:8000](http://localhost:8000) to view the samples.
164-
You can also read the [Developers' Documentation](http://phpword.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPWord/docs/master/) for more detail.
164+
You can also read the [Developers' Documentation](http://phpword.readthedocs.org/) for more detail.
165165

166166
## Contributing
167167

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"php-cs-fixer fix --ansi --dry-run --diff",
4646
"phpcs --report-width=200 --report-summary --report-full samples/ src/ tests/ --ignore=src/PhpWord/Shared/PCLZip --standard=PSR2 -n",
4747
"phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php",
48-
"@test"
48+
"@test-no-coverage"
4949
],
5050
"fix": [
5151
"php-cs-fixer fix --ansi"

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: 18 additions & 7 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,10 +57,11 @@ 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
64+
- ``hidden``. Hidden text, *true* or *false*.
6365

6466
.. _paragraph-style:
6567

@@ -69,7 +71,7 @@ Paragraph
6971
Available Paragraph style options:
7072

7173
- ``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.
74+
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values.
7375
- ``basedOn``. Parent style.
7476
- ``hanging``. Hanging in *twip*.
7577
- ``indent``. Indent in *twip*.
@@ -80,16 +82,17 @@ Available Paragraph style options:
8082
- ``pageBreakBefore``. Start paragraph on next page, *true* or *false*.
8183
- ``spaceBefore``. Space before paragraph in *twip*.
8284
- ``spaceAfter``. Space after paragraph in *twip*.
83-
- ``spacing``. Space between lines.
85+
- ``spacing``. Space between lines in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240.
8486
- ``spacingLineRule``. Line Spacing Rule. *auto*, *exact*, *atLeast*
87+
See ``\PhpOffice\PhpWord\SimpleType\LineSpacingRule`` class constants for possible values.
8588
- ``suppressAutoHyphens``. Hyphenation for paragraph, *true* or *false*.
8689
- ``tabs``. Set of custom tab stops.
8790
- ``widowControl``. Allow first/last line to display on a separate page, *true* or *false*.
8891
- ``contextualSpacing``. Ignore Spacing Above and Below When Using Identical Styles, *true* or *false*.
8992
- ``bidi``. Right to Left Paragraph Layout, *true* or *false*.
9093
- ``shading``. Paragraph Shading.
9194
- ``textAlignment``. Vertical Character Alignment on Line.
92-
See ``\PhpOffice\PhpWord\SimpleType\TextAlignment`` class for possible values.
95+
See ``\PhpOffice\PhpWord\SimpleType\TextAlignment`` class constants for possible values.
9396

9497
.. _table-style:
9598

@@ -99,7 +102,7 @@ Table
99102
Available Table style options:
100103

101104
- ``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.
105+
See ``\PhpOffice\PhpWord\SimpleType\JcTable`` and ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values.
103106
- ``bgColor``. Background color, e.g. '9966CC'.
104107
- ``border(Top|Right|Bottom|Left)Color``. Border color, e.g. '9966CC'.
105108
- ``border(Top|Right|Bottom|Left)Size``. Border size in *twip*.
@@ -168,7 +171,7 @@ Numbering level
168171
Available NumberingLevel style options:
169172

170173
- ``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.
174+
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values.
172175
- ``font``. Font name.
173176
- ``format``. Numbering format bullet\|decimal\|upperRoman\|lowerRoman\|upperLetter\|lowerLetter.
174177
- ``hanging``. See paragraph style.
@@ -190,6 +193,14 @@ Available Chart style options:
190193
- ``width``. Width (in EMU).
191194
- ``height``. Height (in EMU).
192195
- ``3d``. Is 3D; applies to pie, bar, line, area, *true* or *false*.
196+
- ``colors``. A list of colors to use in the chart.
197+
- ``title``. The title for the chart.
198+
- ``showLegend``. Show legend, *true* or *false*.
199+
- ``categoryLabelPosition``. Label position for categories, *nextTo* (default), *low* or *high*.
200+
- ``valueLabelPosition``. Label position for values, *nextTo* (default), *low* or *high*.
201+
- ``categoryAxisTitle``. The title for the category axis.
202+
- ``valueAxisTitle``. The title for the values axis.
203+
- ``majorTickMarkPos``. The position for major tick marks, *in*, *out*, *cross*, *none* (default).
193204
- ``showAxisLabels``. Show labels for axis, *true* or *false*.
194205
- ``gridX``. Show Gridlines for X-Axis, *true* or *false*.
195206
- ``gridY``. Show Gridlines for Y-Axis, *true* or *false*.

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
<logging>
2424
<log type="coverage-html" target="./build/coverage" />
2525
<log type="coverage-clover" target="./build/logs/clover.xml" />
26+
<log type="junit" target="./build/logs/logfile.xml"/>
2627
</logging>
2728
</phpunit>

samples/Sample_04_Textrun.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
$textrun->addObject('resources/_sheet.xls');
4040
$textrun->addText(' Here is some more text. ');
4141

42+
$textrun = $section->addTextRun();
43+
$textrun->addText('This text is not visible.', array('hidden' => true));
44+
4245
// Save file
4346
echo write($phpWord, basename(__FILE__, '.php'), $writers);
4447
if (!CLI) {

samples/Sample_26_Html.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
<tr><td style="text-align: center;">Cell in parent table</td></tr>
9090
</table>';
9191

92+
$html .= '<p style="margin-top: 240pt;">The text below is not visible, click on show/hide to reveil it:</p>';
93+
$html .= '<p style="display: none">This is hidden text</p>';
94+
9295
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html, false, false);
9396

9497
// Save file

0 commit comments

Comments
 (0)