[loc] fix various RTL localization issues

With thanks to Itiel

* Fix a potential buffer overflow in lmprintf for RTL languages
* Automatically apply RLE/PDF to all RTL messages, and remove the RLE/PDFs from the .loc
* Fix Windows messing up of multiline RTL tooltips (The trick is, if you want actually
  want RTL, you need to *disable* RTL... Sure, Microsoft, that makes a lot of sense?!?)
* Also properly scale the length of the multiline tooltips according to the zoom factor
* Closes #1132
This commit is contained in:
Pete Batard 2018-05-17 20:45:32 +01:00
parent 34ee2f6382
commit c3aaa0c252
5 changed files with 82 additions and 97 deletions

View file

@ -1073,7 +1073,9 @@ INT_PTR CALLBACK TooltipCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM
case TTN_GETDISPINFOW:
lpnmtdi = (LPNMTTDISPINFOW)lParam;
lpnmtdi->lpszText = ttlist[i].wstring;
SendMessage(hDlg, TTM_SETMAXTIPWIDTH, 0, 300);
// Don't ask me WHY we need to clear RTLREADING for RTL multiline text to look good
lpnmtdi->uFlags &= ~TTF_RTLREADING;
SendMessage(hDlg, TTM_SETMAXTIPWIDTH, 0, (LPARAM)(int)(150.0f * fScale));
return (INT_PTR)TRUE;
}
break;
@ -1758,7 +1760,7 @@ LPCDLGTEMPLATE GetDialogTemplate(int Dialog_ID)
if (right_to_left_mode) {
// Add the RTL styles into our RC copy, so that we don't have to multiply dialog definitions in the RC
dwBuf = (DWORD*)rcTemplate;
dwBuf[2] = WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL;
dwBuf[2] = WS_EX_APPWINDOW | WS_EX_LAYOUTRTL;
}
// All our dialogs are set to use 'Segoe UI Symbol' by default: