-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature for columns in section, continuous section break, softbreak, hanging paragraph, and normal style #48
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
891798b
Unix format
ivanlanin 3037fbf
Read README.md
ivanlanin 3fa49ee
section breakType
ivanlanin 0edaaaa
Tidy up for pull request
ivanlanin 72e8f3f
Fix comment error
ivanlanin d3e8b69
Remove (int) since there's a possibility for fraction
ivanlanin d55db9d
Patch branch
ivanlanin 4d94d57
(1) new width property for table; (2) allow table cell width to be null
ivanlanin 194940d
Width: dxa > pct
ivanlanin b0a2470
`Table Row` allows `tblHeader` and `cantSplit`
ivanlanin eb6b44e
Use constant instead of hardcoded 'Arial' name.
ivanlanin a915e05
Merge remote-tracking branch 'upstream/master'
ivanlanin ab2b2de
Change default font to Times New Roman 12pt
ivanlanin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<?php | ||
/** | ||
* PHPWord | ||
* | ||
* Copyright (c) 2013 PHPWord | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category PHPWord | ||
* @package PHPWord | ||
* @copyright Copyright (c) 2013 PHPWord | ||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL | ||
* @version 0.7.0 | ||
*/ | ||
|
||
/** | ||
* PHPWord_Section_Table_Row | ||
*/ | ||
class PHPWord_Section_Table_Row | ||
{ | ||
|
||
/** | ||
* Row height | ||
* | ||
* @var int | ||
*/ | ||
private $_height = null; | ||
|
||
/** | ||
* Row style | ||
* | ||
* @var PHPWord_Style_Row | ||
*/ | ||
private $_style; | ||
|
||
/** | ||
* Row cells | ||
* | ||
* @var array | ||
*/ | ||
private $_cells = array(); | ||
|
||
/** | ||
* Table holder | ||
* | ||
* @var string | ||
*/ | ||
private $_insideOf; | ||
|
||
/** | ||
* Section/Header/Footer count | ||
* | ||
* @var int | ||
*/ | ||
private $_pCount; | ||
|
||
|
||
/** | ||
* Create a new table row | ||
* | ||
* @param string $insideOf | ||
* @param int $pCount | ||
* @param int $height | ||
* @param mixed $style | ||
*/ | ||
public function __construct($insideOf, $pCount, $height = null, $style = null) | ||
{ | ||
$this->_insideOf = $insideOf; | ||
$this->_pCount = $pCount; | ||
$this->_height = $height; | ||
$this->_style = new PHPWord_Style_Row(); | ||
|
||
if (!is_null($style)) { | ||
if (is_array($style)) { | ||
|
||
foreach ($style as $key => $value) { | ||
if (substr($key, 0, 1) != '_') { | ||
$key = '_' . $key; | ||
} | ||
$this->_style->setStyleValue($key, $value); | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Add a cell | ||
* | ||
* @param int $width | ||
* @param mixed $style | ||
* @return PHPWord_Section_Table_Cell | ||
*/ | ||
public function addCell($width = null, $style = null) | ||
{ | ||
$cell = new PHPWord_Section_Table_Cell($this->_insideOf, $this->_pCount, $width, $style); | ||
$this->_cells[] = $cell; | ||
return $cell; | ||
} | ||
|
||
/** | ||
* Get all cells | ||
* | ||
* @return array | ||
*/ | ||
public function getCells() | ||
{ | ||
return $this->_cells; | ||
} | ||
|
||
/** | ||
* Get row style | ||
* | ||
* @return PHPWord_Style_Row | ||
*/ | ||
public function getStyle() | ||
{ | ||
return $this->_style; | ||
} | ||
|
||
/** | ||
* Get row height | ||
* | ||
* @return int | ||
*/ | ||
public function getHeight() | ||
{ | ||
return $this->_height; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change default font ? Arial become Times New Roman & 20 become 24.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, my bad :) I forgot to set back my personal style to default setup. Will fix it.