#ifndef __LIBREPTOOL_H__
#define __LIBREPTOOL_H__
-#include <rptreport.h>
-#include <rptcommon.h>
-#include <rptobject.h>
-#include <rptobjectellipse.h>
-#include <rptobjectimage.h>
-#include <rptobjectline.h>
-#include <rptobjectrect.h>
-#include <rptobjecttext.h>
-#include <rptprint.h>
+#include <libreptool/rptreport.h>
+#include <libreptool/rptcommon.h>
+#include <libreptool/rptobject.h>
+#include <libreptool/rptobjectellipse.h>
+#include <libreptool/rptobjectimage.h>
+#include <libreptool/rptobjectline.h>
+#include <libreptool/rptobjectrect.h>
+#include <libreptool/rptobjecttext.h>
+#include <libreptool/rptprint.h>
#endif /* __LIBREPTOOL_H__ */
if (fout == NULL)
{
/* TO DO */
+ g_warning ("Unable to write to the output file.");
return;
}
}
if (fout == NULL)
{
/* TO DO */
+ g_warning ("Unable to write to the output file.");
return;
}
if (position == NULL)
{
- /* TO DO */
+ g_warning ("Text node position is mandatory.");
return;
}
{
str_font = g_strconcat (str_font, " italic", NULL);
}
- if (font->size > 0)
+ if (font->size > 0.0f)
{
- str_font = g_strconcat (str_font, g_strdup_printf (" %d", font->size), NULL);
+ str_font = g_strconcat (str_font, g_strdup_printf (" %f", font->size), NULL);
}
else
{
/* creating pango font description */
pfdesc = pango_font_description_from_string (str_font);
+ if (pfdesc == NULL)
+ {
+ g_warning ("Unable to create a PangoFontDescription from the string: %s", str_font);
+ return;
+ }
+
pango_layout_set_font_description (playout, pfdesc);
pango_font_description_free (pfdesc);
if (position == NULL || size == NULL)
{
+ g_warning ("Rect node position and size are mandatories.");
return;
}
if (stroke == NULL)
if (position == NULL || size == NULL)
{
+ g_warning ("Ellipse node position and size are mandatories.");
return;
}
if (stroke == NULL)
gchar *filename= xmlGetProp (xnode, (const xmlChar *)"source");
if (filename == NULL)
{
+ g_warning ("Image node source is mandatory.");
return;
}
border = rpt_common_get_border (xnode);
image = cairo_image_surface_create_from_png (filename);
+ if (cairo_surface_status (image) != CAIRO_STATUS_SUCCESS)
+ {
+ g_warning ("Unable to create the cairo surface from the image «%s».", filename);
+ return;
+ }
pattern = cairo_pattern_create_for_surface (image);
{
RptPrintPrivate *priv = RPT_PRINT_GET_PRIVATE (rpt_print);
- if (from_p == NULL || to_p == NULL) return;
+ if (from_p == NULL || to_p == NULL)
+ {
+ g_warning ("Line node from point and to point are mandatories.");
+ return;
+ }
if (stroke != NULL)
{
{
RptPrintPrivate *priv = RPT_PRINT_GET_PRIVATE (rpt_print);
- if (position == NULL || size == NULL || border == NULL) return;
+ if (position == NULL || size == NULL || border == NULL)
+ {
+ g_warning ("Border position and size are mandatories.");
+ return;
+ }
RptPoint *from_p = (RptPoint *)g_malloc0 (sizeof (RptPoint));
RptPoint *to_p = (RptPoint *)g_malloc0 (sizeof (RptPoint));