@@ -55,10 +55,10 @@ public function testList()
55
55
$ element = '/office:document-content/office:automatic-styles/text:list-style/text:list-level-style-bullet ' ;
56
56
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
57
57
58
- $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape ' ;
58
+ $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box ' ;
59
59
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
60
60
61
- $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape /text:list/text:list-item/text:p/text:span ' ;
61
+ $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box /text:list/text:list-item/text:p/text:span ' ;
62
62
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
63
63
}
64
64
@@ -89,10 +89,10 @@ public function testInnerList()
89
89
$ element = '/office:document-content/office:automatic-styles/text:list-style/text:list-level-style-bullet ' ;
90
90
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
91
91
92
- $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape ' ;
92
+ $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box ' ;
93
93
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
94
94
95
- $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape /text:list/text:list-item/text:list/text:list-item/text:p/text:span ' ;
95
+ $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box /text:list/text:list-item/text:list/text:list-item/text:p/text:span ' ;
96
96
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
97
97
}
98
98
@@ -110,10 +110,10 @@ public function testParagraphRichText()
110
110
111
111
$ pres = TestHelperDOCX::getDocument ($ phpPowerPoint , 'ODPresentation ' );
112
112
113
- $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape /text:p/text:span/text:line-break ' ;
113
+ $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box /text:p/text:span/text:line-break ' ;
114
114
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
115
115
116
- $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape /text:p/text:span/text:a ' ;
116
+ $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box /text:p/text:span/text:a ' ;
117
117
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
118
118
$ this ->assertEquals ('http://www.google.fr ' , $ pres ->getElementAttribute ($ element , 'xlink:href ' , 'content.xml ' ));
119
119
}
@@ -131,12 +131,43 @@ public function testListWithRichText()
131
131
132
132
$ pres = TestHelperDOCX::getDocument ($ phpPowerPoint , 'ODPresentation ' );
133
133
134
- $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape /text:list/text:list-item/text:p/text:span/text:a ' ;
134
+ $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box /text:list/text:list-item/text:p/text:span/text:a ' ;
135
135
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
136
- $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape /text:list/text:list-item/text:p/text:span/text:line-break ' ;
136
+ $ element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box /text:list/text:list-item/text:p/text:span/text:line-break ' ;
137
137
$ this ->assertTrue ($ pres ->elementExists ($ element , 'content.xml ' ));
138
138
}
139
139
140
+ public function testRichtextAutoShrink ()
141
+ {
142
+ $ phpPowerPoint = new PhpPowerpoint ();
143
+ $ oSlide = $ phpPowerPoint ->getActiveSlide ();
144
+ $ oRichText1 = $ oSlide ->createRichTextShape ();
145
+
146
+ $ pres = TestHelperDOCX::getDocument ($ phpPowerPoint , 'ODPresentation ' );
147
+ $ element = '/office:document-content/office:automatic-styles/style:style[@style:name= \'gr1 \']/style:graphic-properties ' ;
148
+ $ this ->assertFalse ($ pres ->attributeElementExists ($ element , 'draw:auto-grow-height ' , 'content.xml ' ));
149
+ $ this ->assertFalse ($ pres ->attributeElementExists ($ element , 'draw:auto-grow-width ' , 'content.xml ' ));
150
+
151
+ $ oRichText1 ->setAutoShrinkHorizontal (false );
152
+ $ oRichText1 ->setAutoShrinkVertical (true );
153
+ $ pres = TestHelperDOCX::getDocument ($ phpPowerPoint , 'ODPresentation ' );
154
+ $ element = '/office:document-content/office:automatic-styles/style:style[@style:name= \'gr1 \']/style:graphic-properties ' ;
155
+ $ this ->assertTrue ($ pres ->attributeElementExists ($ element , 'draw:auto-grow-height ' , 'content.xml ' ));
156
+ $ this ->assertTrue ($ pres ->attributeElementExists ($ element , 'draw:auto-grow-width ' , 'content.xml ' ));
157
+ $ this ->assertEquals ('true ' , $ pres ->getElementAttribute ($ element , 'draw:auto-grow-height ' , 'content.xml ' ));
158
+ $ this ->assertEquals ('false ' , $ pres ->getElementAttribute ($ element , 'draw:auto-grow-width ' , 'content.xml ' ));
159
+
160
+
161
+ $ oRichText1 ->setAutoShrinkHorizontal (true );
162
+ $ oRichText1 ->setAutoShrinkVertical (false );
163
+ $ pres = TestHelperDOCX::getDocument ($ phpPowerPoint , 'ODPresentation ' );
164
+ $ element = '/office:document-content/office:automatic-styles/style:style[@style:name= \'gr1 \']/style:graphic-properties ' ;
165
+ $ this ->assertTrue ($ pres ->attributeElementExists ($ element , 'draw:auto-grow-height ' , 'content.xml ' ));
166
+ $ this ->assertTrue ($ pres ->attributeElementExists ($ element , 'draw:auto-grow-width ' , 'content.xml ' ));
167
+ $ this ->assertEquals ('false ' , $ pres ->getElementAttribute ($ element , 'draw:auto-grow-height ' , 'content.xml ' ));
168
+ $ this ->assertEquals ('true ' , $ pres ->getElementAttribute ($ element , 'draw:auto-grow-width ' , 'content.xml ' ));
169
+ }
170
+
140
171
public function testStyleAlignment ()
141
172
{
142
173
$ phpPowerPoint = new PhpPowerpoint ();
0 commit comments