Skip to content

Commit 4824985

Browse files
committed
Merge branch '#217-basjan' into develop
2 parents f7b4542 + 42c712e commit 4824985

File tree

6 files changed

+432
-106
lines changed

6 files changed

+432
-106
lines changed

CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ PHPWord license is changed from LGPL 2.1 to LGPL 3 in this release.
88

99
### Features
1010

11-
-
11+
- Image: Ability to define relative and absolute positioning - @basjan GH-217
1212

1313
### Bugfixes
1414

15-
-
16-
17-
### Deprecated
18-
19-
-
15+
- ...
2016

2117
### Miscellaneous
2218

2319
- License: Change the project license from LGPL 2.1 into LGPL 3.0 - GH-211
20+
- Word2007 Writer: New `Style\Image` class - @ivanlanin
2421

2522
## 0.10.0 - 4 May 2014
2623

samples/Sample_13_Images.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
foreach ($wrappingStyles as $wrappingStyle) {
2727
$section->addTextBreak(5);
2828
$section->addText('Wrapping style ' . $wrappingStyle);
29-
$section->addImage('resources/_earth.jpg', array('marginTop' => -1, 'marginLeft' => 1,
29+
$section->addImage('resources/_earth.jpg', array('positioning' => 'relative', 'marginTop' => -1, 'marginLeft' => 1,
3030
'width' => 80, 'height' => 80, 'wrappingStyle' => $wrappingStyle));
3131
$section->addText($text);
3232
}

src/PhpWord/Element/AbstractContainer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ public function addImage($src, $style = null, $isWatermark = false)
249249
$rId = Media::addElement($elementDocPart, 'image', $src, $image);
250250
$image->setRelationId($rId);
251251
$this->addElement($image);
252-
253252
return $image;
254253
}
255254

@@ -413,7 +412,7 @@ private function checkElementDocPart()
413412
$docPart = $isCellTextrun ? $this->getDocPart() : $this->container;
414413
$docPartId = $isCellTextrun ? $this->getDocPartId() : $this->sectionId;
415414
$inHeaderFooter = ($docPart == 'header' || $docPart == 'footer');
416-
415+
$docPartId = $inHeaderFooter ? $this->getDocPartId() : $docPartId;
417416
return $inHeaderFooter ? $docPart . $docPartId : $docPart;
418417
}
419418

0 commit comments

Comments
 (0)