Fixed native CF_TEXT copy, to decrement the size by one when it is a null

terminated string. Apps like MS-Word pass back the size including the terminating
zero. This fixes that.
This commit is contained in:
rods%netscape.com 1999-04-21 00:15:08 +00:00
Родитель 083aeb67d3
Коммит e863238bf0
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -371,6 +371,12 @@ nsresult nsClipboard::GetNativeDataOffClipboard(IDataObject * aDataObject, UINT
switch (stm->tymed) {
case TYMED_HGLOBAL:
result = GetGlobalData(stm->hGlobal, aData, aLen);
if (fe.cfFormat == CF_TEXT) {
char * str = (char *)*aData;
if (str[*aLen-1] == 0) {
(*aLen)--;
}
}
break;
default:
break;