Index: cmdgetprop.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp,v
retrieving revision 1.14
diff -u -r1.14 cmdgetprop.cpp
--- cmdgetprop.cpp	10 Dec 2004 19:28:41 -0000	1.14
+++ cmdgetprop.cpp	12 Dec 2004 11:39:35 -0000
@@ -3,24 +3,24 @@
 
 PyObject *scribus_getfillcolor(PyObject *self, PyObject* args)
 {
-	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	char *Name = NULL;
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
-	return i != NULL ? PyString_FromString(i->Pcolor) : NULL;
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
+	return i != NULL ? PyString_FromString(i->Pcolor.utf8()) : NULL;
 }
 
 PyObject *scribus_getlinecolor(PyObject *self, PyObject* args)
 {
 	char *Name = "";
 	PageItem *it;
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	it = GetUniqueItem(QString(Name));
+	it = GetUniqueItem(QString::fromUtf8(Name));
 	if (it == NULL)
 		return NULL;
 	if ((it->HasSel) && ((it->PType == FRAME_TEXT) || (it->PType == FRAME_PATHTEXT)))
@@ -28,22 +28,21 @@
 		for (uint b = 0; b < it->Ptext.count(); ++b)
 		{
 			if (it->Ptext.at(b)->cselect)
-				return PyString_FromString(it->Ptext.at(b)->ccolor);
+				return PyString_FromString(it->Ptext.at(b)->ccolor.utf8());
 		}
 	}
 	else
-		return PyString_FromString(it->Pcolor2);
-	return PyString_FromString("");
+		return PyString_FromString(it->Pcolor2.utf8());
 }
 
 PyObject *scribus_getlinewidth(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return i != NULL ? PyFloat_FromDouble(static_cast<double>(i->Pwidth)) : NULL;
 }
 
@@ -51,11 +50,11 @@
 {
 	char *Name = "";
 	PageItem *it;
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	it = GetUniqueItem(QString(Name));
+	it = GetUniqueItem(QString::fromUtf8(Name));
 	if (it == NULL)
 		return NULL;
 	if ((it->HasSel) && ((it->PType == FRAME_TEXT) || (it->PType == FRAME_PATHTEXT)))
@@ -74,110 +73,110 @@
 PyObject *scribus_getlinejoin(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return i != NULL ? PyInt_FromLong(static_cast<long>(i->PLineJoin)) : NULL;
 }
 
 PyObject *scribus_getlineend(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return i != NULL ? PyInt_FromLong(static_cast<long>(i->PLineEnd)) : NULL;
 }
 
 PyObject *scribus_getlinestyle(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return i != NULL ? PyInt_FromLong(static_cast<long>(i->PLineArt)) : NULL;
 }
 
 PyObject *scribus_getfillshade(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return i != NULL ? PyInt_FromLong(static_cast<long>(i->Shade)) : NULL;
 }
 
 PyObject *scribus_getcornerrad(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return i != NULL ? PyInt_FromLong(static_cast<long>(i->RadRect)) : NULL;
 }
 
 PyObject *scribus_getimgscale(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return i != NULL ? Py_BuildValue("(ff)", i->LocalScX, i->LocalScY) : NULL;
 }
 
 PyObject *scribus_getimgname(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
-	return i != NULL ? PyString_FromString(i->Pfile) : NULL;
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
+	return i != NULL ? PyString_FromString(i->Pfile.utf8()) : NULL;
 }
 
 PyObject *scribus_getposi(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return (i != NULL) ? Py_BuildValue("(ff)", PointToValue(i->Xpos), PointToValue(i->Ypos)) : NULL;
 }
 
 PyObject *scribus_getsize(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return (i != NULL) ? Py_BuildValue("(ff)", PointToValue(i->Width), PointToValue(i->Height)) : NULL;
 }
 
 PyObject *scribus_getrotation(PyObject *self, PyObject* args)
 {
 	char *Name = "";
-	if (!PyArg_ParseTuple(args, "|s", &Name))
+	if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
 		return NULL;
 	if(!checkHaveDocument())
 		return NULL;
-	PageItem *i = GetUniqueItem(QString(Name));
+	PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
 	return i != NULL ? PyFloat_FromDouble(static_cast<double>(i->Rot * -1)) : NULL;
 }
 
@@ -210,12 +209,12 @@
 		{
 			if (Carrier->doc->ActPage->Items.at(lam)->PType == typ)
 			{
-				PyList_SetItem(l, counter2, PyString_FromString(Carrier->doc->ActPage->Items.at(lam)->AnName));
+				PyList_SetItem(l, counter2, PyString_FromString(Carrier->doc->ActPage->Items.at(lam)->AnName.utf8()));
 				counter2++;
 			}
 		}
 		else
-			PyList_SetItem(l, lam, PyString_FromString(Carrier->doc->ActPage->Items.at(lam)->AnName));
+			PyList_SetItem(l, lam, PyString_FromString(Carrier->doc->ActPage->Items.at(lam)->AnName.utf8()));
 	}
 	return l;
 }
