From b3af87e4a610fc234d1f95ef67e217e0d9bd9f96 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 1 Feb 2008 16:52:58 +0000 Subject: [PATCH] More Hyperlink support. Doesn't end up in HSSFCell just yet, as the records are in the wrong bit of the file, so don't get associated with the sheet. All tests still passing though git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@617555 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/model/Workbook.java | 21 +++- .../poi/hssf/record/HyperlinkRecord.java | 54 +++++------ .../apache/poi/hssf/data/WithHyperlink.xls | Bin 31232 -> 13824 bytes .../poi/hssf/data/WithTwoHyperLinks.xls | Bin 0 -> 13824 bytes .../poi/hssf/record/TestHyperlinkRecord.java | 10 +- .../poi/hssf/usermodel/TestHSSFCell.java | 90 +++++++++++++++--- 6 files changed, 122 insertions(+), 53 deletions(-) create mode 100644 src/testcases/org/apache/poi/hssf/data/WithTwoHyperLinks.xls diff --git a/src/java/org/apache/poi/hssf/model/Workbook.java b/src/java/org/apache/poi/hssf/model/Workbook.java index 08c236cda..2ba50857c 100644 --- a/src/java/org/apache/poi/hssf/model/Workbook.java +++ b/src/java/org/apache/poi/hssf/model/Workbook.java @@ -93,6 +93,8 @@ public class Workbook implements Model protected ArrayList formats = new ArrayList(); protected ArrayList names = new ArrayList(); + + protected ArrayList hyperlinks = new ArrayList(); protected int numxfs = 0; // hold the number of extended format records protected int numfonts = 0; // hold the number of font records @@ -133,7 +135,8 @@ public class Workbook implements Model Workbook retval = new Workbook(); ArrayList records = new ArrayList(recs.size() / 3); - for (int k = 0; k < recs.size(); k++) { + int k; + for (k = 0; k < recs.size(); k++) { Record rec = ( Record ) recs.get(k); if (rec.getSid() == EOFRecord.sid) { @@ -248,6 +251,17 @@ public class Workbook implements Model // retval.records.supbookpos = retval.records.bspos + 1; // retval.records.namepos = retval.records.supbookpos + 1; // } + + // Look for other interesting values that + // follow the EOFRecord + for ( ; k < recs.size(); k++) { + Record rec = ( Record ) recs.get(k); + switch (rec.getSid()) { + case HyperlinkRecord.sid: + retval.hyperlinks.add(rec); + break; + } + } retval.records.setRecords(records); @@ -2116,6 +2130,11 @@ public class Workbook implements Model return null; } + public List getHyperlinks() + { + return hyperlinks; + } + public List getRecords() { return records.getRecords(); diff --git a/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java b/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java index 36a26f415..ec91dc341 100644 --- a/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java +++ b/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java @@ -14,11 +14,6 @@ limitations under the License. ==================================================================== */ -/* - * HyperlinkRecord - * - * Created on February 20th, 2005, 16:00 PM - */ package org.apache.poi.hssf.record; import java.io.IOException; @@ -27,20 +22,15 @@ import java.net.URL; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.poi.util.HexDump; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; -/**The HyperlinkRecord wraps an HLINK-record from the Excel-97 format +/** + * The HyperlinkRecord wraps an HLINK-record + * from the Excel-97 format. + * Supports only external links for now (eg http://) * - * @version 20-feb-2005 * @author Mark Hissink Muller >m{L0&C^F8Vya1shKR8hgD6xR*Uf5{M0eTUfBBdnIA6l@Lg7on#mi}q~^nry6>h}B2-P_%b*)|q}ZJDz< z^Eh*6&fIV2&fGKi=IR&K6Q|!>cwHvZ8Yz-H=~5}qky}VV=;o^g<>@rDZoB|#hz$LQ z5GeIyAd7wS!{RF?<6}q`iChR z*oQGpywz5*SdbOTDTEc6hb*blaE^xORrg~JSEFRY3P^AJ$RjJEC#bv4)2VvLHLTOH z0-+@zYMpOYvP>4rCFrL|PH?)5yzH~OBrXvN%CO9IsaMK{cJY^IH{e|$KA9s@cc!ks zxxRjB`}P($8SvKPF2%j)3fiCB93I$_s}PV9-ngzp>(bo%$OXLh;+H_a#-vtM?Qv<8 zr6T<_-e_x2`dgg7WV4ylx|TYW^|y5Pw*t{%UC!3|y`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qN}sNAiPF&L%|nU~W!2p|0nGX02BEk&3^ zn0g5QGlI`jB;|en?;xRX)mtjitvw#+fqvIBK@9J7Z59}oE% zW-bTX1K)`NUVy&McoF?s@RiXO!Ba$t##n_^t2hd$;2&TrC;B>tcSxc&}}uUZ`Kj#d^qUbsL> zkZx{<6`yqoNdXdKuMzpk??8wY&=U|Btq&h9o`(bWGcv+I4me6z2M5C+9{UXYT?eKfgW2h#9&HkdBez0-q}mz7ya(5eMHF;QL~9KIpV} z0i((X&G;^0R6dk-l6GiRJ|5#aaq#ho&WnSO$N9oI_;~a$kAshOLPH#UtSL6f!N>Z; z9S0w4mECdhv98%42On#ozBu?;Cp{AfA8V?kaqzMJIvoceYqdAx;NunHJ2CjoT1FS+ zkF;-NT(LU~P;VO&_ri;{{)ZML%X`0k@9F#;`xAeU_5b|OUakQx*+k2Qn)@~A{G5nO zY6S4J;e7zCuEd)`_}P)44S1anZ6%%wz6Xre9~}VjGi5J;pBY{SaNfo<0xK(ayoOJ< zPJmLEE*74NOqiFSQRLTvLYKv%%M!`}BWJ`PGU3EFd3-y&`13(sB0i^a0>GG^4&d@Z z^NDCx>YkHextkm7YMN{7>(;K`5R|_f^z8uo?j)j0`hGAyBVEQEekXwI>-yeoBIB`K zU)5=}LcAr#i|KzG?YQn__$z$jPnPi{z;(#|<3_pb&HqN_Yos%t^Vje+Y(dZFGMK;J l$qL2vT&)L(iFk@GUsbo9e+?4P-1%a><#X#M+<2*h{{sZ(71jU% diff --git a/src/testcases/org/apache/poi/hssf/data/WithTwoHyperLinks.xls b/src/testcases/org/apache/poi/hssf/data/WithTwoHyperLinks.xls new file mode 100644 index 0000000000000000000000000000000000000000..6ee60b535fe6370977fad7397e5c875aaa2ca35d GIT binary patch literal 13824 zcmeHOYiv|S6h3#m+iq#0Esu&wmzy?P>63>KLWQ;jni2{&Gz1bMWoZ|>X<^shHKB=- z1;JmKU`X^2i4tNWk_g85j4^HE5Bz}=Bk}R8s6W)0pac?0fc5*%-Ro|bF192DF>|(O z=FXWjbI$!{=FXkD)AL_dj2(Y>-bKlwl~N!#Q^iu4CAV<>pqnlihAi~SuM5rDp@S^}x0d~()0k^cW#Zi&s?OOuOdy@SJFx$=d1?>DO42qVb%hFST8tLx=EmdqJn&Lg^U@g%XP? z`M8+%rzJ}$8JU(PS$bH!=z|S1YWcw!tDjkNUE&zHg5k|4rSyb%M~6aoPc#+^_QzQ> z>g){0?XK{i!FZ`iS8zvY$PUNtj!2|RWYfkjCI%9T=~Xe8Vej0XD#LQRp_u4YUV z(8?~fDj0(hVM?aK>@PqP+0y5q1E#AE%}K`|y6?O|b5|1;=sK=XL4)-^pg6aCK zE=AZcWqMtqPwa9SyMFS|uh;MBZtYchoyzMqJfM=K;=me39!9I+Nhr1}JeR6yt60rhXlPs&TtX#<@+34q zvR;B|8W%bL#c#vcKKZiZ@Bw*S)}1V&yAObw+aVGB&>%TF9gq!30>7v%$D_U(aRifi z6Q=PfxDUA@q#~HwcX29^;Vt{Gv{dcuJl$|$+vkUB`yi4xPtlVjXlCA`bz4tXq1G76 zURV&_6@LN7p_j_Eif(p zj6zsW3MZ>^n+iz(n|yt^FBXYMb|&mKd;3B|>O=DCtCuhJpS9XhK6&D&1%Ke0?;Hyp@2rN* zmm`~xjezeU=l2ip33P+`wP6dGoAmu)Y`@~$xwGC+Am(1c^WaMGK`{3S4uko*=zVbZ z9s#xrl(?QRt1Z#GC}5qW+&F+u1?qB-!ufiZxm=RDTq>ndq#%-GO>6M>C-fHEPrtdTu9E*Xrufn1ixI{TOt`laBEpAph8>ACoS~!zUo0^vH9v8$TZ39G0~}VW;{;NdiYkBaq~$ oM`7RH&zY=!o|VzVFNl1y8W#H0hmf|w)cjd?2lubHp1%LT0Z|X>^8f$< literal 0 HcmV?d00001 diff --git a/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java b/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java index 983b91601..70548fe95 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java @@ -28,7 +28,7 @@ public class TestHyperlinkRecord extends TestCase { private byte[] data = new byte[] { -72, 1, 110, 0, - // Row, col, xf, ?? + // ??, Row, col, xf 6, 0, 3, 0, 2, 0, 2, 0, // ?? @@ -59,7 +59,7 @@ public class TestHyperlinkRecord extends TestCase { private byte[] data2 = new byte[] { -72, 1, -126, 0, - // Row, col, xf, ?? + // ??, Row, col, xf 2, 0, 2, 0, 4, 0, 4, 0, // ?? @@ -96,8 +96,8 @@ public class TestHyperlinkRecord extends TestCase { HyperlinkRecord r = new HyperlinkRecord(inp); - assertEquals(6, r.getRow()); - assertEquals(3, r.getColumn()); + assertEquals(3, r.getRow()); + assertEquals(2, r.getColumn()); assertEquals(2, r.getXFIndex()); assertEquals("L,A", r.getLabel()); @@ -122,7 +122,7 @@ public class TestHyperlinkRecord extends TestCase { HyperlinkRecord r = new HyperlinkRecord(inp); assertEquals(2, r.getRow()); - assertEquals(2, r.getColumn()); + assertEquals(4, r.getColumn()); assertEquals(4, r.getXFIndex()); assertEquals("Stacie@ABC.com", r.getLabel()); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java index 482ae7c6c..76f1b9fba 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java @@ -19,25 +19,20 @@ package org.apache.poi.hssf.usermodel; -import junit.framework.TestCase; - -import org.apache.poi.poifs.filesystem.POIFSFileSystem; -import org.apache.poi.hssf.model.Sheet; -import org.apache.poi.hssf.record.Record; -import org.apache.poi.hssf.record.BOFRecord; -import org.apache.poi.hssf.record.EOFRecord; -import org.apache.poi.hssf.util.CellReference; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.util.TempFile; - import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; - -import java.util.List; -import java.util.Iterator; import java.util.Date; import java.util.GregorianCalendar; +import java.util.List; + +import junit.framework.TestCase; + +import org.apache.poi.hssf.model.Sheet; +import org.apache.poi.hssf.record.HyperlinkRecord; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; +import org.apache.poi.util.TempFile; /** * Tests various functionity having to do with HSSFCell. For instance support for @@ -310,10 +305,75 @@ extends TestCase { in.close(); } - public void testWithHyperlinks() throws Exception { + public void BROKENtestWithHyperlink() throws Exception { String dir = System.getProperty("HSSF.testdata.path"); File f = new File(dir, "WithHyperlink.xls"); HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(f)); + + assertEquals(3, wb.getNumberOfSheets()); + + // Find our hyperlink record, and check they're + // as we'd expect + List records = wb.getWorkbook().getHyperlinks(); + assertEquals(1, records.size()); + + HyperlinkRecord link = (HyperlinkRecord) + records.get(0); + assertNotNull(link); + + // Is in A5 + assertEquals("Foo", link.getLabel()); + assertEquals("http://poi.apache.org/", link.getUrlString()); + assertEquals(4, link.getRow()); + assertEquals(0, link.getColumn()); + + // Now check at the HSSFCell level + assertEquals(3, wb.getNumberOfSheets()); + + HSSFSheet s = wb.getSheetAt(1); + HSSFRow r = s.getRow(4); + assertNotNull(r); + HSSFCell c = r.getCell((short)0); + } + + public void BROKENtestWithTwoHyperlinks() throws Exception { + String dir = System.getProperty("HSSF.testdata.path"); + File f = new File(dir, "WithTwoHyperLinks.xls"); + HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(f)); + + assertEquals(3, wb.getNumberOfSheets()); + + // Find our hyperlink record, and check they're + // as we'd expect + List records = wb.getWorkbook().getHyperlinks(); + assertEquals(2, records.size()); + + HyperlinkRecord linkA = (HyperlinkRecord) + records.get(0); + HyperlinkRecord linkB = (HyperlinkRecord) + records.get(1); + assertNotNull(linkA); + assertNotNull(linkB); + + // Is in A5 + assertEquals("Foo", linkA.getLabel()); + assertEquals("http://poi.apache.org/", linkA.getUrlString()); + assertEquals(4, linkA.getRow()); + assertEquals(0, linkA.getColumn()); + + // Is in B9 + assertEquals("Bar", linkB.getLabel()); + assertEquals("http://poi.apache.org/", linkB.getUrlString()); + assertEquals(8, linkB.getRow()); + assertEquals(1, linkB.getColumn()); + + // Now check at the HSSFCell level + assertEquals(3, wb.getNumberOfSheets()); + + HSSFSheet s = wb.getSheetAt(1); + HSSFRow r = s.getRow(4); + assertNotNull(r); + HSSFCell c = r.getCell((short)0); } /*tests the toString() method of HSSFCell*/