diff options
author | Vladislav Galas <gallon@apache.org> | 2019-01-26 19:40:56 +0000 |
---|---|---|
committer | Vladislav Galas <gallon@apache.org> | 2019-01-26 19:40:56 +0000 |
commit | d60cb3a18c18b958998f066dc3591bc81dd85b3d (patch) | |
tree | 0b652762dc72de5b7efb4cb610ba200113eaa0c6 /src/java/org | |
parent | 1253a295710ed82680dd5153e868edd87a5a981d (diff) | |
download | poi-d60cb3a18c18b958998f066dc3591bc81dd85b3d.tar.gz poi-d60cb3a18c18b958998f066dc3591bc81dd85b3d.zip |
added Cell.setBlank() - as an alias, for now
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1852244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/poi/ss/usermodel/Cell.java | 7 | ||||
-rw-r--r-- | src/java/org/apache/poi/ss/usermodel/CellBase.java | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/ss/usermodel/Cell.java b/src/java/org/apache/poi/ss/usermodel/Cell.java index 6f960a30d7..21e701490e 100644 --- a/src/java/org/apache/poi/ss/usermodel/Cell.java +++ b/src/java/org/apache/poi/ss/usermodel/Cell.java @@ -90,6 +90,13 @@ public interface Cell { void setCellType(CellType cellType); /** + * Removes formula and value from the cell, and sets its type to {@link CellType#BLANK}. + * Preserves comments and hyperlinks. + * While {@link #setCellType(CellType)} exists, is an alias for {@code setCellType(CellType.BLANK)}. + */ + void setBlank(); + + /** * Return the cell type. * * @return the cell type diff --git a/src/java/org/apache/poi/ss/usermodel/CellBase.java b/src/java/org/apache/poi/ss/usermodel/CellBase.java index 7e3929b236..9777739fcf 100644 --- a/src/java/org/apache/poi/ss/usermodel/CellBase.java +++ b/src/java/org/apache/poi/ss/usermodel/CellBase.java @@ -41,6 +41,14 @@ public abstract class CellBase implements Cell { } /** + * {@inheritDoc} + */ + @Override + public void setBlank() { + setCellType(CellType.BLANK); + } + + /** * Implementation-specific logic * @param cellType new cell type. Guaranteed non-null, not _NONE. */ |