Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 1361 → Rev 1360

/branches/Version13x/Scribus/scribus/scribusview.cpp
10711,11 → 10711,11
{
if (!drag)
{
if (b->itemName() == Buffer->AnName)
if (b->AnName == Buffer->AnName)
b->AutoName = true;
else
{
b->setItemName(Buffer->AnName);
b->setName(Buffer->AnName);
b->AutoName = false;
}
}
10724,7 → 10724,7
bool found = false;
for (uint c = 0; c < Doc->Items.count(); ++c)
{
if (Buffer->AnName == Doc->Items.at(c)->itemName())
if (Buffer->AnName == Doc->Items.at(c)->AnName)
{
found = true;
break;
10731,9 → 10731,9
}
}
if (found)
b->setItemName(tr("Copy of")+" "+Buffer->AnName);
b->setName(tr("Copy of")+" "+Buffer->AnName);
else
b->setItemName(Buffer->AnName);
b->setName(Buffer->AnName);
b->AutoName = false;
}
}
11241,7 → 11241,7
bb->LockRes = b->LockRes;
bb->Locked = b->Locked;
bb->NamedLStyle = b->NamedLStyle;
bb->setItemName(b->itemName()+"+"+ccounter.setNum(a));
bb->setName(b->AnName+"+"+ccounter.setNum(a));
bb->AutoName = false;
bb->PoLine = pts.copy();
bb->Rot = b->Rot;
/branches/Version13x/Scribus/scribus/pageitem.h
215,6 → 215,7
QString An_F_act;
QString An_V_act;
QString An_C_act;
QString AnName;
bool AutoName;
QString AnToolTip;
QString AnRollOver;
304,22 → 305,12
 
/** @brief Manages undostack and is where all undo actions/states are sent. */
UndoManager *undoManager;
/** @brief Get name of the item
*
* This is unrelated to QObject::name(); the pageItem's name is independent
* of its Qt name.
* See also PageItem::setItemName()
*/
const QString itemName();
/**
* @brief Set name of the item
* @param newName name for the item
* @author Riku Leino
*
* Note that this is unrelated to QObject::setName()
* See also PageItem::itemName()
*/
void setItemName(const QString& newName);
void setName(const QString& newName);
/**
* @brief Set the fill color of the object.
* @param newColor fill color for the object
371,8 → 362,7
/*@}*/
/** @brief Required by the UndoObject */
void restore(UndoState *state, bool isUndo);
 
protected:
private:
/**
* @name Restore helper methods
* Split the restore method for easier handling.
401,15 → 391,6
bool shouldCheck();
/** @brief Clears the current selection and selects this PageItem. */
void select();
 
// Protected members
 
/**
* @brief Item name. Unicode. User visible (outline, property palette, etc).
*
* See PageItem::itemName(), PageItem::setItemName()
* */
QString AnName;
};
 
#endif
/branches/Version13x/Scribus/scribus/pageitem.cpp
2253,13 → 2253,8
}
}
 
const QString PageItem::itemName()
void PageItem::setName(const QString& newName)
{
return AnName;
}
 
void PageItem::setItemName(const QString& newName)
{
if (UndoManager::undoEnabled())
{
SimpleState *ss = new SimpleState(Um::Rename, QString(Um::FromTo).arg(AnName).arg(newName));
2680,9 → 2675,9
QString oldName = state->get("OLD_NAME");
QString newName = state->get("NEW_NAME");
if (isUndo)
setItemName(oldName);
setName(oldName);
else
setItemName(newName);
setName(newName);
}
 
void PageItem::select()
/branches/Version13x/Scribus/scribus/mpalette.cpp
1066,7 → 1066,7
startArrow->setEnabled(false);
endArrow->setEnabled(false);
}
NameEdit->setText(i->itemName());
NameEdit->setText(i->AnName);
RoundRect->setValue(i->RadRect*UmReFaktor);
QString tm;
LevelTxt->setText(tm.setNum(i->ItemNr));
3249,7 → 3249,7
{
if (ScApp->ScriptRunning)
return;
QString NameOld = CurItem->itemName();
QString NameOld = CurItem->AnName;
QString NameNew = NameEdit->text();
if (NameNew == "")
{
3259,7 → 3259,7
bool found = false;
for (uint b = 0; b < doc->Items.count(); ++b)
{
if ((NameNew == doc->Items.at(b)->itemName()) && (doc->Items.at(b) != CurItem))
if ((NameNew == doc->Items.at(b)->AnName) && (doc->Items.at(b) != CurItem))
{
found = true;
break;
3273,9 → 3273,9
}
else
{
if (CurItem->itemName() != NameEdit->text())
if (CurItem->AnName != NameEdit->text())
{
CurItem->setItemName(NameEdit->text());
CurItem->setName(NameEdit->text());
CurItem->AutoName = false;
emit DocChanged();
}
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
22,8 → 22,8
Carrier->doc->toolSettings.dPen);
Carrier->view->SetRectFrame(Carrier->doc->Items.at(i));
if (Name != "")
Carrier->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(Carrier->doc->Items.at(i)->itemName().utf8());
Carrier->doc->Items.at(i)->setName(QString::fromUtf8(Name));
return PyString_FromString(Carrier->doc->Items.at(i)->AnName.utf8());
}
 
 
46,8 → 46,8
}
Carrier->view->SetOvalFrame(Carrier->doc->Items.at(i));
if (Name != "")
Carrier->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(Carrier->doc->Items.at(i)->itemName().utf8());
Carrier->doc->Items.at(i)->setName(QString::fromUtf8(Name));
return PyString_FromString(Carrier->doc->Items.at(i)->AnName.utf8());
}
 
 
68,8 → 68,8
}
Carrier->view->SetRectFrame(Carrier->doc->Items.at(i));
if (Name != "")
Carrier->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(Carrier->doc->Items.at(i)->itemName().utf8());
Carrier->doc->Items.at(i)->setName(QString::fromUtf8(Name));
return PyString_FromString(Carrier->doc->Items.at(i)->AnName.utf8());
}
 
 
91,8 → 91,8
}
Carrier->view->SetRectFrame(Carrier->doc->Items.at(i));
if (Name != "")
Carrier->doc->Items.at(i)->setItemName(QString::fromUtf8(Name));
return PyString_FromString(Carrier->doc->Items.at(i)->itemName().utf8());
Carrier->doc->Items.at(i)->setName(QString::fromUtf8(Name));
return PyString_FromString(Carrier->doc->Items.at(i)->AnName.utf8());
}
 
 
134,8 → 134,8
Carrier->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), i, false, false);
Carrier->view->AdjustItemSize(it);
if (Name != "")
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
it->setName(QString::fromUtf8(Name));
return PyString_FromString(it->AnName.utf8());
}
 
 
208,9 → 208,9
Carrier->view->AdjustItemSize(it);
if (Name != "")
{
it->setItemName(QString::fromUtf8(Name));
it->setName(QString::fromUtf8(Name));
}
return PyString_FromString(it->itemName().utf8());
return PyString_FromString(it->AnName.utf8());
}
 
 
287,8 → 287,8
Carrier->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false);
Carrier->view->AdjustItemSize(it);
if (Name != "")
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
it->setName(QString::fromUtf8(Name));
return PyString_FromString(it->AnName.utf8());
}
 
PyObject *scribus_bezierline(PyObject */*self*/, PyObject* args)
373,8 → 373,8
Carrier->view->SizeItem(it->PoLine.WidthHeight().x(), it->PoLine.WidthHeight().y(), ic, false, false);
Carrier->view->AdjustItemSize(it);
if (Name != "")
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
it->setName(QString::fromUtf8(Name));
return PyString_FromString(it->AnName.utf8());
}
 
 
411,8 → 411,8
Carrier->view->ToPathText();
Carrier->view->MoveItem(pageUnitXToDocX(x) - it->Xpos, pageUnitYToDocY(y) - it->Ypos, it);
if (Name != "")
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
it->setName(QString::fromUtf8(Name));
return PyString_FromString(it->AnName.utf8());
}
 
 
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
72,7 → 72,7
{
for (uint a = 0; a < Carrier->doc->Items.count(); a++)
{
if (Carrier->doc->Items.at(a)->itemName() == Name)
if (Carrier->doc->Items.at(a)->AnName == Name)
return static_cast<int>(a);
}
}
158,7 → 158,7
}
for (uint j = 0; j<Carrier->doc->Items.count(); j++)
{
if (name==Carrier->doc->Items.at(j)->itemName())
if (name==Carrier->doc->Items.at(j)->AnName)
return Carrier->doc->Items.at(j);
} // for items
PyErr_SetString(NoValidObjectError, QString("Object not found"));
177,7 → 177,7
return false;
for (uint j = 0; j<Carrier->doc->Items.count(); j++)
{
if (name==Carrier->doc->Items.at(j)->itemName())
if (name==Carrier->doc->Items.at(j)->AnName)
return true;
} // for items
return false;
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
229,7 → 229,7
if(!checkHaveDocument())
return NULL;
if ((i < static_cast<int>(Carrier->view->SelItem.count())) && (i > -1))
return PyString_FromString(Carrier->view->SelItem.at(i)->itemName().utf8());
return PyString_FromString(Carrier->view->SelItem.at(i)->AnName.utf8());
else
// FIXME: Should probably return None if no selection?
return PyString_FromString("");
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
211,12 → 211,12
{
if (Carrier->doc->Items.at(lam)->PType == typ)
{
PyList_SetItem(l, counter2, PyString_FromString(Carrier->doc->Items.at(lam)->itemName().utf8()));
PyList_SetItem(l, counter2, PyString_FromString(Carrier->doc->Items.at(lam)->AnName.utf8()));
counter2++;
}
}
else
PyList_SetItem(l, lam, PyString_FromString(Carrier->doc->Items.at(lam)->itemName().utf8()));
PyList_SetItem(l, lam, PyString_FromString(Carrier->doc->Items.at(lam)->AnName.utf8()));
}
return l;
}
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
176,7 → 176,7
// Scan backwards to find the first frame in a linked series
while (it->BackBox != 0)
{
is = GetUniqueItem(it->BackBox->itemName());
is = GetUniqueItem(it->BackBox->AnName);
if (is == NULL)
{
// While GetUniqueItem has already set an exception, we'll
204,7 → 204,7
// Scan forward through linked frames and ... what?
while (it->NextBox != 0)
{
is = GetUniqueItem(it->NextBox->itemName());
is = GetUniqueItem(it->NextBox->AnName);
if (is == NULL)
{
// While GetUniqueItem has already set an exception, we'll
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
125,7 → 125,7
for (uint i = 0; i<Carrier->doc->Items.count(); ++i)
{
row = Py_BuildValue((char*)"(sii)",
Carrier->doc->Items.at(i)->itemName().ascii(),
Carrier->doc->Items.at(i)->AnName.ascii(),
Carrier->doc->Items.at(i)->PType,
Carrier->doc->Items.at(i)->ItemNr
);
/branches/Version13x/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
587,7 → 587,7
}
}
if( !b.attribute("id").isEmpty() )
ite->setItemName(" "+b.attribute("id"));
ite->AnName += " "+b.attribute("id");
ite->Transparency = gc->Transparency;
ite->TranspStroke = gc->TranspStroke;
ite->PLineEnd = gc->PLineEnd;
1976,7 → 1976,7
Prog->view->Deselect();
ite->Ypos -= asce * mm.m22();
if( !e.attribute("id").isEmpty() )
ite->setItemName(" "+e.attribute("id"));
ite->AnName += " "+e.attribute("id");
ite->Transparency = gc->Transparency;
ite->TranspStroke = gc->TranspStroke;
ite->PLineEnd = gc->PLineEnd;
2044,7 → 2044,7
}
Prog->view->SetRectFrame(ite);
if( !e.attribute("id").isEmpty() )
ite->setItemName(" "+e.attribute("id"));
ite->AnName += " "+e.attribute("id");
ite->Transparency = gc->Transparency;
ite->TranspStroke = gc->TranspStroke;
ite->PLineEnd = gc->PLineEnd;
/branches/Version13x/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.cpp
625,7 → 625,7
if (dashes.count() != 0)
ite->DashValues = dashes;
if (drawID != "")
ite->setItemName(drawID);
ite->setName(drawID);
if (b.hasAttribute("draw:transform"))
{
parseTransform(&ite->PoLine, b.attribute("draw:transform"));
/branches/Version13x/Scribus/scribus/scribusXml.cpp
273,7 → 273,7
}
else
ob->setAttribute("ANNOTATION",0);
ob->setAttribute("ANNAME", !item->AutoName ? item->itemName() : QString(""));
ob->setAttribute("ANNAME", !item->AutoName ? item->AnName : QString(""));
ob->setAttribute("TEXTFLOW", item->Textflow ? 1 : 0);
ob->setAttribute("TEXTFLOW2", item->Textflow2 ? 1 : 0);
ob->setAttribute("TEXTFLOW3", item->UseContour ? 1 : 0);
/branches/Version13x/Scribus/scribus/checkDocument.cpp
254,7 → 254,7
bool itemError = false;
QListViewItem * object = new QListViewItem( page, 0 );
templateItemMap.insert(object, doc->MasterItems.at(it2.key())->ItemNr);
object->setText(0, doc->MasterItems.at(it2.key())->itemName());
object->setText(0, doc->MasterItems.at(it2.key())->AnName);
errorCodes::Iterator it3;
if (it2.data().count() == 1)
{
382,7 → 382,7
hasError = true;
bool itemError = false;
QListViewItem * object = new QListViewItem( page, 0 );
object->setText(0, doc->DocItems.at(it2.key())->itemName());
object->setText(0, doc->DocItems.at(it2.key())->AnName);
itemMap.insert(object, doc->DocItems.at(it2.key())->ItemNr);
errorCodes::Iterator it3;
if (it2.data().count() == 1)
517,7 → 517,7
{
hasError = true;
QListViewItem * object = new QListViewItem( page, 0 );
object->setText(0, doc->DocItems.at(it2.key())->itemName());
object->setText(0, doc->DocItems.at(it2.key())->AnName);
itemMap.insert(object, doc->DocItems.at(it2.key())->ItemNr);
errorCodes::Iterator it3;
if (it2.data().count() == 1)
/branches/Version13x/Scribus/scribus/annot.cpp
92,9 → 92,9
Layout60->addWidget( Tip, 1, 1 );
 
Name = new NameWidget(GroupBox10);
Name->setText(item->itemName());
Name->setText(item->AnName);
Layout60->addWidget( Name, 0, 1 );
OldName = item->itemName();
OldName = item->AnName;
 
TextLabel30 = new QLabel( GroupBox10, "TextLabel3" );
TextLabel30->setText( tr( "Tool-Tip:" ) );
1097,7 → 1097,7
bool found = false;
for (uint b = 0; b < view->Doc->Items.count(); ++b)
{
if ((NameNew == view->Doc->Items.at(b)->itemName()) && (view->Doc->Items.at(b) != item))
if ((NameNew == view->Doc->Items.at(b)->AnName) && (view->Doc->Items.at(b) != item))
{
found = true;
break;
1271,7 → 1271,7
 
void Annot::SelectFelder()
{
SelectFields* dia = new SelectFields(this, CalcFields->text(), item->itemName(), &view->Doc->Pages, 3);
SelectFields* dia = new SelectFields(this, CalcFields->text(), item->AnName, &view->Doc->Pages, 3);
if (dia->exec())
CalcFields->setText(dia->S_Fields);
delete dia;
1694,7 → 1694,7
item->AnType = ComboBox1->currentItem()+2;
if (Name->text() != OldName)
{
item->setItemName(Name->text());
item->setName(Name->text());
item->AutoName = false;
}
item->AnToolTip = Tip->text();
/branches/Version13x/Scribus/scribus/util.cpp
1837,7 → 1837,7
Buffer->An_C_act = b->An_C_act;
Buffer->An_Extern = b->An_Extern;
Buffer->AnZiel = b->AnZiel;
Buffer->AnName = b->itemName();
Buffer->AnName = b->AnName;
Buffer->AnActType = b->AnActType;
Buffer->AnToolTip = b->AnToolTip;
Buffer->AnBwid = b->AnBwid;
/branches/Version13x/Scribus/scribus/gtaction.cpp
462,7 → 462,7
 
QString gtAction::getFrameName()
{
return QString(textFrame->itemName());
return QString(textFrame->AnName);
}
 
bool gtAction::getUpdateParagraphStyles()
/branches/Version13x/Scribus/scribus/libpdf/pdflib.cpp
3605,7 → 3605,7
case 6:
Seite.FormObjects.append(ObjCounter-1);
PutDoc("/Subtype /Widget\n");
PutDoc("/T "+EncString("("+ite->itemName()+")",ObjCounter-1)+"\n");
PutDoc("/T "+EncString("("+ite->AnName+")",ObjCounter-1)+"\n");
if (ite->AnToolTip != "")
PutDoc("/TU "+EncString("("+PDFEncode(ite->AnToolTip)+")",ObjCounter-1)+"\n");
PutDoc("/F ");