mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Corrected element autonumbering sequential format 01 and 001. Corrected nameless element autonumbering treatment.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4570 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -513,7 +513,7 @@ void ProjectAutoNumConfigPage::saveContext_element() {
|
||||
// With the the name "No name"
|
||||
if (m_context_cb_element -> currentText() == tr("Nom de la nouvelle numérotation")) {
|
||||
project_->addElementAutoNum (tr("Sans nom"), m_saw_element -> toNumContext());
|
||||
project()->addElementAutoNumFormula (m_context_cb_element->currentText(), m_saw_element->elementFormula()); //add hash <title, formula>
|
||||
project()->addElementAutoNumFormula (tr("Sans nom"), m_saw_element->elementFormula()); //add hash <title, formula>
|
||||
project()->addElementAutoNumCurrentFormula (m_saw_element->elementFormula()); //add last added element formula to current formula
|
||||
m_context_cb_element -> addItem(tr("Sans nom"));
|
||||
}
|
||||
|
||||
@@ -689,7 +689,6 @@ void Element::assignSeq() {
|
||||
QHash <QString,QString> hash = diagram()->project()->elementAutoNum_2();
|
||||
QString formula_name = hash.key(formula);
|
||||
QString label = dc["label"].toString();
|
||||
qDebug() << "Label" << label;
|
||||
NumerotationContext nc = diagram()->project()->elementAutoNum(formula_name);
|
||||
NumerotationContextCommands ncc (nc);
|
||||
if (!nc.isEmpty()) {
|
||||
@@ -706,7 +705,8 @@ void Element::assignSeq() {
|
||||
int count = 1;
|
||||
for (int i = 0; i < nc.size(); i++) {
|
||||
if (nc.itemAt(i).at(0) == "ten") {
|
||||
label.replace("%seqt_" + QString::number(count), QString::number(nc.itemAt(i).at(1).toInt()));
|
||||
QString number = QString("%1").arg(nc.itemAt(i).at(1).toInt(), 2, 10, QChar('0'));
|
||||
label.replace("%seqt_" + QString::number(count), number);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -715,7 +715,8 @@ void Element::assignSeq() {
|
||||
int count = 1;
|
||||
for (int i = 0; i < nc.size(); i++) {
|
||||
if (nc.itemAt(i).at(0) == "hundred") {
|
||||
label.replace("%seqh_" + QString::number(count), QString::number(nc.itemAt(i).at(1).toInt()));
|
||||
QString number = QString("%1").arg(nc.itemAt(i).at(1).toInt(), 3, 10, QChar('0'));
|
||||
label.replace("%seqh_" + QString::number(count), number);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user