From: joncruz Date: Sun, 3 Aug 2008 06:07:19 +0000 (+0000) Subject: Fixed const-correctness X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e37ac57162765656081527f452b65f64730a6900;p=inkscape.git Fixed const-correctness --- diff --git a/src/display/canvas-bpath.cpp b/src/display/canvas-bpath.cpp index 5b0acb31d..15acece5e 100644 --- a/src/display/canvas-bpath.cpp +++ b/src/display/canvas-bpath.cpp @@ -428,7 +428,7 @@ sp_canvastext_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int } SPCanvasItem * -sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, char *new_text) +sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *new_text) { SPCanvasItem *item = sp_canvas_item_new(parent, SP_TYPE_CANVASTEXT, NULL); @@ -487,7 +487,7 @@ sp_canvastext_set_coords (SPCanvasText *ct, const NR::Point start) } void -sp_canvastext_set_text (SPCanvasText *ct, const char* new_text) +sp_canvastext_set_text (SPCanvasText *ct, gchar const * new_text) { g_free (ct->text); ct->text = g_strdup(new_text); diff --git a/src/display/canvas-bpath.h b/src/display/canvas-bpath.h index 5a6e6e7ff..bc3db883b 100644 --- a/src/display/canvas-bpath.h +++ b/src/display/canvas-bpath.h @@ -112,7 +112,7 @@ struct SPCanvasText : public SPCanvasItem{ guint32 rgba; SPDesktop *desktop; // the desktop to which this text is attached; needed for coordinate transforms (TODO: these should be eliminated) - char* text; + gchar* text; NR::Point s; NR::Matrix affine; double fontsize; @@ -123,12 +123,12 @@ struct SPCanvasTextClass : public SPCanvasItemClass{}; GtkType sp_canvastext_get_type (void); -SPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, char *text); +SPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *text); void sp_canvastext_set_rgba32 (SPCanvasText *ct, guint32 rgba); void sp_canvastext_set_coords (SPCanvasText *ct, gdouble x0, gdouble y0); void sp_canvastext_set_coords (SPCanvasText *ct, const NR::Point start); -void sp_canvastext_set_text (SPCanvasText *ct, const char* new_text); +void sp_canvastext_set_text (SPCanvasText *ct, gchar const* new_text); void sp_canvastext_set_number_as_text (SPCanvasText *ct, int num); void sp_canvastext_set_fontsize (SPCanvasText *ct, double size); void sp_canvastext_set_anchor (SPCanvasText *ct, double anchor_x, double anchor_y); diff --git a/src/display/canvas-text.cpp b/src/display/canvas-text.cpp index d93fc3167..1ed35fe2a 100644 --- a/src/display/canvas-text.cpp +++ b/src/display/canvas-text.cpp @@ -168,7 +168,7 @@ sp_canvastext_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int } SPCanvasItem * -sp_canvastext_new(SPCanvasGroup *parent, Geom::Point pos, char *new_text) +sp_canvastext_new(SPCanvasGroup *parent, Geom::Point pos, gchar const *new_text) { SPCanvasItem *item = sp_canvas_item_new(parent, SP_TYPE_CANVASTEXT, NULL); @@ -223,7 +223,7 @@ sp_canvastext_set_coords (SPCanvasText *ct, const NR::Point start) } void -sp_canvastext_set_text (SPCanvasText *ct, const char* new_text) +sp_canvastext_set_text (SPCanvasText *ct, gchar const* new_text) { g_free (ct->text); ct->text = g_strdup(new_text); diff --git a/src/display/canvas-text.h b/src/display/canvas-text.h index 7d1da46f5..54ec8c413 100644 --- a/src/display/canvas-text.h +++ b/src/display/canvas-text.h @@ -26,7 +26,7 @@ struct SPCanvasText : public SPCanvasItem{ SPItem *item; // the item to which this line belongs in some sense; may be NULL for some users guint32 rgba; - char* text; + gchar* text; NR::Point s; NR::Matrix affine; double fontsize; @@ -37,12 +37,12 @@ struct SPCanvasTextClass : public SPCanvasItemClass{}; GtkType sp_canvastext_get_type (void); -SPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, Geom::Point pos, char *text); +SPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, Geom::Point pos, gchar const *text); void sp_canvastext_set_rgba32 (SPCanvasText *ct, guint32 rgba); void sp_canvastext_set_coords (SPCanvasText *ct, gdouble x0, gdouble y0); void sp_canvastext_set_coords (SPCanvasText *ct, const NR::Point start); -void sp_canvastext_set_text (SPCanvasText *ct, const char* new_text); +void sp_canvastext_set_text (SPCanvasText *ct, gchar const* new_text); void sp_canvastext_set_number_as_text (SPCanvasText *ct, int num); void sp_canvastext_set_fontsize (SPCanvasText *ct, double size); void sp_canvastext_set_anchor (SPCanvasText *ct, double anchor_x, double anchor_y);