reset static collections at instantiation

This commit is contained in:
troosan 2018-03-19 23:06:00 +01:00
parent 16a9ded2c9
commit f73beaa26a
3 changed files with 16 additions and 3 deletions

View File

@ -52,8 +52,17 @@ class PhpWord
* @const string|int
*/
const DEFAULT_FONT_NAME = Settings::DEFAULT_FONT_NAME;
/**
* @deprecated 0.11.0 Use Settings constants
*/
const DEFAULT_FONT_SIZE = Settings::DEFAULT_FONT_SIZE;
/**
* @deprecated 0.11.0 Use Settings constants
*/
const DEFAULT_FONT_COLOR = Settings::DEFAULT_FONT_COLOR;
/**
* @deprecated 0.11.0 Use Settings constants
*/
const DEFAULT_FONT_CONTENT_TYPE = Settings::DEFAULT_FONT_CONTENT_TYPE;
/**
@ -85,6 +94,10 @@ class PhpWord
*/
public function __construct()
{
// Reset Media and styles
Media::resetStyles();
Style::resetStyles();
// Collection
$collections = array('Bookmarks', 'Titles', 'Footnotes', 'Endnotes', 'Charts', 'Comments');
foreach ($collections as $collection) {

View File

@ -19,9 +19,9 @@ namespace PhpOffice\PhpWord\Shared;
use PhpOffice\PhpWord\Element\Section;
use PhpOffice\PhpWord\SimpleType\Jc;
use PhpOffice\PhpWord\TestHelperDOCX;
use PhpOffice\PhpWord\Style\Paragraph;
use PhpOffice\PhpWord\SimpleType\LineSpacingRule;
use PhpOffice\PhpWord\Style\Paragraph;
use PhpOffice\PhpWord\TestHelperDOCX;
/**
* Test class for PhpOffice\PhpWord\Shared\Html

View File

@ -11,7 +11,7 @@
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
*
* @see https://github.com/PHPOffice/PHPWord
* @copyright 2010-2017 PHPWord contributors
* @copyright 2010-2018 PHPWord contributors
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/