From c81b20effba5ae48675dcce10eb8e3f489691474 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 2 Mar 2017 00:01:00 +0100 Subject: Fix for native Windows file open dialog only showing the first character of the file name below the preview. There seems to be some confusion wheter the type specifier "%s" means char or wchar and the behavior even changes between different versions of MinGW (bzr r15559) --- src/ui/dialog/filedialogimpl-win32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index 2f7dc3f8f..7bc9a848c 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -792,7 +792,7 @@ LRESULT CALLBACK FileOpenDialogImplWin32::preview_wnd_proc(HWND hwnd, UINT uMsg, _wsplitpath(pImpl->_path_string, NULL, NULL, szFileName, NULL); const int iLength = snwprintf(szCaption, - sizeof(szCaption), L"%s\n%d kB", + sizeof(szCaption), L"%ls\n%d kB", szFileName, pImpl->_preview_file_size); DrawTextW(dc, szCaption, iLength, &rcCaptionRect, @@ -1494,7 +1494,7 @@ int FileOpenDialogImplWin32::format_caption(wchar_t *caption, int caption_size) _wsplitpath(_path_string, NULL, NULL, szFileName, NULL); return snwprintf(caption, caption_size, - L"%s\n%d kB\n%d \xD7 %d", szFileName, _preview_file_size, + L"%ls\n%d kB\n%d \xD7 %d", szFileName, _preview_file_size, (int)_preview_document_width, (int)_preview_document_height); } -- cgit v1.2.3