|
29 | 29 | /**
|
30 | 30 | * Class PHPWord_Writer_Word2007_Base
|
31 | 31 | */
|
32 |
| -class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart { |
| 32 | +class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart |
| 33 | +{ |
33 | 34 |
|
34 |
| - protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Text $text, $withoutP = false) { |
| 35 | + /** |
| 36 | + * Write text |
| 37 | + */ |
| 38 | + protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Text $text, $withoutP = false) |
| 39 | + { |
35 | 40 | $styleFont = $text->getFontStyle();
|
36 | 41 |
|
37 | 42 | $SfIsObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false;
|
@@ -80,7 +85,11 @@ protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWor
|
80 | 85 | }
|
81 | 86 | }
|
82 | 87 |
|
83 |
| - protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun) { |
| 88 | + /** |
| 89 | + * Write text run |
| 90 | + */ |
| 91 | + protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun) |
| 92 | + { |
84 | 93 | $elements = $textrun->getElements();
|
85 | 94 | $styleParagraph = $textrun->getParagraphStyle();
|
86 | 95 |
|
@@ -221,7 +230,11 @@ protected function _writeParagraphStyle(
|
221 | 230 | }
|
222 | 231 | }
|
223 | 232 |
|
224 |
| - protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Link $link, $withoutP = false) { |
| 233 | + /** |
| 234 | + * Write link |
| 235 | + */ |
| 236 | + protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Link $link, $withoutP = false) |
| 237 | + { |
225 | 238 | $rID = $link->getRelationId();
|
226 | 239 | $linkName = $link->getLinkName();
|
227 | 240 | if (is_null($linkName)) {
|
@@ -276,7 +289,11 @@ protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWor
|
276 | 289 | }
|
277 | 290 | }
|
278 | 291 |
|
279 |
| - protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footer_PreserveText $textrun) { |
| 292 | + /** |
| 293 | + * Write preserve text |
| 294 | + */ |
| 295 | + protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footer_PreserveText $textrun) |
| 296 | + { |
280 | 297 | $styleFont = $textrun->getFontStyle();
|
281 | 298 | $styleParagraph = $textrun->getParagraphStyle();
|
282 | 299 |
|
@@ -367,7 +384,11 @@ protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null
|
367 | 384 | $objWriter->endElement(); // p
|
368 | 385 | }
|
369 | 386 |
|
370 |
| - protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Font $style) { |
| 387 | + /** |
| 388 | + * Write text style |
| 389 | + */ |
| 390 | + protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Font $style) |
| 391 | + { |
371 | 392 | $font = $style->getName();
|
372 | 393 | $bold = $style->getBold();
|
373 | 394 | $italic = $style->getItalic();
|
@@ -454,11 +475,19 @@ protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, P
|
454 | 475 | $objWriter->endElement();
|
455 | 476 | }
|
456 | 477 |
|
457 |
| - protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) { |
| 478 | + /** |
| 479 | + * Write text break |
| 480 | + */ |
| 481 | + protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) |
| 482 | + { |
458 | 483 | $objWriter->writeElement('w:p', null);
|
459 | 484 | }
|
460 | 485 |
|
461 |
| - protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Table $table) { |
| 486 | + /** |
| 487 | + * Write table |
| 488 | + */ |
| 489 | + protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Table $table) |
| 490 | + { |
462 | 491 | $_rows = $table->getRows();
|
463 | 492 | $_cRows = count($_rows);
|
464 | 493 |
|
@@ -566,7 +595,11 @@ protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo
|
566 | 595 | }
|
567 | 596 | }
|
568 | 597 |
|
569 |
| - protected function _writeTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Table $style = null) { |
| 598 | + /** |
| 599 | + * Write table style |
| 600 | + */ |
| 601 | + protected function _writeTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Table $style = null) |
| 602 | + { |
570 | 603 | $margins = $style->getCellMargin();
|
571 | 604 | $mTop = (!is_null($margins[0])) ? true : false;
|
572 | 605 | $mLeft = (!is_null($margins[1])) ? true : false;
|
@@ -610,7 +643,11 @@ protected function _writeTableStyle(PHPWord_Shared_XMLWriter $objWriter = null,
|
610 | 643 | }
|
611 | 644 | }
|
612 | 645 |
|
613 |
| - protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Cell $style = null) { |
| 646 | + /** |
| 647 | + * Write cell style |
| 648 | + */ |
| 649 | + protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Cell $style = null) |
| 650 | + { |
614 | 651 | $bgColor = $style->getBgColor();
|
615 | 652 | $valign = $style->getVAlign();
|
616 | 653 | $textDir = $style->getTextDirection();
|
@@ -716,7 +753,8 @@ protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, P
|
716 | 753 | * @param \PHPWord_Shared_XMLWriter $objWriter
|
717 | 754 | * @param \PHPWord_Section_Image $image
|
718 | 755 | */
|
719 |
| - protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Image $image, $withoutP = false) { |
| 756 | + protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Image $image, $withoutP = false) |
| 757 | + { |
720 | 758 | $rId = $image->getRelationId();
|
721 | 759 |
|
722 | 760 | $style = $image->getStyle();
|
@@ -792,7 +830,11 @@ protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo
|
792 | 830 | }
|
793 | 831 | }
|
794 | 832 |
|
795 |
| - protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image) { |
| 833 | + /** |
| 834 | + * Write watermark |
| 835 | + */ |
| 836 | + protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image) |
| 837 | + { |
796 | 838 | $rId = $image->getRelationId();
|
797 | 839 |
|
798 | 840 | $style = $image->getStyle();
|
@@ -835,7 +877,11 @@ protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $
|
835 | 877 | $objWriter->endElement();
|
836 | 878 | }
|
837 | 879 |
|
838 |
| - protected function _writeTitle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Title $title) { |
| 880 | + /** |
| 881 | + * Write title |
| 882 | + */ |
| 883 | + protected function _writeTitle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Title $title) |
| 884 | + { |
839 | 885 | $text = htmlspecialchars($title->getText());
|
840 | 886 | $text = PHPWord_Shared_String::ControlCharacterPHP2OOXML($text);
|
841 | 887 | $anchor = $title->getAnchor();
|
@@ -876,6 +922,9 @@ protected function _writeTitle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo
|
876 | 922 | $objWriter->endElement();
|
877 | 923 | }
|
878 | 924 |
|
| 925 | + /** |
| 926 | + * Write footnote |
| 927 | + */ |
879 | 928 | protected function _writeFootnote(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footnote $footnote)
|
880 | 929 | {
|
881 | 930 | $objWriter->startElement('w:footnote');
|
@@ -911,6 +960,9 @@ protected function _writeFootnote(PHPWord_Shared_XMLWriter $objWriter = null, PH
|
911 | 960 | $objWriter->endElement(); // w:footnote
|
912 | 961 | }
|
913 | 962 |
|
| 963 | + /** |
| 964 | + * Write footnote reference |
| 965 | + */ |
914 | 966 | protected function _writeFootnoteReference(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footnote $footnote, $withoutP = false)
|
915 | 967 | {
|
916 | 968 | if (!$withoutP) {
|
|
0 commit comments