summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Räty <betelgeuse@gentoo.org>2007-05-22 18:04:17 +0000
committerPetteri Räty <betelgeuse@gentoo.org>2007-05-22 18:04:17 +0000
commit69b2a3a7b65233dbeb80ef8f103a3d46b8153851 (patch)
tree76f77a8e45ece7ac1f639c206cb1791dc821f567 /dev-java/poi
parentwaste of space - removed (diff)
downloadgentoo-2-69b2a3a7b65233dbeb80ef8f103a3d46b8153851.tar.gz
gentoo-2-69b2a3a7b65233dbeb80ef8f103a3d46b8153851.tar.bz2
gentoo-2-69b2a3a7b65233dbeb80ef8f103a3d46b8153851.zip
Add missing patch.
(Portage version: 2.1.2.7)
Diffstat (limited to 'dev-java/poi')
-rw-r--r--dev-java/poi/ChangeLog6
-rw-r--r--dev-java/poi/files/poi-3.0-src-isDateFormat.patch95
2 files changed, 100 insertions, 1 deletions
diff --git a/dev-java/poi/ChangeLog b/dev-java/poi/ChangeLog
index 5e9c1e6ea8e1..123f47f4ddba 100644
--- a/dev-java/poi/ChangeLog
+++ b/dev-java/poi/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-java/poi
# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/poi/ChangeLog,v 1.28 2007/05/22 18:00:03 betelgeuse Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/poi/ChangeLog,v 1.29 2007/05/22 18:04:17 betelgeuse Exp $
+
+ 22 May 2007; Petteri Räty <betelgeuse@gentoo.org>
+ +files/poi-3.0-src-isDateFormat.patch:
+ Add missing patch.
*poi-3.0 (22 May 2007)
diff --git a/dev-java/poi/files/poi-3.0-src-isDateFormat.patch b/dev-java/poi/files/poi-3.0-src-isDateFormat.patch
new file mode 100644
index 000000000000..ee887268d482
--- /dev/null
+++ b/dev-java/poi/files/poi-3.0-src-isDateFormat.patch
@@ -0,0 +1,95 @@
+diff -ru poi.original/src/java/org/apache/poi/hssf/model/Workbook.java poi/src/java/org/apache/poi/hssf/model/Workbook.java
+--- poi.original/src/java/org/apache/poi/hssf/model/Workbook.java 2006-01-03 12:41:36.000000000 +0100
++++ poi/src/java/org/apache/poi/hssf/model/Workbook.java 2006-11-03 21:10:29.000000000 +0100
+@@ -103,6 +103,19 @@
+
+ private static POILogger log = POILogFactory.getLogger(Workbook.class);
+
++ /**
++ * The date strings to look for
++ */
++ private static final String[] dateStrings = new String[]
++ {
++ "dd",
++ "mm",
++ "yy",
++ "hh",
++ "ss",
++ "m/",
++ "/d"
++ };
+ /**
+ * Creates new Workbook with no intitialization --useless right now
+ * @see #createWorkbook(List)
+@@ -2221,6 +2234,58 @@
+ {
+ return drawingManager;
+ }
++
++ public FormatRecord getFormat(final short index) {
++ FormatRecord foundFormat = null;
++ Iterator iterator = formats.iterator();
++ while (iterator.hasNext()) {
++ final FormatRecord format = (FormatRecord) iterator.next();
++ if (format.getIndexCode() == index) {
++ foundFormat = format;
++ break;
++ }
++ }
++ return foundFormat;
++ }
+
+-}
++ public boolean isDateFormat(final short index) {
++ boolean isDate = false;
++ final FormatRecord format = getFormat(index);
++ if (format != null) {
++ switch(format.getIndexCode()) {
++ // Internal Date Formats as described on page 427 in
++ // Microsoft Excel Dev's Kit...
++ case 0x0e:
++ case 0x0f:
++ case 0x10:
++ case 0x11:
++ case 0x12:
++ case 0x13:
++ case 0x14:
++ case 0x15:
++ case 0x16:
++ case 0x2d:
++ case 0x2e:
++ case 0x2f:
++ isDate = true;
++ break;
+
++ default:
++ break;
++ }
++
++ if (!isDate) {
++ final String formatString = format.getFormatString();
++ for (int i = 0; i < dateStrings.length; i++) {
++ final String dateString = dateStrings[i];
++ if (formatString.indexOf(dateString) != -1 ||
++ formatString.indexOf(dateString.toUpperCase()) != -1) {
++ isDate = true;
++ break;
++ }
++ }
++ }
++ }
++ return isDate;
++ }
++}
+diff -ru poi.original/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java poi/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
+--- poi.original/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java 2006-07-27 16:15:11.000000000 +0200
++++ poi/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java 2006-11-03 21:09:50.000000000 +0100
+@@ -1279,4 +1279,8 @@
+ byte[] bytes = new byte[16];
+ return bytes;
+ }
++
++ public boolean isDateFormat(final short index) {
++ return workbook.isDateFormat(index);
++ }
+ }