Commit d07ed146 authored by Bruno Unna's avatar Bruno Unna

In src/gnumeric-utilc:

- Added the function font_get_italic_name, analogous to font_get_bold_name.

In plugins/excel/ms-excel.c:
- Modified the function ms_excel_set_cell_font to enhance the support of
  excel font attributes.
parent 74ad45b9
......@@ -15,6 +15,7 @@
#include <stdio.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "gnome-xml/tree.h"
#include "gnome-xml/parser.h"
#include "color.h"
......@@ -275,24 +276,20 @@ static void ms_excel_set_cell_font (MS_EXCEL_SHEET *sheet, Cell *cell, BIFF_XF_D
{
BIFF_FONT_DATA *fd = ptr->data ;
/* FIXME: the following does not accept the possibility of bold AND italic. Ugly code. */
if (fd->italic)
{
cell_set_font (cell, font_get_italic_name(fd->fontname)) ;
cell->style->font->hint_is_italic = 1;
}
else
{
if (fd->boldness==0x2bc)
{
cell_set_font (cell, font_get_bold_name(fd->fontname)) ;
cell->style->font->hint_is_bold = 1;
}
else
{
cell_set_font (cell, fd->fontname) ;
}
}
/* FIXME: instead of just copying the windows font into the cell, we
* should implement a font name mapping mechanism. */
cell_set_font (cell, fd->fontname) ;
if (fd->italic)
{
cell_set_font (cell, font_get_italic_name (cell->style->font->font_name)) ;
cell->style->font->hint_is_italic = 1;
}
if (fd->boldness==0x2bc)
{
cell_set_font (cell, font_get_bold_name (cell->style->font->font_name)) ;
cell->style->font->hint_is_bold = 1;
}
/* What about underlining? */
return ;
}
idx++ ;
......
......@@ -15,6 +15,7 @@
#include <stdio.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "gnome-xml/tree.h"
#include "gnome-xml/parser.h"
#include "color.h"
......@@ -275,24 +276,20 @@ static void ms_excel_set_cell_font (MS_EXCEL_SHEET *sheet, Cell *cell, BIFF_XF_D
{
BIFF_FONT_DATA *fd = ptr->data ;
/* FIXME: the following does not accept the possibility of bold AND italic. Ugly code. */
if (fd->italic)
{
cell_set_font (cell, font_get_italic_name(fd->fontname)) ;
cell->style->font->hint_is_italic = 1;
}
else
{
if (fd->boldness==0x2bc)
{
cell_set_font (cell, font_get_bold_name(fd->fontname)) ;
cell->style->font->hint_is_bold = 1;
}
else
{
cell_set_font (cell, fd->fontname) ;
}
}
/* FIXME: instead of just copying the windows font into the cell, we
* should implement a font name mapping mechanism. */
cell_set_font (cell, fd->fontname) ;
if (fd->italic)
{
cell_set_font (cell, font_get_italic_name (cell->style->font->font_name)) ;
cell->style->font->hint_is_italic = 1;
}
if (fd->boldness==0x2bc)
{
cell_set_font (cell, font_get_bold_name (cell->style->font->font_name)) ;
cell->style->font->hint_is_bold = 1;
}
/* What about underlining? */
return ;
}
idx++ ;
......
......@@ -174,11 +174,7 @@ font_get_italic_name (char *fontname)
{
char *f;
f = font_change_component (fontname, 3, "i");
f = font_change_component (fontname, 3, "o");
return f;
}
......@@ -174,11 +174,7 @@ font_get_italic_name (char *fontname)
{
char *f;
f = font_change_component (fontname, 3, "i");
f = font_change_component (fontname, 3, "o");
return f;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment