mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-07 10:43:13 +02:00
Fixed a win32 bug where the editor would cut off text
This commit is contained in:
@@ -891,3 +891,4 @@ seen. gmtime warning still there
|
||||
- Made some nameser.h changes to work win win32
|
||||
- Fixed a typo in makenet found by 'Eternal Bliss'
|
||||
- Updated module dependancies to allow a module to load the module containing the symbol
|
||||
- Fixed a win32 bug where the editor would cut off text, reported by Inter
|
||||
|
||||
+21
-5
@@ -211,8 +211,23 @@ void WipeColors() {
|
||||
}
|
||||
|
||||
}
|
||||
DWORD CALLBACK RTFToIRC(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) {
|
||||
int fd = (int)dwCookie;
|
||||
DWORD CALLBACK BufferIt(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) {
|
||||
char *buf2;
|
||||
static long size = 0;
|
||||
buf2 = MyMalloc(size+cb+1);
|
||||
if (RTFBuf)
|
||||
memcpy(buf2,RTFBuf,size);
|
||||
else
|
||||
size = 0;
|
||||
memcpy(buf2+size,pbBuff,cb);
|
||||
size += cb;
|
||||
MyFree(RTFBuf);
|
||||
RTFBuf = buf2;
|
||||
pcb = &cb;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD CALLBACK RTFToIRC(int fd, char *pbBuff, long cb) {
|
||||
char *buffer = (char *)malloc(cb);
|
||||
int i = 0, j = 0, k = 0, start = 0, end = 0;
|
||||
int incolor = 0, bold = 0, uline = 0;
|
||||
@@ -993,11 +1008,12 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
|
||||
int fd;
|
||||
EDITSTREAM edit;
|
||||
fd = open(file, _O_TRUNC|_O_CREAT|_O_WRONLY|_O_BINARY,_S_IWRITE);
|
||||
edit.dwCookie = (DWORD)fd;
|
||||
edit.pfnCallback = RTFToIRC;
|
||||
edit.dwCookie = 0;
|
||||
edit.pfnCallback = BufferIt;
|
||||
SendMessage(GetDlgItem(hDlg, IDC_TEXT), EM_SETSEL, -1, -1);
|
||||
SendMessage(GetDlgItem(hDlg, IDC_TEXT), EM_STREAMOUT, (WPARAM)SF_RTF|SFF_PLAINRTF, (LPARAM)&edit);
|
||||
close(fd);
|
||||
RTFToIRC(fd, RTFBuf, strlen(RTFBuf));
|
||||
free(RTFBuf);
|
||||
EndDialog(hDlg, TRUE);
|
||||
}
|
||||
hWnd = GetDlgItem(hDlg, IDC_TEXT);
|
||||
|
||||
Reference in New Issue
Block a user