Changeset 56656 in vbox
- Timestamp:
- Jun 26, 2015 8:51:18 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 101292
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r56655 r56656 241 241 242 242 HRESULT GuestDnDTarget::enter(ULONG aScreenId, ULONG aX, ULONG aY, 243 DnDAction_T aDefaultAction,244 const std::vector<DnDAction_T> &aAllowedActions,243 DnDAction_T aDefaultAction, 244 const std::vector<DnDAction_T> &aAllowedActions, 245 245 const std::vector<com::Utf8Str> &aFormats, 246 DnDAction_T *aResultAction)246 DnDAction_T *aResultAction) 247 247 { 248 248 #if !defined(VBOX_WITH_DRAG_AND_DROP) … … 281 281 /* If there is no valid supported format, ignore this request. */ 282 282 if (strFormats.isEmpty()) 283 return S_OK; 283 return setError(E_INVALIDARG, tr("Specified format(s) not supported")); 284 285 LogRel2(("DnD: Offered formats to guest:\n")); 286 RTCList<RTCString> lstFormats = strFormats.split("\r\n"); 287 for (size_t i = 0; i < lstFormats.size(); i++) 288 LogRel2(("DnD: \t%s\n", lstFormats[i].c_str())); 289 290 /* Save the formats offered to the guest. This is needed to later 291 * decide what to do with the data when sending stuff to the guest. */ 292 m_vecFmtOff = aFormats; 293 Assert(m_vecFmtOff.size()); 284 294 285 295 HRESULT hr = S_OK; … … 308 318 } 309 319 310 if (aResultAction) 311 *aResultAction = resAction; 320 if (RT_FAILURE(rc)) 321 hr = VBOX_E_IPRT_ERROR; 322 323 if (SUCCEEDED(hr)) 324 { 325 if (aResultAction) 326 *aResultAction = resAction; 327 } 312 328 313 329 LogFlowFunc(("hr=%Rhrc, resAction=%ld\n", hr, resAction)); … … 317 333 318 334 HRESULT GuestDnDTarget::move(ULONG aScreenId, ULONG aX, ULONG aY, 319 DnDAction_T aDefaultAction,320 const std::vector<DnDAction_T> &aAllowedActions,335 DnDAction_T aDefaultAction, 336 const std::vector<DnDAction_T> &aAllowedActions, 321 337 const std::vector<com::Utf8Str> &aFormats, 322 DnDAction_T *aResultAction)338 DnDAction_T *aResultAction) 323 339 { 324 340 #if !defined(VBOX_WITH_DRAG_AND_DROP) … … 347 363 /* If there is no valid supported format, ignore this request. */ 348 364 if (strFormats.isEmpty()) 349 return S_OK;365 return setError(E_INVALIDARG, tr("Specified format(s) not supported")); 350 366 351 367 HRESULT hr = S_OK; … … 373 389 } 374 390 375 if (aResultAction) 376 *aResultAction = resAction; 391 if (RT_FAILURE(rc)) 392 hr = VBOX_E_IPRT_ERROR; 393 394 if (SUCCEEDED(hr)) 395 { 396 if (aResultAction) 397 *aResultAction = resAction; 398 } 377 399 378 400 LogFlowFunc(("hr=%Rhrc, *pResultAction=%ld\n", hr, resAction)); … … 400 422 } 401 423 424 if (RT_FAILURE(rc)) 425 hr = VBOX_E_IPRT_ERROR; 426 402 427 LogFlowFunc(("hr=%Rhrc\n", hr)); 403 428 return hr; … … 406 431 407 432 HRESULT GuestDnDTarget::drop(ULONG aScreenId, ULONG aX, ULONG aY, 408 DnDAction_T aDefaultAction,409 const std::vector<DnDAction_T> &aAllowedActions,433 DnDAction_T aDefaultAction, 434 const std::vector<DnDAction_T> &aAllowedActions, 410 435 const std::vector<com::Utf8Str> &aFormats, 411 com::Utf8Str &aFormat, DnDAction_T *aResultAction) 436 com::Utf8Str &aFormat, 437 DnDAction_T *aResultAction) 412 438 { 413 439 #if !defined(VBOX_WITH_DRAG_AND_DROP) … … 432 458 /* If there is no usable action, ignore this request. */ 433 459 if (isDnDIgnoreAction(uDefAction)) 460 { 461 aFormat = ""; 462 if (aResultAction) 463 *aResultAction = DnDAction_Ignore; 434 464 return S_OK; 465 } 435 466 436 467 /* Make a flat data string out of the supported format list. */ … … 438 469 /* If there is no valid supported format, ignore this request. */ 439 470 if (strFormats.isEmpty()) 440 return S_OK;471 return setError(E_INVALIDARG, tr("Specified format(s) not supported")); 441 472 442 473 HRESULT hr = S_OK; … … 471 502 } 472 503 473 if (aResultAction) 474 *aResultAction = resAction; 475 504 if (RT_FAILURE(rc)) 505 hr = VBOX_E_IPRT_ERROR; 506 507 if (SUCCEEDED(hr)) 508 { 509 if (aResultAction) 510 *aResultAction = resAction; 511 } 512 513 LogFlowFunc(("Returning hr=%Rhrc\n", hr)); 476 514 return hr; 477 515 #endif /* VBOX_WITH_DRAG_AND_DROP */ … … 681 719 { 682 720 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 683 684 GuestDnD *pInst = GuestDnDInst();685 if (!pInst)686 return VERR_INVALID_POINTER;687 721 688 722 int rc; … … 1301 1335 *aVeto = FALSE; /** @todo */ 1302 1336 1303 return RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR; 1337 HRESULT hr = RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR; 1338 1339 LogFlowFunc(("hr=%Rhrc\n", hr)); 1340 return hr; 1304 1341 #endif /* VBOX_WITH_DRAG_AND_DROP */ 1305 1342 }
Note:
See TracChangeset
for help on using the changeset viewer.