@@ -101,36 +101,39 @@ public function getDocumentLayout() {
101
101
/**
102
102
* Set Document Layout
103
103
*
104
- * @param string $pValue PHPPowerPoint_DocumentLayout document layout
104
+ * @param array $pValue PHPPowerPoint_DocumentLayout document layout
105
105
* @return PHPPowerPoint_DocumentLayout
106
106
*/
107
107
public function setDocumentLayout ($ pValue = PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_4x3, $ isLandscape = true ) {
108
- switch ($ pValue ) {
109
- case PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_4x3:
110
- case PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_16x10:
111
- case PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_16x9:
112
- case PHPPowerPoint_DocumentLayout::LAYOUT_35mm:
113
- case PHPPowerPoint_DocumentLayout::LAYOUT_A3 :
114
- case PHPPowerPoint_DocumentLayout::LAYOUT_A4 :
115
- case PHPPowerPoint_DocumentLayout::LAYOUT_B4ISO :
116
- case PHPPowerPoint_DocumentLayout::LAYOUT_B5ISO :
117
- case PHPPowerPoint_DocumentLayout::LAYOUT_BANNER :
118
- case PHPPowerPoint_DocumentLayout::LAYOUT_LETTER :
119
- case PHPPowerPoint_DocumentLayout::LAYOUT_OVERHEAD :
120
- $ this ->_layout = $ pValue ;
121
- if ( $ isLandscape ) {
122
- $ this ->_cx = $ this ->_dimension [$ this ->_layout ]['cx ' ];
123
- $ this ->_cy = $ this ->_dimension [$ this ->_layout ]['cy ' ];
124
- } else {
125
- $ this ->_cx = $ this ->_dimension [$ this ->_layout ]['cy ' ];
126
- $ this ->_cy = $ this ->_dimension [$ this ->_layout ]['cx ' ];
127
- }
128
- break ;
129
- case PHPPowerPoint_DocumentLayout::LAYOUT_CUSTOM :
130
- default :
131
- $ this ->_layout = PHPPowerPoint_DocumentLayout::LAYOUT_CUSTOM ;
132
- break ;
133
- }
108
+ switch ($ pValue ) {
109
+ case PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_4x3:
110
+ case PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_16x10:
111
+ case PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_16x9:
112
+ case PHPPowerPoint_DocumentLayout::LAYOUT_35mm:
113
+ case PHPPowerPoint_DocumentLayout::LAYOUT_A3 :
114
+ case PHPPowerPoint_DocumentLayout::LAYOUT_A4 :
115
+ case PHPPowerPoint_DocumentLayout::LAYOUT_B4ISO :
116
+ case PHPPowerPoint_DocumentLayout::LAYOUT_B5ISO :
117
+ case PHPPowerPoint_DocumentLayout::LAYOUT_BANNER :
118
+ case PHPPowerPoint_DocumentLayout::LAYOUT_LETTER :
119
+ case PHPPowerPoint_DocumentLayout::LAYOUT_OVERHEAD :
120
+ $ this ->_layout = $ pValue ;
121
+ $ this ->_cx = $ this ->_dimension [$ this ->_layout ]['cy ' ];
122
+ $ this ->_cy = $ this ->_dimension [$ this ->_layout ]['cx ' ];
123
+ break ;
124
+ case PHPPowerPoint_DocumentLayout::LAYOUT_CUSTOM :
125
+ default :
126
+ $ this ->_cx = $ pValue ['cx ' ];
127
+ $ this ->_cy = $ pValue ['cy ' ];
128
+ $ this ->_layout = PHPPowerPoint_DocumentLayout::LAYOUT_CUSTOM ;
129
+ break ;
130
+ }
131
+
132
+ if (!$ isLandscape ) {
133
+ $ tmp = $ this ->_cx ;
134
+ $ this ->_cx = $ this ->_cy ;
135
+ $ this ->_cy = $ tmp ;
136
+ }
134
137
135
138
return $ this ;
136
139
}
0 commit comments