| 270 | } |
| 271 | |
| 272 | String PropertySystem::FormatPropertyValue(const PropertyValues& values, unsigned index) |
| 273 | { |
| 274 | if (index >= values.m_values.size()) |
| 275 | return _T(""); |
| 276 | String value; |
| 277 | if (values.m_values[index].vt == (VT_VECTOR | VT_UI1)) |
| 278 | { |
| 279 | const CAUB& buf = values.m_values[index].caub; |
| 280 | for (unsigned i = 0; i < buf.cElems; ++i) |
| 281 | { |
| 282 | BYTE c = buf.pElems[i]; |
| 283 | value += "0123456789abcdef"[c >> 4]; |
| 284 | value += "0123456789abcdef"[c & 0xf]; |
| 285 | } |
| 286 | return value; |
| 287 | } |
| 288 | PWSTR pszDisplayValue = NULL; |
| 289 | HRESULT hr = PSFormatForDisplayAlloc(m_keys[index], values.m_values[index], PDFF_DEFAULT, &pszDisplayValue); |
| 290 | if (SUCCEEDED(hr)) |
| 291 | { |
| 292 | value = pszDisplayValue; |
| 293 | CoTaskMemFree(pszDisplayValue); |
| 294 | } |
| 295 | return value; |
| 296 | } |
| 297 | |
| 298 | bool PropertySystem::GetDisplayNames(std::vector<String>& names) |
| 299 | { |