You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2021/10/07 10:16:23 UTC
svn commit: r1893963 - in /poi/trunk:
poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java
poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFRow.java
poi/src/main/java/org/apache/poi/ss/util/CellUtil.java
Author: fanningpj
Date: Thu Oct 7 10:16:23 2021
New Revision: 1893963
URL: http://svn.apache.org/viewvc?rev=1893963&view=rev
Log:
update javadoc for cell/row copy
Modified:
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java
poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFRow.java
poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java?rev=1893963&r1=1893962&r2=1893963&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRow.java Thu Oct 7 10:16:23 2021
@@ -638,11 +638,14 @@ public class XSSFRow implements Row, Com
}
/**
- * Copy the cells from srcRow to this row
+ * Copy the cells from srcRow to this row.
* If this row is not a blank row, this will merge the two rows, overwriting
- * the cells in this row with the cells in srcRow
- * If srcRow is null, overwrite cells in destination row with blank values, styles, etc per cell copy policy
- * srcRow may be from a different sheet in the same workbook
+ * the cells in this row with the cells in srcRow.
+ * If srcRow is null, overwrite cells in destination row with blank values, styles, etc per cell copy policy.
+ *
+ * Note that if you are copying from a non-XSSF row then you will need to disable style copying
+ * in the {@link CellCopyPolicy} (XSSF styles are not compatible with HSSF styles, for instance).
+ *
* @param srcRow the rows to copy from
* @param policy the policy to determine what gets copied
*/
@@ -657,6 +660,10 @@ public class XSSFRow implements Row, Com
* the cells in this row with the cells in srcRow
* If srcRow is null, overwrite cells in destination row with blank values, styles, etc per cell copy policy
* srcRow may be from a different sheet in the same workbook
+ *
+ * Note that if you are copying from a non-XSSF row then you will need to disable style copying
+ * in the {@link CellCopyPolicy} (XSSF styles are not compatible with HSSF styles, for instance).
+ *
* @param srcRow the rows to copy from
* @param policy the policy to determine what gets copied
* @param context the context - see {@link CellCopyContext}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFRow.java?rev=1893963&r1=1893962&r2=1893963&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFRow.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFRow.java Thu Oct 7 10:16:23 2021
@@ -801,11 +801,14 @@ public final class HSSFRow implements Ro
}
/**
- * Copy the cells from srcRow to this row
+ * Copy the cells from srcRow to this row.
* If this row is not a blank row, this will merge the two rows, overwriting
- * the cells in this row with the cells in srcRow
- * If srcRow is null, overwrite cells in destination row with blank values, styles, etc per cell copy policy
- * srcRow may be from a different sheet in the same workbook
+ * the cells in this row with the cells in srcRow.
+ * If srcRow is null, overwrite cells in destination row with blank values, styles, etc per cell copy policy.
+ *
+ * Note that if you are copying from a non-HSSF row then you will need to disable style copying
+ * in the {@link CellCopyPolicy} (HSSF styles are not compatible with XSSF styles, for instance).
+ *
* @param srcRow the rows to copy from
* @param policy the policy to determine what gets copied
* @param context the context - see {@link CellCopyContext}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java?rev=1893963&r1=1893962&r2=1893963&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java Thu Oct 7 10:16:23 2021
@@ -181,7 +181,10 @@ public final class CellUtil {
/**
* Copy cell value, formula and style, from srcCell per cell copy policy
- * If srcCell is null, clears the cell value and cell style per cell copy policy
+ * If srcCell is null, clears the cell value and cell style per cell copy policy.
+ *
+ * Note that if you are copying from a source cell from a different type of then you may need to disable style copying
+ * in the {@link CellCopyPolicy} (HSSF styles are not compatible with XSSF styles, for instance).
*
* This does not shift references in formulas.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org