cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1762858 - in /cocoon/branches/BRANCH_2_1_X: lib/ lib/optional/ src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/ src/blocks/poi/samples/content/
Date Fri, 30 Sep 2016 06:53:08 GMT
Author: ilgrosso
Date: Fri Sep 30 06:53:08 2016
New Revision: 1762858

URL: http://svn.apache.org/viewvc?rev=1762858&view=rev
Log:
[COCOON-2354] Applying the provided patch (Apache POI and Commons Codec JARs upgrade)

Added:
    cocoon/branches/BRANCH_2_1_X/lib/optional/commons-codec-1.5.jar   (with props)
    cocoon/branches/BRANCH_2_1_X/lib/optional/poi-3.10-FINAL.jar   (with props)
Removed:
    cocoon/branches/BRANCH_2_1_X/lib/optional/commons-codec-1.3.jar
    cocoon/branches/BRANCH_2_1_X/lib/optional/poi-3.0.2-FINAL-20080204.jar
Modified:
    cocoon/branches/BRANCH_2_1_X/lib/jars.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPMerge.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Sheet.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Workbook.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/poi/samples/content/simple-date-test.xml

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/lib/jars.xml?rev=1762858&r1=1762857&r2=1762858&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml Fri Sep 30 06:53:08 2016
@@ -496,7 +496,7 @@
       document objects.
     </description>
     <used-by>MS Excel serializer (poi block)</used-by>
-    <lib>optional/poi-3.0.2-FINAL-20080204.jar</lib>
+    <lib>optional/poi-3.10-FINAL.jar</lib>
     <homepage>http://jakarta.apache.org/poi/</homepage>
   </file>
 
@@ -829,7 +829,7 @@
     <title>Jakarta Commons Codec</title>
     <description>Implementations of common encoders and decoders</description>
     <used-by>WebDAV block</used-by>
-    <lib>optional/commons-codec-1.3.jar</lib>
+    <lib>optional/commons-codec-1.5.jar</lib>
     <homepage>http://commons.apache.org/codec/</homepage>
   </file>
 

Added: cocoon/branches/BRANCH_2_1_X/lib/optional/commons-codec-1.5.jar
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/lib/optional/commons-codec-1.5.jar?rev=1762858&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cocoon/branches/BRANCH_2_1_X/lib/optional/commons-codec-1.5.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cocoon/branches/BRANCH_2_1_X/lib/optional/poi-3.10-FINAL.jar
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/lib/optional/poi-3.10-FINAL.jar?rev=1762858&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cocoon/branches/BRANCH_2_1_X/lib/optional/poi-3.10-FINAL.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java?rev=1762858&r1=1762857&r2=1762858&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java
Fri Sep 30 06:53:08 2016
@@ -44,16 +44,12 @@ class Cell {
 
     /**
      * Constructor Cell.
-     * Only a hack as long as the POI stuff is not maintained in the POI CVS:
-     * Setting the encoding to UTF-16 for internationalization
-     * (<a href="http://jakarta.apache.org/poi/javadocs/org/apache/poi/hssf/usermodel/HSSFCell.html#getEncoding()">POI
API</a>).
      *
      * @param cell
      */
     Cell(final HSSFCell cell, final int cellType) {
         _cell = cell;
         _celltype = cellType;
-        _cell.setEncoding(HSSFCell.ENCODING_UTF_16);
     }
 
     /**

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPMerge.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPMerge.java?rev=1762858&r1=1762857&r2=1762858&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPMerge.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EPMerge.java
Fri Sep 30 06:53:08 2016
@@ -17,8 +17,7 @@
 
 package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
 
-import org.apache.poi.hssf.util.RangeAddress;
-import org.apache.poi.hssf.util.Region;
+import org.apache.poi.ss.util.CellRangeAddress;
 
 import java.io.IOException;
 
@@ -54,25 +53,9 @@ public class EPMerge extends BaseElement
      * @exception IOException
      */
     public void endProcessing() throws IOException {
-        RangeAddress rangeAddress = new RangeAddress(getCellRange());
         Sheet sheet = this.getSheet();
-
-        //subtracting one since rangeaddress starts at 1,1 where rows/cols
-        // start at 0,0
-        short fromCol =
-            (short) (rangeAddress.getXPosition(rangeAddress.getFromCell()) - 1);
-        int fromRow = rangeAddress.getYPosition(rangeAddress.getFromCell()) - 1;
-        short toCol =
-            (short) (rangeAddress.getXPosition(rangeAddress.getToCell()) - 1);
-        int toRow = rangeAddress.getYPosition(rangeAddress.getToCell()) - 1;
-
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Merging Range: Row (" + fromRow + ") Col ("
-                    + fromCol + ")" + " to Row (" + toRow + ") Col (" + toCol
-                    + ")");
-        }
-        Region region = new Region(fromRow, fromCol, toRow, toCol);
-        sheet.addMergedRegion(region);
+        CellRangeAddress range = CellRangeAddress.valueOf(getCellRange());
+        sheet.addMergedRegion(range);
     }
 
 } // end public class EPMerge

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Sheet.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Sheet.java?rev=1762858&r1=1762857&r2=1762858&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Sheet.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Sheet.java
Fri Sep 30 06:53:08 2016
@@ -33,6 +33,7 @@ import org.apache.poi.hssf.usermodel.HSS
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.hssf.util.Region;
+import org.apache.poi.ss.util.CellRangeAddress;
 
 /**
  * internal representation of a Sheet
@@ -128,7 +129,8 @@ class Sheet extends AbstractLogEnabled {
      * @return default column width (in 1/256ths of a character width)
      */
     short getDefaultColumnWidth() {
-        return _sheet.getDefaultColumnWidth();
+        Integer objColWidth = new Integer(_sheet.getDefaultColumnWidth());
+        return objColWidth.shortValue();
     }
 
     /**
@@ -237,6 +239,14 @@ class Sheet extends AbstractLogEnabled {
     }
 
     /**
+     * Flag a certain region of cells to be merged
+     * @param range the cell range to create as merged
+     */
+    void addMergedRegion(CellRangeAddress range) {
+        this._sheet.addMergedRegion(range);
+    }
+
+    /**
      * assigns blank cells to regions where no cell is currently allocated.
      * Meaning if there is a sheet with a cell defined at 1,1 and a style
      * region from 0,0-1,1 then cells 0,0;0,1;1,0 will be defined as blank

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Workbook.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Workbook.java?rev=1762858&r1=1762857&r2=1762858&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Workbook.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Workbook.java
Fri Sep 30 06:53:08 2016
@@ -104,7 +104,7 @@ class Workbook {
      * @param name the new name for the sheet
      */
     void renameSheet(final int index, final String name) {
-        _workbook.setSheetName(index, name, HSSFWorkbook.ENCODING_UTF_16);
+        _workbook.setSheetName(index, name);
     }
 
     /**

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/poi/samples/content/simple-date-test.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/poi/samples/content/simple-date-test.xml?rev=1762858&r1=1762857&r2=1762858&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/poi/samples/content/simple-date-test.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/poi/samples/content/simple-date-test.xml Fri Sep
30 06:53:08 2016
@@ -118,7 +118,11 @@
         <gmr:Cell Col="1" Row="17">=date(year(now()), month(now()) + 3, day(now()))</gmr:Cell>
         <gmr:Cell Col="0" Row="18" ValueType="60">today minus 2 years:</gmr:Cell>
         <gmr:Cell Col="1" Row="18">=date(year(now()) - 2, month(now()), day(now()))</gmr:Cell>
+        <gmr:Cell Col="0" Row="19" ValueType="60">Tets Merge cell range</gmr:Cell>
       </gmr:Cells>
+      <gmr:MergedRegions>
+      </gmr:MergedRegions>
+      <Merge>A20:B20</Merge>
     </gmr:Sheet>
   </gmr:Sheets>
 </gmr:Workbook>



Mime
View raw message