cvs commit: jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model ListLevel.java

2005-01-28 Thread klute
klute   2005/01/28 09:23:00

  Modified:src/scratchpad/src/org/apache/poi/hwpf/model ListLevel.java
  Log:
  Bug 33263 fixed: Patch provided by Der-Johng Sun [EMAIL PROTECTED].
  
  Revision  ChangesPath
  1.4   +19 -9 
jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model/ListLevel.java
  
  Index: ListLevel.java
  ===
  RCS file: 
/home/cvs/jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model/ListLevel.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ListLevel.java24 Aug 2004 12:53:59 -  1.3
  +++ ListLevel.java28 Jan 2005 17:23:00 -  1.4
  @@ -49,7 +49,7 @@
 private short _reserved;
 private byte[] _grpprlPapx;
 private byte[] _grpprlChpx;
  -  private char[] _numberText;
  +  private char[] _numberText=null;
   
 public ListLevel(int startAt, int numberFormatCode, int alignment,
  byte[] numberProperties, byte[] entryProperties,
  @@ -111,13 +111,18 @@
   System.arraycopy(buf, offset, _grpprlChpx, 0, _cbGrpprlChpx);
   offset += _cbGrpprlChpx;
   
  -int numberTextLength = LittleEndian.getShort(buf, offset);
  -_numberText = new char[numberTextLength];
  -offset += LittleEndian.SHORT_SIZE;
  -for (int x = 0; x  numberTextLength; x++)
  -{
  -  _numberText[x] = (char)LittleEndian.getShort(buf, offset);
  -  offset += LittleEndian.SHORT_SIZE;
  +int numberTextLength = LittleEndian.getShort(buf, offset); 
  +/* sometimes numberTextLength0 */
  +/* by derjohng */
  +if (numberTextLength0)
  +{
  +_numberText = new char[numberTextLength];
  +offset += LittleEndian.SHORT_SIZE;
  +for (int x = 0; x  numberTextLength; x++)
  +{
  +  _numberText[x] = (char)LittleEndian.getShort(buf, offset);
  +  offset += LittleEndian.SHORT_SIZE;
  +}
   }
   
 }
  @@ -230,7 +235,12 @@
 }
 public int getSizeInBytes()
 {
  -return 28 + _cbGrpprlChpx + _cbGrpprlPapx + (_numberText.length * 
LittleEndian.SHORT_SIZE) + 2;
  +  if (_numberText!=null)
  +  {
  +return 28 + _cbGrpprlChpx + _cbGrpprlPapx + (_numberText.length 
* LittleEndian.SHORT_SIZE) + 2;
  +  } else {
  +  return 28 + _cbGrpprlChpx + _cbGrpprlPapx  + 2;
  +  }
 }
   
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



[Attn:Jason] Re: JUnit test fails and other problem

2005-01-28 Thread avik . sengupta
Jason,
Do you remember what is the current status on
http://issues.apache.org/bugzilla/show_bug.cgi?id=22742
I seem to remember there was some problem with this patch in our 
conversion from
the 2.0 branch to head. Any clues? This is apparently causing this tests to
fail.

Amol, thanks for the report. And please bring on any patches!
Quoting Amol Deshmukh [EMAIL PROTECTED]:
Hi,
(I.)
I'm having some problems running the JUnit tests
for the POI source code. StackTrace is at the end
of this message. Apparently this is something that
I have noticed over the last week or so. I was able
to get all the tests running prior to that.
The exception is thrown from a call at:
org.apache.poi.hssf.usermodel.TestBugs.test15556(TestBugs.java:259)
I'm running Windows XP.
(II.)
Also, I wanted to know how to send a PATCH for
the JUnit tests. Atleast one class does not seem to
close FileIn/OutputStreams at all places
(org.apache.poi.hssf.usermodel.TestBugs). I have
fixed the 'problem' locally, but I dont know whether
this should be submitted as a PATCH since it is change
to 'testing' code.
Regards,
~ amol
 Addendum: 
Stack trace for (I.) from JUnit via ant task test:
[junit] java.lang.reflect.InvocationTargetException
[junit] at
sun.reflect.GeneratedConstructorAccessor41.newInstance(Unknown Source)
[junit] at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[junit] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[junit] at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:224
)
[junit] at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:16
0)
[junit] at
org.apache.poi.hssf.usermodel.HSSFWorkbook.init(HSSFWorkbook.java:164)
[junit] at
org.apache.poi.hssf.usermodel.HSSFWorkbook.init(HSSFWorkbook.java:211)
[junit] at
org.apache.poi.hssf.usermodel.HSSFWorkbook.init(HSSFWorkbook.java:192)
[junit] at
org.apache.poi.hssf.usermodel.TestBugs.test15556(TestBugs.java:259)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
[junit] at java.lang.reflect.Method.invoke(Unknown Source)
[junit] at junit.framework.TestCase.runTest(TestCase.java:154)
[junit] at junit.framework.TestCase.runBare(TestCase.java:127)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRu
nner.java:289)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask
.java:1061)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.jav
a:676)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitT
ask.java:1413)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.jav
a:633)
[junit] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[junit] at org.apache.tools.ant.Task.perform(Task.java:364)
[junit] at org.apache.tools.ant.Target.execute(Target.java:341)
[junit] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[junit] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[junit] at
org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[junit] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunn
er.java:377)
[junit] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRun
ner.java:135)
[junit] Caused by: java.lang.ArrayIndexOutOfBoundsException: 33
[junit] at
org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:491)
[junit] at
org.apache.poi.util.LittleEndian.getShort(LittleEndian.java:52)
[junit] at
org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:98)
[junit] at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
[junit] at org.apache.poi.hssf.record.Record.init(Record.java:55)
[junit] at
org.apache.poi.hssf.record.ObjRecord.init(ObjRecord.java:61)
[junit] ... 34 more
[junit] Test
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:

DO NOT REPLY [Bug 33153] - Need way to get cell num in excel form eg. C11, GH239 etc.

2005-01-28 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33153.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33153


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Additional Comments From [EMAIL PROTECTED]  2005-01-28 19:08 ---
new org.apache.poi.hssf.util.CellReference(row,col).toString()

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/