ASF Bugzilla – Attachment 20404 Details for
Bug 42756
Read support patch for Poi-Ruby
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
The patch
patch (text/plain), 4.38 KB, created by
Adam Lebsack
on 2007-06-27 12:32:12 UTC
(
hide
)
Description:
The patch
Filename:
MIME Type:
Creator:
Adam Lebsack
Created:
2007-06-27 12:32:12 UTC
Size:
4.38 KB
patch
obsolete
>Index: cpp/RubyIO.cpp >=================================================================== >--- cpp/RubyIO.cpp (revision 549857) >+++ cpp/RubyIO.cpp (working copy) >@@ -18,6 +18,7 @@ > > #include "ruby.h" > #include "org/apache/poi/RubyOutputStream.h" >+#include "org/apache/poi/RubyInputStream.h" > > > /** >@@ -39,6 +40,22 @@ > { > rb_funcall((VALUE ) rubyIO, rb_intern("putc"),1,INT2FIX(toWrite)); > } >+ >+ void RubyInputStream::close(void) >+ { >+ rb_funcall3((VALUE ) rubyIO, rb_intern("close"), 0, NULL); >+ } >+ >+ jint RubyInputStream::read() >+ { >+ VALUE ret = rb_funcall((VALUE ) rubyIO, rb_intern("getc"),0); >+ if(ret == Qnil) { >+ return -1; >+ } >+ return NUM2INT(ret); >+ } >+ >+ > } > } > } >Index: Poi4R.i >=================================================================== >--- Poi4R.i (revision 549857) >+++ Poi4R.i (working copy) >@@ -49,6 +49,7 @@ > #include "org/apache/poi/hssf/usermodel/HSSFHeader.h" > #include "org/apache/poi/hssf/usermodel/HSSFFooter.h" > #include "org/apache/poi/RubyOutputStream.h" >+#include "org/apache/poi/RubyInputStream.h" > > > typedef ::org::apache::poi::hssf::usermodel::HSSFWorkbook *jhworkbook; >@@ -294,6 +295,19 @@ > *(VALUE *) &ptr = (VALUE) $input; > $1 = new org::apache::poi::RubyOutputStream(ptr); > } >+ >+%typemap(in) jinputstream { >+ jlong ptr; >+ if (!rb_respond_to($input, rb_intern("getc"))) rb_raise(rb_eTypeError,"Expected IO"); >+ *(VALUE *) &ptr = (VALUE) $input; >+ $1 = new org::apache::poi::RubyInputStream(ptr); >+} >+ >+%typecheck(SWIG_TYPECHECK_POINTER) jinputstream { >+ $1 = rb_respond_to($input, rb_intern("getc")); >+} >+ >+ > %typemap(in) jcalendar { > $1 = java::util::Calendar::getInstance(); > //$1->setTimeInMillis((long long) NUM2DBL(rb_funcall($input,rb_intern("to_i"),0,NULL))*1000.0); >@@ -386,7 +400,8 @@ > %nodefault; > class HSSFWorkbook : public ::java::lang::Object { > public: >- HSSFWorkbook(); >+ HSSFWorkbook(); >+ HSSFWorkbook(jinputstream); > jstring getSheetName(jint); > jint getNumberOfSheets(); > void setSheetOrder(jstring,jint); >@@ -417,6 +432,7 @@ > public: > jhcell createCell(jshort); > jhcell getCell(jshort); >+ jshort getFirstCellNum(); > //jboolean getProtect(); //only in 2.5 > > }; >@@ -437,6 +453,7 @@ > void setAsActiveCell(); > > void setCellStyle(jhcellstyle); >+ void setCellType(jint); > void setEncoding(jshort encoding); > > static const jint CELL_TYPE_BLANK; >Index: Makefile >=================================================================== >--- Makefile (revision 549857) >+++ Makefile (working copy) >@@ -191,9 +191,10 @@ > cp $(POI4R)/$(POI_JAR) $(BINDIR)/$(POI_JAR) > cd $(JAR_CLASSES); $(JAR) -xf $(POI4R)/$(POI_JAR) > >-$(BINDIR)/io.java.o: java/org/apache/poi/RubyOutputStream.java >+$(BINDIR)/io.java.o: java/org/apache/poi/RubyOutputStream.java java/org/apache/poi/RubyInputStream.java > $(JCC) $(JCCFLAGS) -C -d $(CLASSES) java/org/apache/poi/RubyOutputStream.java >- $(JCC) $(JCCFLAGS) $(CCFLAGS) -I$(GCJ_HOME)/include -c -o $@ java/org/apache/poi/RubyOutputStream.java >+ $(JCC) $(JCCFLAGS) -C -d $(CLASSES) java/org/apache/poi/RubyInputStream.java >+ $(JCC) $(JCCFLAGS) $(CCFLAGS) -I$(GCJ_HOME)/include -c -o $@ java/org/apache/poi/RubyOutputStream.java java/org/apache/poi/RubyInputStream.java > > $(CLASSES)/org/apache/poi/RubyOutputStream.h: $(BINDIR)/io.java.o Makefile > mkdir -p $(CLASSES)/org/apache/poi/hssf/usermodel >@@ -206,7 +207,7 @@ > $(JCCH) -d $(CLASSES) --classpath=$(JAR_CLASSES) org.apache.poi.hssf.usermodel.HSSFFont > $(JCCH) -d $(CLASSES) --classpath=$(JAR_CLASSES) org.apache.poi.hssf.usermodel.HSSFDataFormat > $(JCCH) -d $(CLASSES) --classpath=$(JAR_CLASSES) org.apache.poi.hssf.usermodel.HSSFCellStyle >- $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.poi.RubyOutputStream >+ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.poi.RubyOutputStream org.apache.poi.RubyInputStream > > > $(BINDIR)/io.cpp.o: $(CLASSES)/org/apache/poi/RubyOutputStream.h cpp/RubyIO.cpp $(BINDIR)/io.java.o
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 42756
: 20404