DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10777>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10777

[PATCH] The current country in CountryRecord is always 1

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|The current country in      |[PATCH] The current country
                   |CountryRecord is always 1   |in CountryRecord is always 1



------- Additional Comments From [EMAIL PROTECTED]  2002-07-13 20:00 -------
The locale depending code has been added but just for Russian.
As more contributers from different country can find out the code for their 
current country property, they can add more locale-dependent code.

Index: src/java/org/apache/poi/hssf/model/Workbook.java
===================================================================
RCS file: /home/cvspublic/jakarta-
poi/src/java/org/apache/poi/hssf/model/Workbook.java,v
retrieving revision 1.10
diff -r1.10 Workbook.java
62a63
> import java.util.Locale;
408a410
>     
418c420,425
<     public void setSheetName(int sheetnum, String sheetname) {
---
>     // for compartibility
>     public void setSheetName(int sheetnum, String sheetname ) {
>         setSheetName( sheetnum, sheetname, (byte)0 );
>     }
>     
>     public void setSheetName(int sheetnum, String sheetname, short encoding ) 
{
420,423c427,431
<         (( BoundSheetRecord ) boundsheets.get(sheetnum))
<         .setSheetname(sheetname);
<         (( BoundSheetRecord ) boundsheets.get(sheetnum))
<         .setSheetnameLength(( byte ) sheetname.length());
---
>         
>         BoundSheetRecord sheet = (BoundSheetRecord)boundsheets.get( 
sheetnum );
>         sheet.setSheetname(sheetname);
>         sheet.setSheetnameLength( (byte)sheetname.length() );
>               sheet.setCompressedUnicodeFlag( (byte)encoding );
1581c1589,1590
<      * Creates the Country record with the default and current country set to 
1
---
>      * Creates the Country record with the default country set to 1
>      * and current country set to 7 in case of russian locale ("ru_RU") and 1 
otherwise
1591c1600,1608
<         retval.setCurrentCountry(( short ) 1);
---
>         
>         // from Russia with love ;)
>         if ( Locale.getDefault().toString().equals( "ru_RU" ) ) {
>               retval.setCurrentCountry(( short ) 7);
>         }
>         else {
>               retval.setCurrentCountry(( short ) 1);
>         }
>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to