Skip to content

Commit 54b5b38

Browse files
authored
PowerPoint2007 Reader : Support for BarChart (#856)
1 parent ba9213b commit 54b5b38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+712
-453
lines changed

docs/changes/1.2.0.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- ODPresentation Writer : Support for rotation for RichText by [@Progi1984](https://github.com/Progi1984) fixing [#279](https://github.com/PHPOffice/PHPPresentation/pull/279) in [#409](https://github.com/PHPOffice/PHPPresentation/pull/409)
1414
- HTML Writer by [@Progi1984](https://github.com/Progi1984) fixing [#221](https://github.com/PHPOffice/PHPPresentation/pull/221), [#567](https://github.com/PHPOffice/PHPPresentation/pull/567), [#644](https://github.com/PHPOffice/PHPPresentation/pull/644) in [#850](https://github.com/PHPOffice/PHPPresentation/pull/855)
1515
- PDF Writer by [@Progi1984](https://github.com/Progi1984) fixing [#181](https://github.com/PHPOffice/PHPPresentation/pull/181), [#381](https://github.com/PHPOffice/PHPPresentation/pull/381), [#472](https://github.com/PHPOffice/PHPPresentation/pull/472), [#693](https://github.com/PHPOffice/PHPPresentation/pull/693), [#725](https://github.com/PHPOffice/PHPPresentation/pull/725) in [#850](https://github.com/PHPOffice/PHPPresentation/pull/855)
16+
- PowerPoint2007 Reader : Support for BarChart by [@Progi1984](https://github.com/Progi1984) fixing [#824](https://github.com/PHPOffice/PHPPresentation/pull/824) in [#856](https://github.com/PHPOffice/PHPPresentation/pull/856)
1617

1718
## Bug fixes
1819

@@ -30,3 +31,4 @@
3031
- CI: Added ODFValidator by [@Progi1984](https://github.com/Progi1984) fixing [#678](https://github.com/PHPOffice/PHPWord/issues/678) in [#653](https://github.com/PHPOffice/PHPWord/pull/653)
3132

3233
## BC Breaks
34+
- \PhpOffice\PhpPresentation\Style\Border::lineWidth use pixels as reference (and not anymore points)

docs/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ Below are the supported features for each file formats.
8686
| | Image | :material-check: | :material-check: | :material-check: |
8787
| | Hyperlink | :material-check: | :material-check: | :material-check: |
8888
| | RichText | :material-check: | :material-check: | :material-check: |
89-
| | Table | | | |
89+
| | Table | | | :material-check: |
9090
| | Text | :material-check: | :material-check: | :material-check: |
9191
| **Charts** | Area | | | |
92-
| | Bar | | | |
92+
| | Bar | | | :material-check: |
9393
| | Bar3D | | | |
9494
| | Doughnut | | | |
9595
| | Line | | | |

phpmd.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<!-- PptSlides needs more coupling (default: 13) -->
2727
<!-- Writer/Office2007/AbstractSlide needs more coupling (default: 13) -->
2828
<properties>
29-
<property name="maximum" value="35" />
29+
<property name="maximum" value="38" />
3030
</properties>
3131
</rule>
3232
<rule ref="rulesets/design.xml/NumberOfChildren">

samples/Sample_01_Complex.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
->setTooltip('PHPPresentation');
183183

184184
// Save file
185-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
185+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
186186
if (!CLI) {
187187
include_once 'Sample_Footer.php';
188188
}

samples/Sample_01_Simple.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
->setName('B Nazanin');
7373

7474
// Save file
75-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
75+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
7676
if (!CLI) {
7777
include_once 'Sample_Footer.php';
7878
}

samples/Sample_02_Serialized.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
$objPHPPresentationLoaded = IOFactory::load(__DIR__ . '/results/' . basename(__FILE__, '.php') . '.phppt');
6363

6464
// Save file
65-
echo write($objPHPPresentationLoaded, basename(__FILE__, '.php'), $writers);
65+
echo write($objPHPPresentationLoaded, basename(__FILE__, '.php'));
6666
if (!CLI) {
6767
include_once 'Sample_Footer.php';
6868
}

samples/Sample_03_Image.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
$currentSlide->addShape($shape);
9797

9898
// Save file
99-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
99+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
100100
if (!CLI) {
101101
include_once 'Sample_Footer.php';
102102
}

samples/Sample_03_Video.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
$currentSlide->addShape($shape);
3030

3131
// Save file
32-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
32+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
3333
if (!CLI) {
3434
include_once 'Sample_Footer.php';
3535
}

samples/Sample_04_Table.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
$textRunC3->getHyperlink()->setUrl('https://google.com')->setTooltip('Google');
139139

140140
// Save file
141-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
141+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
142142
if (!CLI) {
143143
include_once 'Sample_Footer.php';
144144
}

samples/Sample_05_Chart.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ function fnSlide_Scatter(PhpPresentation $objPHPPresentation): void
706706
fnSlide_Scatter($objPHPPresentation);
707707

708708
// Save file
709-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
709+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
710710
if (!CLI) {
711711
include_once 'Sample_Footer.php';
712712
}

samples/Sample_05_Chart_Line.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
$currentSlide->addShape($shape6);
226226

227227
// Save file
228-
echo EOL . write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
228+
echo EOL . write($objPHPPresentation, basename(__FILE__, '.php'));
229229

230230
if (!CLI) {
231231
include_once 'Sample_Footer.php';

samples/Sample_05_Chart_with_PhpSpreadsheet.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
$shape->getLegend()->getFont()->setItalic(true);
113113

114114
// Save file
115-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
115+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
116116

117117
if (!CLI) {
118118
include_once 'Sample_Footer.php';

samples/Sample_06_Fill.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
}
7070

7171
// Save file
72-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
72+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
7373
if (!CLI) {
7474
include_once 'Sample_Footer.php';
7575
}

samples/Sample_07_Border.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
}
6060

6161
// Save file
62-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
62+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
6363
if (!CLI) {
6464
include_once 'Sample_Footer.php';
6565
}

samples/Sample_08_Group.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
->setColor(new Color('FFE06B20'));
5252

5353
// Save file
54-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
54+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
5555
if (!CLI) {
5656
include_once 'Sample_Footer.php';
5757
}

samples/Sample_09_SlideNote.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
$oRichText->createParagraph()->createTextRun('Supports writing to different file formats');
6161

6262
// Save file
63-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
63+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
6464
if (!CLI) {
6565
include_once 'Sample_Footer.php';
6666
}

samples/Sample_10_Transition.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
$slide1->addShape(clone $shapeRichText);
6666

6767
// Save file
68-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
68+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
6969
if (!CLI) {
7070
include_once 'Sample_Footer.php';
7171
}

samples/Sample_11_Shape.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function fnSlideRichTextList(PhpPresentation $objPHPPresentation): void
167167
fnSlideRichTextList($objPHPPresentation);
168168

169169
// Save file
170-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
170+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
171171
if (!CLI) {
172172
include_once 'Sample_Footer.php';
173173
}

samples/Sample_12_Reader_ODPresentation.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
set_time_limit(10);
44

5+
include_once __DIR__ . '/Sample_PhpPptTree.php';
56
include_once __DIR__ . '/Sample_Header.php';
67

78
use PhpOffice\PhpPresentation\IOFactory;
89

910
$pptReader = IOFactory::createReader('ODPresentation');
1011
$oPHPPresentation = $pptReader->load(__DIR__ . '/resources/Sample_12.odp');
1112

12-
$oTree = new PhpPptTree($oPHPPresentation);
13-
echo $oTree->display();
1413
if (!CLI) {
14+
$oTree = new Sample_PhpPptTree($oPHPPresentation);
15+
echo $oTree->display();
16+
1517
include_once 'Sample_Footer.php';
1618
}

samples/Sample_12_Reader_PowerPoint2007.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
set_time_limit(10);
44

5-
include_once 'Sample_Header.php';
5+
include_once __DIR__ . '/Sample_PhpPptTree.php';
6+
include_once __DIR__ . '/Sample_Header.php';
67

78
use PhpOffice\PhpPresentation\IOFactory;
89

910
$pptReader = IOFactory::createReader('PowerPoint2007');
10-
$oPHPPresentation = $pptReader->load('resources/Sample_12.pptx');
11+
$oPHPPresentation = $pptReader->load(__DIR__ . '/resources/Sample_12.pptx');
1112

12-
$oTree = new PhpPptTree($oPHPPresentation);
13-
echo $oTree->display();
1413
if (!CLI) {
14+
$oTree = new Sample_PhpPptTree($oPHPPresentation);
15+
echo $oTree->display();
16+
1517
include_once 'Sample_Footer.php';
1618
}

samples/Sample_12_Reader_PowerPoint97.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
set_time_limit(10);
44

5-
include_once 'Sample_Header.php';
5+
include_once __DIR__ . '/Sample_PhpPptTree.php';
6+
include_once __DIR__ . '/Sample_Header.php';
67

78
use PhpOffice\PhpPresentation\IOFactory;
89

910
$pptReader = IOFactory::createReader('PowerPoint97');
10-
$oPHPPresentation = $pptReader->load('resources/Sample_12.ppt');
11+
$oPHPPresentation = $pptReader->load(__DIR__ . '/resources/Sample_12.ppt');
1112

12-
$oTree = new PhpPptTree($oPHPPresentation);
13-
echo $oTree->display();
1413
if (!CLI) {
14+
$oTree = new Sample_PhpPptTree($oPHPPresentation);
15+
echo $oTree->display();
16+
1517
include_once 'Sample_Footer.php';
1618
}

samples/Sample_13_MarkAsFinal.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$currentSlide->addShape(clone $oShapeRichText);
1919

2020
// Save file
21-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
21+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
2222
if (!CLI) {
2323
include_once 'Sample_Footer.php';
2424
}

samples/Sample_14_Zoom.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$currentSlide->addShape(clone $oShapeRichText);
1919

2020
// Save file
21-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
21+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
2222
if (!CLI) {
2323
include_once 'Sample_Footer.php';
2424
}

samples/Sample_15_Background.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
$oSlide2->setBackground($oBkgImage);
3636

3737
// Save file
38-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
38+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
3939
if (!CLI) {
4040
include_once 'Sample_Footer.php';
4141
}

samples/Sample_16_Thumbnail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$oSlide1->addShape(clone $oShapeRichText);
1919

2020
// Save file
21-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
21+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
2222
if (!CLI) {
2323
include_once 'Sample_Footer.php';
2424
}

samples/Sample_17_Comment.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$oSlide1->addShape($oComment2);
4040

4141
// Save file
42-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
42+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
4343
if (!CLI) {
4444
include_once 'Sample_Footer.php';
4545
}

samples/Sample_18_Animation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
$oSlide3->addAnimation($oAnimation5);
5555

5656
// Save file
57-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
57+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
5858
if (!CLI) {
5959
include_once 'Sample_Footer.php';
6060
}

samples/Sample_19_SlideMaster.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
$currentSlide->setSlideLayout($oSlideLayout);
107107

108108
// Save file
109-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
109+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
110110
if (!CLI) {
111111
include_once 'Sample_Footer.php';
112112
}

samples/Sample_20_SlideLayout.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
$currentSlide->setSlideLayout($slideLayout);
6868

6969
// Save file
70-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
70+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
7171
if (!CLI) {
7272
include_once 'Sample_Footer.php';
7373
}

samples/Sample_21_AutoShape.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
}
6060

6161
// Save file
62-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
62+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
6363
if (!CLI) {
6464
include_once 'Sample_Footer.php';
6565
}

samples/Sample_22_ExternalSlide.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818

1919
// Save file
20-
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
20+
echo write($objPHPPresentation, basename(__FILE__, '.php'));
2121
if (!CLI) {
2222
include_once 'Sample_Footer.php';
2323
}

0 commit comments

Comments
 (0)