Word2007 : Add rowspan and colspan to cells

This commit is contained in:
Progi1984 2013-12-15 13:42:36 +01:00
parent 0d19d57cba
commit a610c34a18
3 changed files with 45 additions and 4 deletions

View File

@ -121,7 +121,20 @@ class PHPWord_Style_Cell {
* @var string * @var string
*/ */
private $_defaultBorderColor; private $_defaultBorderColor;
/**
* colspan
*
* @var integer
*/
private $_gridSpan = NULL;
/**
* rowspan
*
* @var integer
*/
private $_vMerge = NULL;
/** /**
* Create a new Cell Style * Create a new Cell Style
@ -233,7 +246,6 @@ class PHPWord_Style_Cell {
return $this->_borderTopColor; return $this->_borderTopColor;
} }
public function setBorderLeftSize($pValue = null) { public function setBorderLeftSize($pValue = null) {
$this->_borderLeftSize = $pValue; $this->_borderLeftSize = $pValue;
} }
@ -249,8 +261,7 @@ class PHPWord_Style_Cell {
public function getBorderLeftColor() { public function getBorderLeftColor() {
return $this->_borderLeftColor; return $this->_borderLeftColor;
} }
public function setBorderRightSize($pValue = null) { public function setBorderRightSize($pValue = null) {
$this->_borderRightSize = $pValue; $this->_borderRightSize = $pValue;
} }
@ -287,5 +298,21 @@ class PHPWord_Style_Cell {
public function getDefaultBorderColor() { public function getDefaultBorderColor() {
return $this->_defaultBorderColor; return $this->_defaultBorderColor;
} }
public function setGridSpan($pValue = null) {
$this->_gridSpan = $pValue;
}
public function getGridSpan() {
return $this->_gridSpan;
}
public function setVMerge($pValue = null) {
$this->_vMerge = $pValue;
}
public function getVMerge() {
return $this->_vMerge;
}
} }
?> ?>

View File

@ -586,6 +586,19 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->endElement(); $objWriter->endElement();
} }
} }
$gridSpan = $style->getGridSpan();
if(!is_null($gridSpan)) {
$objWriter->startElement('w:gridSpan');
$objWriter->writeAttribute('w:val', $gridSpan);
$objWriter->endElement();
}
$vMerge = $style->getVMerge();
if(!is_null($vMerge)) {
$objWriter->startElement('w:vMerge');
$objWriter->writeAttribute('w:val', $vMerge);
$objWriter->endElement();
}
} }
protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, $image) { protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, $image) {

View File

@ -26,6 +26,7 @@ Fixed in branch for release 0.7 :
- Bugfix: (RomanSyroeshko) GH-34 - PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input - Bugfix: (RomanSyroeshko) GH-34 - PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input
- Feature: (Progi1984) GH-1 - Implement RTF Writer - Feature: (Progi1984) GH-1 - Implement RTF Writer
- Feature: (Progi1984) GH-2 - Implement ODT Writer - Feature: (Progi1984) GH-2 - Implement ODT Writer
- Feature: (kaystrobach) - Word2007 : Add rowspan and colspan to cells
- General: (MarkBaker) - Add superscript/subscript styling in Excel2007 Writer - General: (MarkBaker) - Add superscript/subscript styling in Excel2007 Writer
- General: (deds) - add indentation support to paragraphs - General: (deds) - add indentation support to paragraphs
- General: (Progi1984) GH-27 - Support for Composer - General: (Progi1984) GH-27 - Support for Composer