From f90660eb127ec0a79ceea27ec054eb106fba4e90 Mon Sep 17 00:00:00 2001 From: Wanderer Fan Date: Tue, 17 May 2022 19:38:20 -0400 Subject: [PATCH] [TD]fix handling of translated enumeration --- src/Mod/TechDraw/Gui/TaskSectionView.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Mod/TechDraw/Gui/TaskSectionView.cpp b/src/Mod/TechDraw/Gui/TaskSectionView.cpp index 439c78ba15..1253271886 100644 --- a/src/Mod/TechDraw/Gui/TaskSectionView.cpp +++ b/src/Mod/TechDraw/Gui/TaskSectionView.cpp @@ -436,11 +436,9 @@ void TaskSectionView::createSectionView(void) Command::doCommand(Command::Doc,"App.ActiveDocument.%s.Scale = %0.6f", m_sectionName.c_str(), ui->sbScale->value().getValue()); - QString qScaleType = ui->cmbScaleType->currentText(); - std::string sScaleType = Base::Tools::toStdString(qScaleType); - Command::doCommand(Command::Doc,"App.ActiveDocument.%s.ScaleType = '%s'", - m_sectionName.c_str(), - sScaleType.c_str()); + int scaleType = ui->cmbScaleType->currentIndex(); + Command::doCommand(Command::Doc,"App.ActiveDocument.%s.ScaleType = %d", + m_sectionName.c_str(), scaleType); App::DocumentObject* newObj = m_base->getDocument()->getObject(m_sectionName.c_str()); m_section = dynamic_cast(newObj); @@ -487,11 +485,9 @@ void TaskSectionView::updateSectionView(void) Command::doCommand(Command::Doc,"App.ActiveDocument.%s.Scale = %0.6f", m_sectionName.c_str(), ui->sbScale->value().getValue()); - QString qScaleType = ui->cmbScaleType->currentText(); - std::string sScaleType = Base::Tools::toStdString(qScaleType); - Command::doCommand(Command::Doc,"App.ActiveDocument.%s.ScaleType = '%s'", - m_sectionName.c_str(), - sScaleType.c_str()); + int scaleType = ui->cmbScaleType->currentIndex(); + Command::doCommand(Command::Doc,"App.ActiveDocument.%s.ScaleType = %d", + m_sectionName.c_str(), scaleType); m_section->setCSFromBase(m_dirName.c_str()); } Gui::Command::commitCommand();