From 3a75c33e4ac58d94bd4068469004c9ea60164e38 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 7 Sep 2013 20:49:02 -0400 Subject: [PATCH] Fixed various bugs introduced by previous commit. --- src/MainLoadSave.cpp | 8 ++++---- src/PreviewWindow.cpp | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/MainLoadSave.cpp b/src/MainLoadSave.cpp index bf6eccf..741d387 100644 --- a/src/MainLoadSave.cpp +++ b/src/MainLoadSave.cpp @@ -11,8 +11,8 @@ void MainWindow::OnLoadFile() HANDLE file = INVALID_HANDLE_VALUE, mapping = 0; LPSTR data = NULL; LPWSTR storage = NULL; - int codepage = 0 - DWORD size = 0, length = 0; + int codepage; + DWORD size, length; ofn.hwndOwner = m_hwnd; ofn.lpstrFilter = L"Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0"; @@ -88,8 +88,8 @@ void MainWindow::OnSaveFile() LPSTR storage = NULL; HANDLE file = INVALID_HANDLE_VALUE; HLOCAL buf = NULL; - int codepage = 0; - DWORD length = 0, size = 0, written = 0; + int codepage; + DWORD length, size, written; ofn.hwndOwner = m_hwnd; ofn.lpstrFilter = L"Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0"; diff --git a/src/PreviewWindow.cpp b/src/PreviewWindow.cpp index 34a38f8..d85dad2 100644 --- a/src/PreviewWindow.cpp +++ b/src/PreviewWindow.cpp @@ -3,6 +3,11 @@ #include #include +#ifndef max +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif + LRESULT PreviewWindow::OnCreate() { LOGFONT lf;