Writers refactoring fixes

This commit is contained in:
Ivan Lanin 2014-05-10 14:45:51 +07:00
parent 0b13b22e07
commit 530f8ee357
7 changed files with 6 additions and 15 deletions

View File

@ -17,7 +17,6 @@
namespace PhpOffice\PhpWord\Writer;
use PhpOffice\PhpWord\Element\AbstractElement;
use PhpOffice\PhpWord\Exception\Exception;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Style\Font;

View File

@ -17,11 +17,6 @@
namespace PhpOffice\PhpWord\Writer\HTML\Element;
use PhpOffice\PhpWord\Element\Footnote as FootnoteElement;
use PhpOffice\PhpWord\Element\TextRun as TextRunElement;
use PhpOffice\PhpWord\Style\Paragraph;
use PhpOffice\PhpWord\Writer\HTML\Style\Paragraph as ParagraphStyleWriter;
/**
* TextRun element HTML writer
*

View File

@ -31,11 +31,11 @@ class Generic extends AbstractStyle
*/
public function write()
{
$this->style = $this->getStyle();
$style = $this->getStyle();
$css = array();
if (is_array($this->style) && !empty($this->style)) {
$css = $this->style;
if (is_array($style) && !empty($style)) {
$css = $style;
}
return $this->assembleCss($css);

View File

@ -31,11 +31,11 @@ class Image extends AbstractStyle
*/
public function write()
{
$this->style = $this->getStyle();
$style = $this->getStyle();
$css = array();
$css['width'] = $this->getValueIf($this->style->getWidth(), $this->style->getWidth() . 'px');
$css['height'] = $this->getValueIf($this->style->getHeight(), $this->style->getHeight() . 'px');
$css['width'] = $this->getValueIf($style->getWidth(), $style->getWidth() . 'px');
$css['height'] = $this->getValueIf($style->getHeight(), $style->getHeight() . 'px');
return $this->assembleCss($css);
}

View File

@ -19,7 +19,6 @@ namespace PhpOffice\PhpWord\Writer\RTF\Element;
use PhpOffice\PhpWord\Style;
use PhpOffice\PhpWord\Style\Font as FontStyle;
use PhpOffice\PhpWord\Style\Paragraph as ParagraphStyle;
use PhpOffice\PhpWord\Writer\RTF\Style\Font as FontStyleWriter;
use PhpOffice\PhpWord\Writer\RTF\Style\Paragraph as ParagraphStyleWriter;

View File

@ -17,7 +17,6 @@
namespace PhpOffice\PhpWord\Writer\Word2007\Style;
use PhpOffice\PhpWord\Exception\Exception;
use PhpOffice\PhpWord\Settings;
use PhpOffice\PhpWord\Shared\XMLWriter;

View File

@ -17,7 +17,6 @@
namespace PhpOffice\PhpWord\Writer\Word2007\Style;
use PhpOffice\PhpWord\Shared\XMLWriter;
use PhpOffice\PhpWord\Style\TextBox as TextBoxStyle;
/**