From 87d6cd1d04067b49e50e913991c0c64513270fd3 Mon Sep 17 00:00:00 2001 From: Don HO Date: Thu, 9 Jan 2020 10:36:44 +0100 Subject: [PATCH] Adapt VS2019 --- PowerEditor/src/WinControls/Grid/BabyGrid.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp index 830dbf6e..489808f0 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp @@ -1305,16 +1305,18 @@ int FindLongestLine(HDC hdc,TCHAR* text,SIZE* size) TCHAR *p; wcscpy_s(temptext,text); - p = generic_strtok(temptext, TEXT("\n")); + p = wcstok(temptext, TEXT("\n")); while(p) - { + { GetTextExtentPoint32(hdc,p,lstrlen(p),size); if(size->cx > longest) - { + { longest=size->cx; - } - p = generic_strtok(TEXT('\0'), TEXT("\n")); - } + } + TCHAR temptext2[2]; + temptext2[0] = TEXT('\0'); + p = wcstok(temptext2, TEXT("\n")); + } return longest; }