Verified Commit 07971282 authored by Zander's avatar Zander 💥

Fix some simple warnings to avoid important warning being missed

parent 6830485c
......@@ -405,12 +405,12 @@ void
ddisplay_add_update(DDisplay *ddisp, const Rectangle *rect)
{
Rectangle *r;
int width, height;
// int width, height;
if (!ddisp->renderer)
return; /* can happen at creation time of the diagram */
width = dia_renderer_get_width_pixels (ddisp->renderer);
height = dia_renderer_get_height_pixels (ddisp->renderer);
// width = dia_renderer_get_width_pixels (ddisp->renderer);
// height = dia_renderer_get_height_pixels (ddisp->renderer);
if (!rectangle_intersects(rect, &ddisp->visible))
return;
......
......@@ -75,14 +75,14 @@ gtk_hwrap_box_get_type (void)
static void
gtk_hwrap_box_class_init (GtkHWrapBoxClass *class)
{
GObjectClass *object_class;
// GObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
// GtkContainerClass *container_class;
GtkWrapBoxClass *wrap_box_class;
object_class = G_OBJECT_CLASS (class);
// object_class = G_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
container_class = GTK_CONTAINER_CLASS (class);
// container_class = GTK_CONTAINER_CLASS (class);
wrap_box_class = GTK_WRAP_BOX_CLASS (class);
parent_class = g_type_class_peek_parent (class);
......
......@@ -75,14 +75,14 @@ gtk_vwrap_box_get_type (void)
static void
gtk_vwrap_box_class_init (GtkVWrapBoxClass *class)
{
GObjectClass *object_class;
// GObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
// GtkContainerClass *container_class;
GtkWrapBoxClass *wrap_box_class;
object_class = G_OBJECT_CLASS (class);
// object_class = G_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
container_class = GTK_CONTAINER_CLASS (class);
// container_class = GTK_CONTAINER_CLASS (class);
wrap_box_class = GTK_WRAP_BOX_CLASS (class);
parent_class = g_type_class_peek_parent (class);
......
......@@ -353,6 +353,8 @@ load_accels(void)
g_free(accelfilename);
}
}
/* FIXME: Apparently unused
static gint
save_accels(gpointer data)
{
......@@ -365,6 +367,7 @@ save_accels(gpointer data)
}
return TRUE;
}
*/
/**
* Synchronized the Object snap property button with the display.
......
......@@ -1259,7 +1259,9 @@ dia_object_type_get_icon (const DiaObjectType *type)
* compatability with 0.97.3 objects */
g_warning ("Object '%s' has an inline icon, this is deprecated",
type->name);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
pixbuf = gdk_pixbuf_new_from_inline (-1, (guint8 *) icon_data, TRUE, NULL);
G_GNUC_END_IGNORE_DEPRECATIONS
} else if (type->pixmap_file != NULL) {
GError *error = NULL;
pixbuf = gdk_pixbuf_new_from_file (type->pixmap_file, &error);
......
......@@ -39,7 +39,7 @@ G_BEGIN_DECLS
/** Flags for DiaObject */
typedef enum {
/** Set this if the DiaObject can 'contain' other objects that move with
* it, a.k.a. be a parent. A parent moves its children along and
* it, a.k.a. be a parent. A parent moves its children along and
* constricts its children to live inside its borders.
*/
DIA_OBJECT_CAN_PARENT = 1
......@@ -106,7 +106,7 @@ typedef DiaObject* (*CreateFunc) (Point *startpoint,
*
* @param obj_node A node in an XML object to load from.
* @param version The version of the object found in the XML file.
* @param filename The name of the file we're loading from, for use in
* @param filename The name of the file we're loading from, for use in
* error messages.
*
* \public \memberof _DiaObjectType
......@@ -225,7 +225,7 @@ typedef void (*SelectFunc) (DiaObject* obj,
* \brief Copy constructor of _DiaObject.
*
* This must be an depth-copy (pointers must be duplicated and so on)
* as the initial object can be deleted any time.
* as the initial object can be deleted any time.
*
* @param obj An object to make a copy of.
* @return A newly allocated object copied from `obj', but without any
......@@ -332,7 +332,7 @@ typedef ObjectChange *(*ApplyPropertiesDialogFunc) (DiaObject* obj, GtkWidget *w
* \public \memberof _DiaObject
*/
typedef ObjectChange *(*ApplyPropertiesListFunc) (DiaObject* obj, GPtrArray* props);
/*!
* \brief Describe the properties that this object supports.
*
......@@ -444,7 +444,7 @@ void object_remove_handle(DiaObject *obj, Handle *handle);
void object_add_connectionpoint(DiaObject *obj, ConnectionPoint *conpoint);
void object_remove_connectionpoint(DiaObject *obj,
ConnectionPoint *conpoint);
void object_add_connectionpoint_at(DiaObject *obj,
void object_add_connectionpoint_at(DiaObject *obj,
ConnectionPoint *conpoint,
int pos);
void object_connect(DiaObject *obj, Handle *handle,
......@@ -458,14 +458,14 @@ void object_registry_foreach(GHFunc func, gpointer user_data);
DiaObjectType *object_get_type(char *name);
gchar *object_get_displayname (DiaObject* obj);
gboolean object_flags_set(DiaObject* obj, gint flags);
/* These functions can be used as a default implementation for an object which
can be completely described, loaded and saved through standard properties.
*/
DiaObject *object_load_using_properties(const DiaObjectType *type,
ObjectNode obj_node, int version,
DiaContext *ctx);
void object_save_using_properties(DiaObject *obj, ObjectNode obj_node,
void object_save_using_properties(DiaObject *obj, ObjectNode obj_node,
DiaContext *ctx);
DiaObject *object_copy_using_properties(DiaObject *obj);
......@@ -494,7 +494,7 @@ struct _ObjectOps {
SetPropsFunc set_props;
TextEditFunc edit_text;
ApplyPropertiesListFunc apply_properties_list;
/*! check for NULL before calling */
TransformFunc transform;
......@@ -504,7 +504,7 @@ struct _ObjectOps {
Then an older object will be binary compatible, because all new code
checks if new ops are supported (!= NULL)
*/
void (*(unused[3]))(DiaObject *obj,...);
void (*unused[3])(DiaObject *obj,...);
};
/*!
......@@ -524,7 +524,7 @@ struct _DiaObject {
Point position; /*!< often but not necessarily the upper left corner of the object */
/*!
* \brief Rectangle containing the whole object
*
*
* The area that contains all parts of the 'real' object, i.e. the parts
* that would be printed, exported to pixmaps etc. This is also used to
* determine the size of autofit scaling, so it should be as large as
......@@ -548,7 +548,7 @@ struct _DiaObject {
Layer *parent_layer; /*!< Back-pointer to the owning layer.
This may only be set by functions internal to
the layer, and accessed via
the layer, and accessed via
dia_object_get_parent_layer() */
DiaObject *parent; /*!< Back-pointer to DiaObject which is parenting this object. Can be NULL */
GList *children; /*!< In case this object is a parent of other object the children are listed here */
......@@ -583,7 +583,7 @@ struct _ObjectTypeOps {
Then an older object will be binary compatible, because all new code
checks if new ops are supported (!= NULL)
*/
void (*(unused[10]))(DiaObject *obj,...);
void (*unused[10])(DiaObject *obj,...);
};
/*!
......@@ -595,12 +595,12 @@ struct _ObjectTypeOps {
struct _DiaObjectType {
char *name; /*!< The type name should follow a pattern of '\<module\> - \<class\>' like "UML - Class" */
int version; /*!< DiaObjects must be backward compatible, i.e. support possibly older versions formats */
int version; /*!< DiaObjects must be backward compatible, i.e. support possibly older versions formats */
const char **pixmap; /*!< Also put a pixmap in the sheet_object.
This one is used if not in sheet but in toolbar.
Stored in xpm format */
ObjectTypeOps *ops; /* pointer to the vtable */
char *pixmap_file; /*!< fallback if pixmap is NULL */
......
......@@ -750,7 +750,7 @@ image_load(ObjectNode obj_node, int version, DiaContext *ctx)
DiaObject *obj;
int i;
AttributeNode attr;
char *diafile_dir;
// char *diafile_dir;
image = g_malloc0(sizeof(Image));
elem = &image->element;
......
......@@ -119,8 +119,8 @@ DiaGraph::AddEdge (int srcNode, int destNode, double* points, int len)
IGraph::eResult
DiaGraph::Layout (const char *module)
{
double p1, p2;
int n;
// double p1, p2;
// int n;
if (strcmp(module, "Grow") == 0)
return Scale (1.4142, 1.4142) ? SUCCESS : FAILED_ALGORITHM;
......
......@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*!
* \file layout.cpp - plugin for automatic diagram layout
*/
......@@ -74,7 +74,7 @@ static int
_obj_get_bends (DiaObject *obj, std::vector<double>& coords)
{
Property *prop = NULL;
coords.resize(0);
// no need to ask for Standard - Line: start_point, end_point
// we always drop the very first and last point
......@@ -91,7 +91,7 @@ _obj_get_bends (DiaObject *obj, std::vector<double>& coords)
} else if ((prop = object_prop_by_name(obj, "bez_points")) != NULL) {
BezPointarrayProperty *ptp = (BezPointarrayProperty *)prop;
int num = ptp->bezpointarray_data->len;
for (int i = 1; i < num-1; ++i) {
BezPoint *bp = &g_array_index(ptp->bezpointarray_data, BezPoint, i);
......@@ -114,7 +114,7 @@ static ObjectChange *
_obj_set_bends (DiaObject *obj, std::vector<double>& coords)
{
Property *prop = NULL;
if ((prop = object_prop_by_name(obj, "poly_points")) != NULL) {
PointarrayProperty *ptp = (PointarrayProperty *)prop;
int num = ptp->pointarray_data->len;
......@@ -226,7 +226,7 @@ layout_callback (DiagramData *data,
nodes = g_list_append (nodes, o);
//FIXME: neither 1 nor num_handles-1 is guaranteed to be the second connection
// it entirely depends on the objects implementation
else if ( o->num_handles > 1 && o->handles[0]->connected_to
else if ( o->num_handles > 1 && o->handles[0]->connected_to
&& (o->handles[1]->connected_to || o->handles[o->num_handles-1]->connected_to))
edges = g_list_append (edges, o);
list = g_list_next(list);
......@@ -282,7 +282,7 @@ layout_callback (DiagramData *data,
if (g->GetNodePosition (n, &pt.x, &pt.y)) {
DiaObject *o = (DiaObject *)list->data;
GPtrArray *props = g_ptr_array_new ();
//FIXME: can't use "obj_pos", it is not read in usual update_data impementations
// "elem_corner" will only work for Element derived classes, but that covers most
// of the cases here ...
......@@ -329,10 +329,12 @@ layout_callback1 (DiagramData *data,
{
return layout_callback (data, filename, flags, user_data, dia_graph_create);
}
/* FIXME: Apparently unused?
static ObjectChange *
layout_callback2 (DiagramData *data,
const gchar *filename,
guint flags, /* further additions */
guint flags, / * further additions * /
void *user_data)
{
#ifdef HAVE_OGDF
......@@ -341,6 +343,7 @@ layout_callback2 (DiagramData *data,
return NULL;
#endif
}
*/
#define AN_ENTRY(group, name, func) \
{ \
......@@ -350,7 +353,7 @@ layout_callback2 (DiagramData *data,
layout_callback ##func, \
(void*)#name \
}
static DiaCallbackFilter cb_layout[] = {
#ifdef HAVE_OGDF
AN_ENTRY(Test, NotAvailable, 2),
......@@ -375,7 +378,7 @@ static DiaCallbackFilter cb_layout[] = {
AN_ENTRY(Planar, Schnyder, 2),
AN_ENTRY(Energy-based, SpringEmbedderFR, 2),
AN_ENTRY(Energy-based, SpringEmbedderKK, 2),
//Borked(huge):
//Borked(huge):
AN_ENTRY(Energy-based, StressMajorization, 2),
AN_ENTRY(Upward, Sugiyama, 2),
AN_ENTRY(Tree, TreeStraight, 2),
......
......@@ -27,17 +27,17 @@
/*
* New
*/
PyObject*
PyObject*
PyDiaProperties_New (DiaObject* obj)
{
PyDiaProperties *self;
self = PyObject_NEW(PyDiaProperties, &PyDiaProperties_Type);
if (!self) return NULL;
self->object = obj; /* XXX: should be ref counted */
self->nprops = -1;
return (PyObject *)self;
}
......@@ -100,14 +100,14 @@ PyDiaProperties_Get(PyDiaProperties *self, PyObject *args)
if (self->object->ops->get_props != NULL) {
Property *p;
char* name = PyString_AsString(key);
p = object_prop_by_name (self->object, name);
p = object_prop_by_name (self->object, name);
if (p) {
val = PyDiaProperty_New(p); /* makes a copy */
p->ops->free(p);
}
}
if (val == NULL) {
if (val == NULL) {
val = failobj;
Py_INCREF(val);
}
......@@ -133,7 +133,7 @@ PyDiaProperties_HasKey(PyDiaProperties *self, PyObject *args)
name = PyString_AsString(key);
p = object_prop_by_name (self->object, name);
p = object_prop_by_name (self->object, name);
ok = (NULL != p);
if (p)
p->ops->free(p);
......@@ -167,7 +167,7 @@ PyDiaProperties_Keys(PyDiaProperties *self, PyObject *args)
return list;
}
static int
static Py_ssize_t
PyDiaProperties_Length (PyDiaProperties* self)
{
if (self->nprops < 0) {
......@@ -198,10 +198,10 @@ PyDiaProperties_Subscript (PyDiaProperties *self, register PyObject *key)
}
else {
Property *p;
char *name;
char *name;
name = PyString_AsString(key);
p = object_prop_by_name (self->object, name);
p = object_prop_by_name (self->object, name);
if (p) {
v = PyDiaProperty_New(p); /* makes a copy */
......@@ -225,10 +225,10 @@ PyDiaProperties_AssSub (PyDiaProperties* self, PyObject *key, PyObject *val)
}
else {
Property *p;
char *name;
char *name;
name = PyString_AsString(key);
p = object_prop_by_name (self->object, name);
p = object_prop_by_name (self->object, name);
/* g_print ("AssSub(key: '%s', type <%s>)\n", name, (p ? p->type : "none")); */
if (p) {
......
......@@ -49,10 +49,10 @@
PyObject* PyDiaProperty_New (Property* property)
{
PyDiaProperty *self;
self = PyObject_NEW(PyDiaProperty, &PyDiaProperty_Type);
if (!self) return NULL;
self->property = property->ops->copy (property);
return (PyObject *)self;
......@@ -98,13 +98,13 @@ PyDiaProperty_Hash(PyObject *self)
typedef PyObject * (*PyDiaPropGetFunc) (Property*);
typedef int (*PyDiaPropSetFunc) (Property*, PyObject *val);
static PyObject * PyDia_get_Char (CharProperty *prop)
static PyObject * PyDia_get_Char (CharProperty *prop)
{ return PyInt_FromLong(prop->char_data); }
static PyObject * PyDia_get_Bool (BoolProperty *prop)
static PyObject * PyDia_get_Bool (BoolProperty *prop)
{ return PyInt_FromLong(prop->bool_data); }
static PyObject * PyDia_get_Int (IntProperty *prop)
static PyObject * PyDia_get_Int (IntProperty *prop)
{ return PyInt_FromLong(prop->int_data); }
static PyObject * PyDia_get_IntArray (IntarrayProperty *prop)
static PyObject * PyDia_get_IntArray (IntarrayProperty *prop)
{
PyObject *ret;
int i, num;
......@@ -113,14 +113,14 @@ static PyObject * PyDia_get_IntArray (IntarrayProperty *prop)
ret = PyTuple_New (num);
for (i = 0; i < num; i++)
PyTuple_SetItem(ret, i,
PyTuple_SetItem(ret, i,
PyInt_FromLong(g_array_index(prop->intarray_data, gint, i)));
return ret;
}
static PyObject * PyDia_get_Enum (EnumProperty *prop)
static PyObject * PyDia_get_Enum (EnumProperty *prop)
{ return PyInt_FromLong(prop->enum_data); }
static PyObject * PyDia_get_LineStyle (LinestyleProperty *prop)
{
static PyObject * PyDia_get_LineStyle (LinestyleProperty *prop)
{
PyObject *ret;
ret = PyTuple_New (2);
......@@ -128,14 +128,14 @@ static PyObject * PyDia_get_LineStyle (LinestyleProperty *prop)
PyTuple_SetItem(ret, 1, PyFloat_FromDouble(prop->dash));
return ret;
}
static PyObject * PyDia_get_Real (RealProperty *prop)
static PyObject * PyDia_get_Real (RealProperty *prop)
{ return PyFloat_FromDouble(prop->real_data); }
static PyObject * PyDia_get_Length (LengthProperty *prop)
static PyObject * PyDia_get_Length (LengthProperty *prop)
{ return PyFloat_FromDouble(prop->length_data); }
static PyObject * PyDia_get_Fontsize (FontsizeProperty *prop)
static PyObject * PyDia_get_Fontsize (FontsizeProperty *prop)
{ return PyFloat_FromDouble(prop->fontsize_data); }
static PyObject * PyDia_get_String (StringProperty *prop)
{
static PyObject * PyDia_get_String (StringProperty *prop)
{
if (NULL == prop->string_data)
return PyString_FromString("(NULL)");
else if (1 == prop->num_lines)
......@@ -143,20 +143,20 @@ static PyObject * PyDia_get_String (StringProperty *prop)
else /* FIXME: MULTISTRING ? */
return PyString_FromString(prop->string_data);
}
static PyObject * PyDia_get_StringList (StringListProperty *prop)
{
static PyObject * PyDia_get_StringList (StringListProperty *prop)
{
GList *tmp;
PyObject *ret = PyList_New(0);
for (tmp = prop->string_list; tmp; tmp = tmp->next)
PyList_Append(ret, PyString_FromString(tmp->data));
return ret;
return ret;
}
static PyObject * PyDia_get_Text (TextProperty *prop)
{ return PyDiaText_New (prop->text_data, &prop->attr); }
static PyObject * PyDia_get_Point (PointProperty *prop)
static PyObject * PyDia_get_Point (PointProperty *prop)
{ return PyDiaPoint_New (&prop->point_data); }
static PyObject * PyDia_get_PointArray (PointarrayProperty *prop)
static PyObject * PyDia_get_PointArray (PointarrayProperty *prop)
{
PyObject *ret;
int i, num;
......@@ -165,12 +165,12 @@ static PyObject * PyDia_get_PointArray (PointarrayProperty *prop)
ret = PyTuple_New (num);
for (i = 0; i < num; i++)
PyTuple_SetItem(ret, i,
PyTuple_SetItem(ret, i,
PyDiaPoint_New(&g_array_index(prop->pointarray_data,
Point, i)));
return ret;
}
static PyObject * PyDia_get_BezPoint (BezPointProperty *prop)
static PyObject * PyDia_get_BezPoint (BezPointProperty *prop)
{ return PyDiaBezPoint_New (&prop->bezpoint_data); }
static PyObject * PyDia_get_BezPointArray (BezPointarrayProperty *prop)
{
......@@ -181,7 +181,7 @@ static PyObject * PyDia_get_BezPointArray (BezPointarrayProperty *prop)
ret = PyTuple_New (num);
for (i = 0; i < num; i++)
PyTuple_SetItem(ret, i,
PyTuple_SetItem(ret, i,
PyDiaBezPoint_New(&g_array_index(prop->bezpointarray_data,
BezPoint, i)));
return ret;
......@@ -263,7 +263,7 @@ static int
PyDia_set_Arrow (Property *prop, PyObject *val)
{
ArrowProperty *p = (ArrowProperty *)prop;
if (val->ob_type == &PyDiaArrow_Type) {
p->arrow_data = ((PyDiaArrow *)val)->arrow;
return 0;
......@@ -292,7 +292,7 @@ static int
PyDia_set_Matrix (Property *prop, PyObject *val)
{
MatrixProperty *p = (MatrixProperty *)prop;
if (val->ob_type == &PyDiaMatrix_Type) {
if (!p->matrix)
p->matrix = g_new (DiaMatrix, 1);
......@@ -309,8 +309,8 @@ PyDia_set_Color (Property *prop, PyObject *val)
gchar *str = PyString_AsString(val);
PangoColor color;
if (pango_color_parse(&color, str)) {
p->color_data.red = color.red / 65535.0;
p->color_data.green = color.green / 65535.0;
p->color_data.red = color.red / 65535.0;
p->color_data.green = color.green / 65535.0;
p->color_data.blue = color.blue / 65535.0;
p->color_data.alpha = 1.0;
return 0;
......@@ -330,8 +330,8 @@ PyDia_set_Color (Property *prop, PyObject *val)
else
f[i] = 0.0;
}
p->color_data.red = f[0];
p->color_data.green = f[1];
p->color_data.red = f[0];
p->color_data.green = f[1];
p->color_data.blue = f[2];
p->color_data.alpha = 1.0;
return 0;
......@@ -364,8 +364,8 @@ PyDia_set_Real(Property *prop, PyObject *val)
}
return -1;
}
/* as of this writing the only difference between Real-, Length- and Fontsize-property
* is the widget representing them. But that may change so here are the 'type-safe'
/* as of this writing the only difference between Real-, Length- and Fontsize-property
* is the widget representing them. But that may change so here are the 'type-safe'
* accessors.
*/
static int
......@@ -419,7 +419,7 @@ PyDia_set_String(Property *prop, PyObject *val)
g_free (p->string_data);
p->string_data = g_strdup (str);
p->num_lines = 1;
Py_DECREF (uval);
Py_DECREF (uval);
return 0;
}
return -1;
......@@ -439,7 +439,7 @@ PyDia_set_Text(Property *prop, PyObject *val)
gchar *str = PyString_AsString(uval);
g_free (p->text_data);
p->text_data = g_strdup (str);
Py_DECREF (uval);
Py_DECREF (uval);
return 0;
}
return -1;
......@@ -601,7 +601,7 @@ ensure_quarks(void)
}
}
static PyObject *
static PyObject *
PyDia_get_Array (ArrayProperty *prop)
{
PyObject *ret;
......@@ -703,7 +703,7 @@ PyDia_set_Array (Property *prop, PyObject *val)
if (Py_None == v) {
/* use just the defaults, setters don't need to handle this */
} else {
g_debug ("Failed to set '%s::%s' from '%s'",
g_debug ("Failed to set '%s::%s' from '%s'",
p->common.descr->name, inner->descr->name, v->ob_type->tp_name);
inner->ops->free(inner);
ret = -1;
......@@ -730,7 +730,7 @@ _keyvalue_get (gpointer key,
gchar *val = (gchar *)value;
PyObject *dict = (PyObject *)user_data;
PyObject *k, *v;
k = PyString_FromString(name);
v = PyString_FromString(val);
if (k && v)
......@@ -752,18 +752,19 @@ PyDia_set_Dict (Property *prop, PyObject *val)
DictProperty *p = (DictProperty *)prop;
if PyDict_Check(val) {
int i = 0; /* not to be modified! */
Py_ssize_t i = 0; /* not to be modified! */
PyObject *key, *value;
if (!p->dict)
p->dict = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
while (PyDict_Next(val, &i, &key, &value)) {
/* CHECK semantics: replace or add? */
g_hash_table_insert (p->dict,
g_strdup (PyString_AsString (key)),
g_strdup (PyString_AsString (value)));
g_hash_table_insert (p->dict, g_strdup (PyString_AsString (key)),
g_strdup (PyString_AsString (value)));
}
return 0;
}
return -1;
......@@ -779,7 +780,7 @@ PyDia_get_Pixbuf (PixbufProperty *prop)
return Py_None;
}
pb = PyCObject_FromVoidPtrAndDesc (prop->pixbuf, NULL, NULL);
return pb;
}
static int
......@@ -838,9 +839,9 @@ PyDiaProperty_GetAttr(PyDiaProperty *self, gchar *attr)
* Similar to SetAttr but the property is directly applied
* to the DiaObject
*/
int PyDiaProperty_ApplyToObject (DiaObject *object,
gchar *key,
Property *prop,
int PyDiaProperty_ApplyToObject (DiaObject *object,
gchar *key,
Property *prop,
PyObject *val)
{
int ret = -1;
......
......@@ -3,7 +3,7 @@
*
* wmf.cpp -- Windows Metafile export plugin for dia
* Copyright (C) 2000, Hans Breuer, <Hans@Breuer.Org>
* based on dummy plug-in.
* based on dummy plug-in.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -170,7 +170,7 @@ UsePen(WmfRenderer* renderer, Color* colour)
int num_dashes = 0;
int dashlen = renderer->nDashLen;
int dotlen = renderer->nDashLen / 10;
logbrush.lbStyle = BS_SOLID;
logbrush.lbColor = rgb;
logbrush.lbHatch = 0;
......@@ -180,7 +180,7 @@ UsePen(WmfRenderer* renderer, Color* colour)
break;
case PS_DASH :
num_dashes = 2;
dashes[0] = dashes[1] = dashlen;
dashes[0] = dashes[1] = dashlen;
break;
case PS_DASHDOT :
num_dashes = 4;
......@@ -207,10 +207,10 @@ UsePen(WmfRenderer* renderer, Color* colour)
renderer->nLineWidth,
&logbrush, num_dashes, num_dashes > 0 ? dashes : 0);
}
else
else
#endif /* G_OS_WIN32 */
{
renderer->hPen = W32::CreatePen(renderer->fnPenStyle,
renderer->hPen = W32::CreatePen(renderer->fnPenStyle,
renderer->nLineWidth,
rgb);
}
......@@ -225,7 +225,7 @@ static void
DonePen(WmfRenderer* renderer, W32::HPEN hPen)
{
/* restore the OLD one ... */
if (hPen)
if (hPen)
W32::SelectObject(renderer->hFileDC, hPen);
/* ... before deleting the last active */
if (renderer->hPen)
......@@ -246,9 +246,9 @@ my_log(WmfRenderer* renderer, const char* format, ...)
{
gchar *string;
va_list args;
g_return_if_fail (format != NULL);
va_start (args, format);
string = g_strdup_vprintf (format, args);
va_end (args);
......@@ -258,7 +258,7 @@ my_log(WmfRenderer* renderer, const char* format, ...)
g_free(string);
}
/*
* renderer interface implementation
*/
......@@ -274,7 +274,7 @@ begin_render(DiaRenderer *self, const Rectangle *)
renderer->fnPenStyle = PS_GEOMETRIC;
/* make unfilled the default */
W32::SelectObject(renderer->hFileDC,
W32::SelectObject(renderer->hFileDC,
W32::GetStockObject (HOLLOW_BRUSH) );
}
......@@ -283,10 +283,11 @@ end_render(DiaRenderer *self)
{
WmfRenderer *renderer = WMF_RENDERER (self);
W32::HENHMETAFILE hEmf;
#if !defined DIRECT_WMF && defined G_OS_WIN32 /* the later offers both */
W32::UINT nSize;
W32::BYTE* pData = NULL;
FILE* f;
#endif
DIAG_NOTE(renderer, "end_render\n");
hEmf = W32::CloseEnhMetaFile(renderer->hFileDC);
......@@ -315,9 +316,9 @@ end_render(DiaRenderer *self)
/* write file */
if (fwrite(pData,1,nSize,f) != nSize)
dia_context_add_message_with_errno(renderer->ctx, errno, _("Couldn't write file %s\n%s"),
dia_context_get_filename (renderer->ctx));
dia_context_get_filename (renderer->ctx));
fclose(f);
g_free(pData);
W32::ReleaseDC(NULL, hdc);
......@@ -331,7 +332,7 @@ end_render(DiaRenderer *self)
W32::DeleteEnhMetaFile(hEmf);
}