[Frhed-commits] SF.net SVN: frhed:[841] trunk/FRHED
Brought to you by:
kimmov
From: <ki...@us...> - 2009-12-27 22:30:03
|
Revision: 841 http://frhed.svn.sourceforge.net/frhed/?rev=841&view=rev Author: kimmov Date: 2009-12-27 22:29:57 +0000 (Sun, 27 Dec 2009) Log Message: ----------- Convert attributes (read-only) from int to their real type (bool). Modified Paths: -------------- trunk/FRHED/ViewSettingsDlg.cpp trunk/FRHED/heksedit.h trunk/FRHED/hexwnd.cpp trunk/FRHED/hexwnd.h Modified: trunk/FRHED/ViewSettingsDlg.cpp =================================================================== --- trunk/FRHED/ViewSettingsDlg.cpp 2009-12-27 22:15:26 UTC (rev 840) +++ trunk/FRHED/ViewSettingsDlg.cpp 2009-12-27 22:29:57 UTC (rev 841) @@ -217,7 +217,7 @@ CheckDlgButton(hDlg, IDC_SETTINGS_ADJUST_BYTELINE, checked); CheckDlgButton(hDlg, bUnsignedView ? IDC_SETTINGS_CARETUNSIGN : IDC_SETTINGS_CARETSIGN, BST_CHECKED); - checked = bOpenReadOnly == 0 ? BST_UNCHECKED : BST_CHECKED; + checked = bOpenReadOnly ? BST_UNCHECKED : BST_CHECKED; CheckDlgButton(hDlg, IDC_SETTINGS_OPENRO, checked); checked = bAutoOffsetLen == 0 ? BST_UNCHECKED : BST_CHECKED; CheckDlgButton(hDlg, IDC_SETTINGS_ADJOFFSET, checked); @@ -272,7 +272,12 @@ else if (res == BST_UNCHECKED) bUnsignedView = false; - bOpenReadOnly = IsDlgButtonChecked(hDlg, IDC_SETTINGS_OPENRO); + res = IsDlgButtonChecked(hDlg, IDC_SETTINGS_OPENRO); + if (res == BST_CHECKED) + bOpenReadOnly = true; + else + bOpenReadOnly = false; + int i = SendMessage(hCbLang, CB_GETCURSEL, 0, 0); if (i != -1) { Modified: trunk/FRHED/heksedit.h =================================================================== --- trunk/FRHED/heksedit.h 2009-12-27 22:15:26 UTC (rev 840) +++ trunk/FRHED/heksedit.h 2009-12-27 22:29:57 UTC (rev 841) @@ -60,7 +60,7 @@ int iBytesPerLine; /**< How many bytes in one line in hex view. */ int iAutomaticBPL; /**< Add max amount of bytes that fit to view. */ BYTE_ENDIAN iBinaryMode; /**< Binary mode, little/big endian. */ - int bReadOnly; /**< Is editor in read-only mode? */ + bool bReadOnly; /**< Is editor in read-only mode? */ int bSaveIni; /**< Save INI file when required. */ int iFontSize; int iCharacterSet; /**< Use OEM or ANSI character set? */ Modified: trunk/FRHED/hexwnd.cpp =================================================================== --- trunk/FRHED/hexwnd.cpp 2009-12-27 22:15:26 UTC (rev 840) +++ trunk/FRHED/hexwnd.cpp 2009-12-27 22:29:57 UTC (rev 841) @@ -129,7 +129,7 @@ iSelBkColorValue = RGB(255, 255, 0); iSelTextColorValue = RGB(0, 0, 0); - bOpenReadOnly = bReadOnly = FALSE; + bOpenReadOnly = bReadOnly = false; iPartialOffset = 0; bPartialStats = false; bPartialOpen = false; @@ -4607,7 +4607,7 @@ { m_dataArray.SetUpperBound(BytesPerSector-1); CopyMemory(m_dataArray, Track.GetObjectMemory(), BytesPerSector); - bReadOnly = TRUE; + bReadOnly = true; _stprintf(filename, GetLangString(IDS_DRIVES_SECTOR), (LPCSTR) SelectedPartitionInfo->GetNameAsString(), CurrentSectorNumber); bFileNeverSaved = false; @@ -5530,7 +5530,7 @@ bFilestatusChanged = true; // If read-only mode on opening is enabled: if (bOpenReadOnly) - bReadOnly = TRUE; + bReadOnly = true; save_ini_data(); resize_window(); } @@ -5862,13 +5862,13 @@ { if (bReadOnly) { - bReadOnly = FALSE; + bReadOnly = false; bInsertMode = true; } else if (bInsertMode) bInsertMode = false; else - bReadOnly = TRUE; + bReadOnly = true; } } else //READ <- INS <- OVR <- READ... @@ -5878,11 +5878,11 @@ { if (bReadOnly) { - bReadOnly = FALSE; + bReadOnly = false; bInsertMode= false; } else if (bInsertMode) - bReadOnly = TRUE; + bReadOnly = true; else bInsertMode = true; } Modified: trunk/FRHED/hexwnd.h =================================================================== --- trunk/FRHED/hexwnd.h 2009-12-27 22:15:26 UTC (rev 840) +++ trunk/FRHED/hexwnd.h 2009-12-27 22:29:57 UTC (rev 841) @@ -299,7 +299,7 @@ static int iPasteTimes; static int iPasteSkip; - int bOpenReadOnly; /**< Open files read-only. */ + bool bOpenReadOnly; /**< Open files read-only. */ INT64 iPartialOffset, iPartialFileLen; bool bPartialOpen; /**< Was file opened partially? */ int iPartialOpenLen; /**< Length of the partially opened block from file. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |