Added windows specific paste code

This commit is contained in:
kostello%netscape.com 1999-03-11 04:27:39 +00:00
Родитель b668b90a35
Коммит 8a43eca493
1 изменённых файлов: 21 добавлений и 1 удалений

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

@ -20,6 +20,8 @@
#include <strstrea.h> #include <strstrea.h>
#include <windows.h> #include <windows.h>
#include "nscore.h"
#include "nsString.h"
// XXX BWEEP BWEEP This is ONLY TEMPORARY until the service manager // XXX BWEEP BWEEP This is ONLY TEMPORARY until the service manager
@ -185,7 +187,25 @@ nsresult nsSelectionMgr::CopyToClipboard()
nsresult nsSelectionMgr::PasteTextBlocking(nsString* aPastedText) nsresult nsSelectionMgr::PasteTextBlocking(nsString* aPastedText)
{ {
return NS_ERROR_NOT_IMPLEMENTED; HGLOBAL hglb;
LPSTR lpstr;
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);
CloseClipboard();
}
else
{
aPastedText = nsnull;
}
return NS_OK;
} }
nsresult NS_NewSelectionMgr(nsISelectionMgr** aInstancePtrResult) nsresult NS_NewSelectionMgr(nsISelectionMgr** aInstancePtrResult)