scribus/scribus-1.3.3.7_string-literal-comparsion-b.patch

158 lines
4.7 KiB
Diff

--- scribus/plugins/scriptplugin/cmdmisc.cpp
+++ scribus/plugins/scriptplugin/cmdmisc.cpp
@@ -190,7 +190,7 @@
return NULL;
if(!checkHaveDocument())
return NULL;
- if (Layer == "")
+ if (Layer[0] == 0)
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
return NULL;
@@ -229,7 +229,7 @@
return NULL;
if(!checkHaveDocument())
return NULL;
- if (Name == "")
+ if (Name[0] == 0)
{
PyErr_SetString(PyExc_ValueError, QString("Cannot have an empty layer name"));
return NULL;
@@ -261,7 +261,7 @@
return NULL;
if(!checkHaveDocument())
return NULL;
- if (Name == "")
+ if (Name[0] == 0)
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
return NULL;
@@ -292,7 +292,7 @@
return NULL;
if(!checkHaveDocument())
return NULL;
- if (Name == "")
+ if (Name[0] == 0)
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
return NULL;
@@ -323,7 +323,7 @@
return NULL;
if(!checkHaveDocument())
return NULL;
- if (Name == "")
+ if (Name[0] == 0)
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
return NULL;
@@ -355,7 +355,7 @@
return NULL;
if(!checkHaveDocument())
return NULL;
- if (Name == "")
+ if (Name[0] == 0)
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot have an empty layer name.","python error"));
return NULL;
@@ -410,7 +410,7 @@
return NULL;
if(!checkHaveDocument())
return NULL;
- if (Name == "")
+ if (Name[0] == 0)
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot create layer without a name.","python error"));
return NULL;
--- scribus/plugins/scriptplugin/cmdobj.cpp
+++ scribus/plugins/scriptplugin/cmdobj.cpp
@@ -30,7 +30,7 @@
ScMW->doc->toolSettings.dWidth,
ScMW->doc->toolSettings.dBrush, ScMW->doc->toolSettings.dPen, true);
ScMW->doc->setRedrawBounding(ScMW->doc->Items->at(i));
- if (Name != "")
+ if (Name[0] != 0)
ScMW->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScMW->doc->Items->at(i)->itemName().utf8());
}
@@ -59,7 +59,7 @@
return NULL;
}
ScMW->doc->setRedrawBounding(ScMW->doc->Items->at(i));
- if (Name != "")
+ if (Name[0] != 0)
ScMW->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScMW->doc->Items->at(i)->itemName().utf8());
}
@@ -86,7 +86,7 @@
return NULL;
}
ScMW->doc->setRedrawBounding(ScMW->doc->Items->at(i));
- if (Name != "")
+ if (Name[0] != 0)
ScMW->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScMW->doc->Items->at(i)->itemName().utf8());
}
@@ -113,7 +113,7 @@
return NULL;
}
ScMW->doc->setRedrawBounding(ScMW->doc->Items->at(i));
- if (Name != "")
+ if (Name[0] != 0)
ScMW->doc->Items->at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(ScMW->doc->Items->at(i)->itemName().utf8());
}
@@ -151,7 +151,7 @@
it->updateClip();
ScMW->doc->setRedrawBounding(it);
it->OwnPage = ScMW->doc->OnPage(it);
- if (Name != "")
+ if (Name[0] != 0)
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
}
@@ -224,7 +224,7 @@
}
ScMW->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false);
ScMW->view->AdjustItemSize(it);
- if (Name != "")
+ if (Name[0] != 0)
{
it->setItemName(QString::fromUtf8(Name));
}
@@ -304,7 +304,7 @@
}
ScMW->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false);
ScMW->view->AdjustItemSize(it);
- if (Name != "")
+ if (Name[0] != 0)
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
}
@@ -391,7 +391,7 @@
}
ScMW->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false, false);
ScMW->view->AdjustItemSize(it);
- if (Name != "")
+ if (Name[0] != 0)
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
}
@@ -429,7 +429,7 @@
PageItem *it = ScMW->doc->Items->at(i);
ScMW->view->ToPathText();
ScMW->view->MoveItem(pageUnitXToDocX(x) - it->xPos(), pageUnitYToDocY(y) - it->yPos(), it);
- if (Name != "")
+ if (Name[0] != 0)
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
}
@@ -532,7 +532,7 @@
return NULL;
}
// for current item only
- if (ScMW->doc->m_Selection->count() == 0 || name != "")
+ if (ScMW->doc->m_Selection->count() == 0 || name[0] != 0)
{
// quick hack to always apply on the right frame - pv
ScMW->view->Deselect(true);