summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Šulc <fordfrog@gentoo.org>2007-08-05 09:54:33 +0000
committerMiroslav Šulc <fordfrog@gentoo.org>2007-08-05 09:54:33 +0000
commitfea128c8c42e776f1cd09cea168329c2e29b3b3c (patch)
tree300e9295a34600b687760e673ccbfcd0889f5d8e
parentMinor fix for compatibility with app-dicts/wordnet-3.0. Tested on amd64 and k... (diff)
downloadgentoo-2-fea128c8c42e776f1cd09cea168329c2e29b3b3c.tar.gz
gentoo-2-fea128c8c42e776f1cd09cea168329c2e29b3b3c.tar.bz2
gentoo-2-fea128c8c42e776f1cd09cea168329c2e29b3b3c.zip
Added patch that enables better detection of whether cell is formatted as date.
(Portage version: 2.1.3.3)
-rw-r--r--dev-java/poi/ChangeLog9
-rw-r--r--dev-java/poi/files/digest-poi-3.0.1-r1 (renamed from dev-java/poi/files/digest-poi-3.0.1)0
-rw-r--r--dev-java/poi/files/poi-3.0.1-src-isDateFormat.patch100
-rw-r--r--dev-java/poi/poi-3.0.1-r1.ebuild (renamed from dev-java/poi/poi-3.0.1.ebuild)6
4 files changed, 112 insertions, 3 deletions
diff --git a/dev-java/poi/ChangeLog b/dev-java/poi/ChangeLog
index 9e4ecbe9d995..8306a83a1b00 100644
--- a/dev-java/poi/ChangeLog
+++ b/dev-java/poi/ChangeLog
@@ -1,6 +1,13 @@
# 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.33 2007/08/04 14:01:19 fordfrog Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/poi/ChangeLog,v 1.34 2007/08/05 09:54:32 fordfrog Exp $
+
+*poi-3.0.1-r1 (05 Aug 2007)
+
+ 05 Aug 2007; Miroslav Šulc <fordfrog@gentoo.org>
+ +files/poi-3.0.1-src-isDateFormat.patch, -poi-3.0.1.ebuild,
+ +poi-3.0.1-r1.ebuild:
+ Added patch that enables better detection of whether cell is formatted as date.
04 Aug 2007; Miroslav Šulc <fordfrog@gentoo.org> poi-3.0.1.ebuild:
Fixed SRC_URI, bug #187722.
diff --git a/dev-java/poi/files/digest-poi-3.0.1 b/dev-java/poi/files/digest-poi-3.0.1-r1
index 0d4f1442bdf5..0d4f1442bdf5 100644
--- a/dev-java/poi/files/digest-poi-3.0.1
+++ b/dev-java/poi/files/digest-poi-3.0.1-r1
diff --git a/dev-java/poi/files/poi-3.0.1-src-isDateFormat.patch b/dev-java/poi/files/poi-3.0.1-src-isDateFormat.patch
new file mode 100644
index 000000000000..c9ba97f62f35
--- /dev/null
+++ b/dev-java/poi/files/poi-3.0.1-src-isDateFormat.patch
@@ -0,0 +1,100 @@
+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,25 @@
+
+ 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",
++ "m/",
++ "-m",
++ "m-",
++ "/d",
++ "d/",
++ "-d",
++ "d-"
++ };
+ /**
+ * Creates new Workbook with no intitialization --useless right now
+ * @see #createWorkbook(List)
+@@ -2221,6 +2234,57 @@
+ {
+ 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().toLowerCase();
++ for (int i = 0; i < dateStrings.length; i++) {
++ final String dateString = dateStrings[i];
++ if (formatString.indexOf(dateString) != -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);
++ }
+ }
diff --git a/dev-java/poi/poi-3.0.1.ebuild b/dev-java/poi/poi-3.0.1-r1.ebuild
index 707ff5202d46..dded97fb11c3 100644
--- a/dev-java/poi/poi-3.0.1.ebuild
+++ b/dev-java/poi/poi-3.0.1-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/poi/poi-3.0.1.ebuild,v 1.2 2007/08/04 14:01:19 fordfrog Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/poi/poi-3.0.1-r1.ebuild,v 1.1 2007/08/05 09:54:32 fordfrog Exp $
JAVA_PKG_IUSE="doc examples source"
inherit java-pkg-2 java-ant-2
@@ -31,7 +31,9 @@ src_unpack() {
unpack ${A}
cd "${S}"
- #epatch ${FILESDIR}/${P}-src-isDateFormat.patch
+ # Patch that adds unofficial support for detection whether cell is
+ # date/time format till upstream solves that
+ epatch ${FILESDIR}/${P}-src-isDateFormat.patch
find -name "*.jar" | xargs rm -v