重构: AecXData 类型标签改用枚举 AecXData::EType

- 在 AecXData 内新增 enum EType,取值直接采用 wtypes.h 的 VARENUM(VT_*),
  与原实现逐位一致(nVt 会序列化进 DWG/DXF/XData,数值必须保持不变)。
- 各模块共 303 处 nVt 判断由裸 VT_* 改为 AecXData::kTypeXxx,涉及 18 个文件;
  仅调试打印用的字符串字面量保持原样。
- AecDbObjXDataMap.h 增加 #include <wtypes.h>(EType 引用 VT_*)。
This commit is contained in:
company-desktop-computer committed 2026-10-13 09:55:42 +08:00
1 parent 9d9077a03e
commit 0467086e65
18 files changed
+602 -723

No files matched your search

@@ -62,13 +62,13 @@ BOOL CDLGArribtEdit::OnInitDialog()
{
iIndex = m_wndLstAttrib.InsertItem(0, sKey);
if (cVal.nVt == VT_BSTR)
if (cVal.nVt == AecXData::kTypeString)
sKey.Format(_T("%s"), cVal.pszVal);
else if (cVal.nVt == VT_I4)
else if (cVal.nVt == AecXData::kTypeInt)
sKey.Format(_T("%d"), cVal.nVal);
else if (cVal.nVt == VT_R8)
else if (cVal.nVt == AecXData::kTypeDouble)
sKey.Format(_T("%g"), cVal.dVal[0]);
else if (cVal.nVt == (VT_BYREF | VT_R8))
else if (cVal.nVt == AecXData::kTypePoint)
sKey.Format(_T("%g,%g,%g"), cVal.dVal[0], cVal.dVal[1], cVal.dVal[2]);
m_wndLstAttrib.SetItemText(iIndex, 1, sKey);
@@ -203,13 +203,13 @@ void CDLGArribtEdit::OnOK()
sValue = m_wndLstAttrib.GetItemText(iPos, 1);
iVt = m_wndLstAttrib.GetItemData(iPos);
if (iVt == VT_BSTR)
if (iVt == AecXData::kTypeString)
m_pmapXData->SetAt(sKey, sValue);
else if (iVt == VT_I4)
else if (iVt == AecXData::kTypeInt)
m_pmapXData->SetAt(sKey, (int)_ttol(sValue));
else if (iVt == VT_R8)
else if (iVt == AecXData::kTypeDouble)
m_pmapXData->SetAt(sKey, _tcstod(sValue, NULL));
else if (iVt == (VT_BYREF | VT_R8))
else if (iVt == AecXData::kTypePoint)
{
pt.x = pt.y = pt.z = 0.0;
_stscanf(sValue, _T("%lf,%lf,%lf"), &(pt.x), &(pt.y), &(pt.z));