diff --git a/.travis.yml b/.travis.yml index 7604e9cf..2cca49ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,40 @@ language: php - php: + - 5.3.3 - 5.3 - 5.4 - 5.5 before_script: + ## Composer - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev --prefer-source + - php composer.phar install + ## PHP_CodeSniffer + - pyrus install pear/PHP_CodeSniffer + - phpenv rehash + ## PHP Copy/Paste Detector + - curl -o phpcpd.phar https://phar.phpunit.de/phpcpd.phar + ## PHP Mess Detector + - pear config-set preferred_state beta + - printf "\n" | pecl install imagick + - pear channel-discover pear.phpmd.org + - pear channel-discover pear.pdepend.org + - pear install --alldeps phpmd/PHP_PMD + - phpenv rehash + ## PHPLOC + - curl -o phploc.phar https://phar.phpunit.de/phploc.phar + +script: + ## PHP_CodeSniffer + - phpcs --standard=PSR1 src/ + - phpcs --standard=PSR2 src/ + ## PHP Copy/Paste Detector + - php phpcpd.phar --verbose src/ + ## PHP Mess Detector + - phpmd src/ text codesize,unusedcode,naming,design + ## PHPLOC + - php phploc.phar src/ + +notifications: + email: + - progi1984@gmail.com diff --git a/composer.json b/composer.json index 888f3bac..a954a074 100644 --- a/composer.json +++ b/composer.json @@ -1,25 +1,34 @@ { "name": "phpoffice/phpword", - "description": "PHPWord - OpenXML - Read, Write and Create Word documents in PHP", - "keywords": ["PHP","Word","docx","doc"], - "homepage": "http://phpword.codeplex.com", + "description": "PHPWord - Read, Create and Write Word documents in PHP", + "keywords": ["PHP", "Word", "Writer", "docx", "doc", "rtf"], + "homepage": "http://phpoffice.github.io", "type": "library", "license": "LGPL", "authors": [ + { + "name": "Mark Baker" + }, { "name": "Gabriel Bull", "email": "gavroche.bull@gmail.com" + }, + { + "name": "Franck Lefevre", + "homepage": "http://blog.rootslabs.net" } ], "require": { - "php": ">=5.3.0" + "php": ">=5.3.0", + "ext-xml": "*" }, - "require-dev": { - "phpunit/phpunit": "3.7.28" + "recommend": { + "ext-zip": "*", + "ext-gd2": "*" }, "autoload": { "psr-0": { "PHPWord": "src/" } } -} \ No newline at end of file +} diff --git a/src/PHPWord/Writer/Word2007/Base.php b/src/PHPWord/Writer/Word2007/Base.php index 1c889ddb..be65c762 100644 --- a/src/PHPWord/Writer/Word2007/Base.php +++ b/src/PHPWord/Writer/Word2007/Base.php @@ -119,10 +119,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart $spaceBefore = $style->getSpaceBefore(); $spaceAfter = $style->getSpaceAfter(); $spacing = $style->getSpacing(); - $indent = $style->getIndent(); - if (!is_null($align) || !is_null($spacing) || !is_null($spaceBefore) || !is_null($spaceAfter) || !is_null($indent)) { + if (!is_null($align) || !is_null($spacing) || !is_null($spaceBefore) || !is_null($spaceAfter)) { if (!$withoutPPR) { $objWriter->startElement('w:pPr'); @@ -134,13 +133,6 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart $objWriter->endElement(); } - if (!is_null($indent)) { - $objWriter->startElement('w:ind'); - $objWriter->writeAttribute('w:firstLine', 0); - $objWriter->writeAttribute('w:left', $indent); - $objWriter->endElement(); - } - if (!is_null($spaceBefore) || !is_null($spaceAfter) || !is_null($spacing)) { $objWriter->startElement('w:spacing'); @@ -320,6 +312,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart $fgColor = $style->getFgColor(); $striketrough = $style->getStrikethrough(); $underline = $style->getUnderline(); + $superscript = $style->getSuperScript(); + $subscript = $style->getSubScript(); $objWriter->startElement('w:rPr'); @@ -354,6 +348,20 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart $objWriter->writeElement('w:b', null); } + // Superscript + if ($superscript) { + $objWriter->startElement('w:vertAlign'); + $objWriter->writeAttribute('w:val', 'superscript'); + $objWriter->endElement(); + } + + // Subscript + if ($subscript) { + $objWriter->startElement('w:vertAlign'); + $objWriter->writeAttribute('w:val', 'subscript'); + $objWriter->endElement(); + } + // Italic if ($italic) { $objWriter->writeElement('w:i', null); @@ -609,7 +617,6 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart } } } - /** * @param \PHPWord_Shared_XMLWriter $objWriter * @param \PHPWord_Section_Image $image