mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 19:14:56 -06:00
15.08
This commit is contained in:
committed by
Kornel Lesiński
parent
f6444c3256
commit
6543c28020
@@ -265,7 +265,7 @@ STDMETHODIMP CAgent::DoOperation(
|
||||
UInt32 value;
|
||||
RINOK(outArchive->GetFileTimeType(&value));
|
||||
|
||||
switch(value)
|
||||
switch (value)
|
||||
{
|
||||
case NFileTimeType::kWindows:
|
||||
case NFileTimeType::kDOS:
|
||||
|
||||
@@ -3,10 +3,16 @@
|
||||
#include "StdAfx.h"
|
||||
|
||||
// #include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include <wchar.h>
|
||||
#else
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
#include "../../../../C/Sort.h"
|
||||
#include "../../../../C/CpuArch.h"
|
||||
|
||||
#include "../../../Common/UTFConvert.h"
|
||||
#include "../../../Common/Wildcard.h"
|
||||
|
||||
#include "../../../Windows/PropVariant.h"
|
||||
@@ -555,7 +561,10 @@ HRESULT CProxyArc2::Load(const CArc &arc, IProgress *progress)
|
||||
}
|
||||
|
||||
Files.Alloc(numItems);
|
||||
|
||||
|
||||
UString tempUString;
|
||||
AString tempAString;
|
||||
|
||||
UInt32 i;
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
@@ -567,12 +576,12 @@ HRESULT CProxyArc2::Load(const CArc &arc, IProgress *progress)
|
||||
|
||||
CProxyFile2 &file = Files[i];
|
||||
|
||||
#ifdef MY_CPU_LE
|
||||
const void *p;
|
||||
UInt32 size;
|
||||
UInt32 propType;
|
||||
RINOK(arc.GetRawProps->GetRawProp(i, kpidName, &p, &size, &propType));
|
||||
|
||||
#ifdef MY_CPU_LE
|
||||
if (p && propType == PROP_DATA_TYPE_wchar_t_PTR_Z_LE)
|
||||
{
|
||||
file.Name = (const wchar_t *)p;
|
||||
@@ -582,6 +591,16 @@ HRESULT CProxyArc2::Load(const CArc &arc, IProgress *progress)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (p && propType == NPropDataType::kUtf8z)
|
||||
{
|
||||
tempAString = (const char *)p;
|
||||
ConvertUTF8ToUnicode(tempAString, tempUString);
|
||||
file.NameLen = tempUString.Len();
|
||||
file.Name = new wchar_t[file.NameLen + 1];
|
||||
file.NeedDeleteName = true;
|
||||
wmemcpy((wchar_t *)file.Name, tempUString.Ptr(), file.NameLen + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
NCOM::CPropVariant prop;
|
||||
RINOK(arc.Archive->GetProperty(i, kpidName, &prop));
|
||||
@@ -595,7 +614,7 @@ HRESULT CProxyArc2::Load(const CArc &arc, IProgress *progress)
|
||||
file.NameLen = MyStringLen(s);
|
||||
file.Name = new wchar_t[file.NameLen + 1];
|
||||
file.NeedDeleteName = true;
|
||||
MyStringCopy((wchar_t *)file.Name, s);
|
||||
wmemcpy((wchar_t *)file.Name, s, file.NameLen + 1);
|
||||
}
|
||||
|
||||
UInt32 parent = (UInt32)(Int32)-1;
|
||||
|
||||
@@ -309,7 +309,7 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index,
|
||||
NCOM::CPropVariant prop;
|
||||
RINOK(_archiveHandler->GetProperty(index, kpidMTime, &prop));
|
||||
_processedFileInfo.MTimeDefined = false;
|
||||
switch(prop.vt)
|
||||
switch (prop.vt)
|
||||
{
|
||||
case VT_EMPTY:
|
||||
// _processedFileInfo.MTime = _utcMTimeDefault;
|
||||
@@ -582,7 +582,7 @@ STDMETHODIMP CArchiveUpdateCallback::GetProperty(UInt32 index, PROPID propID, PR
|
||||
|
||||
{
|
||||
const CDirItem &dirItem = (*DirItems)[index];
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidPath: prop = dirItem.Name; break;
|
||||
case kpidIsDir: prop = dirItem.isDir(); break;
|
||||
|
||||
@@ -1329,5 +1329,5 @@ void CArcCmdLineParser::Parse2(CArcCmdLineOptions &options)
|
||||
{
|
||||
}
|
||||
else
|
||||
throw 9815676711;
|
||||
throw 20150919;
|
||||
}
|
||||
|
||||
@@ -608,6 +608,10 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStre
|
||||
_curSizeDefined = false;
|
||||
_index = index;
|
||||
|
||||
_diskFilePath.Empty();
|
||||
|
||||
// _fi.Clear();
|
||||
|
||||
#ifdef SUPPORT_LINKS
|
||||
// _CopyFile_Path.Empty();
|
||||
linkPath.Empty();
|
||||
@@ -1454,7 +1458,7 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 opRes)
|
||||
}
|
||||
|
||||
#ifdef _USE_SECURITY_CODE
|
||||
if (_ntOptions.NtSecurity.Val && _arc->GetRawProps)
|
||||
if (!_stdOutMode && _extractMode && _ntOptions.NtSecurity.Val && _arc->GetRawProps)
|
||||
{
|
||||
const void *data;
|
||||
UInt32 dataSize;
|
||||
@@ -1497,7 +1501,7 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 opRes)
|
||||
else
|
||||
NumFiles++;
|
||||
|
||||
if (_extractMode && _fi.AttribDefined)
|
||||
if (!_stdOutMode && _extractMode && _fi.AttribDefined)
|
||||
SetFileAttrib(_diskFilePath, _fi.Attrib);
|
||||
|
||||
RINOK(_extractCallback2->SetOperationResult(opRes, BoolToInt(_encrypted)));
|
||||
|
||||
@@ -40,12 +40,12 @@ STDMETHODIMP COpenCallbackImp::GetProperty(PROPID propID, PROPVARIANT *value)
|
||||
COM_TRY_BEGIN
|
||||
NCOM::CPropVariant prop;
|
||||
if (_subArchiveMode)
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidName: prop = _subArchiveName; break;
|
||||
}
|
||||
else
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidName: prop = _fileInfo.Name; break;
|
||||
case kpidIsDir: prop = _fileInfo.IsDir(); break;
|
||||
|
||||
@@ -18,7 +18,7 @@ static void ReplaceIncorrectChars(UString &s)
|
||||
#ifdef _WIN32
|
||||
c == ':' || c == '*' || c == '?' || c < 0x20 || c == '<' || c == '>' || c == '|' || c == '"'
|
||||
|| c == '/'
|
||||
|| c == 0x202E // RLO
|
||||
// || c == 0x202E // RLO
|
||||
||
|
||||
#endif
|
||||
c == WCHAR_PATH_SEPARATOR)
|
||||
@@ -190,9 +190,7 @@ void Correct_FsPath(bool absIsAllowed, UStringVector &parts, bool isDir)
|
||||
{
|
||||
UString &s = parts[i];
|
||||
|
||||
#ifdef _WIN32
|
||||
Correct_PathPart(s);
|
||||
#endif
|
||||
|
||||
if (s.IsEmpty())
|
||||
{
|
||||
|
||||
@@ -268,7 +268,7 @@ void CHandler::AddItem(const CParseItem &item)
|
||||
}
|
||||
|
||||
/*
|
||||
static const STATPROPSTG kProps[] =
|
||||
static const CStatProp kProps[] =
|
||||
{
|
||||
{ NULL, kpidPath, VT_BSTR},
|
||||
{ NULL, kpidSize, VT_UI8},
|
||||
|
||||
@@ -571,6 +571,7 @@ static HRESULT Compress(
|
||||
const CArcItem &ai = arcItems[i];
|
||||
bool needRename = false;
|
||||
UString dest;
|
||||
|
||||
if (ai.Censored)
|
||||
{
|
||||
FOR_VECTOR (j, options.RenamePairs)
|
||||
@@ -581,6 +582,8 @@ static HRESULT Compress(
|
||||
needRename = true;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef SUPPORT_ALT_STREAMS
|
||||
if (ai.IsAltStream)
|
||||
{
|
||||
int colonPos = FindAltStreamColon_in_Path(ai.Name);
|
||||
@@ -600,8 +603,10 @@ static HRESULT Compress(
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
CUpdatePair2 up2;
|
||||
up2.SetAs_NoChangeArcItem(ai.IndexInServer);
|
||||
if (needRename)
|
||||
|
||||
@@ -92,7 +92,7 @@ STDMETHODIMP CArchiveUpdateCallback::SetRatioInfo(const UInt64 *inSize, const UI
|
||||
|
||||
|
||||
/*
|
||||
static const STATPROPSTG kProps[] =
|
||||
static const CStatProp kProps[] =
|
||||
{
|
||||
{ NULL, kpidPath, VT_BSTR},
|
||||
{ NULL, kpidIsDir, VT_BOOL},
|
||||
|
||||
@@ -27,7 +27,7 @@ static BOOL WINAPI HandlerRoutine(DWORD ctrlType)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
/*
|
||||
switch(ctrlType)
|
||||
switch (ctrlType)
|
||||
{
|
||||
case CTRL_C_EVENT:
|
||||
case CTRL_BREAK_EVENT:
|
||||
@@ -50,7 +50,7 @@ void CheckCtrlBreak()
|
||||
CCtrlHandlerSetter::CCtrlHandlerSetter()
|
||||
{
|
||||
#if !defined(UNDER_CE) && defined(_WIN32)
|
||||
if(!SetConsoleCtrlHandler(HandlerRoutine, TRUE))
|
||||
if (!SetConsoleCtrlHandler(HandlerRoutine, TRUE))
|
||||
throw "SetConsoleCtrlHandler fails";
|
||||
#endif
|
||||
}
|
||||
@@ -58,7 +58,7 @@ CCtrlHandlerSetter::CCtrlHandlerSetter()
|
||||
CCtrlHandlerSetter::~CCtrlHandlerSetter()
|
||||
{
|
||||
#if !defined(UNDER_CE) && defined(_WIN32)
|
||||
if(!SetConsoleCtrlHandler(HandlerRoutine, FALSE))
|
||||
if (!SetConsoleCtrlHandler(HandlerRoutine, FALSE))
|
||||
throw "SetConsoleCtrlHandler fails";
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream)
|
||||
AString scannedString = g_StdIn.ScanStringUntilNewLine();
|
||||
scannedString.Trim();
|
||||
if (!scannedString.IsEmpty())
|
||||
switch(::MyCharLower_Ascii(scannedString[0]))
|
||||
switch (::MyCharLower_Ascii(scannedString[0]))
|
||||
{
|
||||
case kYes: return NUserAnswerMode::kYes;
|
||||
case kNo: return NUserAnswerMode::kNo;
|
||||
|
||||
@@ -940,7 +940,7 @@ STDMETHODIMP CZipContextMenu::GetCommandString(UINT_PTR commandOffset, UINT uTyp
|
||||
UINT * /* pwReserved */ , LPSTR pszName, UINT /* cchMax */)
|
||||
{
|
||||
int cmdOffset = (int)commandOffset;
|
||||
switch(uType)
|
||||
switch (uType)
|
||||
{
|
||||
#ifdef UNDER_CE
|
||||
case GCS_VALIDATE:
|
||||
|
||||
@@ -100,7 +100,7 @@ STDMETHODIMP CExtractCallbackImp::AskOverwrite(
|
||||
NOverwriteDialog::NResult::EEnum result =
|
||||
NOverwriteDialog::Execute(oldFileInfo, newFileInfo);
|
||||
|
||||
switch(result)
|
||||
switch (result)
|
||||
{
|
||||
case NOverwriteDialog::NResult::kCancel:
|
||||
// *answer = NOverwriteAnswer::kCancel;
|
||||
|
||||
@@ -259,13 +259,13 @@ STDMETHODIMP COpenArchiveCallback::GetProperty(PROPID propID, PROPVARIANT *value
|
||||
NCOM::CPropVariant prop;
|
||||
if (_subArchiveMode)
|
||||
{
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidName: prop = _subArchiveName; break;
|
||||
}
|
||||
}
|
||||
else
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidName: prop = GetUnicodeString(_fileInfo.Name, CP_OEMCP); break;
|
||||
case kpidIsDir: prop = _fileInfo.IsDir(); break;
|
||||
@@ -447,30 +447,34 @@ EXTERN_C HANDLE WINAPI OpenFilePluginW(const wchar_t *name,const unsigned char *
|
||||
EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item)
|
||||
{
|
||||
MY_TRY_BEGIN;
|
||||
if(openFrom == OPEN_COMMANDLINE)
|
||||
|
||||
if (openFrom == OPEN_COMMANDLINE)
|
||||
{
|
||||
AString fileName = (const char *)item;
|
||||
if(fileName.IsEmpty())
|
||||
if (fileName.IsEmpty())
|
||||
return INVALID_HANDLE_VALUE;
|
||||
if (fileName.Len() >= 2 &&
|
||||
fileName[0] == '\"' && fileName.Back() == '\"')
|
||||
if (fileName.Len() >= 2
|
||||
&& fileName[0] == '\"'
|
||||
&& fileName.Back() == '\"')
|
||||
{
|
||||
fileName.DeleteBack();
|
||||
fileName.DeleteFrontal(1);
|
||||
}
|
||||
return MyOpenFilePlugin(fileName);
|
||||
}
|
||||
if(openFrom == OPEN_PLUGINSMENU)
|
||||
|
||||
if (openFrom == OPEN_PLUGINSMENU)
|
||||
{
|
||||
switch(item)
|
||||
switch (item)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
PluginPanelItem pluginPanelItem;
|
||||
if(!g_StartupInfo.ControlGetActivePanelCurrentItemInfo(pluginPanelItem))
|
||||
if (!g_StartupInfo.ControlGetActivePanelCurrentItemInfo(pluginPanelItem))
|
||||
throw 142134;
|
||||
return MyOpenFilePlugin(pluginPanelItem.FindData.cFileName);
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
CObjectVector<PluginPanelItem> pluginPanelItem;
|
||||
@@ -491,10 +495,12 @@ EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item)
|
||||
}
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
default:
|
||||
throw 4282215;
|
||||
}
|
||||
}
|
||||
|
||||
return INVALID_HANDLE_VALUE;
|
||||
MY_TRY_END2("OpenPlugin", INVALID_HANDLE_VALUE);
|
||||
}
|
||||
|
||||
@@ -166,6 +166,14 @@ SOURCE=..\..\..\Common\StringToInt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\UTFConvert.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\UTFConvert.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Wildcard.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -40,11 +40,11 @@ CPlugin::CPlugin(const FString &fileName, CAgent *agent, UString archiveTypeName
|
||||
|
||||
CPlugin::~CPlugin() {}
|
||||
|
||||
static void MyGetFileTime(IFolderFolder *anArchiveFolder, UInt32 itemIndex,
|
||||
static void MyGetFileTime(IFolderFolder *folder, UInt32 itemIndex,
|
||||
PROPID propID, FILETIME &fileTime)
|
||||
{
|
||||
NCOM::CPropVariant prop;
|
||||
if (anArchiveFolder->GetProperty(itemIndex, propID, &prop) != S_OK)
|
||||
if (folder->GetProperty(itemIndex, propID, &prop) != S_OK)
|
||||
throw 271932;
|
||||
if (prop.vt == VT_EMPTY)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ void CPlugin::AddRealIndexOfFile(const CArchiveFolderItem &aFolder,
|
||||
{
|
||||
const CArchiveFolderFileItem &anItem = aFolder.m_FileSubItems[anIndexInVector];
|
||||
int aHandlerItemIndex = m_ProxyHandler->GetHandlerItemIndex(anItem.m_Properties);
|
||||
if(aHandlerItemIndex < 0)
|
||||
if (aHandlerItemIndex < 0)
|
||||
throw "error";
|
||||
aRealIndexes.push_back(aHandlerItemIndex);
|
||||
}
|
||||
@@ -19,11 +19,11 @@ void CPlugin::AddRealIndexes(const CArchiveFolderItem &anItem,
|
||||
vector<int> &aRealIndexes)
|
||||
{
|
||||
int aHandlerItemIndex = m_ProxyHandler->GetHandlerItemIndex(anItem.m_Properties);
|
||||
if(aHandlerItemIndex >= 0) // test -1 value
|
||||
if (aHandlerItemIndex >= 0) // test -1 value
|
||||
aRealIndexes.push_back(aHandlerItemIndex);
|
||||
for(int i = 0; i < anItem.m_DirSubItems.Size(); i++)
|
||||
for (int i = 0; i < anItem.m_DirSubItems.Size(); i++)
|
||||
AddRealIndexes(anItem.m_DirSubItems[i], aRealIndexes);
|
||||
for(i = 0; i < anItem.m_FileSubItems.Size(); i++)
|
||||
for (i = 0; i < anItem.m_FileSubItems.Size(); i++)
|
||||
AddRealIndexOfFile(anItem, i , aRealIndexes);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ void CPlugin::GetRealIndexes(PluginPanelItem *aPanelItems, int anItemsNumber,
|
||||
vector<int> &aRealIndexes)
|
||||
{
|
||||
aRealIndexes.clear();
|
||||
for(int i = 0; i < anItemsNumber; i++)
|
||||
for (int i = 0; i < anItemsNumber; i++)
|
||||
{
|
||||
int anIndex = aPanelItems[i].UserData;
|
||||
if (anIndex < m_FolderItem->m_DirSubItems.Size())
|
||||
|
||||
@@ -20,6 +20,7 @@ CURRENT_OBJS = \
|
||||
$O\PluginWrite.obj \
|
||||
$O\ProgressBox.obj \
|
||||
$O\UpdateCallbackFar.obj \
|
||||
$O\UTFConvert.obj \
|
||||
|
||||
COMMON_OBJS = \
|
||||
$O\IntToString.obj \
|
||||
|
||||
@@ -277,7 +277,7 @@ bool CBrowseDialog::OnInit()
|
||||
if (!GetParentPath(FilePath, DirPrefix, name))
|
||||
DirPrefix = _topDirPrefix;
|
||||
|
||||
for(;;)
|
||||
for (;;)
|
||||
{
|
||||
UString baseFolder = DirPrefix;
|
||||
if (Reload(baseFolder, name) == S_OK)
|
||||
|
||||
@@ -75,7 +75,7 @@ bool CCopyDialog::OnSize(WPARAM /* wParam */, int xSize, int ySize)
|
||||
|
||||
bool CCopyDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch(buttonID)
|
||||
switch (buttonID)
|
||||
{
|
||||
case IDB_COPY_SET_PATH:
|
||||
OnButtonSetPath();
|
||||
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
static void DeepCopyFormatEtc(FORMATETC *dest, const FORMATETC *src)
|
||||
{
|
||||
*dest = *src;
|
||||
if(src->ptd)
|
||||
if (src->ptd)
|
||||
{
|
||||
dest->ptd = (DVTARGETDEVICE*)CoTaskMemAlloc(sizeof(DVTARGETDEVICE));
|
||||
*(dest->ptd) = *(src->ptd);
|
||||
@@ -43,20 +43,20 @@ CEnumFormatEtc::CEnumFormatEtc(const FORMATETC *pFormatEtc, ULONG numFormats)
|
||||
m_Index = 0;
|
||||
m_NumFormats = 0;
|
||||
m_Formats = new FORMATETC[numFormats];
|
||||
if(m_Formats)
|
||||
if (m_Formats)
|
||||
{
|
||||
m_NumFormats = numFormats;
|
||||
for(ULONG i = 0; i < numFormats; i++)
|
||||
for (ULONG i = 0; i < numFormats; i++)
|
||||
DeepCopyFormatEtc(&m_Formats[i], &pFormatEtc[i]);
|
||||
}
|
||||
}
|
||||
|
||||
CEnumFormatEtc::~CEnumFormatEtc()
|
||||
{
|
||||
if(m_Formats)
|
||||
if (m_Formats)
|
||||
{
|
||||
for(ULONG i = 0; i < m_NumFormats; i++)
|
||||
if(m_Formats[i].ptd)
|
||||
for (ULONG i = 0; i < m_NumFormats; i++)
|
||||
if (m_Formats[i].ptd)
|
||||
CoTaskMemFree(m_Formats[i].ptd);
|
||||
delete[]m_Formats;
|
||||
}
|
||||
@@ -65,15 +65,15 @@ CEnumFormatEtc::~CEnumFormatEtc()
|
||||
STDMETHODIMP CEnumFormatEtc::Next(ULONG celt, FORMATETC *pFormatEtc, ULONG *pceltFetched)
|
||||
{
|
||||
ULONG copied = 0;
|
||||
if(celt == 0 || pFormatEtc == 0)
|
||||
if (celt == 0 || pFormatEtc == 0)
|
||||
return E_INVALIDARG;
|
||||
while(m_Index < m_NumFormats && copied < celt)
|
||||
while (m_Index < m_NumFormats && copied < celt)
|
||||
{
|
||||
DeepCopyFormatEtc(&pFormatEtc[copied], &m_Formats[m_Index]);
|
||||
copied++;
|
||||
m_Index++;
|
||||
}
|
||||
if(pceltFetched != 0)
|
||||
if (pceltFetched != 0)
|
||||
*pceltFetched = copied;
|
||||
return (copied == celt) ? S_OK : S_FALSE;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ STDMETHODIMP CEnumFormatEtc::Reset(void)
|
||||
STDMETHODIMP CEnumFormatEtc::Clone(IEnumFORMATETC ** ppEnumFormatEtc)
|
||||
{
|
||||
HRESULT hResult = CreateEnumFormatEtc(m_NumFormats, m_Formats, ppEnumFormatEtc);
|
||||
if(hResult == S_OK)
|
||||
if (hResult == S_OK)
|
||||
((CEnumFormatEtc *)*ppEnumFormatEtc)->m_Index = m_Index;
|
||||
return hResult;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ STDMETHODIMP CEnumFormatEtc::Clone(IEnumFORMATETC ** ppEnumFormatEtc)
|
||||
// replacement for SHCreateStdEnumFmtEtc
|
||||
HRESULT CreateEnumFormatEtc(UINT numFormats, const FORMATETC *formats, IEnumFORMATETC **enumFormat)
|
||||
{
|
||||
if(numFormats == 0 || formats == 0 || enumFormat == 0)
|
||||
if (numFormats == 0 || formats == 0 || enumFormat == 0)
|
||||
return E_INVALIDARG;
|
||||
*enumFormat = new CEnumFormatEtc(formats, numFormats);
|
||||
return (*enumFormat) ? S_OK : E_OUTOFMEMORY;
|
||||
|
||||
@@ -100,7 +100,7 @@ static HRESULT CopyFileSpec(CFSTR fromPath, CFSTR toPath, bool writeToDisk, UInt
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static const PROPID kProps[] =
|
||||
static const Byte kProps[] =
|
||||
{
|
||||
kpidName,
|
||||
// kpidOutName,
|
||||
|
||||
@@ -52,7 +52,7 @@ bool CFoldersPage::OnInit()
|
||||
int CFoldersPage::GetWorkMode() const
|
||||
{
|
||||
for (int i = 0; i < kNumWorkModeButtons; i++)
|
||||
if(IsButtonCheckedBool(kWorkModeButtons[i]))
|
||||
if (IsButtonCheckedBool(kWorkModeButtons[i]))
|
||||
return i;
|
||||
throw 0;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ bool CFoldersPage::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
ModifiedEvent();
|
||||
return true;
|
||||
}
|
||||
switch(buttonID)
|
||||
switch (buttonID)
|
||||
{
|
||||
case IDB_FOLDERS_WORK_PATH:
|
||||
OnFoldersWorkButtonPath();
|
||||
|
||||
@@ -78,7 +78,7 @@ bool CListViewDialog::OnNotify(UINT /* controlID */, LPNMHDR header)
|
||||
{
|
||||
if (header->hwndFrom != _listView)
|
||||
return false;
|
||||
switch(header->code)
|
||||
switch (header->code)
|
||||
{
|
||||
case LVN_ITEMACTIVATE:
|
||||
if (g_LVN_ITEMACTIVATE_Support)
|
||||
@@ -99,7 +99,7 @@ bool CListViewDialog::OnNotify(UINT /* controlID */, LPNMHDR header)
|
||||
case LVN_KEYDOWN:
|
||||
{
|
||||
LPNMLVKEYDOWN keyDownInfo = LPNMLVKEYDOWN(header);
|
||||
switch(keyDownInfo->wVKey)
|
||||
switch (keyDownInfo->wVKey)
|
||||
{
|
||||
case VK_DELETE:
|
||||
{
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
// it's hack for supporting Windows NT
|
||||
// constants are from WinUser.h
|
||||
|
||||
#if(WINVER < 0x0500)
|
||||
#if (WINVER < 0x0500)
|
||||
#define MIIM_STRING 0x00000040
|
||||
#define MIIM_BITMAP 0x00000080
|
||||
#define MIIM_FTYPE 0x00000100
|
||||
@@ -162,6 +162,8 @@ static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
|
||||
if (langID == IDM_OPEN_INSIDE_ONE || langID == IDM_OPEN_INSIDE_PARSER)
|
||||
{
|
||||
LangString_OnlyFromLangFile(IDM_OPEN_INSIDE, newString);
|
||||
if (newString.IsEmpty())
|
||||
continue;
|
||||
newString.Replace(L"&", L"");
|
||||
int tabPos = newString.Find(L"\t");
|
||||
if (tabPos >= 0)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
using namespace NWindows;
|
||||
using namespace NNet;
|
||||
|
||||
static const PROPID kProps[] =
|
||||
static const Byte kProps[] =
|
||||
{
|
||||
kpidName,
|
||||
kpidLocalName,
|
||||
@@ -170,7 +170,7 @@ STDMETHODIMP CNetFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIAN
|
||||
{
|
||||
NCOM::CPropVariant prop;
|
||||
const CResourceEx &item = _items[itemIndex];
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidIsDir: prop = true; break;
|
||||
case kpidName:
|
||||
@@ -243,7 +243,7 @@ IMP_IFolderFolder_Props(CNetFolder)
|
||||
STDMETHODIMP CNetFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value)
|
||||
{
|
||||
NWindows::NCOM::CPropVariant prop;
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidType: prop = "NetFolder"; break;
|
||||
case kpidPath: prop = _path; break;
|
||||
|
||||
@@ -60,14 +60,14 @@ STDMETHODIMP COpenArchiveCallback::GetProperty(PROPID propID, PROPVARIANT *value
|
||||
NCOM::CPropVariant prop;
|
||||
if (_subArchiveMode)
|
||||
{
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidName: prop = _subArchiveName; break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidName: prop = _fileInfo.Name; break;
|
||||
case kpidIsDir: prop = _fileInfo.IsDir(); break;
|
||||
|
||||
@@ -460,7 +460,7 @@ extern UString RootFolder_GetName_Documents(int &iconIndex);
|
||||
bool CPanel::OnComboBoxCommand(UINT code, LPARAM /* param */, LRESULT &result)
|
||||
{
|
||||
result = FALSE;
|
||||
switch(code)
|
||||
switch (code)
|
||||
{
|
||||
case CBN_DROPDOWN:
|
||||
{
|
||||
|
||||
@@ -544,7 +544,7 @@ static HRESULT StartApplication(const UString &dir, const UString &path, HWND wi
|
||||
}
|
||||
if (result <= 32)
|
||||
{
|
||||
switch(result)
|
||||
switch (result)
|
||||
{
|
||||
case SE_ERR_NOASSOC:
|
||||
::MessageBoxW(window,
|
||||
@@ -1241,7 +1241,7 @@ static bool CheckDeleteItem(UINT64 currentFileTime, UINT64 folderFileTime)
|
||||
void DeleteOldTempFiles()
|
||||
{
|
||||
UString tempPath;
|
||||
if(!MyGetTempPath(tempPath))
|
||||
if (!MyGetTempPath(tempPath))
|
||||
throw 1;
|
||||
|
||||
UINT64 currentFileTime;
|
||||
@@ -1250,12 +1250,12 @@ void DeleteOldTempFiles()
|
||||
searchWildCard += WCHAR(NName::kAnyStringWildcard);
|
||||
NFind::CEnumeratorW enumerator(searchWildCard);
|
||||
NFind::CFileInfo fileInfo;
|
||||
while(enumerator.Next(fileInfo))
|
||||
while (enumerator.Next(fileInfo))
|
||||
{
|
||||
if (!fileInfo.IsDir())
|
||||
continue;
|
||||
const UINT64 &cTime = *(const UINT64 *)(&fileInfo.CTime);
|
||||
if(CheckDeleteItem(cTime, currentFileTime))
|
||||
if (CheckDeleteItem(cTime, currentFileTime))
|
||||
RemoveDirectoryWithSubItems(tempPath + fileInfo.Name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,14 +78,14 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
g_App.SwitchOnOffOnePanel();
|
||||
}
|
||||
|
||||
if(keyDownInfo->wVKey >= VK_F3 && keyDownInfo->wVKey <= VK_F12 && ctrl)
|
||||
if (keyDownInfo->wVKey >= VK_F3 && keyDownInfo->wVKey <= VK_F12 && ctrl)
|
||||
{
|
||||
int index = FindVKeyPropIDPair(keyDownInfo->wVKey);
|
||||
if (index >= 0)
|
||||
SortItemsWithPropID(g_VKeyPropIDPairs[index].PropID);
|
||||
}
|
||||
|
||||
switch(keyDownInfo->wVKey)
|
||||
switch (keyDownInfo->wVKey)
|
||||
{
|
||||
case VK_SHIFT:
|
||||
{
|
||||
@@ -191,7 +191,7 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
}
|
||||
case VK_DOWN:
|
||||
{
|
||||
if(shift)
|
||||
if (shift)
|
||||
OnArrowWithShift();
|
||||
return false;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
{
|
||||
if (alt)
|
||||
_panelCallback->OnSetSameFolder();
|
||||
else if(shift)
|
||||
else if (shift)
|
||||
OnArrowWithShift();
|
||||
return false;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
{
|
||||
if (alt)
|
||||
_panelCallback->OnSetSubFolder();
|
||||
else if(shift)
|
||||
else if (shift)
|
||||
OnArrowWithShift();
|
||||
return false;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
{
|
||||
if (alt)
|
||||
_panelCallback->OnSetSubFolder();
|
||||
else if(shift)
|
||||
else if (shift)
|
||||
OnArrowWithShift();
|
||||
return false;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
SelectByType(true);
|
||||
else if (shift)
|
||||
SelectAll(true);
|
||||
else if(!ctrl)
|
||||
else if (!ctrl)
|
||||
SelectSpec(true);
|
||||
return true;
|
||||
}
|
||||
@@ -272,7 +272,7 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
}
|
||||
*/
|
||||
case 'A':
|
||||
if(ctrl)
|
||||
if (ctrl)
|
||||
{
|
||||
SelectAll(true);
|
||||
return true;
|
||||
@@ -307,14 +307,14 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
}
|
||||
return false;
|
||||
case 'R':
|
||||
if(ctrl)
|
||||
if (ctrl)
|
||||
{
|
||||
OnReload();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'Z':
|
||||
if(ctrl)
|
||||
if (ctrl)
|
||||
{
|
||||
ChangeComment();
|
||||
return true;
|
||||
@@ -324,7 +324,7 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
if(ctrl)
|
||||
if (ctrl)
|
||||
{
|
||||
int styleIndex = keyDownInfo->wVKey - '1';
|
||||
SetListViewMode(styleIndex);
|
||||
|
||||
@@ -465,7 +465,7 @@ void CPanel::OnNotifyActivateItems()
|
||||
|
||||
bool CPanel::OnNotifyList(LPNMHDR header, LRESULT &result)
|
||||
{
|
||||
switch(header->code)
|
||||
switch (header->code)
|
||||
{
|
||||
case LVN_ITEMCHANGED:
|
||||
{
|
||||
@@ -507,7 +507,7 @@ bool CPanel::OnNotifyList(LPNMHDR header, LRESULT &result)
|
||||
{
|
||||
LPNMLVKEYDOWN keyDownInfo = LPNMLVKEYDOWN(header);
|
||||
bool boolResult = OnKeyDown(keyDownInfo, result);
|
||||
switch(keyDownInfo->wVKey)
|
||||
switch (keyDownInfo->wVKey)
|
||||
{
|
||||
case VK_CONTROL:
|
||||
case VK_SHIFT:
|
||||
@@ -602,7 +602,7 @@ bool CPanel::OnNotifyList(LPNMHDR header, LRESULT &result)
|
||||
|
||||
bool CPanel::OnCustomDraw(LPNMLVCUSTOMDRAW lplvcd, LRESULT &result)
|
||||
{
|
||||
switch(lplvcd->nmcd.dwDrawStage)
|
||||
switch (lplvcd->nmcd.dwDrawStage)
|
||||
{
|
||||
case CDDS_PREPAINT :
|
||||
result = CDRF_NOTIFYITEMDRAW;
|
||||
|
||||
@@ -480,7 +480,7 @@ void CPanel::CreateSystemMenu(HMENU menuSpec,
|
||||
// HMENU hMenu = CreatePopupMenu();
|
||||
CMenu popupMenu;
|
||||
// CMenuDestroyer menuDestroyer(popupMenu);
|
||||
if(!popupMenu.CreatePopup())
|
||||
if (!popupMenu.CreatePopup())
|
||||
throw 210503;
|
||||
|
||||
HMENU hMenu = popupMenu;
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
HRESULT CThreadFolderOperations::ProcessVirt()
|
||||
{
|
||||
NCOM::CComInitializer comInitializer;
|
||||
switch(OpType)
|
||||
switch (OpType)
|
||||
{
|
||||
case FOLDER_TYPE_CREATE_FOLDER:
|
||||
Result = FolderOperations->CreateFolder(Name, UpdateCallback);
|
||||
|
||||
@@ -132,7 +132,7 @@ bool CProgressDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */)
|
||||
|
||||
bool CProgressDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(message)
|
||||
switch (message)
|
||||
{
|
||||
case kCloseMessage:
|
||||
{
|
||||
@@ -158,7 +158,7 @@ bool CProgressDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch(buttonID)
|
||||
switch (buttonID)
|
||||
{
|
||||
case IDCANCEL:
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ static const unsigned kNumRootFolderItems =
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
static const PROPID kProps[] =
|
||||
static const Byte kProps[] =
|
||||
{
|
||||
kpidName
|
||||
};
|
||||
@@ -108,7 +108,7 @@ STDMETHODIMP CRootFolder::GetNumberOfItems(UInt32 *numItems)
|
||||
STDMETHODIMP CRootFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT *value)
|
||||
{
|
||||
NCOM::CPropVariant prop;
|
||||
switch(propID)
|
||||
switch (propID)
|
||||
{
|
||||
case kpidIsDir: prop = true; break;
|
||||
case kpidName: prop = _names[itemIndex]; break;
|
||||
|
||||
@@ -93,7 +93,7 @@ void CSettingsPage::OnNotifyHelp()
|
||||
|
||||
bool CSettingsPage::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch(buttonID)
|
||||
switch (buttonID)
|
||||
{
|
||||
case IDX_SETTINGS_SINGLE_CLICK:
|
||||
/*
|
||||
|
||||
@@ -77,7 +77,7 @@ bool CSplitDialog::OnSize(WPARAM /* wParam */, int xSize, int ySize)
|
||||
|
||||
bool CSplitDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch(buttonID)
|
||||
switch (buttonID)
|
||||
{
|
||||
case IDB_SPLIT_PATH:
|
||||
OnButtonSetPath();
|
||||
|
||||
@@ -505,7 +505,7 @@ bool CBenchmarkDialog::OnCommand(int code, int itemID, LPARAM lParam)
|
||||
|
||||
bool CBenchmarkDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch(buttonID)
|
||||
switch (buttonID)
|
||||
{
|
||||
case IDB_RESTART:
|
||||
OnRestartButton();
|
||||
|
||||
@@ -253,7 +253,7 @@ void CExtractDialog::UpdatePasswordControl()
|
||||
|
||||
bool CExtractDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
|
||||
{
|
||||
switch(buttonID)
|
||||
switch (buttonID)
|
||||
{
|
||||
case IDB_EXTRACT_SET_PATH:
|
||||
OnButtonSetPath();
|
||||
|
||||
@@ -229,7 +229,7 @@ HRESULT ExtractGUI(
|
||||
NName::NormalizeDirPathPrefix(options.OutputDir);
|
||||
|
||||
/*
|
||||
if(!CreateComplexDirectory(options.OutputDir))
|
||||
if (!CreateComplexDirectory(options.OutputDir))
|
||||
{
|
||||
UString s = GetUnicodeString(NError::MyFormatMessage(GetLastError()));
|
||||
UString s2 = MyFormatNew(IDS_CANNOT_CREATE_FOLDER,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../FileManager/ProgressDialog2.h"
|
||||
#include "../FileManager/ProgressDialog2Res.h"
|
||||
#include "../FileManager/PropertyNameRes.h"
|
||||
#include "../FileManager/resourceGUI.h"
|
||||
#include "../FileManager/resourceGui.h"
|
||||
|
||||
#include "HashGUI.h"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "../FileManager/FormatUtils.h"
|
||||
#include "../FileManager/LangUtils.h"
|
||||
|
||||
#include "../FileManager/resourceGUI.h"
|
||||
#include "../FileManager/resourceGui.h"
|
||||
|
||||
#include "resource2.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user