Yeah, to get a sensible answer, we need to pass in a workbook. However, it probably 
needs to be done less intrusively than pass it in the toFormulaString() signature, 
since that is an interface method that can be called recursively (or in a loop, 
whatever..)

So the current return value is just a placeholder, awaiting a correct implementation. 
Probably silly of me to tweak a placeholder, so, wth, i'll change it back if you feel 
strongly... no issues. 

BTW, i plan to merge this with your work over the weekend, should be done by monday. 
I'll do it manually, but shouldnt be a problem since you have a testcase. 

Regards
-
Avik




   -------Original Message-------
   > From: Paul Krause <[EMAIL PROTECTED]>
   > Subject: RE: cvs commit: jakarta-poi/src/testcases/org/apache/poi/hssf/usermodel 
TestBugs.java
   > Sent: 26 Jul 2003 00:13:13
   >
   >  A NamePtg can name other entities besides named ranges, so this change is 
misleading.
   >  I believe that the right way to do this is to pass in a Workbook and look up the 
NameRecord.
   >  
   >      public String toFormulaString(Workbook book)
   >      {
   >          NameRecord rec = book.getNameRecord(field_1_name_index - 1);
   >          return rec.getNameText();
   >      }
   >  
   >  PFK
   >  
   >  -----Original Message-----
   >  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   >  Sent: Friday, July 25, 2003 2:22 PM
   >  To: [EMAIL PROTECTED]
   >  Subject: cvs commit: jakarta-poi/src/testcases/org/apache/poi/hssf/usermodel 
TestBugs.java
   >  
   >  
   >    1.6.2.2   +14 -12    
jakarta-poi/src/java/org/apache/poi/hssf/record/formula/NamePtg.java
   >  
   >    Index: NamePtg.java
   >    ===================================================================
   >    RCS file: 
/home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/record/formula/NamePtg.java,v
   >    retrieving revision 1.6.2.1
   >    retrieving revision 1.6.2.2
   >    diff -u -r1.6.2.1 -r1.6.2.2
   >    --- NamePtg.java      1 Jul 2003 14:47:34 -0000       1.6.2.1
   >    +++ NamePtg.java      25 Jul 2003 18:22:19 -0000      1.6.2.2
   >    @@ -111,17 +115,15 @@
   >    
   >         public String toFormulaString(SheetReferences refs)
   >         {
   >    -        return "NO IDEA - NAME";
   >    +        return "NAMED RANGE";
   >         }
   >  
   >  
   >  ---------------------------------------------------------------------
   >  To unsubscribe, e-mail: [EMAIL PROTECTED]
   >  For additional commands, e-mail: [EMAIL PROTECTED]
   -------Original Message-------


Reply via email to