Bug 49262 - HSSFPalette not contain exist cell foregroundcolor
Summary: HSSFPalette not contain exist cell foregroundcolor
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.6-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 03:25 UTC by longxibo
Modified: 2010-06-10 07:35 UTC (History)
0 users



Attachments
for fixbug (29.00 KB, application/octet-stream)
2010-05-07 03:37 UTC, longxibo
Details
a xls cell foreground intercept picture (964.13 KB, image/bmp)
2010-06-07 22:55 UTC, longxibo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description longxibo 2010-05-07 03:25:36 UTC
I use office2007 created a xls,in Cell X1,fill foregroundcolor is RGB(79,129,189).
But when I use HSSFWorkbook open this xls and getCustomPalette,In return HSSFPalette object can't found Color RGB(79,129,189).
java code as follows:
HSSFWorkbook wb;
	FileInputStream finput=null;
	File file;
	
	file = new File("D:\\mysoft\\rpsp-sample\\testfile\\testcopycell.xls");
	try {
	    finput = new FileInputStream(file);
	    wb = new HSSFWorkbook(finput);
	    HSSFPalette palette = wb.getCustomPalette();
	    System.out.print(palette);
	} catch (FileNotFoundException e) {
	    // TODO Auto-generated catch block
	    e.printStackTrace();
	} catch (IOException e) {
	    // TODO Auto-generated catch block
	    e.printStackTrace();
	}finally{
	    try {
		finput.close();
	    } catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	    }
	}
Comment 1 longxibo 2010-05-07 03:37:50 UTC
Created attachment 25412 [details]
for fixbug

d
Comment 2 Nick Burch 2010-05-28 11:27:48 UTC
Your file really doesn't seem to have a cell with that color.

Opening open the file, I see the dark blue is 51,51,153 (X1) and the light blue is 153,229,229 (Y1). So, poi won't find the color you mentioned, because it isn't there...
Comment 3 longxibo 2010-06-07 22:12:34 UTC
(In reply to comment #2)
> Your file really doesn't seem to have a cell with that color.
> Opening open the file, I see the dark blue is 51,51,153 (X1) and the light blue
> is 153,229,229 (Y1). So, poi won't find the color you mentioned, because it
> isn't there...

You certitude open that xls with office2007? I upload the intercept picture
Comment 4 longxibo 2010-06-07 22:55:57 UTC
Created attachment 25543 [details]
a xls cell foreground intercept picture
Comment 5 Nick Burch 2010-06-10 07:35:43 UTC
In your screenshot, I can see your excel claiming the colour is 79/129/189. Loading the screenshot into an image program I can confirm that the colour shown really is 79/129/189

However, when I load the excel file up, the blue I see isn't the same blue that was in your screenshot. I see a darker blue of 51,51,153. Looking in the excel file at the palette records, the colour really is defined as 51,51,153. The colour 79,129,189 isn't in the palette.

So, I think there must be something very odd going on with your copy of excel. It is showing you one colour, but recording a quite different one. Not sure what we can do to help here - if the colour doesn't get put in the file, we can't read it back out again...