[goffice] Changed go_component_set_font so that it returns TRUE when its size changed.
- From: Jean BrÃfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] Changed go_component_set_font so that it returns TRUE when its size changed.
- Date: Tue, 11 Dec 2012 15:55:25 +0000 (UTC)
commit a9bab7939c56a82f22436d1cf0ebcfdd260d907e
Author: Jean Brefort <jean brefort normalesup org>
Date: Tue Dec 11 16:54:14 2012 +0100
Changed go_component_set_font so that it returns TRUE when its size changed.
ChangeLog | 6 ++++++
goffice/component/go-component.c | 15 +++++++++++++--
goffice/component/go-component.h | 4 ++--
3 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4a41992..43d9d62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-11 Jean Brefort <jean brefort normalesup org>
+
+ * goffice/component/go-component.c (go_component_set_font): make it return
+ TRUE when size changed.
+ * goffice/component/go-component.h: ditto.
+
2012-12-03 Jean Brefort <jean brefort normalesup org>
* configure.in: rquire lasem >= 0.4.1.
diff --git a/goffice/component/go-component.c b/goffice/component/go-component.c
index 4c8590e..8754cce 100644
--- a/goffice/component/go-component.c
+++ b/goffice/component/go-component.c
@@ -851,11 +851,22 @@ go_component_get_snapshot (GOComponent *component, GOSnapshotType *type, size_t
return component->snapshot_data;
}
-void go_component_set_font (GOComponent *component, PangoFontDescription const *desc)
+/**
+ * go_component_set_font:
+ * @component: #GOComponent
+ * @desc: #PangoFontDescription
+ *
+ * Sets the font the component should use. Not all components will actually
+ * changed the font they use.
+ * Returns: %TRUE if size changed.
+ */
+
+gboolean go_component_set_font (GOComponent *component, PangoFontDescription const *desc)
{
GOComponentClass *klass = GO_COMPONENT_GET_CLASS (component);
if (klass->set_font)
- klass->set_font (component, desc);
+ return klass->set_font (component, desc);
+ return FALSE;
}
/**
diff --git a/goffice/component/go-component.h b/goffice/component/go-component.h
index 0b10e4d..0c983ec 100644
--- a/goffice/component/go-component.h
+++ b/goffice/component/go-component.h
@@ -70,7 +70,7 @@ struct _GOComponentClass {
void (*set_size) (GOComponent *component);
void (*render) (GOComponent *component, cairo_t *cr,
double width, double height);
- void (*set_font) (GOComponent *component, PangoFontDescription const *desc);
+ gboolean (*set_font) (GOComponent *component, PangoFontDescription const *desc);
/*<private>*/
void (*reserved1) (void);
void (*reserved2) (void);
@@ -116,7 +116,7 @@ GOCmdContext *go_component_get_command_context (GOComponent *component);
void go_component_set_default_command_context (GOCmdContext *cc);
void go_component_render (GOComponent *component, cairo_t *cr, double width, double height);
void go_component_get_size (GOComponent *component, double *width, double *height);
-void go_component_set_font (GOComponent *component, PangoFontDescription const *desc);
+gboolean go_component_set_font (GOComponent *component, PangoFontDescription const *desc);
void go_component_write_xml_sax (GOComponent *component, GsfXMLOut *output);
typedef void (*GOComponentSaxHandler)(GOComponent *component, gpointer user_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]