Index: cmdsetprop.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp,v
retrieving revision 1.14
diff -u -r1.14 cmdsetprop.cpp
--- cmdsetprop.cpp	10 Dec 2004 19:28:41 -0000	1.14
+++ cmdsetprop.cpp	12 Dec 2004 11:39:28 -0000
@@ -7,17 +7,17 @@
 	char *Color1;
 	char *Color2;
 	int typ, shade1, shade2;
-	if (!PyArg_ParseTuple(args, "isisi|s", &typ, &Color1, &shade1, &Color2, &shade2, &Name))
+	if (!PyArg_ParseTuple(args, "iesiesi|es", &typ, "utf-8", &Color1, &shade1, "utf-8", &Color2, &shade2, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *b = GetUniqueItem(QString(Name));
+	PageItem *b = GetUniqueItem(QString::fromUtf8(Name));
 	if (b == NULL)
 		return NULL;
 	QColor tmp;
 	b->fill_gradient.clearStops();
-	QString c1 = QString(Color1);
-	QString c2 = QString(Color2);
+	QString c1 = QString::fromUtf8(Color1);
+	QString c2 = QString::fromUtf8(Color2);
 	b->SetFarbe(&tmp, c1, shade1);
 	b->fill_gradient.addStop(tmp, 0.0, 0.5, 1.0, c1, shade1);
 	b->SetFarbe(&tmp, c2, shade2);
@@ -33,14 +33,14 @@
 {
 	char *Name = "";
 	char *Color;
-	if (!PyArg_ParseTuple(args, "s|s", &Color, &Name))
+	if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Color, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
-	i->Pcolor = QString(Color);
+	i->Pcolor = QString::fromUtf8(Color);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -49,14 +49,14 @@
 {
 	char *Name = "";
 	char *Color;
-	if (!PyArg_ParseTuple(args, "s|s", &Color, &Name))
+	if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Color, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *it = GetUniqueItem(QString(Name));
+	PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
 	if (it == NULL)
 		return NULL;
-	it->Pcolor2 = QString(Color);
+	it->Pcolor2 = QString::fromUtf8(Color);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
@@ -65,7 +65,7 @@
 {
 	char *Name = "";
 	double w;
-	if (!PyArg_ParseTuple(args, "d|s", &w, &Name))
+	if (!PyArg_ParseTuple(args, "d|es", &w, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
@@ -74,7 +74,7 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Line width out of bounds, must be 0 <= line_width <= 12","python error"));
 		return NULL;
 	}
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
 	i->Pwidth = w;
@@ -86,7 +86,7 @@
 {
 	char *Name = "";
 	int w;
-	if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
+	if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
@@ -95,7 +95,7 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Line shade out of bounds, must be 0 <= shade <= 100","python error"));
 		return NULL;
 	}
-	PageItem *it = GetUniqueItem(QString(Name));
+	PageItem *it = GetUniqueItem(QString::fromUtf8(Name));
 	if (it == NULL)
 		return NULL;
 	it->Shade2 = w;
@@ -107,7 +107,7 @@
 {
 	char *Name = "";
 	int w;
-	if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
+	if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
@@ -116,7 +116,7 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Fill shade out of bounds, must be 0 <= shade <= 100","python error"));
 		return NULL;
 	}
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
 	i->Shade = w;
@@ -128,11 +128,11 @@
 {
 	char *Name = "";
 	int w;
-	if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
+	if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
 	i->PLineJoin = Qt::PenJoinStyle(w);
@@ -144,11 +144,11 @@
 {
 	char *Name = "";
 	int w;
-	if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
+	if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
 	i->PLineEnd = Qt::PenCapStyle(w);
@@ -160,11 +160,11 @@
 {
 	char *Name = "";
 	int w;
-	if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
+	if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	if (i == NULL)
 		return NULL;
 	i->PLineArt = Qt::PenStyle(w);
@@ -176,7 +176,7 @@
 {
 	char *Name = "";
 	int w;
-	if (!PyArg_ParseTuple(args, "i|s", &w, &Name))
+	if (!PyArg_ParseTuple(args, "i|es", &w, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
@@ -185,10 +185,11 @@
 		PyErr_SetString(PyExc_ValueError, QObject::tr("Corner radius must be a positive number.","python error"));
 		return NULL;
 	}
-	PageItem *b = GetUniqueItem(QString(Name));
+	PageItem *b = GetUniqueItem(QString::fromUtf8(Name));
 	if (b == NULL)
 		return NULL;
 	// What the heck is a type 3 frame?
+	// FIXME: Doesn't seem to work, at least on rect/polygon frames
 	if ((b->PType == FRAME_IMAGE) || (b->PType == 3) || (b->PType == FRAME_TEXT))
 	{
 		b->RadRect = w;
@@ -205,19 +206,19 @@
 {
 	char *Name = "";
 	char *Style = NULL;
-	if (!PyArg_ParseTuple(args, "s|s", &Style, &Name))
+	if (!PyArg_ParseTuple(args, "es|es", "utf-8", &Style, "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *b = GetUniqueItem(QString(Name));
+	PageItem *b = GetUniqueItem(QString::fromUtf8(Name));
 	if (b == NULL)
 		return NULL;
-	if (!Carrier->doc->MLineStyles.contains(QString(Style)))
+	if (!Carrier->doc->MLineStyles.contains(QString::fromUtf8(Style)))
 	{
 		PyErr_SetString(NotFoundError, QObject::tr("Line style not found","python error"));
 		return NULL;
 	}
-	b->NamedLStyle = QString(Style);
+	b->NamedLStyle = QString::fromUtf8(Style);
 	Py_INCREF(Py_None);
 	return Py_None;
 }
