| 1295 | } |
| 1296 | |
| 1297 | bool CSaveModifiedItemsDialog::FindUsedColumns(ITabbedMDIChildModifiedList* list, int columnUseCount[eColumn_Count]) |
| 1298 | { |
| 1299 | if(list == NULL) |
| 1300 | { |
| 1301 | return false; |
| 1302 | } |
| 1303 | |
| 1304 | bool success = true; |
| 1305 | |
| 1306 | long count = 0; |
| 1307 | list->get_Count(&count); |
| 1308 | for(long i=0; i<count; ++i) |
| 1309 | { |
| 1310 | ATL::CComPtr<ITabbedMDIChildModifiedItem> item; |
| 1311 | list->get_Item(i, &item); |
| 1312 | if(item) |
| 1313 | { |
| 1314 | if(m_showColumn[eColumn_Name]) |
| 1315 | { |
| 1316 | ATL::CComBSTR displayName; |
| 1317 | item->get_DisplayName(&displayName); |
| 1318 | if(displayName.Length() > 0) |
| 1319 | { |
| 1320 | columnUseCount[eColumn_Name] += 1; |
| 1321 | } |
| 1322 | } |
| 1323 | if(m_showColumn[eColumn_Description]) |
| 1324 | { |
| 1325 | ATL::CComBSTR description; |
| 1326 | item->get_Description(&description); |
| 1327 | if(description.Length() > 0) |
| 1328 | { |
| 1329 | columnUseCount[eColumn_Description] += 1; |
| 1330 | } |
| 1331 | } |
| 1332 | if(m_showColumn[eColumn_LastModified]) |
| 1333 | { |
| 1334 | DATE lastModified = 0; |
| 1335 | item->get_LastModifiedUTC(&lastModified); |
| 1336 | if(lastModified != 0) |
| 1337 | { |
| 1338 | columnUseCount[eColumn_LastModified] += 1; |
| 1339 | } |
| 1340 | } |
| 1341 | |
| 1342 | ATL::CComPtr<ITabbedMDIChildModifiedList> subItems; |
| 1343 | item->get_SubItems(&subItems); |
| 1344 | if(subItems) |
| 1345 | { |
| 1346 | this->FindUsedColumns(subItems, columnUseCount); |
| 1347 | } |
| 1348 | } |
| 1349 | } |
| 1350 | |
| 1351 | return success; |
| 1352 | } |
| 1353 | |
| 1354 | bool CSaveModifiedItemsDialog::AddItems(ITabbedMDIChildModifiedList* list, int indent) |
no test coverage detected