Author: jukka
Date: Tue Jul  1 14:20:09 2008
New Revision: 673212

URL: http://svn.apache.org/viewvc?rev=673212&view=rev
Log:
TIKA-146: Upgrade to POI 3.1
    - Enable Excel hyperlink support available in POI 3.1

Modified:
    
incubator/tika/trunk/src/main/java/org/apache/tika/parser/microsoft/ExcelExtractor.java

Modified: 
incubator/tika/trunk/src/main/java/org/apache/tika/parser/microsoft/ExcelExtractor.java
URL: 
http://svn.apache.org/viewvc/incubator/tika/trunk/src/main/java/org/apache/tika/parser/microsoft/ExcelExtractor.java?rev=673212&r1=673211&r2=673212&view=diff
==============================================================================
--- 
incubator/tika/trunk/src/main/java/org/apache/tika/parser/microsoft/ExcelExtractor.java
 (original)
+++ 
incubator/tika/trunk/src/main/java/org/apache/tika/parser/microsoft/ExcelExtractor.java
 Tue Jul  1 14:20:09 2008
@@ -40,6 +40,7 @@
 import org.apache.poi.hssf.record.ExtendedFormatRecord;
 import org.apache.poi.hssf.record.FormatRecord;
 import org.apache.poi.hssf.record.FormulaRecord;
+import org.apache.poi.hssf.record.HyperlinkRecord;
 import org.apache.poi.hssf.record.UnicodeString;
 //import org.apache.poi.hssf.record.HyperlinkRecord;  // FIXME - requires POI 
release
 import org.apache.poi.hssf.record.LabelRecord;
@@ -138,7 +139,7 @@
             hssfRequest.addListener(listener, LabelSSTRecord.sid);
             hssfRequest.addListener(listener, NumberRecord.sid);
             hssfRequest.addListener(listener, RKRecord.sid);
-            //hssfRequest.addListener(listener, HyperlinkRecord.sid); // FIXME 
- requires POI release
+            hssfRequest.addListener(listener, HyperlinkRecord.sid);
         }
 
         // Create event factory and process Workbook (fire events)
@@ -277,18 +278,17 @@
                 addCell(record, new NumberCell(rk.getRKNumber()));
                 break;
 
-            // FIXME - requires POI release
-            // case HyperlinkRecord.sid: // holds a URL associated with a cell
-            //     if (currentSheet != null) {
-            //         HyperlinkRecord link = (HyperlinkRecord) record;
-            //         Point point =
-            //             new Point(link.getFirstColumn(), 
link.getFirstRow());
-            //         Cell cell = currentSheet.get(point);
-            //         if (cell != null) {
-            //             addCell(record, new LinkedCell(cell, 
link.getAddress()));
-            //         }
-            //     }
-            //     break;
+            case HyperlinkRecord.sid: // holds a URL associated with a cell
+                if (currentSheet != null) {
+                    HyperlinkRecord link = (HyperlinkRecord) record;
+                    Point point =
+                        new Point(link.getFirstColumn(), link.getFirstRow());
+                    Cell cell = currentSheet.get(point);
+                    if (cell != null) {
+                        addCell(record, new LinkedCell(cell, 
link.getAddress()));
+                    }
+                }
+                break;
             }
         }
 


Reply via email to