mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Fix : new conductor have text without variable replaced
For a new conductor with the text set from the default conductor text defined in the folio properties, and this text contain variables, in this case the variables are not replaced. This commit fix it.
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
#include "diagram.h"
|
||||
#include "qet.h"
|
||||
#include "qetdiagrameditor.h"
|
||||
#include "qetgraphicsitem/conductor.h"
|
||||
#include "ui/potentialselectordialog.h"
|
||||
|
||||
/**
|
||||
@@ -221,9 +220,12 @@ void ConductorAutoNumerotation::numeratePotential()
|
||||
*/
|
||||
void ConductorAutoNumerotation::numerateNewConductor()
|
||||
{
|
||||
if (!m_conductor || m_diagram->conductorsAutonumName().isEmpty())
|
||||
if (m_conductor) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_diagram->conductorsAutonumName().isEmpty())
|
||||
{
|
||||
NumerotationContext context = m_diagram->project()->conductorAutoNum(
|
||||
m_diagram -> conductorsAutonumName());
|
||||
if (context.isEmpty())
|
||||
@@ -244,9 +246,10 @@ void ConductorAutoNumerotation::numerateNewConductor()
|
||||
|
||||
NumerotationContextCommands ncc (context, m_diagram);
|
||||
m_diagram->project()->addConductorAutoNum(autoNum_name, ncc.next());
|
||||
}
|
||||
|
||||
applyText(autonum::AssignVariables::formulaToLabel(
|
||||
formula,
|
||||
m_conductor->properties().m_formula,
|
||||
m_conductor->rSequenceNum(),
|
||||
m_diagram));
|
||||
}
|
||||
|
||||
@@ -19,11 +19,12 @@
|
||||
#define CONDUCTORAUTONUMEROTATION_H
|
||||
|
||||
#include "autoNum/assignvariables.h"
|
||||
#include "qetgraphicsitem/conductor.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QPointer>
|
||||
|
||||
class Diagram;
|
||||
class Conductor;
|
||||
class QUndoCommand;
|
||||
class ConductorProperties;
|
||||
|
||||
@@ -52,7 +53,7 @@ class ConductorAutoNumerotation
|
||||
|
||||
//attributes
|
||||
Diagram *m_diagram;
|
||||
Conductor *m_conductor;
|
||||
QPointer<Conductor> m_conductor;
|
||||
QList <Conductor *> conductor_list;
|
||||
QUndoCommand *m_parent_undo;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user