mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 10:46:58 +00:00
[WIN32SS] Fix NtUserGetClipboardData for text paste (#645)
Fix the NtUserGetClipboardData function for the synthesized text formats (CF_TEXT, CF_OEMTEXT and CF_UNICODETEXT). CORE-11471
This commit is contained in:
parent
2170901e6a
commit
6abc9f5b5a
1 changed files with 30 additions and 17 deletions
|
@ -294,8 +294,8 @@ IntAddSynthesizedFormats(PWINSTATION_OBJECT pWinStaObj)
|
||||||
bHaveBm = IntIsFormatAvailable(pWinStaObj, CF_BITMAP);
|
bHaveBm = IntIsFormatAvailable(pWinStaObj, CF_BITMAP);
|
||||||
bHaveDib = IntIsFormatAvailable(pWinStaObj, CF_DIB);
|
bHaveDib = IntIsFormatAvailable(pWinStaObj, CF_DIB);
|
||||||
|
|
||||||
/* Add CF_LOCALE format if we have CF_TEXT */
|
/* Add CF_LOCALE format if we have CF_TEXT, CF_OEMTEXT or CF_UNICODETEXT */
|
||||||
if (!bHaveLocale && bHaveText)
|
if (!bHaveLocale && (bHaveText || bHaveOemText || bHaveUniText))
|
||||||
{
|
{
|
||||||
PCLIPBOARDDATA pMemObj;
|
PCLIPBOARDDATA pMemObj;
|
||||||
HANDLE hMem;
|
HANDLE hMem;
|
||||||
|
@ -881,6 +881,7 @@ NtUserGetClipboardData(UINT fmt, PGETCLIPBDATA pgcd)
|
||||||
HANDLE hRet = NULL;
|
HANDLE hRet = NULL;
|
||||||
PCLIP pElement;
|
PCLIP pElement;
|
||||||
PWINSTATION_OBJECT pWinStaObj;
|
PWINSTATION_OBJECT pWinStaObj;
|
||||||
|
UINT uSourceFmt = fmt;
|
||||||
|
|
||||||
TRACE("NtUserGetClipboardData(%x, %p)\n", fmt, pgcd);
|
TRACE("NtUserGetClipboardData(%x, %p)\n", fmt, pgcd);
|
||||||
|
|
||||||
|
@ -898,18 +899,7 @@ NtUserGetClipboardData(UINT fmt, PGETCLIPBDATA pgcd)
|
||||||
}
|
}
|
||||||
|
|
||||||
pElement = IntGetFormatElement(pWinStaObj, fmt);
|
pElement = IntGetFormatElement(pWinStaObj, fmt);
|
||||||
if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner)
|
if (!pElement)
|
||||||
{
|
|
||||||
/* Send WM_RENDERFORMAT message */
|
|
||||||
pWinStaObj->fInDelayedRendering = TRUE;
|
|
||||||
co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)fmt, 0);
|
|
||||||
pWinStaObj->fInDelayedRendering = FALSE;
|
|
||||||
|
|
||||||
/* Data should be in clipboard now */
|
|
||||||
pElement = IntGetFormatElement(pWinStaObj, fmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pElement || IS_DATA_DELAYED(pElement))
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (IS_DATA_SYNTHESIZED(pElement))
|
if (IS_DATA_SYNTHESIZED(pElement))
|
||||||
|
@ -921,20 +911,43 @@ NtUserGetClipboardData(UINT fmt, PGETCLIPBDATA pgcd)
|
||||||
case CF_UNICODETEXT:
|
case CF_UNICODETEXT:
|
||||||
case CF_TEXT:
|
case CF_TEXT:
|
||||||
case CF_OEMTEXT:
|
case CF_OEMTEXT:
|
||||||
pElement = IntGetFormatElement(pWinStaObj, CF_UNICODETEXT);
|
uSourceFmt = CF_UNICODETEXT;
|
||||||
|
pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
|
||||||
if (IS_DATA_SYNTHESIZED(pElement))
|
if (IS_DATA_SYNTHESIZED(pElement))
|
||||||
pElement = IntGetFormatElement(pWinStaObj, CF_TEXT);
|
{
|
||||||
|
uSourceFmt = CF_TEXT;
|
||||||
|
pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
|
||||||
|
}
|
||||||
if (IS_DATA_SYNTHESIZED(pElement))
|
if (IS_DATA_SYNTHESIZED(pElement))
|
||||||
pElement = IntGetFormatElement(pWinStaObj, CF_OEMTEXT);
|
{
|
||||||
|
uSourceFmt = CF_OEMTEXT;
|
||||||
|
pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CF_BITMAP:
|
case CF_BITMAP:
|
||||||
IntSynthesizeBitmap(pWinStaObj, pElement);
|
IntSynthesizeBitmap(pWinStaObj, pElement);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner)
|
||||||
|
{
|
||||||
|
/* Send WM_RENDERFORMAT message */
|
||||||
|
pWinStaObj->fInDelayedRendering = TRUE;
|
||||||
|
co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)uSourceFmt, 0);
|
||||||
|
pWinStaObj->fInDelayedRendering = FALSE;
|
||||||
|
|
||||||
|
/* Data should be in clipboard now */
|
||||||
|
pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pElement || IS_DATA_DELAYED(pElement))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
ProbeForWrite(pgcd, sizeof(*pgcd), 1);
|
ProbeForWrite(pgcd, sizeof(*pgcd), 1);
|
||||||
|
|
Loading…
Reference in a new issue