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

@ -122,6 +122,19 @@ class PHPWord_Style_Cell {
*/
private $_defaultBorderColor;
/**
* colspan
*
* @var integer
*/
private $_gridSpan = NULL;
/**
* rowspan
*
* @var integer
*/
private $_vMerge = NULL;
/**
* Create a new Cell Style
@ -233,7 +246,6 @@ class PHPWord_Style_Cell {
return $this->_borderTopColor;
}
public function setBorderLeftSize($pValue = null) {
$this->_borderLeftSize = $pValue;
}
@ -250,7 +262,6 @@ class PHPWord_Style_Cell {
return $this->_borderLeftColor;
}
public function setBorderRightSize($pValue = null) {
$this->_borderRightSize = $pValue;
}
@ -287,5 +298,21 @@ class PHPWord_Style_Cell {
public function getDefaultBorderColor() {
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();
}
}
$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) {

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
- Feature: (Progi1984) GH-1 - Implement RTF 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: (deds) - add indentation support to paragraphs
- General: (Progi1984) GH-27 - Support for Composer