From 4d7f9f00f4f79dd2a1d6d1ef6cd042f5fa2b2348 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Mon, 4 Mar 2024 10:02:14 -0500 Subject: [PATCH] [TD]correct s/s cell format --- src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp b/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp index 3f2bed8383..a7b293152a 100644 --- a/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp +++ b/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp @@ -31,6 +31,8 @@ #include #include +#include + #include #include @@ -268,12 +270,13 @@ std::string DrawViewSpreadsheet::getSheetImage() App::Property* prop = sheet->getPropertyByName(address.toString().c_str()); std::stringstream field; if (prop && cell) { - if ( - prop->isDerivedFrom(App::PropertyQuantity::getClassTypeId()) || - prop->isDerivedFrom(App::PropertyFloat::getClassTypeId()) || - prop->isDerivedFrom(App::PropertyInteger::getClassTypeId()) - ) { - std::string temp = cell->getFormattedQuantity(); //writable + if (prop->isDerivedFrom(App::PropertyQuantity::getClassTypeId())) { + auto contentAsQuantity = static_cast(prop)->getQuantityValue(); + auto ustring = contentAsQuantity.getUserString(); + field << Base::Tools::toStdString(ustring); + } else if (prop->isDerivedFrom(App::PropertyFloat::getClassTypeId()) || + prop->isDerivedFrom(App::PropertyInteger::getClassTypeId())) { + std::string temp = cell->getFormattedQuantity(); DrawUtil::encodeXmlSpecialChars(temp); field << temp; } else if (prop->isDerivedFrom(App::PropertyString::getClassTypeId())) {