Esempio n. 1
0
BOOL COleClipSource::DoDelayRender()
{
	CClipTypes types;
	m_ClipIDs.GetTypes(types);

	bool foundHDrop = false;
	
	INT_PTR count = types.GetSize();
	for(int i=0; i < count; i++)
	{
		DelayRenderData(types[i]);

		if (types[i] == CF_HDROP)
		{
			foundHDrop = true;
		}
	}

	if (foundHDrop == false)
	{
		DelayRenderData(CF_HDROP);
		m_convertToHDROPOnDelayRender = true;
	}

	return count > 0;
}
Esempio n. 2
0
  DROPEFFECT StartDragging(RECT *rClient)
  {
    //pws_os::Trace(L"CStaticDataSource::StartDragging\n");

    DelayRenderData(CF_UNICODETEXT);
    DelayRenderData(CF_TEXT);

    //pws_os::Trace(L"CStaticDataSource::StartDragging - calling DoDragDrop\n");
    DROPEFFECT dropEffect = DoDragDrop(DROPEFFECT_COPY, rClient, m_pDropSource);

    //pws_os::Trace(L"CStaticDataSource::StartDragging - returned from DoDragDrop, dropEffect=%d\n",
    //  dropEffect);

    if (m_DDstatic.m_hgDataTXT != NULL) {
      //pws_os::Trace(L"CStaticDataSource::StartDragging - Unlock/Free m_hgDataTXT\n");
      GlobalUnlock(m_DDstatic.m_hgDataTXT);
      GlobalFree(m_DDstatic.m_hgDataTXT);
      m_DDstatic.m_hgDataTXT = NULL;
    }

    if (m_DDstatic.m_hgDataUTXT != NULL) {
      //pws_os::Trace(L"CStaticDataSource::StartDragging - Unlock/Free m_hgDataUTXT\n");
      GlobalUnlock(m_DDstatic.m_hgDataUTXT);
      GlobalFree(m_DDstatic.m_hgDataUTXT);
      m_DDstatic.m_hgDataUTXT = NULL;
    }
    return dropEffect;
  }
Esempio n. 3
0
INT_PTR COleClipSource::PutFormatOnClipboard(CClipFormats *pFormats)
{
	Log(_T("Start of put format on clipboard"));

	CClipFormat* pCF;
	INT_PTR	count = pFormats->GetSize();
	bool bDelayedRenderCF_HDROP = false;
	INT_PTR i = 0;

	//see if the html format is in the list
	//if it is the list we will not paste CF_TEXT
	for(i = 0; i < count; i++)
	{
		pCF = &pFormats->ElementAt(i);

		if(pCF->m_cfType == theApp.m_RemoteCF_HDROP)
		{
			bDelayedRenderCF_HDROP = true;
		}
	}

	for(i = 0; i < count; i++)
	{
		pCF = &pFormats->ElementAt(i);

		if(bDelayedRenderCF_HDROP)
		{
			if(pCF->m_cfType == CF_HDROP)
			{
				LogSendRecieveInfo("Added delayed cf_hdrop to clipboard");
				DelayRenderData(pCF->m_cfType);
			}

			continue;
		}

		wchar_t * stringData = (wchar_t *) GlobalLock(pCF->m_hgData);
		int size = (int) GlobalSize(pCF->m_hgData);
		CString cs(stringData);
		GlobalUnlock(pCF->m_hgData);
		
		Log(StrF(_T("Setting clipboard type: %s to the clipboard"), GetFormatName(pCF->m_cfType)));

		CacheGlobalData(pCF->m_cfType, pCF->m_hgData);
		pCF->m_hgData = 0; // OLE owns it now
	}

	pFormats->RemoveAll();

	m_bLoadedFormats = true;

	Log(_T("End of put format on clipboard"));

	return count;
}  
Esempio n. 4
0
//##ModelId=474D3058036D
BOOL COleClipSource::DoDelayRender()
{
	CClipTypes types;
	m_ClipIDs.GetTypes(types);
	
	int count = types.GetSize();
	for(int i=0; i < count; i++)
		DelayRenderData(types[i]);
	
	return count;
}
Esempio n. 5
0
//##ModelId=474D3058038B
long COleClipSource::PutFormatOnClipboard(CClipFormats *pFormats, bool bPasteHTMLFormatAs_CF_TEXT)
{
	CClipFormat* pCF;
	bool bDelayedRenderCF_HDROP = false;
	int	count = pFormats->GetSize();
	int i = 0;

	//see if the html format is in the list
	//if it is the list we will not paste CF_TEXT
	for(i = 0; i < count; i++)
	{
		pCF = &pFormats->ElementAt(i);

		if(bPasteHTMLFormatAs_CF_TEXT)
		{
			if(pCF->m_cfType == theApp.m_HTML_Format)
				break;
		}

		if(pCF->m_cfType == theApp.m_RemoteCF_HDROP)
		{
			bDelayedRenderCF_HDROP = true;
		}
	}

	//Didn't find html format
	if(i == count)
		bPasteHTMLFormatAs_CF_TEXT = false;
	
	for(i = 0; i < count; i++)
	{
		pCF = &pFormats->ElementAt(i);

		if(bDelayedRenderCF_HDROP)
		{
			if(pCF->m_cfType == CF_HDROP)
			{
				DelayRenderData(pCF->m_cfType);
			}

			continue;
		}
		
		if(bPasteHTMLFormatAs_CF_TEXT)
		{
			if(pCF->m_cfType == CF_TEXT)
				continue;

			if(pCF->m_cfType == theApp.m_HTML_Format)
				pCF->m_cfType = CF_TEXT;
		}

		CacheGlobalData( pCF->m_cfType, pCF->m_hgData );
		pCF->m_hgData = 0; // OLE owns it now
	}

	pFormats->RemoveAll();

	m_bLoadedFormats = true;

	return count;
}