This repository has been archived by the owner on Jan 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Write conditional formatting styles to worksheet instead of copying to e... #172
Open
sorpigal
wants to merge
3
commits into
PHPOffice:develop
Choose a base branch
from
sorpigal:conditionalstylefix
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,8 @@ class PHPExcel_Style_Conditional implements PHPExcel_IComparable | |
const CONDITION_CELLIS = 'cellIs'; | ||
const CONDITION_CONTAINSTEXT = 'containsText'; | ||
const CONDITION_EXPRESSION = 'expression'; | ||
const CONDITION_CONTAINSBLANKS = 'containsBlanks'; | ||
const CONDITION_NOTCONTAINSBLANKS = 'notContainsBlanks'; | ||
|
||
/* Operator types */ | ||
const OPERATOR_NONE = ''; | ||
|
@@ -55,6 +57,8 @@ class PHPExcel_Style_Conditional implements PHPExcel_IComparable | |
const OPERATOR_NOTCONTAINS = 'notContains'; | ||
const OPERATOR_BETWEEN = 'between'; | ||
|
||
const STOP_IF_TRUE = '1'; | ||
|
||
/** | ||
* Condition type | ||
* | ||
|
@@ -76,6 +80,13 @@ class PHPExcel_Style_Conditional implements PHPExcel_IComparable | |
*/ | ||
private $_text; | ||
|
||
/** | ||
* Stop If True | ||
* | ||
* @var string | ||
*/ | ||
private $_stopIfTrue = ''; | ||
|
||
/** | ||
* Condition | ||
* | ||
|
@@ -163,6 +174,55 @@ public function setText($value = null) { | |
return $this; | ||
} | ||
|
||
/** | ||
* Get Stop If True | ||
* | ||
* Whether to stop processing conditional formatting rules for a given cell if this rule evaluates to true. | ||
* | ||
* @return string | ||
*/ | ||
public function getStopIfTrue() { | ||
return $this->_stopIfTrue; | ||
} | ||
|
||
/** | ||
* Set Stop If True | ||
* | ||
* @param string $pValue | ||
* @return PHPExcel_Style_Conditional | ||
*/ | ||
public function setStopIfTrue($pValue = '') { | ||
if($pValue === PHPExcel_Style_Conditional::STOP_IF_TRUE){ | ||
$this->_stopIfTrue = $pValue; | ||
} else{ | ||
// treat all unknown as "unset" | ||
$this->_stopIfTrue = ''; | ||
} | ||
return $this; | ||
} | ||
|
||
/** | ||
* Get Priority | ||
* | ||
* Priority is the order in which conditional formatting rules will apply to the affected range(s). Lower priority values run first. | ||
* | ||
* @return int | ||
*/ | ||
public function getPriority() { | ||
return $this->_priority; | ||
} | ||
|
||
/** | ||
* Set Priority | ||
* | ||
* @param int $pValue | ||
* @return PHPExcel_Style_Conditional | ||
*/ | ||
public function setStopIfTrue($pValue = 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fatal error: Cannot redeclare PHPExcel_Style_Conditional::setStopIfTrue() in PHPExcel\Style\Conditional.php on line 221 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that you mean setPriority() instead of setStopIfTrue(), not? |
||
$this->_priority = $pValue; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Get Condition | ||
* | ||
|
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
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.
Parse error: syntax error, unexpected ']' in PHPExcel\Reader\Excel2007.php on line 944