This is my small fix for this issue. @WandererFan can you please test it and consider change it since I am not Github guru?
This code in DrawViewDimension.cpp somewhere end of the file
Code: Select all
std::string DrawViewDimension::getDefaultFormatSpec() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
std::string prefFormat = hGrp->GetASCII("formatSpec","");
QString formatSpec;
if (prefFormat.empty()) {
QString format1 = Base::Tools::fromStdString("%.");
QString format2 = Base::Tools::fromStdString("f");
int precision;
if (useDecimals()) {
precision = Base::UnitsApi::getDecimals();
} else {
precision = hGrp->GetInt("AltDecimals", 2);
}
QString formatPrecision = QString::number(precision);
std::string prefix = getPrefix();
QString qPrefix;
if (!prefix.empty()) {
qPrefix = QString::fromUtf8(prefix.data(),prefix.size());
}
formatSpec = qPrefix + format1 + formatPrecision + format2;
} else {
return prefFormat;
}
return Base::Tools::toStdString(formatSpec);
}
is to be replaced by :
Code: Select all
std::string DrawViewDimension::getDefaultFormatSpec() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
std::string prefFormat = hGrp->GetASCII("formatSpec","");
QString formatSpec;
QString qPrefix; //Move it here
if (prefFormat.empty()) {
QString format1 = Base::Tools::fromStdString("%.");
QString format2 = Base::Tools::fromStdString("f");
int precision;
if (useDecimals()) {
precision = Base::UnitsApi::getDecimals();
} else {
precision = hGrp->GetInt("AltDecimals", 2);
}
QString formatPrecision = QString::number(precision);
std::string prefix = getPrefix();
//QString qPrefix;
if (!prefix.empty()) {
qPrefix = QString::fromUtf8(prefix.data(),prefix.size());
}
formatSpec = qPrefix + format1 + formatPrecision + format2;
} else {
//return prefFormat;
std::string prefix = getPrefix();
qPrefix = QString::fromUtf8(prefix.data(),prefix.size());
formatSpec = qPrefix + QString::fromStdString(prefFormat);
}
return Base::Tools::toStdString(formatSpec);
}