From: Alexander Shaposhnikov Date: Mon, 10 Jul 2017 22:45:53 +0000 (+0000) Subject: [RAPPS] Fixes X-Git-Tag: backups/GSoC_2017/rapps@75905~62 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=09da413dc83cce7c91c6da849a5e01e68ef41a97 [RAPPS] Fixes - Minor style improvements - Not resizing with GetBuffer() calls where not nessesary - loaddlg.cpp: Wrong logic fixed - rosui.h: Fixed length determination svn path=/branches/GSoC_2017/rapps/; revision=75317 --- diff --git a/reactos/base/applications/rapps/gui.cpp b/reactos/base/applications/rapps/gui.cpp index 71de7c3d6f4..3b870c4614f 100644 --- a/reactos/base/applications/rapps/gui.cpp +++ b/reactos/base/applications/rapps/gui.cpp @@ -1148,12 +1148,12 @@ private: /* Get version info */ GetApplicationString(ItemInfo->hSubKey, L"DisplayVersion", szText); - ListView_SetItemText(hListView, Index, 1, szText.GetBuffer(MAX_PATH)); + ListView_SetItemText(hListView, Index, 1, szText.GetBuffer()); szText.ReleaseBuffer(); /* Get comments */ GetApplicationString(ItemInfo->hSubKey, L"Comments", szText); - ListView_SetItemText(hListView, Index, 2, szText.GetBuffer(MAX_PATH)); + ListView_SetItemText(hListView, Index, 2, szText.GetBuffer()); szText.ReleaseBuffer(); return TRUE; } @@ -1163,8 +1163,7 @@ private: INT Index; HICON hIcon = NULL; ATL::CStringW szIconPath; - HIMAGELIST hImageListView = NULL; - hImageListView = ListView_GetImageList(hListView, LVSIL_SMALL); + HIMAGELIST hImageListView = ListView_GetImageList(hListView, LVSIL_SMALL); if (!SearchPatternMatch(Info->szName, szSearchPattern) && !SearchPatternMatch(Info->szDesc, szSearchPattern)) @@ -1195,10 +1194,10 @@ private: Index = ListViewAddItem(Info->Category, Index, Info->szName, (LPARAM) Info); hImageListView = ListView_SetImageList(hListView, hImageListView, LVSIL_SMALL); - ListView_SetItemText(hListView, Index, 1, Info->szVersion.GetBuffer(MAX_PATH)); + ListView_SetItemText(hListView, Index, 1, Info->szVersion.GetBuffer()); Info->szVersion.ReleaseBuffer(); - ListView_SetItemText(hListView, Index, 2, Info->szDesc.GetBuffer(MAX_PATH)); + ListView_SetItemText(hListView, Index, 2, Info->szDesc.GetBuffer()); Info->szDesc.ReleaseBuffer(); return TRUE; } diff --git a/reactos/base/applications/rapps/loaddlg.cpp b/reactos/base/applications/rapps/loaddlg.cpp index c0415c1bc07..8d1fdf96f03 100644 --- a/reactos/base/applications/rapps/loaddlg.cpp +++ b/reactos/base/applications/rapps/loaddlg.cpp @@ -366,11 +366,8 @@ ThreadFunc(LPVOID Context) memset(&urlComponents, 0, sizeof(urlComponents)); urlComponents.dwStructSize = sizeof(urlComponents); - - if (AppInfo->szUrlDownload.GetLength() > urlLength) - goto end; - urlLength /= sizeof(WCHAR); + urlLength = AppInfo->szUrlDownload.GetLength(); urlComponents.dwSchemeLength = urlLength + 1; urlComponents.lpszScheme = (LPWSTR) malloc(urlComponents.dwSchemeLength * sizeof(WCHAR)); urlComponents.dwHostNameLength = urlLength + 1; diff --git a/reactos/base/applications/rapps/rosui.h b/reactos/base/applications/rapps/rosui.h index b372dfca705..2627364c0c6 100644 --- a/reactos/base/applications/rapps/rosui.h +++ b/reactos/base/applications/rapps/rosui.h @@ -495,8 +495,8 @@ public: void GetWindowTextW(ATL::CStringW& szText) { - INT length = CWindow::GetWindowTextLengthW(); - CWindow::GetWindowText(szText.GetBuffer(length), length); + INT length = CWindow::GetWindowTextLengthW() + 1; + CWindow::GetWindowTextW(szText.GetBuffer(length), length); szText.ReleaseBuffer(); } };