405 switch (fmt) {
406 case CF_ENHMETAFILE:
407 m_ntypes++; // Only TYMED_ENHMF
408 break;
409 case CF_METAFILEPICT:
410 m_ntypes++; // Only TYMED_MFPICT
411 break;
412 case CF_HDROP:
413 m_ntypes++; // Only TYMED_HGLOBAL
414 break;
415 default:
416 m_ntypes += 2; // TYMED_HGLOBAL and TYMED_ISTREAM
417 break;
418 }
419 }
420
421 try {
422 m_types = (FORMATETC *)safe_Calloc(sizeof(FORMATETC), m_ntypes);
423 } catch (std::bad_alloc&) {
424 m_ntypes = 0;
425 throw;
426 }
427
428 lFormats = saveFormats;
429
430 for (i = 0, idx = 0; i < items; i++, lFormats++) {
431 // Warning C4244.
432 // Cast from jlong to CLIPFORMAT (WORD).
433 CLIPFORMAT fmt = (CLIPFORMAT)*lFormats;
434
435 m_types[idx].cfFormat = fmt;
436 m_types[idx].dwAspect = DVASPECT_CONTENT;
437 m_types[idx].lindex = -1;
438
439 switch (fmt) {
440 default:
441 m_types[idx].tymed = TYMED_ISTREAM;
442 idx++;
443
444 // now make a copy, but with a TYMED of HGLOBAL
|
405 switch (fmt) {
406 case CF_ENHMETAFILE:
407 m_ntypes++; // Only TYMED_ENHMF
408 break;
409 case CF_METAFILEPICT:
410 m_ntypes++; // Only TYMED_MFPICT
411 break;
412 case CF_HDROP:
413 m_ntypes++; // Only TYMED_HGLOBAL
414 break;
415 default:
416 m_ntypes += 2; // TYMED_HGLOBAL and TYMED_ISTREAM
417 break;
418 }
419 }
420
421 try {
422 m_types = (FORMATETC *)safe_Calloc(sizeof(FORMATETC), m_ntypes);
423 } catch (std::bad_alloc&) {
424 m_ntypes = 0;
425 if (saveFormats != NULL) {
426 env->ReleaseLongArrayElements(formats, saveFormats, 0);
427 }
428 throw;
429 }
430
431 lFormats = saveFormats;
432
433 for (i = 0, idx = 0; i < items; i++, lFormats++) {
434 // Warning C4244.
435 // Cast from jlong to CLIPFORMAT (WORD).
436 CLIPFORMAT fmt = (CLIPFORMAT)*lFormats;
437
438 m_types[idx].cfFormat = fmt;
439 m_types[idx].dwAspect = DVASPECT_CONTENT;
440 m_types[idx].lindex = -1;
441
442 switch (fmt) {
443 default:
444 m_types[idx].tymed = TYMED_ISTREAM;
445 idx++;
446
447 // now make a copy, but with a TYMED of HGLOBAL
|