Skip to content

Commit b6a5bf2

Browse files
author
Gabriel Bull
committed
Merge branch 'refs/heads/develop'
Conflicts: .travis.yml composer.json src/PHPWord/Writer/Word2007/Base.php
2 parents be1e357 + 1e50dc0 commit b6a5bf2

File tree

3 files changed

+65
-19
lines changed

3 files changed

+65
-19
lines changed

.travis.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
11
language: php
2-
32
php:
3+
- 5.3.3
44
- 5.3
55
- 5.4
66
- 5.5
77

88
before_script:
9+
## Composer
910
- curl -s http://getcomposer.org/installer | php
10-
- php composer.phar install --dev --prefer-source
11+
- php composer.phar install
12+
## PHP_CodeSniffer
13+
- pyrus install pear/PHP_CodeSniffer
14+
- phpenv rehash
15+
## PHP Copy/Paste Detector
16+
- curl -o phpcpd.phar https://phar.phpunit.de/phpcpd.phar
17+
## PHP Mess Detector
18+
- pear config-set preferred_state beta
19+
- printf "\n" | pecl install imagick
20+
- pear channel-discover pear.phpmd.org
21+
- pear channel-discover pear.pdepend.org
22+
- pear install --alldeps phpmd/PHP_PMD
23+
- phpenv rehash
24+
## PHPLOC
25+
- curl -o phploc.phar https://phar.phpunit.de/phploc.phar
26+
27+
script:
28+
## PHP_CodeSniffer
29+
- phpcs --standard=PSR1 src/
30+
- phpcs --standard=PSR2 src/
31+
## PHP Copy/Paste Detector
32+
- php phpcpd.phar --verbose src/
33+
## PHP Mess Detector
34+
- phpmd src/ text codesize,unusedcode,naming,design
35+
## PHPLOC
36+
- php phploc.phar src/
37+
38+
notifications:
39+
email:
40+

composer.json

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
{
22
"name": "phpoffice/phpword",
3-
"description": "PHPWord - OpenXML - Read, Write and Create Word documents in PHP",
4-
"keywords": ["PHP","Word","docx","doc"],
5-
"homepage": "http://phpword.codeplex.com",
3+
"description": "PHPWord - Read, Create and Write Word documents in PHP",
4+
"keywords": ["PHP", "Word", "Writer", "docx", "doc", "rtf"],
5+
"homepage": "http://phpoffice.github.io",
66
"type": "library",
77
"license": "LGPL",
88
"authors": [
9+
{
10+
"name": "Mark Baker"
11+
},
912
{
1013
"name": "Gabriel Bull",
1114
"email": "[email protected]"
15+
},
16+
{
17+
"name": "Franck Lefevre",
18+
"homepage": "http://blog.rootslabs.net"
1219
}
1320
],
1421
"require": {
15-
"php": ">=5.3.0"
22+
"php": ">=5.3.0",
23+
"ext-xml": "*"
1624
},
17-
"require-dev": {
18-
"phpunit/phpunit": "3.7.28"
25+
"recommend": {
26+
"ext-zip": "*",
27+
"ext-gd2": "*"
1928
},
2029
"autoload": {
2130
"psr-0": {
2231
"PHPWord": "src/"
2332
}
2433
}
25-
}
34+
}

src/PHPWord/Writer/Word2007/Base.php

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,9 @@ protected function _writeParagraphStyle(PHPWord_Shared_XMLWriter $objWriter = nu
119119
$spaceBefore = $style->getSpaceBefore();
120120
$spaceAfter = $style->getSpaceAfter();
121121
$spacing = $style->getSpacing();
122-
$indent = $style->getIndent();
123122

124123

125-
if (!is_null($align) || !is_null($spacing) || !is_null($spaceBefore) || !is_null($spaceAfter) || !is_null($indent)) {
124+
if (!is_null($align) || !is_null($spacing) || !is_null($spaceBefore) || !is_null($spaceAfter)) {
126125

127126
if (!$withoutPPR) {
128127
$objWriter->startElement('w:pPr');
@@ -134,13 +133,6 @@ protected function _writeParagraphStyle(PHPWord_Shared_XMLWriter $objWriter = nu
134133
$objWriter->endElement();
135134
}
136135

137-
if (!is_null($indent)) {
138-
$objWriter->startElement('w:ind');
139-
$objWriter->writeAttribute('w:firstLine', 0);
140-
$objWriter->writeAttribute('w:left', $indent);
141-
$objWriter->endElement();
142-
}
143-
144136
if (!is_null($spaceBefore) || !is_null($spaceAfter) || !is_null($spacing)) {
145137

146138
$objWriter->startElement('w:spacing');
@@ -320,6 +312,8 @@ protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, P
320312
$fgColor = $style->getFgColor();
321313
$striketrough = $style->getStrikethrough();
322314
$underline = $style->getUnderline();
315+
$superscript = $style->getSuperScript();
316+
$subscript = $style->getSubScript();
323317

324318
$objWriter->startElement('w:rPr');
325319

@@ -354,6 +348,20 @@ protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, P
354348
$objWriter->writeElement('w:b', null);
355349
}
356350

351+
// Superscript
352+
if ($superscript) {
353+
$objWriter->startElement('w:vertAlign');
354+
$objWriter->writeAttribute('w:val', 'superscript');
355+
$objWriter->endElement();
356+
}
357+
358+
// Subscript
359+
if ($subscript) {
360+
$objWriter->startElement('w:vertAlign');
361+
$objWriter->writeAttribute('w:val', 'subscript');
362+
$objWriter->endElement();
363+
}
364+
357365
// Italic
358366
if ($italic) {
359367
$objWriter->writeElement('w:i', null);
@@ -609,7 +617,6 @@ protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, P
609617
}
610618
}
611619
}
612-
613620
/**
614621
* @param \PHPWord_Shared_XMLWriter $objWriter
615622
* @param \PHPWord_Section_Image $image

0 commit comments

Comments
 (0)