Patch 8.0.1835
Problem: Print document name does not support multi-byte.
Solution: Use StartDocW() if needed. (Yasuhiro Matsumoto, closes #2478)
Files: src/os_mswin.c
*** ../vim-8.0.1834/src/os_mswin.c 2018-03-04 18:07:04.272592321 +0100
--- src/os_mswin.c 2018-05-13 17:28:51.398296031 +0200
***************
*** 1678,1685 ****
mch_print_begin(prt_settings_T *psettings)
{
int ret;
- static DOCINFO di;
char szBuffer[300];
hDlgPrint = CreateDialog(GetModuleHandle(NULL), TEXT("PrintDlgBox"),
prt_dlg.hwndOwner, PrintDlgProc);
--- 1678,1687 ----
mch_print_begin(prt_settings_T *psettings)
{
int ret;
char szBuffer[300];
+ #if defined(FEAT_MBYTE)
+ WCHAR *wp = NULL;
+ #endif
hDlgPrint = CreateDialog(GetModuleHandle(NULL), TEXT("PrintDlgBox"),
prt_dlg.hwndOwner, PrintDlgProc);
***************
*** 1687,1696 ****
wsprintf(szBuffer, _("Printing '%s'"), gettail(psettings->jobname));
vimSetDlgItemText(hDlgPrint, IDC_PRINTTEXT1, (char_u *)szBuffer);
! vim_memset(&di, 0, sizeof(DOCINFO));
! di.cbSize = sizeof(DOCINFO);
! di.lpszDocName = (LPCSTR)psettings->jobname;
! ret = StartDoc(prt_dlg.hDC, &di);
#ifdef FEAT_GUI
/* Give focus back to main window (when using MDI). */
--- 1689,1717 ----
wsprintf(szBuffer, _("Printing '%s'"), gettail(psettings->jobname));
vimSetDlgItemText(hDlgPrint, IDC_PRINTTEXT1, (char_u *)szBuffer);
! #if defined(FEAT_MBYTE)
! if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
! wp = enc_to_utf16(psettings->jobname, NULL);
! if (wp != NULL)
! {
! DOCINFOW di;
!
! vim_memset(&di, 0, sizeof(di));
! di.cbSize = sizeof(di);
! di.lpszDocName = wp;
! ret = StartDocW(prt_dlg.hDC, &di);
! vim_free(wp);
! }
! else
! #endif
! {
! DOCINFO di;
!
! vim_memset(&di, 0, sizeof(di));
! di.cbSize = sizeof(di);
! di.lpszDocName = (LPCSTR)psettings->jobname;
! ret = StartDoc(prt_dlg.hDC, &di);
! }
#ifdef FEAT_GUI
/* Give focus back to main window (when using MDI). */
*** ../vim-8.0.1834/src/version.c 2018-05-13 17:05:26.770158615 +0200
--- src/version.c 2018-05-13 17:29:16.226150969 +0200
***************
*** 763,764 ****
--- 763,766 ----
{ /* Add new patch number below this line */
+ /**/
+ 1835,
/**/
--
BRIDGEKEEPER: What is your favorite colour?
GAWAIN: Blue ... No yelloooooww!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.