Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 25099 → Rev 25098

/branches/Version15x/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
1286,34 → 1286,34
return nullptr;
if (!checkHaveDocument())
return nullptr;
PageItem *fromItem = GetUniqueItem(QString::fromUtf8(name1));
if (fromItem == nullptr)
PageItem *fromitem = GetUniqueItem(QString::fromUtf8(name1));
if (fromitem == nullptr)
return nullptr;
PageItem *toItem = GetUniqueItem(QString::fromUtf8(name2));
if (toItem == nullptr)
PageItem *toitem = GetUniqueItem(QString::fromUtf8(name2));
if (toitem == nullptr)
return nullptr;
if (!(fromItem->isTextFrame()) || !(toItem->isTextFrame()))
if (!(fromitem->isTextFrame()) || !(toitem->isTextFrame()))
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Can only link text frames.", "python error").toLocal8Bit().constData());
return nullptr;
}
if (fromItem->nextInChain() != nullptr)
if (fromitem->nextInChain() != nullptr)
{
PyErr_SetString(ScribusException, QObject::tr("Source frame is linked to another frame.", "python error").toLocal8Bit().constData());
return nullptr;
}
if (toItem->prevInChain() != nullptr)
if (toitem->prevInChain() != nullptr)
{
PyErr_SetString(ScribusException, QObject::tr("Target frame is linked to by another frame.", "python error").toLocal8Bit().constData());
return nullptr;
}
if (toItem == fromItem)
if (toitem == fromitem)
{
PyErr_SetString(ScribusException, QObject::tr("Source and target are the same object.", "python error").toLocal8Bit().constData());
return nullptr;
}
// references to the others boxes
fromItem->link(toItem);
fromitem->link(toitem);
ScCore->primaryMainWindow()->view->DrawNew();
// enable 'save icon' stuff
ScCore->primaryMainWindow()->slotDocCh();