|
|
@@ -33,15 +33,53 @@ bool PasteAnyAsText::SelectClipToPasteAsText(const CDittoInfo &DittoInfo, IClip
|
|
|
pText->AutoDeleteData(false);
|
|
|
HGLOBAL data = pText->Data();
|
|
|
|
|
|
- //Remove all over formats and add the selected date back as CF_TEXT
|
|
|
- pFormats->DeleteAll();
|
|
|
+ if(dlg.PasteAsUnicode() == false)
|
|
|
+ {
|
|
|
+ char * stringData = (char *)GlobalLock(data);
|
|
|
+ int size = (int)GlobalSize(data);
|
|
|
+ for(int i = 0; i < size; i++)
|
|
|
+ {
|
|
|
+ if(stringData[i] == 0)
|
|
|
+ {
|
|
|
+ stringData[i] = ' ';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ GlobalUnlock(data);
|
|
|
+
|
|
|
+ //Remove all over formats and add the selected date back as CF_TEXT
|
|
|
+ pFormats->DeleteAll();
|
|
|
|
|
|
- pFormats->AddNew(CF_TEXT, data);
|
|
|
+ pFormats->AddNew(CF_TEXT, data);
|
|
|
|
|
|
- IClipFormat *pText = pFormats->FindFormatEx(CF_TEXT);
|
|
|
- if(pText != NULL)
|
|
|
+ IClipFormat *pText = pFormats->FindFormatEx(CF_TEXT);
|
|
|
+ if(pText != NULL)
|
|
|
+ {
|
|
|
+ pText->AutoDeleteData(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- pText->AutoDeleteData(true);
|
|
|
+ wchar_t * stringData = (wchar_t *)GlobalLock(data);
|
|
|
+ int size = (int)GlobalSize(data);
|
|
|
+ for(int i = 0; i < (int)(size/(sizeof(wchar_t))); i++)
|
|
|
+ {
|
|
|
+ if(stringData[i] == 0)
|
|
|
+ {
|
|
|
+ stringData[i] = ' ';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ GlobalUnlock(data);
|
|
|
+
|
|
|
+ //Remove all over formats and add the selected date back as CF_TEXT
|
|
|
+ pFormats->DeleteAll();
|
|
|
+
|
|
|
+ pFormats->AddNew(CF_UNICODETEXT, data);
|
|
|
+
|
|
|
+ IClipFormat *pText = pFormats->FindFormatEx(CF_UNICODETEXT);
|
|
|
+ if(pText != NULL)
|
|
|
+ {
|
|
|
+ pText->AutoDeleteData(true);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
ret = true;
|