Skip to content
  • Jon K Hellan's avatar
    New function. Factored out of style_color_new. Creates color · c200db78
    Jon K Hellan authored
    2002-02-05  Jon K Hellan  <hellan@acm.org>
    
    	* src/style-color.c (style_color_new_uninterned): New
    	function. Factored out of style_color_new. Creates color
    	unconditionally, without using the hash table.
    	(style_color_new): Factor out style_color_new_uninterned.
    	(style_color_new_i8): New function. Create a style color from 8
    	bit rgb values by cloning to 16 bits.
    	(style_color_auto_font): New function. Returns an uninterned black
    	to represent Excel auto font color.
    	(style_color_auto_back): New function. Returns an uninterned white
    	to represent Excel auto background color.
    	(style_color_auto_pattern): New function. Returns an uninterned black
    	to represent Excel auto pattern color.
    	(color_equal): Include is_auto flag in comparison.
    	(color_hash): Include is_auto flag in hash function.
    
    	* src/style-color.h (style_color_new_i8, style_color_auto_font,
    	style_color_auto_back, style_color_auto_pattern): Declare
    
    	* src/sheet-style.c (struct _SheetStyleData): Add
    	auto_pattern_color.
    	(sheet_style_init): Initialize auto_pattern_color.
    	(sheet_style_shutdown): Unref auto_pattern_color.
    	(sheet_style_set_auto_pattern_color): New function. Set the auto
    	pattern color for this sheet.
    	(sheet_style_get_auto_pattern_color): New function. Get the auto
    	pattern color for this sheet.
    
    	* src/sheet-style.h (sheet_style_set_auto_pattern_color,
    	sheet_style_get_auto_pattern_color): Declare.
    
    	* src/dialogs/dialog-cell-format.c (border_get_mstyle): Use
            style_color_new_i8.
    
    	* src/plugins/excel/ms-excel-read.c (black_or_white_contrast): Burn.
    	(ms_excel_palette_get): Simplify to get autocolors right. We used
    	to be too clever.
    	(ms_sheet_map_color): Use style_color_new_i8 to convert from
    	rgb888.
    	(ms_excel_read_window2): Update pattern color according to
    	icvHdr/rgbHdr grid color if fDefaultHdr flag says so.
    
    	* src/plugins/applix/applix-read.c (applix_read_colormap): Use
            style_color_new_i8.
    c200db78