Skip to content

Commit

Permalink
Merge branch 'develop' into issue279pptx
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 authored May 10, 2019
2 parents c56a079 + d9e4d81 commit e950d33
Show file tree
Hide file tree
Showing 158 changed files with 762 additions and 527 deletions.
17 changes: 17 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: true

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- Progi1984

# A list of keywords to be skipped the process that add reviewers if pull requests include it
skipKeywords:
- WIP

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- hhvm

matrix:
Expand Down
21 changes: 10 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

### Changes
- PHP 7.1 is now supported - @Progi1984 GH-355
- PhpOffice\PhpPresentation\Style\Color : Define only the transparency - @Progi1984 GH-370
- PhpOffice\PhpPresentation\Style\Color : Define only the transparency - @Progi1984 GH-370
- PowerPoint2007 Reader : Background Color based on SchemeColor - @Progi1984 GH-397

### Features
Expand All @@ -30,7 +30,7 @@

### Features
- PowerPoint2007 Writer : Implemented XSD validation test case according to the ECMA/ISO standard - @k42b3 GH-307
- PowerPoint2007 Writer : Implement visibility for axis - @kw-pr @Progi1984 GH-356
- PowerPoint2007 Writer : Implement visibility for axis - @kw-pr @Progi1984 GH-356
- PowerPoint2007 Writer : Implement gap width in Bar(3D) Charts - @Progi1984 GH-358

## 0.8.0 - 2017-04-03
Expand Down Expand Up @@ -91,16 +91,16 @@
- ODPresentation & PowerPoint2007 Writer : Add Font Support For Chart Axis - @jrking4 GH-186
- ODPresentation & PowerPoint2007 Writer : Support for video - @Progi1984 GH-123
- ODPresentation & PowerPoint2007 Writer : Support for Visibility for slides - @Progi1984
- PowerPoint2007 Reader : Layout Management - @vincentKool @Progi1984 GH-161
- PowerPoint2007 Reader : Slide size - @loverslcn @Progi1984 GH-246
- PowerPoint2007 Reader : Bullet Color - @Progi1984 GH-257
- PowerPoint2007 Reader : Line Spacing - @Progi1984 GH-257
- PowerPoint2007 Reader : Layout Management - @vincentKool @Progi1984 GH-161
- PowerPoint2007 Reader : Slide size - @loverslcn @Progi1984 GH-246
- PowerPoint2007 Reader : Bullet Color - @Progi1984 GH-257
- PowerPoint2007 Reader : Line Spacing - @Progi1984 GH-257
- PowerPoint2007 Writer : Presentation with predefined View Type - @Progi1984 GH-120
- PowerPoint2007 Writer : Implement alpha channel to Fills - @Dayjo GH-203 / @Progi1984 GH-215
- PowerPoint2007 Writer : Implement Animations - @JewrassicPark GH-214 / @Progi1984 GH-217
- PowerPoint2007 Writer : Layout Management - @vincentKool @Progi1984 GH-161
- PowerPoint2007 Writer : Bullet Color - @piotrbelina GH-249
- PowerPoint2007 Writer : Line Spacing - @piotrbelina GH-249
- PowerPoint2007 Writer : Bullet Color - @piotrbelina GH-249
- PowerPoint2007 Writer : Line Spacing - @piotrbelina GH-249

## 0.6.0 - 2016-01-24

Expand Down Expand Up @@ -176,7 +176,7 @@
- PowerPoint2007 Writer : Hyperlink in table doesn't work - @Progi1984 GH-70
- PowerPoint2007 Writer : AutoFitNormal works with options (fontScale & lineSpacingReduction) - @Progi1984 @desigennaro GH-71
- PowerPoint2007 Writer : Shadow don't work for RichTextShapes - @Progi1984 GH-81
- PowerPoint2007 Writer : Visibility of the Title doesn't work - @Progi1984 GH-107
- PowerPoint2007 Writer : Visibility of the Title doesn't work - @Progi1984 GH-107
- Refactor findLayoutIndex to findLayoutId where it assumes the slideLayout order was sorted. IMPROVED: unit tests - @kenliau GH-95

### Miscellaneous
Expand Down Expand Up @@ -250,15 +250,14 @@
- PowerPoint2007 Writer: Scatter chart with numerical X values not working well - @Progi1984 GH-3
- Shape RichText: Support of Vertical Alignment in PowerPoint2007 - @Progi1984 GH-35


### Miscellaneous

- Rename PHPPowerpoint.php to PHPPowerPoint.php - @maartenba CP-1165
- Create build script using Phing - @maartenba CP-5270
- QA: Prepare `.travis.yml` and `phpcs.xml` for Travis build passing - @Progi1984 @ivanlanin
- QA: Initiate unit tests - @Progi1984 @ivanlanin
- QA: Cleanup source code for PSR dan PHPDoc compatibility - @ivanlanin
- QA: Unit Tests - @Progi1984 & @ivanlanin
- QA: Unit Tests - @Progi1984 & @ivanlanin
- Doc: Initiate documentation - @ivanlanin
- Doc: Move to [Read The Docs](http://phppowerpoint.readthedocs.org) - @Progi1984
- Refactor: Change PHPPowerPoint_Shape_Shadow to PHPPowerPoint_Style_Shadow because it's a style, not a shape - @ivanlanin
Expand Down
299 changes: 149 additions & 150 deletions README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["PHP","PowerPoint","LibreOffice","pptx","ppt","odp","presentations"],
"homepage": "http://phpoffice.github.io",
"type": "library",
"license": "LGPL",
"license": "LGPL-3.0-only",
"authors": [
{
"name": "Mark Baker"
Expand All @@ -25,7 +25,7 @@
"phpoffice/common": "0.2.*"
},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/phpunit": "~4.8.36",
"phpdocumentor/phpdocumentor":"2.*",
"phpmd/phpmd": "2.*",
"sebastian/phpcpd": "2.*",
Expand All @@ -34,7 +34,7 @@
"codeclimate/php-test-reporter": "dev-master"
},
"suggest": {
"ext-gd2": "Required to add images"
"ext-gd": "Required to add images"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion docs/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ name. Use the following functions :
$properties->setSubject('My subject');
$properties->setKeywords('my, key, word');
Presentation Properties
-----------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PHPPresentation is a library written in pure PHP that provides a set of classes
.. toctree::
:maxdepth: 2
:caption: Shapes

shapes_chart
shapes_comment
shapes_drawing
Expand Down
10 changes: 5 additions & 5 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Introduction
============

PHPPresentation is a library written in pure PHP that provides a set of
classes to write to different presentation file formats, i.e. Microsoft
`Office Open XML <http://en.wikipedia.org/wiki/Office_Open_XML>`
(.pptx) and OASIS `Open Document Format for Office Applications
<http://en.wikipedia.org/wiki/OpenDocument>`__ (.odp).
PHPPresentation is a library written in pure PHP that provides a set of
classes to write to different presentation file formats, i.e. Microsoft
`Office Open XML <http://en.wikipedia.org/wiki/Office_Open_XML>`
(.pptx) and OASIS `Open Document Format for Office Applications
<http://en.wikipedia.org/wiki/OpenDocument>`__ (.odp).

PHPPresentation is an open source project licensed under the terms of `LGPL
version 3 <https://github.com/PHPOffice/PHPPresentation/blob/develop/COPYING.LESSER>`__.
Expand Down
3 changes: 1 addition & 2 deletions docs/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OpenXML

Known as "ISO/IEC 29500, Third edition, 2012-09-01"

ISO :
ISO :

- `Part 1: Fundamentals and Markup Language Reference
<http://standards.iso.org/ittf/PubliclyAvailableStandards/c061750_ISO_IEC_29500-1_2012.zip>`__
Expand All @@ -32,7 +32,6 @@ OpenDocument
- `Oasis OpenDocument Standard Version
1.2 <http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os.html>`__


PowerPoint 97
---------------

Expand Down
3 changes: 1 addition & 2 deletions docs/shapes_chart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ You can define visibility for each axis (X & Y).
Title
^^^^^

By default, the title of a chart is displayed.
By default, the title of a chart is displayed.
For hiding it, you define its visibility to false.

.. code-block:: php
Expand Down Expand Up @@ -229,7 +229,6 @@ You can stack multiples series in a same chart. After adding multiples series, y
:width: 120px
:alt: Bar::GROUPING_PERCENTSTACKED


Line
^^^^

Expand Down
1 change: 0 additions & 1 deletion docs/shapes_comment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Example:
$oComment->setDate(time());
$oSlide->addShape($oComment);
Author
------

Expand Down
1 change: 0 additions & 1 deletion docs/shapes_drawing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ GD
->setMimeType(Drawing\Gd::MIMETYPE_DEFAULT);
$oSlide->addShape($oShape);
Base64
------

Expand Down
1 change: 0 additions & 1 deletion docs/shapes_media.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Example:
$oMedia->setName('Name of the Media');
$oSlide->addShape($oMedia);
Quirks
------

Expand Down
3 changes: 0 additions & 3 deletions docs/shapes_richtext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Properties that can be set for each paragraphs are as follow.
- ``lineSpacing`` see *[LineSpacing](#linespacing)*
- ``font`` see *[Font](#font)*


Bullet
------

Expand Down Expand Up @@ -59,7 +58,6 @@ With the bullet style, you can define the char, the font, the color and the type
$oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET);
$oParagraph->getBulletStyle()->setBulletColor(new Color(Color::COLOR_RED));
LineSpacing
-----------

Expand All @@ -75,7 +73,6 @@ Example:
$oParagraph->setLineSpacing(200);
$iLineSpacing = $oParagraph->getLineSpacing();
Run
---

Expand Down
7 changes: 2 additions & 5 deletions docs/shapes_table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A row is a child of a table. For creating a row, use `createRow` method of a Tab
$tableShape = $slide->createTableShape($columns);
$row = $tableShape->createRow();
Cells
-------
A cell is a child of a row.
Expand All @@ -35,7 +35,7 @@ You can access cell objects with `nextCell` method of a Row object.
$cellA1 = $row->nextCell();
// Get the second cell
$cellA2 = $row->nextCell();
You can access cell object directly.

.. code-block:: php
Expand All @@ -47,7 +47,6 @@ You can access cell object directly.
// Get the second cell
$cellA2 = $row->getCell(1);
Define margins of a cell
~~~~~~~~~~~~~~~~~~~~~~~~
Margins of cells are defined by margins of the first paragraph of cell.
Expand All @@ -66,7 +65,6 @@ For defining margins of cell, you can use the `setMargin*` method of a Alignment
->setMarginRight(60)
->setMarginTop(80);
Define the text direction of a cell
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For defining the text direction of cell, you can use the `setTextDirection` method of the `getAlignment` method of a Cell object.
Expand All @@ -79,7 +77,6 @@ The width is in pixels.
$cellA1 = $row->nextCell();
$cellA1->getAlignment()->setTextDirection(\PhpOffice\PhpPresentation\Style\Alignment::TEXT_DIRECTION_VERTICAL_270);
Define the width of a cell
~~~~~~~~~~~~~~~~~~~~~~~~~~
The width of cells are defined by the width of cell of the first row.
Expand Down
1 change: 0 additions & 1 deletion docs/writers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Writers
=======


ODPresentation
--------------

Expand Down
18 changes: 16 additions & 2 deletions samples/Sample_Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@
require_once __DIR__ . '/../src/PhpPresentation/Autoloader.php';
Autoloader::register();

require_once __DIR__ . '/../vendor/autoload.php';
if (is_file(__DIR__. '/../../../../vendor/autoload.php')) {
require_once __DIR__ . '/../../../../vendor/autoload.php';
} else {
throw new Exception ('Can not find the vendor folder!');
}
// do some checks to make sure the outputs are set correctly.
if (is_dir(__DIR__.DIRECTORY_SEPARATOR.'results') === FALSE) {
throw new Exception ('The results folder is not present!');
}
if (is_writable(__DIR__.DIRECTORY_SEPARATOR.'results'.DIRECTORY_SEPARATOR) === FALSE) {
throw new Exception ('The results folder is not writable!');
}
if (is_writable(__DIR__.DIRECTORY_SEPARATOR) === FALSE) {
throw new Exception ('The samples folder is not writable!');
}

// Set writers
$writers = array('PowerPoint2007' => 'pptx', 'ODPresentation' => 'odp');
Expand Down Expand Up @@ -498,4 +512,4 @@ protected function getConstantName($class, $search, $startWith = '') {
</div>
</div>
</div>
<?php echo $pageHeading; ?>
<?php echo $pageHeading;
3 changes: 2 additions & 1 deletion src/PhpPresentation/AbstractShape.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function __clone()
/**
* Get Container, Slide or Group
*
* @return \PhpOffice\PhpPresentation\Container
* @return \PhpOffice\PhpPresentation\ShapeContainerInterface
*/
public function getContainer()
{
Expand Down Expand Up @@ -385,6 +385,7 @@ public function hasHyperlink()
* Get Hyperlink
*
* @return \PhpOffice\PhpPresentation\Shape\Hyperlink
* @throws \Exception
*/
public function getHyperlink()
{
Expand Down
5 changes: 2 additions & 3 deletions src/PhpPresentation/HashTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,12 @@ public function add(ComparableInterface $pSource)
{
// Determine hashcode
$hashIndex = $pSource->getHashIndex();

$hashCode = $pSource->getHashCode();

if (is_null($hashIndex)) {
$hashCode = $pSource->getHashCode();
} elseif (isset($this->keyMap[$hashIndex])) {
$hashCode = $this->keyMap[$hashIndex];
} else {
$hashCode = $pSource->getHashCode();
}

// Add value
Expand Down
7 changes: 5 additions & 2 deletions src/PhpPresentation/IOFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class IOFactory
* @param PhpPresentation $phpPresentation
* @param string $name
* @return \PhpOffice\PhpPresentation\Writer\WriterInterface
* @throws \Exception
*/
public static function createWriter(PhpPresentation $phpPresentation, $name = 'PowerPoint2007')
{
Expand All @@ -47,6 +48,7 @@ public static function createWriter(PhpPresentation $phpPresentation, $name = 'P
*
* @param string $name
* @return \PhpOffice\PhpPresentation\Reader\ReaderInterface
* @throws \Exception
*/
public static function createReader($name = '')
{
Expand Down Expand Up @@ -81,8 +83,8 @@ public static function load($pFilename)
* @param string $name
* @param string $type
* @param \PhpOffice\PhpPresentation\PhpPresentation $phpPresentation
* @throws \Exception
* @return
* @return mixed
* @throws \ReflectionException
*/
private static function loadClass($class, $name, $type, PhpPresentation $phpPresentation = null)
{
Expand All @@ -102,6 +104,7 @@ private static function loadClass($class, $name, $type, PhpPresentation $phpPres
*
* @param string $class
* @return bool
* @throws \ReflectionException
*/
private static function isConcreteClass($class)
{
Expand Down
Loading

0 comments on commit e950d33

Please sign in to comment.