Commit 9c6a0d88 authored by Hans Breuer's avatar Hans Breuer

[warningectomy] implicit conversion from enumeration type DiaSvgLineDefaults

Actually a design change: formerly we were relying on weak typing of enums,
i.e. assigning values from the wrong enum to e.g. to type 'LineJoin'. Now
*_DEFAULT variants are part of the main enum, e.g LineJoin and has to be
handled explicitely on the consumer level, here mostly renderers.

Removes the following warnings:

dia_svg.c:71:56: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineCaps' [-Wenum-conversion]
  gs->linecap = parent_style ? parent_style->linecap : DIA_SVG_LINECAPS_DEFAULT;
              ~                                        ^~~~~~~~~~~~~~~~~~~~~~~~
dia_svg.c:72:58: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineJoin' [-Wenum-conversion]
  gs->linejoin = parent_style ? parent_style->linejoin : DIA_SVG_LINEJOIN_DEFAULT;
               ~                                         ^~~~~~~~~~~~~~~~~~~~~~~~
dia_svg.c:73:60: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineStyle' [-Wenum-conversion]
  gs->linestyle = parent_style ? parent_style->linestyle : DIA_SVG_LINESTYLE_DEFAULT;
                ~                                          ^~~~~~~~~~~~~~~~~~~~~~~~~
dia_svg.c:484:19: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineJoin' [-Wenum-conversion]
    s->linejoin = DIA_SVG_LINEJOIN_DEFAULT;
                ~ ^~~~~~~~~~~~~~~~~~~~~~~~
dia_svg.c:496:18: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineCaps' [-Wenum-conversion]
    s->linecap = DIA_SVG_LINECAPS_DEFAULT;
               ~ ^~~~~~~~~~~~~~~~~~~~~~~~
dia_svg.c:694:17: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineStyle' [-Wenum-conversion]
        s->linestyle = DIA_SVG_LINESTYLE_DEFAULT;
                     ~ ^~~~~~~~~~~~~~~~~~~~~~~~~
shape_info.c:121:32: warning: comparison of constant -1 with expression of type 'Alignment' is always false [-Wtautological-constant-out-of-range-compare]
      if (el->text.s.alignment == -1)
          ~~~~~~~~~~~~~~~~~~~~ ^  ~~
shape_info.c:911:2: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineCaps' [-Wenum-conversion]
        DIA_SVG_LINECAPS_DEFAULT, DIA_SVG_LINEJOIN_DEFAULT, DIA_SVG_LINESTYLE_DEFAULT, 1.0
        ^~~~~~~~~~~~~~~~~~~~~~~~
shape_info.c:911:28: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineJoin' [-Wenum-conversion]
        DIA_SVG_LINECAPS_DEFAULT, DIA_SVG_LINEJOIN_DEFAULT, DIA_SVG_LINESTYLE_DEFAULT, 1.0
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
shape_info.c:911:54: warning: implicit conversion from enumeration type 'enum DiaSvgLineDefaults' to different enumeration type 'LineStyle' [-Wenum-conversion]
        DIA_SVG_LINECAPS_DEFAULT, DIA_SVG_LINEJOIN_DEFAULT, DIA_SVG_LINESTYLE_DEFAULT, 1.0
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~
custom_object.c:926:26: warning: comparison of constant 'DIA_SVG_LINECAPS_DEFAULT' (20) with expression of type 'LineCaps' is always false [-Wtautological-constant-out-of-range-compare]
  if ((el->any.s.linecap == DIA_SVG_LINECAPS_DEFAULT && (*cur_caps) != LINECAPS_BUTT) ||
       ~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~
custom_object.c:928:39: warning: comparison of constant 'DIA_SVG_LINECAPS_DEFAULT' (20) with expression of type 'LineCaps' is always true [-Wtautological-constant-out-of-range-compare]
      (*cur_caps) = (el->any.s.linecap!=DIA_SVG_LINECAPS_DEFAULT) ?
                     ~~~~~~~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~
custom_object.c:932:26: warning: comparison of constant 'DIA_SVG_LINEJOIN_DEFAULT' (20) with expression of type 'LineJoin' is always false [-Wtautological-constant-out-of-range-compare]
  if ((el->any.s.linejoin==DIA_SVG_LINEJOIN_DEFAULT && (*cur_join)!=LINEJOIN_MITER) ||
       ~~~~~~~~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~
custom_object.c:934:38: warning: comparison of constant 'DIA_SVG_LINEJOIN_DEFAULT' (20) with expression of type 'LineJoin' is always true [-Wtautological-constant-out-of-range-compare]
    (*cur_join) = (el->any.s.linejoin!=DIA_SVG_LINEJOIN_DEFAULT) ?
                   ~~~~~~~~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~
custom_object.c:938:28: warning: comparison of constant 'DIA_SVG_LINESTYLE_DEFAULT' (20) with expression of type 'LineStyle' is always false [-Wtautological-constant-out-of-range-compare]
  if ((el->any.s.linestyle == DIA_SVG_LINESTYLE_DEFAULT &&
       ~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~
custom_object.c:940:40: warning: comparison of constant 'DIA_SVG_LINESTYLE_DEFAULT' (20) with expression of type 'LineStyle' is always true [-Wtautological-constant-out-of-range-compare]
    (*cur_style) = (el->any.s.linestyle!=DIA_SVG_LINESTYLE_DEFAULT) ?
                    ~~~~~~~~~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~
svg-import.c:468:25: warning: comparison of constant 'DIA_SVG_LINESTYLE_DEFAULT' (20) with expression of type 'LineStyle' is always true [-Wtautological-constant-out-of-range-compare]
      if (gs->linestyle != DIA_SVG_LINESTYLE_DEFAULT)
          ~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~
svg-import.c:524:24: warning: comparison of constant 'DIA_SVG_LINEJOIN_DEFAULT' (20) with expression of type 'LineJoin' is always true [-Wtautological-constant-out-of-range-compare]
      if (gs->linejoin != DIA_SVG_LINEJOIN_DEFAULT)
          ~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~
svg-import.c:530:23: warning: comparison of constant 'DIA_SVG_LINECAPS_DEFAULT' (20) with expression of type 'LineCaps' is always true [-Wtautological-constant-out-of-range-compare]
      if (gs->linecap != DIA_SVG_LINECAPS_DEFAULT)
          ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~
parent 75e7b409
......@@ -2,19 +2,22 @@
#define DIA_ENUMS_H
typedef enum {
LINECAPS_BUTT,
LINECAPS_DEFAULT = -1, /* default usually butt, this is unset */
LINECAPS_BUTT = 0,
LINECAPS_ROUND,
LINECAPS_PROJECTING
} LineCaps;
typedef enum {
LINEJOIN_MITER,
LINEJOIN_DEFAULT = -1, /* default usually miter, this is unset */
LINEJOIN_MITER = 0,
LINEJOIN_ROUND,
LINEJOIN_BEVEL
} LineJoin;
typedef enum {
LINESTYLE_SOLID,
LINESTYLE_DEFAULT = -1, /* default usually solid, this is unset */
LINESTYLE_SOLID = 0,
LINESTYLE_DASHED,
LINESTYLE_DASH_DOT,
LINESTYLE_DASH_DOT_DOT,
......
......@@ -68,9 +68,9 @@ dia_svg_style_init(DiaSvgStyle *gs, DiaSvgStyle *parent_style)
*/
gs->fill = parent_style ? parent_style->fill : DIA_SVG_COLOUR_DEFAULT;
gs->fill_opacity = parent_style ? parent_style->fill_opacity : 1.0;
gs->linecap = parent_style ? parent_style->linecap : DIA_SVG_LINECAPS_DEFAULT;
gs->linejoin = parent_style ? parent_style->linejoin : DIA_SVG_LINEJOIN_DEFAULT;
gs->linestyle = parent_style ? parent_style->linestyle : DIA_SVG_LINESTYLE_DEFAULT;
gs->linecap = parent_style ? parent_style->linecap : LINECAPS_DEFAULT;
gs->linejoin = parent_style ? parent_style->linejoin : LINEJOIN_DEFAULT;
gs->linestyle = parent_style ? parent_style->linestyle : LINESTYLE_DEFAULT;
gs->font = (parent_style && parent_style->font) ? dia_font_ref(parent_style->font) : NULL;
gs->font_height = parent_style ? parent_style->font_height : 0.8;
gs->alignment = parent_style ? parent_style->alignment : ALIGN_LEFT;
......@@ -481,7 +481,7 @@ _parse_linejoin (DiaSvgStyle *s, const char *val)
else if (!strncmp(val, "bevel", 5))
s->linejoin = LINEJOIN_BEVEL;
else if (!strncmp(val, "default", 7))
s->linejoin = DIA_SVG_LINEJOIN_DEFAULT;
s->linejoin = LINEJOIN_DEFAULT;
}
static void
_parse_linecap (DiaSvgStyle *s, const char *val)
......@@ -493,7 +493,7 @@ _parse_linecap (DiaSvgStyle *s, const char *val)
else if (!strncmp(val, "square", 6) || !strncmp(val, "projecting", 10))
s->linecap = LINECAPS_PROJECTING;
else if (!strncmp(val, "default", 7))
s->linecap = DIA_SVG_LINECAPS_DEFAULT;
s->linecap = LINECAPS_DEFAULT;
}
/*!
......@@ -691,7 +691,7 @@ dia_svg_parse_style_string (DiaSvgStyle *s, real user_scale, const gchar *str)
else if (!strncmp(ptr, "dotted", 6))
s->linestyle = LINESTYLE_DOTTED;
else if (!strncmp(ptr, "default", 7))
s->linestyle = DIA_SVG_LINESTYLE_DEFAULT;
s->linestyle = LINESTYLE_DEFAULT;
/* XXX: deal with a real pattern */
} else if (!strncmp("stroke-dashlength:", ptr, 18)) {
ptr += 18;
......
......@@ -33,14 +33,6 @@ enum DiaSvgColours
DIA_SVG_COLOUR_DEFAULT = -5
};
/* these should be changed if they ever cause a conflict */
enum DiaSvgLineDefaults
{
DIA_SVG_LINECAPS_DEFAULT = 20,
DIA_SVG_LINEJOIN_DEFAULT = 20,
DIA_SVG_LINESTYLE_DEFAULT = 20
};
typedef struct _DiaSvgStyle DiaSvgStyle;
struct _DiaSvgStyle {
real line_width;
......
......@@ -312,6 +312,7 @@ set_linecaps (DiaRenderer *object, LineCaps mode)
renderer->cap_style = GDK_CAP_ROUND;
} else {
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
renderer->cap_style = GDK_CAP_BUTT;
break;
......@@ -340,6 +341,7 @@ set_linejoin (DiaRenderer *object, LineJoin mode)
renderer->join_style = GDK_JOIN_ROUND;
} else {
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
renderer->join_style = GDK_JOIN_MITER;
break;
......@@ -374,6 +376,7 @@ dia_gdk_renderer_set_dashes(DiaGdkRenderer *renderer, int offset)
int hole_width;
switch(renderer->saved_line_style) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
break;
case LINESTYLE_DASHED:
......@@ -435,6 +438,7 @@ set_linestyle (DiaRenderer *object, LineStyle mode, real length)
renderer->saved_line_style = mode;
switch(mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
renderer->line_style = GDK_LINE_SOLID;
break;
......
......@@ -142,6 +142,7 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event)
/* increase line width */
gdk_gc_get_values(gc, &gcvalues);
switch (line->lstyle) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
gdk_gc_set_line_attributes(gc, line_width, GDK_LINE_SOLID,
gcvalues.cap_style, gcvalues.join_style);
......
......@@ -923,21 +923,21 @@ custom_draw_element(GraphicElement* el, Custom *custom, DiaRenderer *renderer,
renderer_ops->set_linewidth(renderer,
custom->border_width*(*cur_line));
}
if ((el->any.s.linecap == DIA_SVG_LINECAPS_DEFAULT && (*cur_caps) != LINECAPS_BUTT) ||
if ((el->any.s.linecap == LINECAPS_DEFAULT && (*cur_caps) != LINECAPS_BUTT) ||
el->any.s.linecap != (*cur_caps)) {
(*cur_caps) = (el->any.s.linecap!=DIA_SVG_LINECAPS_DEFAULT) ?
(*cur_caps) = (el->any.s.linecap!=LINECAPS_DEFAULT) ?
el->any.s.linecap : LINECAPS_BUTT;
renderer_ops->set_linecaps(renderer, (*cur_caps));
}
if ((el->any.s.linejoin==DIA_SVG_LINEJOIN_DEFAULT && (*cur_join)!=LINEJOIN_MITER) ||
if ((el->any.s.linejoin==LINEJOIN_DEFAULT && (*cur_join)!=LINEJOIN_MITER) ||
el->any.s.linejoin != (*cur_join)) {
(*cur_join) = (el->any.s.linejoin!=DIA_SVG_LINEJOIN_DEFAULT) ?
(*cur_join) = (el->any.s.linejoin!=LINEJOIN_DEFAULT) ?
el->any.s.linejoin : LINEJOIN_MITER;
renderer_ops->set_linejoin(renderer, (*cur_join));
}
if ((el->any.s.linestyle == DIA_SVG_LINESTYLE_DEFAULT &&
if ((el->any.s.linestyle == LINESTYLE_DEFAULT &&
(*cur_style) != custom->line_style) || el->any.s.linestyle != (*cur_style)) {
(*cur_style) = (el->any.s.linestyle!=DIA_SVG_LINESTYLE_DEFAULT) ?
(*cur_style) = (el->any.s.linestyle!=LINESTYLE_DEFAULT) ?
el->any.s.linestyle : custom->line_style;
renderer_ops->set_linestyle(renderer, (*cur_style),
custom->dashlength*(*cur_dash));
......
......@@ -908,7 +908,7 @@ load_shape_info(const gchar *filename, ShapeInfo *preload)
} else if (node->ns == svg_ns && !xmlStrcmp(node->name, (const xmlChar *)"svg")) {
DiaSvgStyle s = {
1.0, DIA_SVG_COLOUR_FOREGROUND, 1.0, DIA_SVG_COLOUR_NONE, 1.0,
DIA_SVG_LINECAPS_DEFAULT, DIA_SVG_LINEJOIN_DEFAULT, DIA_SVG_LINESTYLE_DEFAULT, 1.0
LINECAPS_DEFAULT, LINEJOIN_DEFAULT, LINESTYLE_DEFAULT, 1.0
};
dia_svg_parse_style(node, &s, -1);
......
......@@ -388,6 +388,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
DIAG_NOTE(g_message("set_linecaps %d", mode));
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
cairo_set_line_cap (renderer->cr, CAIRO_LINE_CAP_BUTT);
break;
......@@ -411,6 +412,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
DIAG_NOTE(g_message("set_join %d", mode));
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
cairo_set_line_join (renderer->cr, CAIRO_LINE_JOIN_MITER);
break;
......@@ -438,6 +440,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
ensure_minimum_one_device_unit(renderer, &dash_length);
/* line type */
switch (mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
cairo_set_dash (renderer->cr, NULL, 0, 0);
break;
......
......@@ -582,6 +582,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
switch(mode)
{
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
cap = 2;
break;
......@@ -606,6 +607,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
switch(mode)
{
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
join = 2;
break;
......@@ -645,6 +647,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
case LINESTYLE_DOTTED:
style = 3;
break;
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
default:
style = 1;
......
......@@ -288,6 +288,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
gchar *value = NULL;
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
value = "butt";
break;
......@@ -312,6 +313,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
gchar *value = NULL;
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
value = "miter";
break;
......@@ -337,6 +339,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
/* line type */
switch (mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
value = "solid";
break;
......
......@@ -203,6 +203,7 @@ set_linecaps(DiaRenderer *object, LineCaps mode)
DIAG_NOTE(g_message("set_linecaps %d", mode));
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
break;
case LINECAPS_ROUND:
......@@ -220,6 +221,7 @@ set_linejoin(DiaRenderer *object, LineJoin mode)
DIAG_NOTE(g_message("set_join %d", mode));
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
break;
case LINEJOIN_ROUND:
......@@ -240,6 +242,7 @@ set_linestyle(DiaRenderer *object, LineStyle mode, real dash_length)
/* line type */
switch (mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
fprintf(renderer->file, "LT;\n");
break;
......
......@@ -175,6 +175,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
renderer->cap_style = ART_PATH_STROKE_CAP_ROUND;
} else {
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
renderer->cap_style = ART_PATH_STROKE_CAP_BUTT;
break;
......@@ -198,6 +199,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
renderer->join_style = ART_PATH_STROKE_JOIN_ROUND;
} else {
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
renderer->join_style = ART_PATH_STROKE_JOIN_MITER;
break;
......@@ -237,6 +239,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real length)
dot_length = 255.0;
switch(mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
renderer->dash_enabled = 0;
break;
......@@ -1161,7 +1164,7 @@ get_text_width(DiaRenderer *object,
if (length != g_utf8_strlen(text, -1)) {
char *othertx;
int ulen;
/* A couple UTF8-chars: æblegrød Š Ť Ž ę ć ń уфхц?ОПРЄ є ? Њ Ћ ? */
ulen = g_utf8_offset_to_pointer(text, length)-text;
if (!g_utf8_validate(text, ulen, NULL)) {
g_warning ("Text at char %d not valid\n", length);
......@@ -1424,3 +1427,4 @@ dia_libart_renderer_class_init (DiaLibartRendererClass *klass)
}
#endif
......@@ -507,3 +507,4 @@ new_libart_renderer(DiaTransform *transform, int interactive)
}
#endif
......@@ -250,6 +250,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
return;
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
fprintf(renderer->file, "linecap:=butt;\n");
break;
......@@ -276,6 +277,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
return;
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
fprintf(renderer->file, "linejoin:=mitered;\n");
break;
......@@ -314,6 +316,7 @@ draw_with_linestyle(MetapostRenderer *renderer)
gchar hole_width_buf[DTOSTR_BUF_SIZE];
switch(renderer->saved_line_style) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
break;
case LINESTYLE_DASHED:
......
......@@ -378,6 +378,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
/* int ps_mode; */
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
fprintf(renderer->file, "\\pgfsetmiterjoin\n");
break;
......@@ -409,6 +410,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
dot_length = dash_length * 0.2;
switch(mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
fprintf(renderer->file, "\\pgfsetdash{}{0pt}\n");
break;
......
......@@ -160,6 +160,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
int ps_mode;
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
ps_mode = 0;
break;
......@@ -183,6 +184,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
int ps_mode;
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
ps_mode = 0;
break;
......@@ -215,6 +217,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
dot_length = dash_length*0.2; /* dot = 20% of len */
switch(mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
fprintf(renderer->file, "[] 0 sd\n");
break;
......
......@@ -275,6 +275,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
int ps_mode;
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
ps_mode = 0;
break;
......@@ -298,6 +299,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
int ps_mode;
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
ps_mode = 0;
break;
......@@ -330,6 +332,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
dot_length = dash_length * 0.2;
switch(mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
fprintf(renderer->file, "\\psset{linestyle=solid}\n");
break;
......
......@@ -206,6 +206,7 @@ set_linecaps(DiaRenderer *renderer, LineCaps mode)
break;
case LINECAPS_PROJECTING:
break;
case LINECAPS_DEFAULT:
default:
PyErr_Warn (PyExc_RuntimeWarning, "DiaPyRenderer : Unsupported fill mode specified!\n");
}
......@@ -246,6 +247,7 @@ set_linejoin(DiaRenderer *renderer, LineJoin mode)
break;
case LINEJOIN_BEVEL:
break;
case LINEJOIN_DEFAULT:
default:
PyErr_Warn (PyExc_RuntimeWarning, "DiaPyRenderer : Unsupported fill mode specified!\n");
}
......@@ -291,6 +293,7 @@ set_linestyle(DiaRenderer *renderer, LineStyle mode, real dash_length)
break;
case LINESTYLE_DOTTED:
break;
case LINESTYLE_DEFAULT:
default:
PyErr_Warn (PyExc_RuntimeWarning, "DiaPyRenderer : Unsupported fill mode specified!\n");
}
......
......@@ -465,7 +465,7 @@ apply_style(DiaObject *obj, xmlNodePtr node, DiaSvgStyle *parent_style,
rprop->real_data = gs->line_width * scale;
lsprop = g_ptr_array_index(props,2);
if (gs->linestyle != DIA_SVG_LINESTYLE_DEFAULT)
if (gs->linestyle != LINESTYLE_DEFAULT)
lsprop->style = gs->linestyle;
else if (init)
lsprop->style = LINESTYLE_SOLID;
......@@ -521,13 +521,13 @@ apply_style(DiaObject *obj, xmlNodePtr node, DiaSvgStyle *parent_style,
}
eprop = g_ptr_array_index(props,5);
if (gs->linejoin != DIA_SVG_LINEJOIN_DEFAULT)
if (gs->linejoin != LINEJOIN_DEFAULT)
eprop->enum_data = gs->linejoin;
else
eprop->common.experience |= PXP_NOTSET;
eprop = g_ptr_array_index(props,6);
if (gs->linecap != DIA_SVG_LINECAPS_DEFAULT)
if (gs->linecap != LINECAPS_DEFAULT)
eprop->enum_data = gs->linecap;
else
eprop->common.experience |= PXP_NOTSET;
......
......@@ -458,6 +458,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
/* line type */
renderer->fnPenStyle &= ~(PS_STYLE_MASK);
switch (mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
renderer->fnPenStyle |= PS_SOLID;
break;
......@@ -491,6 +492,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
case LINESTYLE_DOTTED:
renderer->nLineWidth = MIN(renderer->nLineWidth, 1);
case LINESTYLE_SOLID:
case LINESTYLE_DEFAULT:
break;
}
}
......
......@@ -340,6 +340,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
DIAG_NOTE(g_message("set_linecaps %d", mode));
switch(mode) {
case LINECAPS_DEFAULT:
case LINECAPS_BUTT:
break;
case LINECAPS_ROUND:
......@@ -347,7 +348,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
case LINECAPS_PROJECTING:
break;
default:
g_warning("WpgRenderer : Unsupported fill mode specified!\n");
g_warning("WpgRenderer : Unsupported line-caps mode specified!\n");
}
}
......@@ -357,6 +358,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
DIAG_NOTE(g_message("set_join %d", mode));
switch(mode) {
case LINEJOIN_DEFAULT:
case LINEJOIN_MITER:
break;
case LINEJOIN_ROUND:
......@@ -364,7 +366,7 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
case LINEJOIN_BEVEL:
break;
default:
g_warning("WpgRenderer : Unsupported fill mode specified!\n");
g_warning("WpgRenderer : Unsupported line-join mode specified!\n");
}
}
......@@ -377,6 +379,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
/* line type */
switch (mode) {
case LINESTYLE_DEFAULT:
case LINESTYLE_SOLID:
renderer->LineAttr.Type = WPG_LA_SOLID;
break;
......
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