/** * Gets the transferable object * */ NS_IMETHODIMP nsBaseClipboard::GetData(nsITransferable * aTransferable, PRInt32 aWhichClipboard) { NS_ASSERTION ( aTransferable, "clipboard given a null transferable" ); bool selectClipPresent; SupportsSelectionClipboard(&selectClipPresent); if ( !selectClipPresent && aWhichClipboard != kGlobalClipboard ) return NS_ERROR_FAILURE; if ( aTransferable ) return GetNativeClipboardData(aTransferable, aWhichClipboard); return NS_ERROR_FAILURE; }
// OnGetClipboardData is used by CopyToClipboard and DoDragDrop COleDataSource* CRectItem::OnGetClipboardData( BOOL bIncludeLink, LPPOINT lpOffset, LPSIZE lpSize) { ASSERT_VALID(this); COleDataSource* pDataSource = new COleDataSource; TRY { GetNativeClipboardData(pDataSource); GetClipboardData(pDataSource, bIncludeLink, lpOffset, lpSize); } CATCH_ALL(e) { delete pDataSource; THROW_LAST(); } END_CATCH_ALL ASSERT_VALID(pDataSource); return pDataSource; }
/** * Gets the transferable object */ NS_IMETHODIMP nsClipboard::GetData(nsITransferable *aTransferable, PRInt32 aWhichClipboard) { if (nsnull != aTransferable) { QClipboard::Mode mode; if (kGlobalClipboard == aWhichClipboard) { mode = QClipboard::Clipboard; } else { mode = QClipboard::Selection; } return GetNativeClipboardData(aTransferable, mode); } else { qDebug(" nsClipboard::GetData(), aTransferable is NULL."); } return NS_ERROR_FAILURE; }