mirror of
https://github.com/fadden/ciderpress.git
synced 2025-01-02 00:29:40 +00:00
Simplify
This commit is contained in:
parent
8c34eb1213
commit
0861b7ead4
@ -183,9 +183,8 @@ void DiskArchiveInfoDialog::AddSubVolumes(const DiskFS* pDiskFS,
|
||||
/*
|
||||
* Add the current DiskFS.
|
||||
*/
|
||||
CStringA volumeIdA(pDiskFS->GetVolumeID());
|
||||
CString tmpStr(prefix);
|
||||
tmpStr += Charset::ConvertMORToUNI(volumeIdA);
|
||||
tmpStr += Charset::ConvertMORToUNI(pDiskFS->GetVolumeID());
|
||||
pCombo->AddString(tmpStr);
|
||||
pCombo->SetItemData(*pIdx, (unsigned long) pDiskFS);
|
||||
(*pIdx)++;
|
||||
|
@ -892,8 +892,7 @@ CString DiskArchive::GetDescription() const
|
||||
CString str = L"Disk Image";
|
||||
|
||||
if (fpPrimaryDiskFS != NULL && fpPrimaryDiskFS->GetVolumeID() != NULL) {
|
||||
CStringA volumeIdA(fpPrimaryDiskFS->GetVolumeID());
|
||||
CString volumeId(Charset::ConvertMORToUNI(volumeIdA));
|
||||
CString volumeId(Charset::ConvertMORToUNI(fpPrimaryDiskFS->GetVolumeID()));
|
||||
str.Format(L"Disk Image - %ls", (LPCWSTR) volumeId);
|
||||
}
|
||||
return str;
|
||||
@ -1090,12 +1089,11 @@ int DiskArchive::LoadDiskFSContents(DiskFS* pDiskFS, const WCHAR* volName)
|
||||
*/
|
||||
pSubVol = pDiskFS->GetNextSubVolume(NULL);
|
||||
while (pSubVol != NULL) {
|
||||
CStringA subVolNameMOR;
|
||||
CString concatSubVolName;
|
||||
int ret;
|
||||
|
||||
subVolNameMOR = pSubVol->GetDiskFS()->GetVolumeName();
|
||||
if (subVolNameMOR.IsEmpty()) {
|
||||
const char* subVolNameMOR = pSubVol->GetDiskFS()->GetVolumeName();
|
||||
if (subVolNameMOR == NULL) {
|
||||
subVolNameMOR = "+++"; // call it *something*
|
||||
}
|
||||
CString subVolName(Charset::ConvertMORToUNI(subVolNameMOR));
|
||||
|
@ -132,8 +132,7 @@ BOOL DiskEditDialog::OnInitDialog(void)
|
||||
title += fFileName;
|
||||
if (fpDiskFS->GetVolumeID() != NULL) {
|
||||
title += " (";
|
||||
CStringA volumeIdA(fpDiskFS->GetVolumeID());
|
||||
title += Charset::ConvertMORToUNI(volumeIdA);
|
||||
title += Charset::ConvertMORToUNI(fpDiskFS->GetVolumeID());
|
||||
title += ")";
|
||||
}
|
||||
SetWindowText(title);
|
||||
@ -280,8 +279,7 @@ void DiskEditDialog::OnSubVolume(void)
|
||||
pEditDialog = &blockEdit;
|
||||
else
|
||||
pEditDialog = §orEdit;
|
||||
CStringA volumeIdA(fpDiskFS->GetVolumeID());
|
||||
CString volumeId(Charset::ConvertMORToUNI(volumeIdA));
|
||||
CString volumeId(Charset::ConvertMORToUNI(fpDiskFS->GetVolumeID()));
|
||||
pEditDialog->Setup(pSubVol->GetDiskFS(), volumeId);
|
||||
pEditDialog->SetPositionShift(8);
|
||||
(void) pEditDialog->DoModal();
|
||||
|
@ -43,8 +43,7 @@ bool DiskFSTree::AddDiskFS(CTreeCtrl* pTree, HTREEITEM parent,
|
||||
pTarget->pDiskFS = pDiskFS;
|
||||
pTarget->pFile = NULL; // could also use volume dir for ProDOS
|
||||
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
|
||||
CStringA volumeIdA(pDiskFS->GetVolumeID());
|
||||
CString volumeId(Charset::ConvertMORToUNI(volumeIdA));
|
||||
CString volumeId(Charset::ConvertMORToUNI(pDiskFS->GetVolumeID()));
|
||||
int index = fStringHolder.Add(volumeId);
|
||||
tvi.pszText = (LPWSTR)(LPCWSTR) fStringHolder.GetAt(index);
|
||||
tvi.cchTextMax = 0; // not needed for insertitem
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define kAppMajorVersion 4
|
||||
#define kAppMinorVersion 0
|
||||
#define kAppBugVersion 0
|
||||
#define kAppDevString L"b3"
|
||||
#define kAppDevString L"-b3"
|
||||
|
||||
/*
|
||||
* Windows application object.
|
||||
|
@ -34,8 +34,7 @@ BOOL SubVolumeDialog::OnInitDialog(void)
|
||||
DiskFS::SubVolume* pSubVol = fpDiskFS->GetNextSubVolume(NULL);
|
||||
ASSERT(pSubVol != NULL); // shouldn't be here otherwise
|
||||
while (pSubVol != NULL) {
|
||||
CStringA volumeIdA(pSubVol->GetDiskFS()->GetVolumeID());
|
||||
CString volumeId(Charset::ConvertMORToUNI(volumeIdA));
|
||||
CString volumeId(Charset::ConvertMORToUNI(pSubVol->GetDiskFS()->GetVolumeID()));
|
||||
pListBox->AddString(volumeId); // makes a copy of the string
|
||||
|
||||
pSubVol = fpDiskFS->GetNextSubVolume(pSubVol);
|
||||
|
@ -334,8 +334,7 @@ void VolumeCopyDialog::AddToList(CListCtrl* pListView, DiskImg* pDiskImg,
|
||||
|
||||
long numBlocks = pDiskImg->GetNumBlocks();
|
||||
|
||||
CStringA volNameA = pDiskFS->GetVolumeName();
|
||||
CString volName(Charset::ConvertMORToUNI(volNameA));
|
||||
CString volName(Charset::ConvertMORToUNI(pDiskFS->GetVolumeName()));
|
||||
CString format = DiskImg::ToString(pDiskImg->GetFSFormat());
|
||||
blocksStr.Format(L"%ld", pDiskImg->GetNumBlocks());
|
||||
if (numBlocks > 1024*1024*2)
|
||||
@ -400,8 +399,7 @@ void VolumeCopyDialog::OnCopyToFile(void)
|
||||
assert(pSrcImg != NULL);
|
||||
assert(pSrcFS != NULL);
|
||||
|
||||
CStringA srcNameA = pSrcFS->GetVolumeName();
|
||||
CString srcName(Charset::ConvertMORToUNI(srcNameA));
|
||||
CString srcName(Charset::ConvertMORToUNI(pSrcFS->GetVolumeName()));
|
||||
|
||||
/* force the format to be generic ProDOS-ordered blocks */
|
||||
originalFormat = pSrcImg->GetFSFormat();
|
||||
@ -586,8 +584,7 @@ void VolumeCopyDialog::OnCopyFromFile(void)
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
CStringA targetNameA = pDstFS->GetVolumeName();
|
||||
CString targetName(Charset::ConvertMORToUNI(targetNameA));
|
||||
CString targetName(Charset::ConvertMORToUNI(pDstFS->GetVolumeName()));
|
||||
|
||||
|
||||
/*
|
||||
|
@ -28,14 +28,14 @@ public:
|
||||
}
|
||||
|
||||
// Simple Mac OS Roman to Unicode string conversion.
|
||||
static CString ConvertMORToUNI(const CStringA& strMOR)
|
||||
static CString ConvertMORToUNI(const char* strMOR)
|
||||
{
|
||||
// We know that all MOR characters are represented in Unicode with a
|
||||
// single BMP code point, so we know that strlen(MOR) == wcslen(UNI).
|
||||
const int len = strMOR.GetLength();
|
||||
const size_t len = strlen(strMOR);
|
||||
CString strUNI;
|
||||
WCHAR* uniBuf = strUNI.GetBuffer(len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
uniBuf[i] = Charset::ConvertMacRomanToUTF16(strMOR[i]);
|
||||
}
|
||||
strUNI.ReleaseBuffer(len);
|
||||
|
Loading…
Reference in New Issue
Block a user