File tree Expand file tree Collapse file tree 3 files changed +56
-4
lines changed Expand file tree Collapse file tree 3 files changed +56
-4
lines changed Original file line number Diff line number Diff line change @@ -135,9 +135,22 @@ public function __construct()
135
135
public function __clone ()
136
136
{
137
137
$ this ->container = null ;
138
- $ this ->fill = clone $ this ->fill ;
139
- $ this ->border = clone $ this ->border ;
140
- $ this ->shadow = clone $ this ->shadow ;
138
+ $ this ->name = $ this ->name ;
139
+ if (isset ($ this ->fill )) {
140
+ $ this ->fill = clone $ this ->fill ;
141
+ }
142
+ if (isset ($ this ->border )) {
143
+ $ this ->border = clone $ this ->border ;
144
+ }
145
+ if (isset ($ this ->shadow )) {
146
+ $ this ->shadow = clone $ this ->shadow ;
147
+ }
148
+ if (isset ($ this ->placeholder )) {
149
+ $ this ->placeholder = clone $ this ->placeholder ;
150
+ }
151
+ if (isset ($ this ->hyperlink )) {
152
+ $ this ->hyperlink = clone $ this ->hyperlink ;
153
+ }
141
154
}
142
155
143
156
/**
Original file line number Diff line number Diff line change @@ -185,7 +185,23 @@ public function __construct()
185
185
}
186
186
187
187
/**
188
- * Get active paragraph index.
188
+ * Magic Method : clone
189
+ */
190
+ public function __clone ()
191
+ {
192
+ // Call perent clonage for heritage
193
+ parent ::__clone ();
194
+ // Clone each paragraph
195
+ if (isset ($ this ->richTextParagraphs )) {
196
+ foreach ($ this ->richTextParagraphs as &$ paragraph ) {
197
+ $ paragraph = clone $ paragraph ;
198
+ }}
199
+ }
200
+
201
+ /**
202
+ * Get active paragraph index
203
+ *
204
+ * @return int
189
205
*/
190
206
public function getActiveParagraphIndex (): int
191
207
{
Original file line number Diff line number Diff line change @@ -132,6 +132,29 @@ public function setSlideMasterId($masterId = 1)
132
132
return $ this ;
133
133
}
134
134
135
+
136
+ public function __clone ()
137
+ {
138
+ // Set parent
139
+ $ this ->parent = clone $ this ->parent ;
140
+ // Shape collection
141
+ if (isset ($ this ->shapeCollection )) {
142
+ $ this ->shapeCollection = clone $ this ->shapeCollection ;
143
+ foreach ($ this ->shapeCollection as &$ shape ) {
144
+ $ shape = clone $ shape ;
145
+ }
146
+ }
147
+ // Transition object
148
+ if (isset ($ this ->slideTransition )) {
149
+ $ this ->slideTransition = clone $ this ->slideTransition ;
150
+ }
151
+ // Note object
152
+ if (isset ($ this ->slideNote )) {
153
+ $ this ->slideNote = clone $ this ->slideNote ;
154
+ }
155
+
156
+ }
157
+
135
158
/**
136
159
* Copy slide (!= clone!).
137
160
*
You can’t perform that action at this time.
0 commit comments