Commit Graph

846 Commits

Author SHA1 Message Date
troosan affccc7937 Merge branch 'improve-cloneBlock-regex' of https://github.com/nicoder/PHPWord into fix_clone_block 2018-07-17 08:03:35 +02:00
Nicolas Dermine 198165ce59
allow to override TemplateProcessor#ensureUtf8Encoded
the method is `protected`,
but since it is called with `self` instead of `static`
it does not allow for subclasses to override it
2018-07-16 19:49:30 +02:00
troosan fe454dbaf3
Merge pull request #1428 from troosan/parse_short_lang_code
Allow passing short lang code
2018-07-14 18:11:50 +02:00
troosan 87498e43e1 Allow passing short lang code 2018-07-14 17:21:30 +02:00
troosan af4f834149
Merge branch 'develop' into develop 2018-07-14 17:12:45 +02:00
troosan de83da2bbf
Merge branch 'develop' into parse_drawings 2018-07-14 03:30:11 +02:00
troosan 6475812e82 fix documentation 2018-07-14 03:28:09 +02:00
troosan 32907215ed fix phpstan issues 2018-07-14 02:54:17 +02:00
troosan adc1428607 use PasswordEncoder from phpoffice/common instead 2018-07-14 02:51:08 +02:00
smaug1985 3906be19ee Added Support for Indentation & Tabs on RTF Writer. (#1405)
* Added Support for Indentation  & Tabs on RTF Writer.
* add decimal tab writer + tests
* Update CHANGELOG.md
2018-07-14 02:13:45 +02:00
troosan 536a1b89d7 disable entity loader 2018-07-14 00:50:01 +02:00
Javier Garcia 2593e9e200 Merge branch 'develop' of github.com:jgpATs2w/PHPWord into develop 2018-06-13 17:57:55 +02:00
Javier Garcia fe647f6e55 fix when style line-height size comes in decimal number 2018-06-13 17:41:17 +02:00
troosan da43a880e3 Address scrutinizer issues 2018-06-03 00:32:21 +02:00
troosan d9ddc162a3 write column width in ODT writer 2018-06-03 00:32:20 +02:00
troosan 844a7c95ba
Merge pull request #1391 from omarpiani/develop
Added Italian to supported languages
2018-06-01 09:13:40 +02:00
troosan 0bd7c0b301
Add constants for Italian 2018-05-31 19:50:43 +02:00
Omar Piani aa27109101
Update Language.php 2018-05-31 11:43:20 +02:00
javier 1a06173e1b Add parsing of html image in base64 format (#1382)
* increased test coverage of new lines
* added exception control to file_get_contents error
* update changelog
2018-05-31 01:28:14 +02:00
troosan b2cafffffc Merge remote-tracking branch 'upstream/develop' into develop_upstream 2018-05-31 00:25:31 +02:00
Edvin Hultberg 82f3a2ab44 Update documentation for Style::add*Style methods (#1383)
* Update documentation for Style::add*Style methods
* remove phpDocumentor, simplify dependencies
2018-05-31 00:21:08 +02:00
troosan c22f7eab5e add check on opened file 2018-05-27 21:27:45 +02:00
Javier Garcia 65a594d271 cs-fixer fixes 2018-05-25 09:29:58 +02:00
Javier Garcia a89e4c93a7 added exception control to file_get_contents error 2018-05-25 08:01:17 +02:00
Maxim Bulygin e40449e7c8 fix variable names 2018-05-24 17:40:21 +03:00
Maxim Bulygin 13fc647d01 html writes / setup table cell color 2018-05-24 17:03:35 +03:00
Javier Garcia 46b7bea097 increased test coverage of new lines 2018-05-24 07:19:45 +02:00
Javier Garcia a228811a61 fixes 2018-05-23 18:48:28 +02:00
Javier Garcia 58c6c52ee9 merged with local version 2018-05-23 18:22:54 +02:00
troosan 7f46d951eb Merge branch 'develop' of https://github.com/PHPOffice/PHPWord into develop_upstream 2018-05-20 14:40:15 +02:00
troosan 453ddf078b Do not try to read document protection if not present 2018-05-20 14:37:59 +02:00
JAEK-S 65b0f062ad New features when creating charts (#1332)
* add stacked bar and column charts
* add chart colors feature
* adding preliminary chart axis title functionality to XMLwriter
* added percent_stacked to available types array
* Make tick mark and tick label positions configurable
* scrutinizer fixes
* update changelog
2018-05-11 22:50:19 +02:00
troosan 94be56b0ec fix parsing of link style 2018-04-25 23:57:07 +02:00
troosan 84fa44090f
Merge pull request #1343 from meteocontrol/feature-add-table-indent-option
Add support for table indent
2018-04-25 22:37:16 +02:00
troosan c52c96d657 add support for STYLEREF field 2018-04-17 07:34:57 +02:00
troosan 85e1e5c280
fix warning 2018-04-14 23:21:02 +02:00
troosan b394247740
Merge branch 'develop' into feature-add-table-indent-option 2018-04-14 22:46:09 +02:00
troosan 9bc85347ef fix code formatting 2018-04-14 21:15:36 +02:00
troosan 6ba2df474f
Merge pull request #1336 from lalop/addhtpl-bookmark
support internal link in addHtml method
2018-04-13 22:40:09 +02:00
troosan 57ededeabf
Merge pull request #1338 from pcworld/image-security-doc
Improve security-related documentation of addImage and addHtml
2018-04-13 22:36:18 +02:00
Frank Liepert 081c6722f6 Add support for table indent 2018-04-11 10:06:58 +02:00
pcworld 6253adaba1 Warn about parsing user-generated HTML 2018-04-09 02:48:49 +02:00
Sam ca82e19bba support internal link in addHtml method 2018-04-07 11:24:52 +02:00
eweso 91ada213c5
Update ListItem.php 2018-03-31 00:38:43 +02:00
eweso 5741e47129
Update ListItem.php 2018-03-31 00:37:50 +02:00
eweso a09e7151ac
Update ListItem.php 2018-03-30 22:58:03 +02:00
eweso 71618f704d
Adding setNumId method for ListItem style
By allowing to set the numId in the ListItem style manually, you can separate lists. Every ListItem with the same numId belongs to one list. This allows you to restart list counting.
2018-03-30 19:24:45 +02:00
troosan 566e625b85 merge/add test/cleanup 2018-03-25 22:46:50 +02:00
gthomas2 9b722a5b0c Added missing namespaces 2018-03-23 21:29:41 +01:00
gthomas2 34bda10536 Fix images added in word 2011 2018-03-23 21:28:53 +01:00
troosan 400ee57bee fix 2018-03-22 22:47:27 +01:00
troosan c08f2718af check style fixes 2018-03-21 21:58:41 +01:00
troosan 45e2e92af7 fix graph data 2018-03-21 21:50:41 +01:00
troosan a8d1775eb1 Merge remote-tracking branch 'FrankMeyer/develop' into develop 2018-03-21 06:51:22 +01:00
troosan 2c5970a388 php 5.3 compatibility 2018-03-20 23:42:01 +01:00
Tim Jarrett d8387c1aba Escape incoming invalid XML characters using htmlspecialchars(). 2018-03-20 22:47:15 +01:00
troosan d7fc1a5f7b
Merge branch 'develop' into develop 2018-03-20 21:49:36 +01:00
troosan 992d842552 fix 2018-03-19 23:07:35 +01:00
troosan f73beaa26a reset static collections at instantiation 2018-03-19 23:06:00 +01:00
troosan de01e86d41 parse fixed line space 2018-03-19 22:50:54 +01:00
troosan 97d60dd985 tranlate percentage to rate 2018-03-19 22:50:54 +01:00
troosan 997e21433c add parsing of line-height and text-indent 2018-03-18 22:32:55 +01:00
troosan 4c846426ce format & changelog 2018-03-18 20:53:05 +01:00
troosan fb1e2e41cc Merge branch 'ComputerTinker-AddFieldDateFormats' of
https://github.com/ComputerTinker/PHPWord into
ComputerTinker-ComputerTinker-AddFieldDateFormats

# Conflicts:
#	src/PhpWord/Element/Field.php
2018-03-18 20:44:05 +01:00
troosan bb70eb0b4c fix docx parsing 2018-03-18 12:37:39 +01:00
troosan 17680f7aec
Merge branch 'develop' into word2007_read_tabs 2018-03-11 22:37:05 +01:00
troosan 6b48451ebc
Merge pull request #1310 from troosan/add_image_wrap_distance
add text wrapping distance
2018-03-11 20:42:40 +01:00
troosan e29a3e7c10 add text wrapping distance 2018-03-11 13:27:35 +01:00
troosan 8bafe0000f
Merge pull request #1307 from franciscosens/add-suport-pt-br 2018-03-10 08:48:30 +01:00
troosan 77f2b16bc1 update copyright to 2018 2018-03-08 23:52:25 +01:00
Henri MEDOT f9a05547f7 Added support for Floating Table Positioning (tblpPr) (#639)
Added support for Floating Table Positioning (tblpPr)
2018-03-08 23:46:22 +01:00
Francisco Lucas Sens eb6900969f Added new constant to Brazilian portuguese language 2018-03-08 16:15:31 -03:00
Frank Liepert f41c542ba0 Enforce valid value for on/off type 2018-03-07 07:01:54 +01:00
Frank Liepert 6a6497956d Allow to set "autoHyphenation" setting (#1282)
* Allow to set "autoHyphenation" for document
* Allow to set "consecutiveHyphenLimit" for document
* Allow to set "hyphenationZone" for document
* Allow to set "doNotHyphenateCaps" for document
* Allow to set "suppressAutoHyphens" for paragraph
* randomize the tempDir more
* Word2007 parsing title formatting (#1297)
* Improve Title parsing
- Title should be able to contain TextRun
- Style 'Title' should be treated the same with as Heading
- Add tests for Heading/Title reader
* update the documentation and the changelog
* PHP 7.2 build should not fail anymore
* fix parsing of footnotes and endnotes
* add method to remove an element from a section
* add method to allow sorting of sections
2018-03-06 22:19:39 +01:00
troosan 250fbd49b1
Added support for Vertically Raised or Lowered Text (w:position) (#1294)
* Added support for Vertically Raised or Lowered Text (w:position). Note that only docx writing is implemented for now.
* Add tests + changelog
* add reader + tests + doc
2018-03-06 06:35:43 +01:00
troosan 30b224b3d0
Word2007 parsing title formatting (#1297)
* Improve Title parsing
- Title should be able to contain TextRun
- Style 'Title' should be treated the same with as Heading
- Add tests for Heading/Title reader

* update the documentation and the changelog
* PHP 7.2 build should not fail anymore
* reduce dependencies versions
* fix parsing of footnotes and endnotes
* add method to remove an element from a section
2018-03-06 06:34:55 +01:00
Damjan Cvetko 8a2cba2292 Support multiple elements (w:t, w:delText, w:tab) in w:r. 2018-03-04 17:13:06 +01:00
troosan 740e66acf5
randomize the tempDir more
to make sure directory is unique [ci skip]
2018-03-02 07:17:26 +01:00
Damjan Cvetko 0869bdc8f7 Add support for reading <w:tab/> element in runs. Internaly encoding it as "\t". 2018-03-01 01:40:54 +01:00
Lenz Weber 7fe32e6ac1 Add support for MACROBUTTON Field (#1021)
* add functionality to use MACROBUTTON as Field, use Styles for Field, add noProof to Font Style
* code review
* refactoring + fixes + unit tests
2018-02-27 23:27:18 +01:00
Samuel Laulhau f3c73f333a Fix HTML parsing when style attribute is empty (#1295) 2018-02-27 23:24:00 +01:00
Matt Bolt a95c3f83bc Fix colspan and rowspan for tables in HTML Writer. Syntax improved. 2018-02-19 18:02:55 +08:00
Matt Bolt 557af99a6d Fix colspan and rowspan for tables in HTML Writer 2018-02-19 13:08:17 +08:00
troosan 59de019881
Fix listitem parsing (#1290)
* Word 2007 Reader: Added support for ListItemRun
* Add tests + changelog
2018-02-18 01:41:32 +01:00
troosan def023752d
Merge pull request #1248 from carusogabriel/patch-1
Refactoring
2018-02-18 01:40:24 +01:00
troosan bded91af9f
Footnote in listitem (#1289)
* Allow footnote to be added in ListItems
2018-02-18 00:39:00 +01:00
dox07 04d0c02e23 Add support for cellSpacing for tables (#1040)
* Add cellSpacing  into table
* add word 2007 reader
* add tests
* add documentation
2018-02-18 00:10:10 +01:00
Frank Liepert d061c6dc7c Remove zend-stdlib dependency 2018-02-17 00:03:41 +01:00
troosan 6a926e26f1 refactor attribute name to layout, add doc and tests 2018-02-14 00:39:37 +01:00
troosan 615c1d5576 Merge branch 'stretch-table' of https://github.com/aoloe/php-PHPWord
into tableLayout

Conflicts:
	src/PhpWord/Writer/Word2007/Style/Table.php
2018-02-13 23:29:53 +01:00
ale rimoldi 7ddaed240f table->setStretch() optionally avoids the table to stretch to the page width (only for word output) 2018-02-13 23:24:15 +01:00
troosan e846602d1e fix null check
[ci skip]
2018-02-11 13:58:26 +01:00
troosan ee95cf3df0
Merge pull request #1278 from troosan/fix_internal_links_in_html_output
Add HTML writer for Bookmarks + tests
2018-02-11 00:21:12 +01:00
troosan 377fb99fbc Add HTML writer for Bookmarks + tests 2018-02-10 23:43:15 +01:00
troosan b868c3370c
Merge pull request #1277 from troosan/fix_parsing_of_textbreaks
Fix parsing of textbreaks
2018-02-10 23:05:53 +01:00
troosan 91a8dd3b22 add parsing of p:br and add unit test 2018-02-10 22:16:55 +01:00
troosan 5b381bc0c0
Merge branch 'develop' into various_html_parsing_fixes 2018-02-09 21:53:48 +01:00
troosan 604e60cae9
Add support for Track changes (#1262)
* add changed information to HTML writer
* add missing writeFontStyle
* refactor track changes
* set the style
* update documentation and release note
* Update the changelog and doc
* fix scrutinizer issues
2018-02-09 21:49:11 +01:00
troosan fd127ef9bb
Merge pull request #779 from samsullivan/imagesavealpha
Save PNG alpha information when using remote images.
2018-02-09 17:16:03 +01:00
troosan 304173c4d7 fix nested list 2018-02-08 07:02:28 +01:00
troosan 33739ea21c cannot add list on textrun 2018-02-07 21:39:01 +01:00
troosan 46476d7101 update phpdoc 2018-02-07 07:09:27 +01:00
troosan 47c837abef add unit tests 2018-02-06 23:31:56 +01:00
troosan 46a5f96d3b fix parsing of table and p inside table cells 2018-02-06 23:16:32 +01:00
Nicolas Dermine 623bd993d8 refactor: use extracted method in original method 2018-02-05 17:49:23 +01:00
Nicolas Dermine 07e97c38cd add `getVariableCount` method to `TemplateProcessor`
returns how many times each placeholder is present in the document

almost the same code as `getVariables`

useful when cloning a block a number of times and want to replace
placeholders that are present more than once in the block
(using the `$limit` parameter of `setValue`)
2018-02-05 17:45:24 +01:00
Nicolas Dermine 4105a9aad1 improve `cloneBlock` regex
it wrongly matched `<w:pPr` when looking for `<w:p`

in that case the cloned block would not be valid XML,
and so the generated docx document could not be opened by Word

adding the `\b` word boundary to the regex fixes this.

the accompanying unit test failed with this message when trying to load
the generated file:

```
ErrorException: DOMDocument::loadXML(): Opening and ending tag mismatch:
p line 2 and body in Entity, line: 2
```

This might solve issues such as #681 and #664.
2018-02-02 17:03:49 +01:00
Nicolas Dermine 30183e2881
fix typo in comment 2018-01-26 18:31:35 +01:00
troosan 0425a25cdb Add parsing of HTML links 2018-01-25 23:24:21 +01:00
Gabriel Caruso 8ed3cacfe8
Refactoring 2018-01-16 20:19:54 -02:00
samimussbach 4c68ebbe9d Parse formatting inside HTML lists (#1239) 2018-01-13 10:03:53 +01:00
troosan 99b04f0353
fix reading of docx default style (#1238) 2018-01-12 23:42:22 +01:00
troosan 23693b403c change impl to avoid compilation issue 2017-12-29 21:47:55 +01:00
Maxim 400a8e65d3 rename 'Object' classes to 'ObjectElement' (php 7.2 compatibility) (#1185)
merge develop branch
2017-12-29 20:19:35 +01:00
troosan d2b9e88047 add parsing of "align" HTML attribute 2017-12-29 15:16:03 +01:00
troosan b614497ae6
fix dependencies to have 7.1 compatible build (#1228)
* add assertions in test methods without assertions
* loosen dependencies so 7.0 & 7.1 builds can succeed
* fix some scrutinizer errors
* update release date
2017-12-29 02:30:53 +01:00
troosan fce1bf28c8 format code 2017-12-25 22:05:46 +01:00
troosan 512cf952ae randomise temp directory name to avoid collisions 2017-12-25 20:42:37 +01:00
troosan 7250b15e74 Title can be added in Cell 2017-12-25 08:33:02 +01:00
SRG Group 3e6745f146 HTML image support & TextRun paragraph style (#934)
* Adding setParagraphStyle to Textrun for indentation
* Html Image support added
* fix formatting, add tests & update changelog
2017-12-21 00:03:52 +01:00
troosan 200c2f1eb0
Merge pull request #1019 from jun-i-corn/feature/EnablePasswordProtection
enable password protection (Word)
2017-12-20 22:00:34 +01:00
troosan 8929917677
Merge pull request #592 from ComputerTinker/ComputerTinker-FixEmptyDropdownEntry
Pad Empty Dropdown Entry
2017-12-19 21:53:59 +01:00
troosan 0f200d99f4
Merge pull request #1222 from carusogabriel/clean-elses
Clean elses
2017-12-19 21:41:21 +01:00
Gabriel Caruso 87acd3764b Clean elses 2017-12-14 12:21:16 -02:00
troosan 5a57409df0 fix tests 2017-12-13 23:55:48 +01:00
troosan ad38d4c20f Merge branch 'feature/EnablePasswordProtection' of https://github.com/jun-i-corn/PHPWord into feature/EnablePasswordProtection 2017-12-13 23:25:32 +01:00
troosan f7d2ad7201 formatting 2017-12-13 23:24:37 +01:00
troosan 9e029415cc align with pull request submitted in PHPOffice/Commom 2017-12-13 23:17:01 +01:00
troosan dc7cb1ee75 update changelog & doc 2017-12-13 22:48:58 +01:00
troosan 253b060241 correctly parse on/off values (w:val="true|false|1|0|on|off") 2017-12-13 07:47:49 +01:00
troosan 88bbe49d01
Merge pull request #1217 from troosan/html_br
Added support for linebreaks <br/> in Shared\Html::addHtml()
2017-12-05 21:38:55 +01:00
troosan d4c6427418
Merge pull request #727 from irond/container_for_checkbox
Add TextRun as container for CheckBox
2017-12-05 21:28:59 +01:00
troosan 0c7593ba10
Merge pull request #582 from SSchwaiger/patch-2
A chart object can also be added to a table cell
2017-12-05 21:04:07 +01:00
troosan fd156bf12a
Merge branch 'develop' into html_br 2017-12-05 20:50:13 +01:00
troosan 9081ed9868 fix warning 2017-12-05 17:40:23 +01:00
troosan 8f512bf618 Merge branch 'develop-html-br' of https://github.com/anrikun/PHPWord
into develop

Conflicts:
	src/PhpWord/Shared/Html.php
2017-12-05 17:33:51 +01:00
troosan 05e2f1bf63 use non deprecated method 2017-12-05 08:02:23 +01:00
troosan cfc89b7853
Merge branch 'develop' into feature/EnablePasswordProtection 2017-12-05 00:34:14 +01:00
troosan 274f50ce5a Add unit tests & add array type checks 2017-12-04 22:30:49 +01:00
troosan ca25eba8aa Scrutinizer fixes 2017-11-26 22:55:37 +01:00
troosan 23bc837666 Scrutinizer fixes 2017-11-26 17:54:47 +01:00
troosan 911739a0b2
Merge branch 'develop' into odt_page_break 2017-11-26 00:36:37 +01:00
troosan 355027d854 PHP-CS fix, improve code coverage 2017-11-26 00:11:09 +01:00
Michael Spahn 5d928db916 Implement PageBreak for odt writer 2017-11-25 23:44:45 +01:00
troosan 5a5ae48bb6 also add w:bCs 2017-11-25 21:37:11 +01:00
troosan ab5d4468f9 add the updateFields option on document settings
When set to true, word will ask you to update the fields in the document
when you open the document.
2017-11-25 01:48:30 +01:00
troosan 2e562512f4 Add unit tests for PasswordEncoder 2017-11-24 14:45:05 +01:00
troosan ad83196a05 move password encoding in separate class
fix PHPCS errors
add documentation
add sample
2017-11-23 22:49:21 +01:00
troosan 7b30145270
Merge branch 'develop' into feature/EnablePasswordProtection 2017-11-22 22:59:46 +01:00
troosan 6a5d2a636d CS fixer warning 2017-11-22 09:02:16 +01:00