diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2015-10-05 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:56 +0300 |
commit | 6543c280208393fa32cb0094f770d14c1cfb13b2 (patch) | |
tree | beb90f5e81e85e7957463ee5ad89cab0b3566560 /CPP/7zip/UI/Far | |
parent | f6444c32568553e0261ca0105083658f12be6284 (diff) |
15.0815.08
Diffstat (limited to 'CPP/7zip/UI/Far')
-rw-r--r-- | CPP/7zip/UI/Far/ExtractEngine.cpp | 2 | ||||
-rw-r--r-- | CPP/7zip/UI/Far/Far.cpp | 24 | ||||
-rw-r--r-- | CPP/7zip/UI/Far/Far.dsp | 8 | ||||
-rw-r--r-- | CPP/7zip/UI/Far/Plugin.cpp | 4 | ||||
-rw-r--r-- | CPP/7zip/UI/Far/PluginCommon.cpp | 10 | ||||
-rw-r--r-- | CPP/7zip/UI/Far/makefile | 1 |
6 files changed, 32 insertions, 17 deletions
diff --git a/CPP/7zip/UI/Far/ExtractEngine.cpp b/CPP/7zip/UI/Far/ExtractEngine.cpp index e1db1c9f..c21655fd 100644 --- a/CPP/7zip/UI/Far/ExtractEngine.cpp +++ b/CPP/7zip/UI/Far/ExtractEngine.cpp @@ -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; diff --git a/CPP/7zip/UI/Far/Far.cpp b/CPP/7zip/UI/Far/Far.cpp index 0cd53cc5..6505c6c4 100644 --- a/CPP/7zip/UI/Far/Far.cpp +++ b/CPP/7zip/UI/Far/Far.cpp @@ -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); } diff --git a/CPP/7zip/UI/Far/Far.dsp b/CPP/7zip/UI/Far/Far.dsp index 26365152..2433b252 100644 --- a/CPP/7zip/UI/Far/Far.dsp +++ b/CPP/7zip/UI/Far/Far.dsp @@ -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 diff --git a/CPP/7zip/UI/Far/Plugin.cpp b/CPP/7zip/UI/Far/Plugin.cpp index 8df7b512..485358d3 100644 --- a/CPP/7zip/UI/Far/Plugin.cpp +++ b/CPP/7zip/UI/Far/Plugin.cpp @@ -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) { diff --git a/CPP/7zip/UI/Far/PluginCommon.cpp b/CPP/7zip/UI/Far/PluginCommon.cpp index ce1a18bb..e1d44582 100644 --- a/CPP/7zip/UI/Far/PluginCommon.cpp +++ b/CPP/7zip/UI/Far/PluginCommon.cpp @@ -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()) diff --git a/CPP/7zip/UI/Far/makefile b/CPP/7zip/UI/Far/makefile index 0fff95a2..621c8d9e 100644 --- a/CPP/7zip/UI/Far/makefile +++ b/CPP/7zip/UI/Far/makefile @@ -20,6 +20,7 @@ CURRENT_OBJS = \ $O\PluginWrite.obj \ $O\ProgressBox.obj \ $O\UpdateCallbackFar.obj \ + $O\UTFConvert.obj \ COMMON_OBJS = \ $O\IntToString.obj \ |