Passed
Push — 1.10.x ( 751682...677ec8 )
by Yannick
50:57
created
main/inc/lib/phpdocx/pdf/include/table_cell_frame_decorator.cls.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -94,21 +94,21 @@
 block discarded – undo
94 94
 
95 95
       switch ($valign) {
96 96
 
97
-      default:
98
-      case "baseline":
99
-        // FIXME: this isn't right
97
+          default:
98
+          case "baseline":
99
+            // FIXME: this isn't right
100 100
         
101
-      case "top":
102
-        // Don't need to do anything
103
-        return;
101
+          case "top":
102
+            // Don't need to do anything
103
+            return;
104 104
 
105
-      case "middle":
106
-        $delta = ($new_height - $this->_content_height) / 2;
107
-        break;
105
+          case "middle":
106
+            $delta = ($new_height - $this->_content_height) / 2;
107
+            break;
108 108
 
109
-      case "bottom":
110
-        $delta = $new_height - $this->_content_height;
111
-        break;
109
+          case "bottom":
110
+            $delta = $new_height - $this->_content_height;
111
+            break;
112 112
 
113 113
       }
114 114
    
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/text_frame_reflower.cls.php 1 patch
Switch Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
     // Handle text transform
57 57
     $transform = $this->_frame->get_style()->text_transform;
58 58
     switch ( strtolower($transform) ) {
59
-    case "capitalize":
60
-      $this->_frame->set_text( ucwords($this->_frame->get_text()) );
61
-      break;
59
+        case "capitalize":
60
+          $this->_frame->set_text( ucwords($this->_frame->get_text()) );
61
+          break;
62 62
 
63
-    case "uppercase":
64
-      $this->_frame->set_text( strtoupper($this->_frame->get_text()) );
65
-      break;
63
+        case "uppercase":
64
+          $this->_frame->set_text( strtoupper($this->_frame->get_text()) );
65
+          break;
66 66
 
67
-    case "lowercase":
68
-      $this->_frame->set_text( strtolower($this->_frame->get_text()) );
69
-      break;
67
+        case "lowercase":
68
+          $this->_frame->set_text( strtolower($this->_frame->get_text()) );
69
+          break;
70 70
 
71
-    default:
72
-      // Do nothing
73
-      break;
71
+        default:
72
+          // Do nothing
73
+          break;
74 74
     }
75 75
   }
76 76
 
@@ -192,20 +192,20 @@  discard block
 block discarded – undo
192 192
 
193 193
     switch ($style->text_transform) {
194 194
 
195
-    default:
196
-      break;
195
+        default:
196
+          break;
197 197
 
198
-    case "capitalize":
199
-      $text = mb_convert_case($text, MB_CASE_TITLE, 'UTF-8');
200
-      break;
198
+        case "capitalize":
199
+          $text = mb_convert_case($text, MB_CASE_TITLE, 'UTF-8');
200
+          break;
201 201
 
202
-    case "uppercase":
203
-      $text = mb_convert_case($text, MB_CASE_UPPER, 'UTF-8');
204
-      break;
202
+        case "uppercase":
203
+          $text = mb_convert_case($text, MB_CASE_UPPER, 'UTF-8');
204
+          break;
205 205
 
206
-    case "lowercase":
207
-      $text = mb_convert_case($text, MB_CASE_LOWER, 'UTF-8');
208
-      break;
206
+        case "lowercase":
207
+          $text = mb_convert_case($text, MB_CASE_LOWER, 'UTF-8');
208
+          break;
209 209
 
210 210
     }
211 211
     
@@ -214,51 +214,51 @@  discard block
 block discarded – undo
214 214
 
215 215
     switch ($style->white_space) {
216 216
 
217
-    default:
218
-    case "normal":
219
-      $this->_frame->set_text( $text = $this->_collapse_white_space($text) );
220
-      if ( $text == "" )
221
-        break;
217
+        default:
218
+        case "normal":
219
+          $this->_frame->set_text( $text = $this->_collapse_white_space($text) );
220
+          if ( $text == "" )
221
+            break;
222 222
 
223
-      $split = $this->_line_break($text);
224
-      break;
223
+          $split = $this->_line_break($text);
224
+          break;
225 225
 
226
-    case "pre":
227
-      $split = $this->_newline_break($text);
228
-      $add_line = $split !== false;
229
-      break;
226
+        case "pre":
227
+          $split = $this->_newline_break($text);
228
+          $add_line = $split !== false;
229
+          break;
230 230
 
231
-    case "nowrap":
232
-      $this->_frame->set_text( $text = $this->_collapse_white_space($text) );
233
-      break;
231
+        case "nowrap":
232
+          $this->_frame->set_text( $text = $this->_collapse_white_space($text) );
233
+          break;
234 234
 
235
-    case "pre-wrap":
236
-      $split = $this->_newline_break($text);
235
+        case "pre-wrap":
236
+          $split = $this->_newline_break($text);
237 237
 
238
-      if ( ($tmp = $this->_line_break($text)) !== false ) {
239
-        $add_line = $split < $tmp;
240
-        $split = min($tmp, $split);
241
-      } else
242
-        $add_line = true;
238
+          if ( ($tmp = $this->_line_break($text)) !== false ) {
239
+            $add_line = $split < $tmp;
240
+            $split = min($tmp, $split);
241
+          } else
242
+            $add_line = true;
243 243
 
244
-      break;
244
+          break;
245 245
 
246
-    case "pre-line":
247
-      // Collapse white-space except for \n
248
-      $this->_frame->set_text( $text = preg_replace( "/[ \t]+/u", " ", $text ) );
246
+        case "pre-line":
247
+          // Collapse white-space except for \n
248
+          $this->_frame->set_text( $text = preg_replace( "/[ \t]+/u", " ", $text ) );
249 249
 
250
-      if ( $text == "" )
251
-        break;
250
+          if ( $text == "" )
251
+            break;
252 252
 
253
-      $split = $this->_newline_break($text);
253
+          $split = $this->_newline_break($text);
254 254
 
255
-      if ( ($tmp = $this->_line_break($text)) !== false ) {
256
-        $add_line = $split < $tmp;
257
-        $split = min($tmp, $split);
258
-      } else
259
-        $add_line = true;
255
+          if ( ($tmp = $this->_line_break($text)) !== false ) {
256
+            $add_line = $split < $tmp;
257
+            $split = min($tmp, $split);
258
+          } else
259
+            $add_line = true;
260 260
 
261
-      break;
261
+          break;
262 262
 
263 263
     }
264 264
 
@@ -351,59 +351,59 @@  discard block
 block discarded – undo
351 351
 
352 352
     switch($style->white_space) {
353 353
 
354
-    default:
355
-    case "normal":
356
-      $str = preg_replace("/[\s\n]+/u"," ", $str);
357
-    case "pre-wrap":
358
-    case "pre-line":
359
-
360
-      // Find the longest word (i.e. minimum length)
361
-
362
-      // This technique (using arrays & an anonymous function) is actually
363
-      // faster than doing a single-pass character by character scan.  Heh,
364
-      // yes I took the time to bench it ;)
365
-      $words = array_flip(preg_split("/[\s-]+/u",$str, -1, PREG_SPLIT_DELIM_CAPTURE));
366
-      array_walk($words, create_function('&$val,$str',
367
-                                         '$val = Font_Metrics::get_text_width($str, "'.$font.'", '.$size.', '.$spacing.');'));
368
-      arsort($words);
369
-      $min = reset($words);
370
-      break;
371
-
372
-    case "pre":
373
-      $lines = array_flip(preg_split("/\n/u", $str));
374
-      array_walk($lines, create_function('&$val,$str',
375
-                                         '$val = Font_Metrics::get_text_width($str, "'.$font.'", '.$size.', '.$spacing.');'));
376
-
377
-      arsort($lines);
378
-      $min = reset($lines);
379
-      break;
380
-
381
-    case "nowrap":
382
-      $min = Font_Metrics::get_text_width($this->_collapse_white_space($str), $font, $size, $spacing);
383
-      break;
354
+        default:
355
+        case "normal":
356
+          $str = preg_replace("/[\s\n]+/u"," ", $str);
357
+        case "pre-wrap":
358
+        case "pre-line":
359
+
360
+          // Find the longest word (i.e. minimum length)
361
+
362
+          // This technique (using arrays & an anonymous function) is actually
363
+          // faster than doing a single-pass character by character scan.  Heh,
364
+          // yes I took the time to bench it ;)
365
+          $words = array_flip(preg_split("/[\s-]+/u",$str, -1, PREG_SPLIT_DELIM_CAPTURE));
366
+          array_walk($words, create_function('&$val,$str',
367
+                                             '$val = Font_Metrics::get_text_width($str, "'.$font.'", '.$size.', '.$spacing.');'));
368
+          arsort($words);
369
+          $min = reset($words);
370
+          break;
371
+
372
+        case "pre":
373
+          $lines = array_flip(preg_split("/\n/u", $str));
374
+          array_walk($lines, create_function('&$val,$str',
375
+                                             '$val = Font_Metrics::get_text_width($str, "'.$font.'", '.$size.', '.$spacing.');'));
376
+
377
+          arsort($lines);
378
+          $min = reset($lines);
379
+          break;
380
+
381
+        case "nowrap":
382
+          $min = Font_Metrics::get_text_width($this->_collapse_white_space($str), $font, $size, $spacing);
383
+          break;
384 384
 
385 385
     }
386 386
 
387 387
     switch ($style->white_space) {
388 388
 
389
-    default:
390
-    case "normal":
391
-    case "nowrap":
392
-      $str = preg_replace("/[\s\n]+/u"," ", $text);
393
-      break;
394
-
395
-    case "pre-line":
396
-      $str = preg_replace( "/[ \t]+/u", " ", $text);
397
-
398
-    case "pre-wrap":
399
-      // Find the longest word (i.e. minimum length)
400
-      $lines = array_flip(preg_split("/\n/", $text));
401
-      array_walk($lines, create_function('&$val,$str',
402
-                                         '$val = Font_Metrics::get_text_width($str, "'.$font.'", '.$size.', '.$spacing.');'));
403
-      arsort($lines);
404
-      reset($lines);
405
-      $str = key($lines);
406
-      break;
389
+        default:
390
+        case "normal":
391
+        case "nowrap":
392
+          $str = preg_replace("/[\s\n]+/u"," ", $text);
393
+          break;
394
+
395
+        case "pre-line":
396
+          $str = preg_replace( "/[ \t]+/u", " ", $text);
397
+
398
+        case "pre-wrap":
399
+          // Find the longest word (i.e. minimum length)
400
+          $lines = array_flip(preg_split("/\n/", $text));
401
+          array_walk($lines, create_function('&$val,$str',
402
+                                             '$val = Font_Metrics::get_text_width($str, "'.$font.'", '.$size.', '.$spacing.');'));
403
+          arsort($lines);
404
+          reset($lines);
405
+          $str = key($lines);
406
+          break;
407 407
 
408 408
     }
409 409
 
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/block_frame_reflower.cls.php 1 patch
Switch Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -404,60 +404,60 @@  discard block
 block discarded – undo
404 404
     // http://www.w3.org/TR/CSS21/text.html#propdef-text-align
405 405
     switch ($style->text_align) {
406 406
 
407
-    default:
408
-    case "left":
409
-      return;
407
+        default:
408
+        case "left":
409
+          return;
410 410
 
411
-    case "right":
412
-      foreach ($this->_frame->get_lines() as $line) {
411
+        case "right":
412
+          foreach ($this->_frame->get_lines() as $line) {
413 413
 
414
-        // Move each child over by $dx
415
-        $dx = $width - $line["w"];
416
-        foreach($line["frames"] as $frame)
417
-          $frame->set_position( $frame->get_position("x") + $dx );
414
+            // Move each child over by $dx
415
+            $dx = $width - $line["w"];
416
+            foreach($line["frames"] as $frame)
417
+              $frame->set_position( $frame->get_position("x") + $dx );
418 418
 
419
-      }
420
-      break;
419
+          }
420
+          break;
421 421
 
422 422
 
423
-    case "justify":
424
-      foreach ($this->_frame->get_lines() as $i => $line) {
423
+        case "justify":
424
+          foreach ($this->_frame->get_lines() as $i => $line) {
425 425
 
426
-        // Only set the spacing if the line is long enough.  This is really
427
-        // just an aesthetic choice ;)
428
-        if ( $line["w"] > self::MIN_JUSTIFY_WIDTH * $width ) {
429
-          // Set the spacing for each child
430
-          if ( $line["wc"] > 1 )
431
-            $spacing = ($width - $line["w"]) / ($line["wc"] - 1);
432
-          else
433
-            $spacing = 0;
426
+            // Only set the spacing if the line is long enough.  This is really
427
+            // just an aesthetic choice ;)
428
+            if ( $line["w"] > self::MIN_JUSTIFY_WIDTH * $width ) {
429
+              // Set the spacing for each child
430
+              if ( $line["wc"] > 1 )
431
+                $spacing = ($width - $line["w"]) / ($line["wc"] - 1);
432
+              else
433
+                $spacing = 0;
434 434
 
435
-          $dx = 0;
436
-          foreach($line["frames"] as $frame) {
437
-            if ( !$frame instanceof Text_Frame_Decorator )
438
-              continue;
435
+              $dx = 0;
436
+              foreach($line["frames"] as $frame) {
437
+                if ( !$frame instanceof Text_Frame_Decorator )
438
+                  continue;
439 439
 
440
-            $frame->set_position( $frame->get_position("x") + $dx );
441
-            $frame->set_text_spacing($spacing);
442
-            $dx += mb_substr_count($frame->get_text(), " ") * $spacing;
443
-          }
440
+                $frame->set_position( $frame->get_position("x") + $dx );
441
+                $frame->set_text_spacing($spacing);
442
+                $dx += mb_substr_count($frame->get_text(), " ") * $spacing;
443
+              }
444 444
 
445
-          // The line (should) now occupy the entire width
446
-          $this->_frame->set_line($i, null, $width);
445
+              // The line (should) now occupy the entire width
446
+              $this->_frame->set_line($i, null, $width);
447 447
 
448
-        }
449
-      }
450
-      break;
451
-
452
-    case "center":
453
-    case "centre":
454
-      foreach ($this->_frame->get_lines() as $i => $line) {
455
-        // Centre each line by moving each frame in the line by:
456
-        $dx = ($width - $line["w"]) / 2;
457
-        foreach ($line["frames"] as $frame)
458
-          $frame->set_position( $frame->get_position("x") + $dx );
459
-      }
460
-      break;
448
+            }
449
+          }
450
+          break;
451
+
452
+        case "center":
453
+        case "centre":
454
+          foreach ($this->_frame->get_lines() as $i => $line) {
455
+            // Centre each line by moving each frame in the line by:
456
+            $dx = ($width - $line["w"]) / 2;
457
+            foreach ($line["frames"] as $frame)
458
+              $frame->set_position( $frame->get_position("x") + $dx );
459
+          }
460
+          break;
461 461
     }
462 462
 
463 463
   }
@@ -480,31 +480,31 @@  discard block
 block discarded – undo
480 480
 
481 481
         switch ($align) {
482 482
 
483
-        case "baseline":
484
-          $y = $line["y"] + $line["h"] - $frame_h;
485
-          break;
483
+            case "baseline":
484
+              $y = $line["y"] + $line["h"] - $frame_h;
485
+              break;
486 486
 
487
-        case "middle":
488
-          $y = $line["y"] + ($line["h"] + $frame_h) / 2;
489
-          break;
487
+            case "middle":
488
+              $y = $line["y"] + ($line["h"] + $frame_h) / 2;
489
+              break;
490 490
 
491
-        case "sub":
492
-          $y = $line["y"] + 0.9 * $line["h"];
493
-          break;
491
+            case "sub":
492
+              $y = $line["y"] + 0.9 * $line["h"];
493
+              break;
494 494
 
495
-        case "super":
496
-          $y = $line["y"] + 0.1 * $line["h"];
497
-          break;
495
+            case "super":
496
+              $y = $line["y"] + 0.1 * $line["h"];
497
+              break;
498 498
 
499
-        case  "text-top":
500
-        case "top": // Not strictly accurate, but good enough for now
501
-          $y = $line["y"];
502
-          break;
499
+            case  "text-top":
500
+            case "top": // Not strictly accurate, but good enough for now
501
+              $y = $line["y"];
502
+              break;
503 503
 
504
-        case "text-bottom":
505
-        case "bottom":
506
-          $y = $line["y"] + $line["h"] - $frame_h;
507
-          break;
504
+            case "text-bottom":
505
+            case "bottom":
506
+              $y = $line["y"] + $line["h"] - $frame_h;
507
+              break;
508 508
         }
509 509
 
510 510
         $x = $frame->get_position("x");
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/abstract_renderer.cls.php 1 patch
Switch Indentation   +245 added lines, -245 removed lines patch added patch discarded remove patch
@@ -299,21 +299,21 @@  discard block
 block discarded – undo
299 299
 
300 300
     switch (strtolower($ext)) {
301 301
 
302
-    case "png":
303
-      $src = imagecreatefrompng($img);
304
-      break;
302
+        case "png":
303
+          $src = imagecreatefrompng($img);
304
+          break;
305 305
 
306
-    case "jpg":
307
-    case "jpeg":
308
-      $src = imagecreatefromjpeg($img);
309
-      break;
306
+        case "jpg":
307
+        case "jpeg":
308
+          $src = imagecreatefromjpeg($img);
309
+          break;
310 310
 
311
-    case "gif":
312
-      $src = imagecreatefromgif($img);
313
-      break;
311
+        case "gif":
312
+          $src = imagecreatefromgif($img);
313
+          break;
314 314
 
315
-    default:
316
-      return; // Unsupported image type
315
+        default:
316
+          return; // Unsupported image type
317 317
     }
318 318
 
319 319
     if ($src == null) {
@@ -475,22 +475,22 @@  discard block
 block discarded – undo
475 475
     
476 476
     switch ($side) {
477 477
 
478
-    case "top":
479
-      $delta = $top / 2;
480
-    case "bottom":
481
-      $delta = isset($delta) ? $delta : -$bottom / 2;
482
-      $this->_canvas->line($x, $y + $delta, $x + $length, $y + $delta, $color, $$side, $dash);
483
-      break;
484
-
485
-    case "left":
486
-      $delta = $left / 2;
487
-    case "right":
488
-      $delta = isset($delta) ? $delta : - $right / 2;
489
-      $this->_canvas->line($x + $delta, $y, $x + $delta, $y + $length, $color, $$side, $dash);
490
-      break;
491
-
492
-    default:
493
-      return;
478
+        case "top":
479
+          $delta = $top / 2;
480
+        case "bottom":
481
+          $delta = isset($delta) ? $delta : -$bottom / 2;
482
+          $this->_canvas->line($x, $y + $delta, $x + $length, $y + $delta, $color, $$side, $dash);
483
+          break;
484
+
485
+        case "left":
486
+          $delta = $left / 2;
487
+        case "right":
488
+          $delta = isset($delta) ? $delta : - $right / 2;
489
+          $this->_canvas->line($x + $delta, $y, $x + $delta, $y + $length, $color, $$side, $dash);
490
+          break;
491
+
492
+        default:
493
+          return;
494 494
 
495 495
     }
496 496
   }
@@ -501,22 +501,22 @@  discard block
 block discarded – undo
501 501
 
502 502
     switch ($side) {
503 503
 
504
-    case "top":
505
-      $delta = $top / 2;
506
-    case "bottom":
507
-      $delta = isset($delta) ? $delta : -$bottom / 2;
508
-      $this->_canvas->line($x, $y + $delta, $x + $length, $y + $delta, $color, $$side, array(3 * $$side));
509
-      break;
510
-
511
-    case "left":
512
-      $delta = $left / 2;
513
-    case "right":
514
-      $delta = isset($delta) ? $delta : - $right / 2;
515
-      $this->_canvas->line($x + $delta, $y, $x + $delta, $y + $length, $color, $$side, array(3 * $$side));
516
-      break;
517
-
518
-    default:
519
-      return;
504
+        case "top":
505
+          $delta = $top / 2;
506
+        case "bottom":
507
+          $delta = isset($delta) ? $delta : -$bottom / 2;
508
+          $this->_canvas->line($x, $y + $delta, $x + $length, $y + $delta, $color, $$side, array(3 * $$side));
509
+          break;
510
+
511
+        case "left":
512
+          $delta = $left / 2;
513
+        case "right":
514
+          $delta = isset($delta) ? $delta : - $right / 2;
515
+          $this->_canvas->line($x + $delta, $y, $x + $delta, $y + $length, $color, $$side, array(3 * $$side));
516
+          break;
517
+
518
+        default:
519
+          return;
520 520
     }
521 521
     
522 522
   }
@@ -528,57 +528,57 @@  discard block
 block discarded – undo
528 528
     // All this polygon business is for beveled corners...
529 529
     switch ($side) {
530 530
 
531
-    case "top":
532
-      if ( $corner_style === "bevel" ) {
531
+        case "top":
532
+          if ( $corner_style === "bevel" ) {
533 533
         
534
-        $points = array($x, $y,
535
-                        $x + $length, $y,
536
-                        $x + $length - $right, $y + $top,
537
-                        $x + $left, $y + $top);
538
-        $this->_canvas->polygon($points, $color, null, null, true);
539
-      } else
540
-        $this->_canvas->filled_rectangle($x, $y, $length, $top, $color);
534
+            $points = array($x, $y,
535
+                            $x + $length, $y,
536
+                            $x + $length - $right, $y + $top,
537
+                            $x + $left, $y + $top);
538
+            $this->_canvas->polygon($points, $color, null, null, true);
539
+          } else
540
+            $this->_canvas->filled_rectangle($x, $y, $length, $top, $color);
541 541
       
542
-      break;
542
+          break;
543 543
       
544
-    case "bottom":
545
-      if ( $corner_style === "bevel" ) {
546
-        $points = array($x, $y,
547
-                        $x + $length, $y,
548
-                        $x + $length - $right, $y - $bottom,
549
-                        $x + $left, $y - $bottom);
550
-        $this->_canvas->polygon($points, $color, null, null, true);
551
-      } else
552
-        $this->_canvas->filled_rectangle($x, $y - $bottom, $length, $bottom, $color);
544
+        case "bottom":
545
+          if ( $corner_style === "bevel" ) {
546
+            $points = array($x, $y,
547
+                            $x + $length, $y,
548
+                            $x + $length - $right, $y - $bottom,
549
+                            $x + $left, $y - $bottom);
550
+            $this->_canvas->polygon($points, $color, null, null, true);
551
+          } else
552
+            $this->_canvas->filled_rectangle($x, $y - $bottom, $length, $bottom, $color);
553 553
       
554
-      break;
554
+          break;
555 555
       
556
-    case "left":
557
-      if ( $corner_style === "bevel" ) {
558
-        $points = array($x, $y,
559
-                        $x, $y + $length,
560
-                        $x + $left, $y + $length - $bottom,
561
-                        $x + $left, $y + $top);
562
-        $this->_canvas->polygon($points, $color, null, null, true);
563
-      } else
564
-        $this->_canvas->filled_rectangle($x, $y, $left, $length, $color);
556
+        case "left":
557
+          if ( $corner_style === "bevel" ) {
558
+            $points = array($x, $y,
559
+                            $x, $y + $length,
560
+                            $x + $left, $y + $length - $bottom,
561
+                            $x + $left, $y + $top);
562
+            $this->_canvas->polygon($points, $color, null, null, true);
563
+          } else
564
+            $this->_canvas->filled_rectangle($x, $y, $left, $length, $color);
565 565
       
566
-      break;
566
+          break;
567 567
       
568
-    case "right":
569
-      if ( $corner_style === "bevel" ) {
570
-        $points = array($x, $y,
571
-                        $x, $y + $length,
572
-                        $x - $right, $y + $length - $bottom,
573
-                        $x - $right, $y + $top);
574
-        $this->_canvas->polygon($points, $color, null, null, true);
575
-      } else
576
-        $this->_canvas->filled_rectangle($x - $right, $y, $right, $length, $color);
577
-
578
-      break;
579
-
580
-    default:
581
-      return;
568
+        case "right":
569
+          if ( $corner_style === "bevel" ) {
570
+            $points = array($x, $y,
571
+                            $x, $y + $length,
572
+                            $x - $right, $y + $length - $bottom,
573
+                            $x - $right, $y + $top);
574
+            $this->_canvas->polygon($points, $color, null, null, true);
575
+          } else
576
+            $this->_canvas->filled_rectangle($x - $right, $y, $right, $length, $color);
577
+
578
+          break;
579
+
580
+        default:
581
+          return;
582 582
 
583 583
     }
584 584
         
@@ -595,105 +595,105 @@  discard block
 block discarded – undo
595 595
     // inner bottom, inner top.
596 596
     switch ($side) {
597 597
 
598
-    case "top":
599
-      if ( $corner_style === "bevel" ) {
600
-        $left_line_width = $left / 4;
601
-        $right_line_width = $right / 4;
598
+        case "top":
599
+          if ( $corner_style === "bevel" ) {
600
+            $left_line_width = $left / 4;
601
+            $right_line_width = $right / 4;
602 602
         
603
-        $points = array($x, $y,
604
-                        $x + $length, $y,
605
-                        $x + $length - $right_line_width, $y + $line_width,
606
-                        $x + $left_line_width, $y + $line_width,);
607
-        $this->_canvas->polygon($points, $color, null, null, true);
603
+            $points = array($x, $y,
604
+                            $x + $length, $y,
605
+                            $x + $length - $right_line_width, $y + $line_width,
606
+                            $x + $left_line_width, $y + $line_width,);
607
+            $this->_canvas->polygon($points, $color, null, null, true);
608 608
         
609
-        $points = array($x + $left - $left_line_width, $y + $top - $line_width,
610
-                        $x + $length - $right + $right_line_width, $y + $top - $line_width,
611
-                        $x + $length - $right, $y + $top,
612
-                        $x + $left, $y + $top);
613
-        $this->_canvas->polygon($points, $color, null, null, true);
609
+            $points = array($x + $left - $left_line_width, $y + $top - $line_width,
610
+                            $x + $length - $right + $right_line_width, $y + $top - $line_width,
611
+                            $x + $length - $right, $y + $top,
612
+                            $x + $left, $y + $top);
613
+            $this->_canvas->polygon($points, $color, null, null, true);
614 614
 
615
-      } else {
616
-        $this->_canvas->filled_rectangle($x, $y, $length, $line_width, $color);
617
-        $this->_canvas->filled_rectangle($x, $y + $top - $line_width, $length, $line_width, $color);
615
+          } else {
616
+            $this->_canvas->filled_rectangle($x, $y, $length, $line_width, $color);
617
+            $this->_canvas->filled_rectangle($x, $y + $top - $line_width, $length, $line_width, $color);
618 618
 
619
-      }
620
-      break;
619
+          }
620
+          break;
621 621
       
622
-    case "bottom":
623
-      if ( $corner_style === "bevel" ) {
624
-        $left_line_width = $left / 4;
625
-        $right_line_width = $right / 4;
622
+        case "bottom":
623
+          if ( $corner_style === "bevel" ) {
624
+            $left_line_width = $left / 4;
625
+            $right_line_width = $right / 4;
626 626
         
627
-        $points = array($x, $y,
628
-                        $x + $length, $y,
629
-                        $x + $length - $right_line_width, $y - $line_width,
630
-                        $x + $left_line_width, $y - $line_width);
631
-        $this->_canvas->polygon($points, $color, null, null, true);
627
+            $points = array($x, $y,
628
+                            $x + $length, $y,
629
+                            $x + $length - $right_line_width, $y - $line_width,
630
+                            $x + $left_line_width, $y - $line_width);
631
+            $this->_canvas->polygon($points, $color, null, null, true);
632 632
         
633
-        $points = array($x + $left - $left_line_width, $y - $bottom + $line_width,
634
-                        $x + $length - $right + $right_line_width, $y - $bottom + $line_width,
635
-                        $x + $length - $right, $y - $bottom,
636
-                        $x + $left, $y - $bottom);
637
-        $this->_canvas->polygon($points, $color, null, null, true);
633
+            $points = array($x + $left - $left_line_width, $y - $bottom + $line_width,
634
+                            $x + $length - $right + $right_line_width, $y - $bottom + $line_width,
635
+                            $x + $length - $right, $y - $bottom,
636
+                            $x + $left, $y - $bottom);
637
+            $this->_canvas->polygon($points, $color, null, null, true);
638 638
 
639
-      } else {
640
-        $this->_canvas->filled_rectangle($x, $y - $line_width, $length, $line_width, $color);
641
-        $this->_canvas->filled_rectangle($x, $y - $bottom, $length, $line_width, $color);
642
-      }
639
+          } else {
640
+            $this->_canvas->filled_rectangle($x, $y - $line_width, $length, $line_width, $color);
641
+            $this->_canvas->filled_rectangle($x, $y - $bottom, $length, $line_width, $color);
642
+          }
643 643
           
644
-      break;
644
+          break;
645 645
 
646
-    case "left":
647
-      if ( $corner_style === "bevel" ) {
648
-        $top_line_width = $top / 4;
649
-        $bottom_line_width = $bottom / 4;
646
+        case "left":
647
+          if ( $corner_style === "bevel" ) {
648
+            $top_line_width = $top / 4;
649
+            $bottom_line_width = $bottom / 4;
650 650
         
651
-        $points = array($x, $y,
652
-                        $x, $y + $length,
653
-                        $x + $line_width, $y + $length - $bottom_line_width,
654
-                        $x + $line_width, $y + $top_line_width);
655
-        $this->_canvas->polygon($points, $color, null, null, true);
656
-
657
-        $points = array($x + $left - $line_width, $y + $top - $top_line_width,
658
-                        $x + $left - $line_width, $y + $length - $bottom + $bottom_line_width,
659
-                        $x + $left, $y + $length - $bottom,
660
-                        $x + $left, $y + $top);
661
-        $this->_canvas->polygon($points, $color, null, null, true);
651
+            $points = array($x, $y,
652
+                            $x, $y + $length,
653
+                            $x + $line_width, $y + $length - $bottom_line_width,
654
+                            $x + $line_width, $y + $top_line_width);
655
+            $this->_canvas->polygon($points, $color, null, null, true);
656
+
657
+            $points = array($x + $left - $line_width, $y + $top - $top_line_width,
658
+                            $x + $left - $line_width, $y + $length - $bottom + $bottom_line_width,
659
+                            $x + $left, $y + $length - $bottom,
660
+                            $x + $left, $y + $top);
661
+            $this->_canvas->polygon($points, $color, null, null, true);
662 662
 
663
-      } else {
664
-        $this->_canvas->filled_rectangle($x, $y, $line_width, $length, $color);
665
-        $this->_canvas->filled_rectangle($x + $left - $line_width, $y, $line_width, $length, $color);
666
-      }
663
+          } else {
664
+            $this->_canvas->filled_rectangle($x, $y, $line_width, $length, $color);
665
+            $this->_canvas->filled_rectangle($x + $left - $line_width, $y, $line_width, $length, $color);
666
+          }
667 667
       
668
-      break;
668
+          break;
669 669
                       
670
-    case "right":
671
-      if ( $corner_style === "bevel" ) {
672
-        $top_line_width = $top / 4;
673
-        $bottom_line_width = $bottom / 4;
670
+        case "right":
671
+          if ( $corner_style === "bevel" ) {
672
+            $top_line_width = $top / 4;
673
+            $bottom_line_width = $bottom / 4;
674 674
         
675 675
       
676
-        $points = array($x, $y,
677
-                      $x, $y + $length,
678
-                        $x - $line_width, $y + $length - $bottom_line_width,
679
-                        $x - $line_width, $y + $top_line_width);
680
-        $this->_canvas->polygon($points, $color, null, null, true);
676
+            $points = array($x, $y,
677
+                          $x, $y + $length,
678
+                            $x - $line_width, $y + $length - $bottom_line_width,
679
+                            $x - $line_width, $y + $top_line_width);
680
+            $this->_canvas->polygon($points, $color, null, null, true);
681 681
         
682
-        $points = array($x - $right + $line_width, $y + $top - $top_line_width,
683
-                        $x - $right + $line_width, $y + $length - $bottom + $bottom_line_width,
684
-                        $x - $right, $y + $length - $bottom,
685
-                        $x - $right, $y + $top);
686
-        $this->_canvas->polygon($points, $color, null, null, true);
682
+            $points = array($x - $right + $line_width, $y + $top - $top_line_width,
683
+                            $x - $right + $line_width, $y + $length - $bottom + $bottom_line_width,
684
+                            $x - $right, $y + $length - $bottom,
685
+                            $x - $right, $y + $top);
686
+            $this->_canvas->polygon($points, $color, null, null, true);
687 687
 
688
-      } else {
689
-        $this->_canvas->filled_rectangle($x - $line_width, $y, $line_width, $length, $color);
690
-        $this->_canvas->filled_rectangle($x - $right, $y, $line_width, $length, $color);
691
-      }
688
+          } else {
689
+            $this->_canvas->filled_rectangle($x - $line_width, $y, $line_width, $length, $color);
690
+            $this->_canvas->filled_rectangle($x - $right, $y, $line_width, $length, $color);
691
+          }
692 692
       
693
-      break;
693
+          break;
694 694
 
695
-    default:
696
-      return;
695
+        default:
696
+          return;
697 697
 
698 698
     }
699 699
         
@@ -708,32 +708,32 @@  discard block
 block discarded – undo
708 708
 
709 709
     switch ($side) {
710 710
 
711
-    case "top":
712
-      $x += $left / 2;
713
-      $y += $top / 2;
714
-      $length -= $left / 2 + $right / 2;
715
-      break;
716
-
717
-    case "bottom":
718
-      $x += $left / 2;
719
-      $y -= $bottom / 2;
720
-      $length -= $left / 2 + $right / 2;
721
-      break;
722
-
723
-    case "left":
724
-      $x += $left / 2;
725
-      $y += $top / 2;
726
-      $length -= $top / 2 + $bottom / 2;
727
-      break;
728
-
729
-    case "right":
730
-      $x -= $right / 2;
731
-      $y += $top / 2;
732
-      $length -= $top / 2 + $bottom / 2;
733
-      break;
734
-
735
-    default:
736
-      return;
711
+        case "top":
712
+          $x += $left / 2;
713
+          $y += $top / 2;
714
+          $length -= $left / 2 + $right / 2;
715
+          break;
716
+
717
+        case "bottom":
718
+          $x += $left / 2;
719
+          $y -= $bottom / 2;
720
+          $length -= $left / 2 + $right / 2;
721
+          break;
722
+
723
+        case "left":
724
+          $x += $left / 2;
725
+          $y += $top / 2;
726
+          $length -= $top / 2 + $bottom / 2;
727
+          break;
728
+
729
+        case "right":
730
+          $x -= $right / 2;
731
+          $y += $top / 2;
732
+          $length -= $top / 2 + $bottom / 2;
733
+          break;
734
+
735
+        default:
736
+          return;
737 737
 
738 738
     }
739 739
 
@@ -750,32 +750,32 @@  discard block
 block discarded – undo
750 750
 
751 751
     switch ($side) {
752 752
 
753
-    case "top":
754
-      $x += $left / 2;
755
-      $y += $top / 2;
756
-      $length -= $left / 2 + $right / 2;
757
-      break;
758
-
759
-    case "bottom":
760
-      $x += $left / 2;
761
-      $y -= $bottom / 2;
762
-      $length -= $left / 2 + $right / 2;
763
-      break;
764
-
765
-    case "left":
766
-      $x += $left / 2;
767
-      $y += $top / 2;
768
-      $length -= $top / 2 + $bottom / 2;
769
-      break;
770
-
771
-    case "right":
772
-      $x -= $right / 2;
773
-      $y += $top / 2;
774
-      $length -= $top / 2 + $bottom / 2;
775
-      break;
776
-
777
-    default:
778
-      return;
753
+        case "top":
754
+          $x += $left / 2;
755
+          $y += $top / 2;
756
+          $length -= $left / 2 + $right / 2;
757
+          break;
758
+
759
+        case "bottom":
760
+          $x += $left / 2;
761
+          $y -= $bottom / 2;
762
+          $length -= $left / 2 + $right / 2;
763
+          break;
764
+
765
+        case "left":
766
+          $x += $left / 2;
767
+          $y += $top / 2;
768
+          $length -= $top / 2 + $bottom / 2;
769
+          break;
770
+
771
+        case "right":
772
+          $x -= $right / 2;
773
+          $y += $top / 2;
774
+          $length -= $top / 2 + $bottom / 2;
775
+          break;
776
+
777
+        default:
778
+          return;
779 779
 
780 780
     }
781 781
 
@@ -802,20 +802,20 @@  discard block
 block discarded – undo
802 802
     
803 803
     switch ($side) {
804 804
 
805
-    case "top":
806
-    case "left":
807
-      $shade = array_map(array($this, "_shade"), $color);
808
-      $this->_border_solid($x, $y, $length, $shade, $widths, $side);
809
-      break;
805
+        case "top":
806
+        case "left":
807
+          $shade = array_map(array($this, "_shade"), $color);
808
+          $this->_border_solid($x, $y, $length, $shade, $widths, $side);
809
+          break;
810 810
 
811
-    case "bottom":
812
-    case "right":
813
-      $tint = array_map(array($this, "_tint"), $color);
814
-      $this->_border_solid($x, $y, $length, $tint, $widths, $side);
815
-      break;
811
+        case "bottom":
812
+        case "right":
813
+          $tint = array_map(array($this, "_tint"), $color);
814
+          $this->_border_solid($x, $y, $length, $tint, $widths, $side);
815
+          break;
816 816
 
817
-    default:
818
-      return;
817
+        default:
818
+          return;
819 819
     }
820 820
   }
821 821
   
@@ -823,20 +823,20 @@  discard block
 block discarded – undo
823 823
     list($top, $right, $bottom, $left) = $widths;
824 824
     
825 825
     switch ($side) {
826
-    case "top":
827
-    case "left":
828
-      $tint = array_map(array($this, "_tint"), $color);
829
-      $this->_border_solid($x, $y, $length, $tint, $widths, $side);
830
-      break;
831
-
832
-    case "bottom":
833
-    case "right":
834
-      $shade = array_map(array($this, "_shade"), $color);
835
-      $this->_border_solid($x, $y, $length, $shade, $widths, $side);
836
-      break;
837
-
838
-    default:
839
-      return;
826
+        case "top":
827
+        case "left":
828
+          $tint = array_map(array($this, "_tint"), $color);
829
+          $this->_border_solid($x, $y, $length, $tint, $widths, $side);
830
+          break;
831
+
832
+        case "bottom":
833
+        case "right":
834
+          $shade = array_map(array($this, "_shade"), $color);
835
+          $this->_border_solid($x, $y, $length, $shade, $widths, $side);
836
+          break;
837
+
838
+        default:
839
+          return;
840 840
 
841 841
     }
842 842
   }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/block_renderer.cls.php 1 patch
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -86,25 +86,25 @@
 block discarded – undo
86 86
 
87 87
 
88 88
       switch($side) {
89
-      case "top":
90
-        $length = $w;
91
-        break;
92
-
93
-      case "bottom":
94
-        $length = $w;
95
-        $y += $h;
96
-        break;
97
-
98
-      case "left":
99
-        $length = $h;
100
-        break;
101
-
102
-      case "right":
103
-        $length = $h;
104
-        $x += $w;
105
-        break;
106
-      default:
107
-        break;
89
+          case "top":
90
+            $length = $w;
91
+            break;
92
+
93
+          case "bottom":
94
+            $length = $w;
95
+            $y += $h;
96
+            break;
97
+
98
+          case "left":
99
+            $length = $h;
100
+            break;
101
+
102
+          case "right":
103
+            $length = $h;
104
+            $x += $w;
105
+            break;
106
+          default:
107
+            break;
108 108
       }
109 109
       $method = "_border_" . $props["style"];
110 110
 
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/renderer.cls.php 1 patch
Switch Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -88,58 +88,58 @@  discard block
 block discarded – undo
88 88
     
89 89
     switch ($display) {
90 90
       
91
-    case "block":
92
-    case "list-item":
93
-    case "inline-block":
94
-    case "table":
95
-    case "table-row-group":
96
-    case "table-header-group":
97
-    case "table-footer-group":
98
-    case "inline-table":
99
-      $this->_render_frame("block", $frame);
100
-      break;
101
-
102
-    case "inline":
103
-      if ( $frame->get_node()->nodeName === "#text" )
104
-        $this->_render_frame("text", $frame);
105
-      else
106
-        $this->_render_frame("inline", $frame);
107
-      break;
108
-
109
-    case "table-cell":
110
-      $this->_render_frame("table-cell", $frame);
111
-      break;
112
-
113
-    case "-dompdf-list-bullet":
114
-      $this->_render_frame("list-bullet", $frame);
115
-      break;
116
-
117
-    case "-dompdf-image":
118
-      $this->_render_frame("image", $frame);
119
-      break;
91
+        case "block":
92
+        case "list-item":
93
+        case "inline-block":
94
+        case "table":
95
+        case "table-row-group":
96
+        case "table-header-group":
97
+        case "table-footer-group":
98
+        case "inline-table":
99
+          $this->_render_frame("block", $frame);
100
+          break;
101
+
102
+        case "inline":
103
+          if ( $frame->get_node()->nodeName === "#text" )
104
+            $this->_render_frame("text", $frame);
105
+          else
106
+            $this->_render_frame("inline", $frame);
107
+          break;
108
+
109
+        case "table-cell":
110
+          $this->_render_frame("table-cell", $frame);
111
+          break;
112
+
113
+        case "-dompdf-list-bullet":
114
+          $this->_render_frame("list-bullet", $frame);
115
+          break;
116
+
117
+        case "-dompdf-image":
118
+          $this->_render_frame("image", $frame);
119
+          break;
120 120
       
121
-    case "none":
122
-      $node = $frame->get_node();
121
+        case "none":
122
+          $node = $frame->get_node();
123 123
           
124
-      if ( $node->nodeName === "script" ) {
125
-        if ( $node->getAttribute("type") === "text/php" ||
126
-             $node->getAttribute("language") === "php" ) {
127
-          // Evaluate embedded php scripts
128
-          $this->_render_frame("php", $frame);
129
-        }
124
+          if ( $node->nodeName === "script" ) {
125
+            if ( $node->getAttribute("type") === "text/php" ||
126
+                 $node->getAttribute("language") === "php" ) {
127
+              // Evaluate embedded php scripts
128
+              $this->_render_frame("php", $frame);
129
+            }
130 130
         
131
-        elseif ( $node->getAttribute("type") === "text/javascript" ||
132
-             $node->getAttribute("language") === "javascript" ) {
133
-          // Insert JavaScript
134
-          $this->_render_frame("javascript", $frame);
135
-        }
136
-      }
131
+            elseif ( $node->getAttribute("type") === "text/javascript" ||
132
+                 $node->getAttribute("language") === "javascript" ) {
133
+              // Insert JavaScript
134
+              $this->_render_frame("javascript", $frame);
135
+            }
136
+          }
137 137
 
138
-      // Don't render children, so skip to next iter
139
-      return;
138
+          // Don't render children, so skip to next iter
139
+          return;
140 140
       
141
-    default:
142
-      break;
141
+        default:
142
+          break;
143 143
 
144 144
     }
145 145
 
@@ -195,37 +195,37 @@  discard block
 block discarded – undo
195 195
     if ( !isset($this->_renderers[$type]) ) {
196 196
       
197 197
       switch ($type) {
198
-      case "block":
199
-        $this->_renderers["block"] = new Block_Renderer($this->_dompdf);
200
-        break;
198
+          case "block":
199
+            $this->_renderers["block"] = new Block_Renderer($this->_dompdf);
200
+            break;
201 201
 
202
-      case "inline":
203
-        $this->_renderers["inline"] = new Inline_Renderer($this->_dompdf);
204
-        break;
202
+          case "inline":
203
+            $this->_renderers["inline"] = new Inline_Renderer($this->_dompdf);
204
+            break;
205 205
 
206
-      case "text":
207
-        $this->_renderers["text"] = new Text_Renderer($this->_dompdf);
208
-        break;
206
+          case "text":
207
+            $this->_renderers["text"] = new Text_Renderer($this->_dompdf);
208
+            break;
209 209
 
210
-      case "image":
211
-        $this->_renderers["image"] = new Image_Renderer($this->_dompdf);
212
-        break;
210
+          case "image":
211
+            $this->_renderers["image"] = new Image_Renderer($this->_dompdf);
212
+            break;
213 213
       
214
-      case "table-cell":
215
-        $this->_renderers["table-cell"] = new Table_Cell_Renderer($this->_dompdf);
216
-        break;
214
+          case "table-cell":
215
+            $this->_renderers["table-cell"] = new Table_Cell_Renderer($this->_dompdf);
216
+            break;
217 217
 
218
-      case "list-bullet":
219
-        $this->_renderers["list-bullet"] = new List_Bullet_Renderer($this->_dompdf);
220
-        break;
218
+          case "list-bullet":
219
+            $this->_renderers["list-bullet"] = new List_Bullet_Renderer($this->_dompdf);
220
+            break;
221 221
 
222
-      case "php":
223
-        $this->_renderers["php"] = new PHP_Evaluator($this->_canvas);
224
-        break;
222
+          case "php":
223
+            $this->_renderers["php"] = new PHP_Evaluator($this->_canvas);
224
+            break;
225 225
 
226
-      case "javascript":
227
-        $this->_renderers["javascript"] = new Javascript_Embedder($this->_dompdf);
228
-        break;
226
+          case "javascript":
227
+            $this->_renderers["javascript"] = new Javascript_Embedder($this->_dompdf);
228
+            break;
229 229
         
230 230
       }
231 231
     }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/frame_factory.cls.php 1 patch
Switch Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -65,100 +65,100 @@
 block discarded – undo
65 65
       throw new Exception("foo");
66 66
     switch ($frame->get_style()->display) {
67 67
       
68
-    case "block":
69
-      $positioner = "Block";        
70
-      $decorator = "Block";
71
-      $reflower = "Block";
72
-      break;
68
+        case "block":
69
+          $positioner = "Block";        
70
+          $decorator = "Block";
71
+          $reflower = "Block";
72
+          break;
73 73
     
74
-    case "inline-block":
75
-      $positioner = "Inline";
76
-      $decorator = "Block";
77
-      $reflower = "Block";
78
-      break;
79
-
80
-    case "inline":
81
-      $positioner = "Inline";
82
-      if ( $frame->get_node()->nodeName === "#text" ) {
83
-        $decorator = "Text";
84
-        $reflower = "Text";
85
-      } else {
86
-        $decorator = "Inline";
87
-        $reflower = "Inline";
88
-      }
89
-      break;   
90
-
91
-    case "table":
92
-      $positioner = "Block";
93
-      $decorator = "Table";
94
-      $reflower = "Table";
95
-      break;
74
+        case "inline-block":
75
+          $positioner = "Inline";
76
+          $decorator = "Block";
77
+          $reflower = "Block";
78
+          break;
79
+
80
+        case "inline":
81
+          $positioner = "Inline";
82
+          if ( $frame->get_node()->nodeName === "#text" ) {
83
+            $decorator = "Text";
84
+            $reflower = "Text";
85
+          } else {
86
+            $decorator = "Inline";
87
+            $reflower = "Inline";
88
+          }
89
+          break;   
90
+
91
+        case "table":
92
+          $positioner = "Block";
93
+          $decorator = "Table";
94
+          $reflower = "Table";
95
+          break;
96 96
       
97
-    case "inline-table":
98
-      $positioner = "Inline";
99
-      $decorator = "Table";
100
-      $reflower = "Table";
101
-      break;
102
-
103
-    case "table-row-group":
104
-    case "table-header-group":
105
-    case "table-footer-group":
106
-      $positioner = "Null";
107
-      $decorator = "Table_Row_Group";
108
-      $reflower = "Table_Row_Group";
109
-      break;
97
+        case "inline-table":
98
+          $positioner = "Inline";
99
+          $decorator = "Table";
100
+          $reflower = "Table";
101
+          break;
102
+
103
+        case "table-row-group":
104
+        case "table-header-group":
105
+        case "table-footer-group":
106
+          $positioner = "Null";
107
+          $decorator = "Table_Row_Group";
108
+          $reflower = "Table_Row_Group";
109
+          break;
110 110
       
111
-    case "table-row":
112
-      $positioner = "Null";
113
-      $decorator = "Table_Row";
114
-      $reflower = "Table_Row";
115
-      break;
116
-
117
-    case "table-cell":
118
-      $positioner = "Table_Cell";
119
-      $decorator = "Table_Cell";
120
-      $reflower = "Table_Cell";
121
-      break;
111
+        case "table-row":
112
+          $positioner = "Null";
113
+          $decorator = "Table_Row";
114
+          $reflower = "Table_Row";
115
+          break;
116
+
117
+        case "table-cell":
118
+          $positioner = "Table_Cell";
119
+          $decorator = "Table_Cell";
120
+          $reflower = "Table_Cell";
121
+          break;
122 122
         
123
-    case "list-item":
124
-      $positioner = "Block";
125
-      $decorator  = "Block";
126
-      $reflower   = "Block";
127
-      break;
128
-
129
-    case "-dompdf-list-bullet":
130
-      if ( $frame->get_style()->list_style_position === "inside" )
131
-        $positioner = "Inline";
132
-      else        
133
-        $positioner = "List_Bullet";
134
-
135
-      if ( $frame->get_style()->list_style_image !== "none" )
136
-        $decorator = "List_Bullet_Image";
137
-      else
138
-        $decorator = "List_Bullet";
123
+        case "list-item":
124
+          $positioner = "Block";
125
+          $decorator  = "Block";
126
+          $reflower   = "Block";
127
+          break;
128
+
129
+        case "-dompdf-list-bullet":
130
+          if ( $frame->get_style()->list_style_position === "inside" )
131
+            $positioner = "Inline";
132
+          else        
133
+            $positioner = "List_Bullet";
134
+
135
+          if ( $frame->get_style()->list_style_image !== "none" )
136
+            $decorator = "List_Bullet_Image";
137
+          else
138
+            $decorator = "List_Bullet";
139 139
       
140
-      $reflower = "List_Bullet";
141
-      break;
142
-
143
-    case "-dompdf-image":
144
-      $positioner = "Inline";
145
-      $decorator = "Image";
146
-      $reflower = "Image";
147
-      break;
140
+          $reflower = "List_Bullet";
141
+          break;
142
+
143
+        case "-dompdf-image":
144
+          $positioner = "Inline";
145
+          $decorator = "Image";
146
+          $reflower = "Image";
147
+          break;
148 148
       
149
-    case "-dompdf-br":
150
-      $positioner = "Inline";
151
-      $decorator = "Inline";
152
-      $reflower = "Inline";
153
-      break;
154
-
155
-    default:
156
-      // FIXME: should throw some sort of warning or something?
157
-    case "none":
158
-      $positioner = "Null";
159
-      $decorator = "Null";
160
-      $reflower = "Null";
161
-      break;
149
+        case "-dompdf-br":
150
+          $positioner = "Inline";
151
+          $decorator = "Inline";
152
+          $reflower = "Inline";
153
+          break;
154
+
155
+        default:
156
+          // FIXME: should throw some sort of warning or something?
157
+        case "none":
158
+          $positioner = "Null";
159
+          $decorator = "Null";
160
+          $reflower = "Null";
161
+          break;
162 162
 
163 163
     }
164 164
 
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/text_renderer.cls.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -132,20 +132,20 @@
 block discarded – undo
132 132
 
133 133
       switch ($text_deco) {
134 134
 
135
-      default:
136
-        continue;
135
+          default:
136
+            continue;
137 137
 
138
-      case "underline":
139
-        $deco_y += $base - $descent+ $size * (self::UNDERLINE_OFFSET - self::DECO_THICKNESS/2);
140
-        break;
138
+          case "underline":
139
+            $deco_y += $base - $descent+ $size * (self::UNDERLINE_OFFSET - self::DECO_THICKNESS/2);
140
+            break;
141 141
 
142
-      case "overline":
143
-        $deco_y += $size * (self::OVERLINE_OFFSET + self::DECO_THICKNESS/2);
144
-        break;
142
+          case "overline":
143
+            $deco_y += $size * (self::OVERLINE_OFFSET + self::DECO_THICKNESS/2);
144
+            break;
145 145
 
146
-      case "line-through":
147
-        $deco_y += $base * 0.7 + $size * self::LINETHROUGH_OFFSET;
148
-        break;
146
+          case "line-through":
147
+            $deco_y += $base * 0.7 + $size * self::LINETHROUGH_OFFSET;
148
+            break;
149 149
 
150 150
       }
151 151
 
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/cpdf_adapter.cls.php 1 patch
Switch Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -595,56 +595,56 @@  discard block
 block discarded – undo
595 595
     $img_type = mb_strtolower($img_type);
596 596
 
597 597
     switch ($img_type) {
598
-    case "jpeg":
599
-    case "jpg":
600
-      //debugpng
601
-      if (DEBUGPNG)  print '!!!jpg!!!';
598
+        case "jpeg":
599
+        case "jpg":
600
+          //debugpng
601
+          if (DEBUGPNG)  print '!!!jpg!!!';
602 602
 
603
-      $this->_pdf->addJpegFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
604
-      break;
603
+          $this->_pdf->addJpegFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
604
+          break;
605 605
 
606
-    case "png":
607
-      //debugpng
608
-      if (DEBUGPNG)  print '!!!png!!!';
609
-
610
-      $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
611
-      break;
612
-
613
-    case "gif":
614
-      // Convert gifs to pngs
615
-      //DEBUG_IMG_TEMP
616
-      //if (0) {
617
-      if ( method_exists( $this->_pdf, "addImagePng" ) ) {
618
-        //debugpng
619
-        if (DEBUGPNG)  print '!!!gif addImagePng!!!';
620
-
621
-      	//If optimization to direct png creation from gd object is available,
622
-        //don't create temp file, but place gd object directly into the pdf
623
-	    if ( method_exists( $this->_pdf, "image_iscached" ) &&
624
-	         $this->_pdf->image_iscached($img_url) ) {
625
-	      //If same image has occured already before, no need to load because
626
-	      //duplicate will anyway be eliminated.
627
-	      $img = null;
628
-	    } else {
629
-    	  $img = @imagecreatefromgif($img_url);
630
-    	  if (!$img) {
631
-      	    return;
632
-    	  }
633
-    	  imageinterlace($img, 0);
634
-    	}
635
-    	$this->_pdf->addImagePng($img_url, $x, $this->y($y) - $h, $w, $h, $img);
636
-      } else {
637
-        //debugpng
638
-        if (DEBUGPNG)  print '!!!gif addPngFromFile!!!';
639
-        $img_url = $this->_convert_gif_to_png($img_url);
640
-        $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
641
-      }
642
-      break;
606
+        case "png":
607
+          //debugpng
608
+          if (DEBUGPNG)  print '!!!png!!!';
643 609
 
644
-    default:
645
-      //debugpng
646
-      if (DEBUGPNG) print '!!!unknown!!!';
647
-      break;
610
+          $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
611
+          break;
612
+
613
+        case "gif":
614
+          // Convert gifs to pngs
615
+          //DEBUG_IMG_TEMP
616
+          //if (0) {
617
+          if ( method_exists( $this->_pdf, "addImagePng" ) ) {
618
+            //debugpng
619
+            if (DEBUGPNG)  print '!!!gif addImagePng!!!';
620
+
621
+      	    //If optimization to direct png creation from gd object is available,
622
+            //don't create temp file, but place gd object directly into the pdf
623
+	        if ( method_exists( $this->_pdf, "image_iscached" ) &&
624
+	             $this->_pdf->image_iscached($img_url) ) {
625
+	          //If same image has occured already before, no need to load because
626
+	          //duplicate will anyway be eliminated.
627
+	          $img = null;
628
+	        } else {
629
+    	      $img = @imagecreatefromgif($img_url);
630
+    	      if (!$img) {
631
+      	        return;
632
+    	      }
633
+    	      imageinterlace($img, 0);
634
+    	    }
635
+    	    $this->_pdf->addImagePng($img_url, $x, $this->y($y) - $h, $w, $h, $img);
636
+          } else {
637
+            //debugpng
638
+            if (DEBUGPNG)  print '!!!gif addPngFromFile!!!';
639
+            $img_url = $this->_convert_gif_to_png($img_url);
640
+            $this->_pdf->addPngFromFile($img_url, $x, $this->y($y) - $h, $w, $h);
641
+          }
642
+          break;
643
+
644
+        default:
645
+          //debugpng
646
+          if (DEBUGPNG) print '!!!unknown!!!';
647
+          break;
648 648
     }
649 649
     
650 650
     return;
@@ -833,18 +833,18 @@  discard block
 block discarded – undo
833 833
 
834 834
         switch ($_t) {
835 835
             
836
-        case "text":
837
-        $text = str_replace(array("{PAGE_NUM}","{PAGE_COUNT}"),
838
-                            array($page_number, $this->_page_count), $text);
839
-        $this->text($x, $y, $text, $font, $size, $color, $adjust, $angle);
840
-          break;
836
+            case "text":
837
+            $text = str_replace(array("{PAGE_NUM}","{PAGE_COUNT}"),
838
+                                array($page_number, $this->_page_count), $text);
839
+            $this->text($x, $y, $text, $font, $size, $color, $adjust, $angle);
840
+              break;
841 841
           
842
-        case "script":
843
-          if (!$eval) {
844
-            $eval = new PHP_Evaluator($this);
845
-          }
846
-          $eval->evaluate($code, array('PAGE_NUM' => $page_number, 'PAGE_COUNT' => $this->_page_count));
847
-          break;
842
+            case "script":
843
+              if (!$eval) {
844
+                $eval = new PHP_Evaluator($this);
845
+              }
846
+              $eval->evaluate($code, array('PAGE_NUM' => $page_number, 'PAGE_COUNT' => $this->_page_count));
847
+              break;
848 848
         }
849 849
       }
850 850
 
Please login to merge, or discard this patch.