Changeset 50508 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 19, 2014 3:45:58 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 92350
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp
r50460 r50508 53 53 HRESULT hr; 54 54 55 ULONG c AllFormats = lstFormats.size();55 ULONG cMaxFormats = 16; /* Maximum number of registered formats. */ 56 56 ULONG cRegisteredFormats = 0; 57 57 58 58 try 59 59 { 60 mpFormatEtc = new FORMATETC[c AllFormats];61 RT_BZERO(mpFormatEtc, sizeof(FORMATETC) * c AllFormats);62 mpStgMedium = new STGMEDIUM[c AllFormats];63 RT_BZERO(mpStgMedium, sizeof(STGMEDIUM) * c AllFormats);60 mpFormatEtc = new FORMATETC[cMaxFormats]; 61 RT_BZERO(mpFormatEtc, sizeof(FORMATETC) * cMaxFormats); 62 mpStgMedium = new STGMEDIUM[cMaxFormats]; 63 RT_BZERO(mpStgMedium, sizeof(STGMEDIUM) * cMaxFormats); 64 64 65 65 for (int i = 0; i < lstFormats.size(); i++) … … 69 69 continue; 70 70 71 /* URI data ("text/uri-list"). */ 71 72 if (strFormat.contains("text/uri-list", Qt::CaseInsensitive)) 72 73 { 73 /* URI data ("text/uri-list"). */ 74 RegisterFormat(&mpFormatEtc[cRegisteredFormats], CF_TEXT); 75 mpStgMedium[cRegisteredFormats++].tymed = TYMED_HGLOBAL; 76 RegisterFormat(&mpFormatEtc[cRegisteredFormats], CF_UNICODETEXT); 77 mpStgMedium[cRegisteredFormats++].tymed = TYMED_HGLOBAL; 74 78 RegisterFormat(&mpFormatEtc[cRegisteredFormats], CF_HDROP); 75 79 mpStgMedium[cRegisteredFormats++].tymed = TYMED_HGLOBAL; … … 77 81 mlstFormats << strFormat; 78 82 } 83 /* Plain text ("text/plain"). */ 79 84 else if (strFormat.contains("text/plain", Qt::CaseInsensitive)) 80 85 { 81 /* Plain text ("text/plain"). */82 86 RegisterFormat(&mpFormatEtc[cRegisteredFormats], CF_TEXT); 83 87 mpStgMedium[cRegisteredFormats++].tymed = TYMED_HGLOBAL; 88 RegisterFormat(&mpFormatEtc[cRegisteredFormats], CF_UNICODETEXT); 89 mpStgMedium[cRegisteredFormats++].tymed = TYMED_HGLOBAL; 84 90 85 91 mlstFormats << strFormat; … … 89 95 LogFlowFunc(("Total registered formats: %RU32 (of %d total)\n", 90 96 cRegisteredFormats, lstFormats.size())); 91 #ifdef VBOX_STRICT92 AssertMsg(cRegisteredFormats == cAllFormats,93 ("Registered formats count is not matching all formats count\n"));94 #endif95 97 hr = S_OK; 96 98 } … … 201 203 AssertPtrReturn(pMedium, DV_E_FORMATETC); 202 204 205 #ifdef VBOX_DND_DEBUG_FORMATS 203 206 LogFlowFunc(("pFormatEtc=%p, pMedium=%p\n", pFormatEtc, pMedium)); 207 #endif 204 208 205 209 ULONG lIndex; … … 227 231 if (mStatus == Dropped) 228 232 { 229 #if 0 230 LogFlowFunc(("Starting to transfer content from the guest ...\n")); 231 232 /* 233 * This is the right time starting to transfer the actual data 234 * from the guest: 235 * - The user just triggered an action that tells us to start, e.g. at 236 * the moment we only "listen" for releasing the left mouse button. 237 * - We're still in OLE's (modal) drag'n drop context so that all data 238 * from the guest (hopefully) will be available on the host when the 239 * drag'n drop operation is about to finish through OLE. 240 * 241 * Note that in the URI case the guest files/dirs must be somewhere 242 * on the host before OLE's drag'n drop operation is finished, otherwise 243 * the whole operation will fail. 244 */ 245 #endif 233 #ifdef VBOX_DND_DEBUG_FORMATS 246 234 LogFlowFunc(("cfFormat=%RI16, sFormat=%s, tyMed=%RU32, dwAspect=%RU32\n", 247 235 pThisFormat->cfFormat, UIDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat), … … 249 237 LogFlowFunc(("Got strFormat=%s, pvData=%p, cbData=%RU32\n", 250 238 mstrFormat.toAscii().constData(), mpvData, mcbData)); 251 239 #endif 252 240 QVariant::Type vaType; 253 241 QString strMIMEType; … … 495 483 STDMETHODIMP UIDnDDataObject::QueryGetData(FORMATETC *pFormatEtc) 496 484 { 497 LogFlowFunc(("\n"));498 485 return (LookupFormatEtc(pFormatEtc, NULL /* puIndex */)) ? S_OK : DV_E_FORMATETC; 499 486 } … … 648 635 && pFormatEtc->dwAspect == mpFormatEtc[i].dwAspect) 649 636 { 637 #ifdef VBOX_DND_DEBUG_FORMATS 650 638 LogFlowFunc(("Format found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32, ulIndex=%RU32\n", 651 639 pFormatEtc->tymed, pFormatEtc->cfFormat, UIDnDDataObject::ClipboardFormatToString(mpFormatEtc[i].cfFormat), 652 640 pFormatEtc->dwAspect, i)); 641 #endif 653 642 if (puIndex) 654 643 *puIndex = i; … … 657 646 } 658 647 648 #ifdef VBOX_DND_DEBUG_FORMATS 659 649 LogFlowFunc(("Format NOT found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32\n", 660 650 pFormatEtc->tymed, pFormatEtc->cfFormat, UIDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat), 661 651 pFormatEtc->dwAspect)); 662 652 #endif 663 653 return false; 664 654 }
Note:
See TracChangeset
for help on using the changeset viewer.