Cleaned up PasteTextBlocking to return better

error information if NO TEXT data exists
on the clipboard
This commit is contained in:
kostello%netscape.com 1999-03-11 04:41:43 +00:00
Родитель 8a43eca493
Коммит 30f9fba3d0
1 изменённых файлов: 12 добавлений и 13 удалений

Просмотреть файл

@ -187,25 +187,24 @@ nsresult nsSelectionMgr::CopyToClipboard()
nsresult nsSelectionMgr::PasteTextBlocking(nsString* aPastedText)
{
HGLOBAL hglb;
LPSTR lpstr;
HGLOBAL hglb;
LPSTR lpstr;
nsresult result = NS_ERROR_FAILURE;
if (aPastedText && OpenClipboard(NULL))
{
// Just Grab TEXT for now, later we will grab HTML, XIF, etc.
hglb = GetClipboardData(CF_TEXT);
lpstr = (LPSTR)GlobalLock(hglb);
aPastedText->SetString((char*)lpstr);
GlobalUnlock(hglb);
if (hglb != NULL)
{
lpstr = (LPSTR)GlobalLock(hglb);
aPastedText->SetString((char*)lpstr);
GlobalUnlock(hglb);
result = NS_OK;
}
CloseClipboard();
}
else
{
aPastedText = nsnull;
}
return NS_OK;
return result;
}
nsresult NS_NewSelectionMgr(nsISelectionMgr** aInstancePtrResult)