Index: src/chext/MenuExt.cpp =================================================================== diff -u -rc17c4aa7bb4c96219af4191623abe40d18e02713 -rb54c79b15d7c1a101c43994e9a403b07d695c8dc --- src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision c17c4aa7bb4c96219af4191623abe40d18e02713) +++ src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision b54c79b15d7c1a101c43994e9a403b07d695c8dc) @@ -238,7 +238,7 @@ return E_FAIL; // find command to be executed, if not found - fail - TShellMenuItemPtr spSelectedItem = m_tContextMenuHandler.GetCommandByMenuItemOffset(LOWORD(lpmis->itemID)); + TShellMenuItemPtr spSelectedItem = m_tContextMenuHandler.GetCommandByItemID(LOWORD(lpmis->itemID)); if(!spSelectedItem || !spSelectedItem->SpecifiesDestinationPath()) return E_FAIL; @@ -295,7 +295,7 @@ return S_OK; // find command to be executed, if not found - fail - TShellMenuItemPtr spSelectedItem = m_tContextMenuHandler.GetCommandByMenuItemOffset(LOWORD(lpdis->itemID)); + TShellMenuItemPtr spSelectedItem = m_tContextMenuHandler.GetCommandByItemID(LOWORD(lpdis->itemID)); if(!spSelectedItem || !spSelectedItem->SpecifiesDestinationPath()) return E_FAIL; Index: src/chext/TContextMenuHandler.cpp =================================================================== diff -u -r44a2ec5f1eb0a435b56daef42ef5fe3b7a91da0d -rb54c79b15d7c1a101c43994e9a403b07d695c8dc --- src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision 44a2ec5f1eb0a435b56daef42ef5fe3b7a91da0d) +++ src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision b54c79b15d7c1a101c43994e9a403b07d695c8dc) @@ -115,7 +115,12 @@ TShellMenuItemPtr TContextMenuHandler::GetCommandByMenuItemOffset(UINT uiOffset) { - std::map::iterator iter = m_mapMenuItems.find(m_uiFirstMenuID + uiOffset); + return GetCommandByItemID(m_uiFirstMenuID + uiOffset); +} + +TShellMenuItemPtr TContextMenuHandler::GetCommandByItemID(UINT uiID) +{ + std::map::iterator iter = m_mapMenuItems.find(uiID); if(iter != m_mapMenuItems.end()) return (*iter).second; else Index: src/chext/TContextMenuHandler.h =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rb54c79b15d7c1a101c43994e9a403b07d695c8dc --- src/chext/TContextMenuHandler.h (.../TContextMenuHandler.h) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/chext/TContextMenuHandler.h (.../TContextMenuHandler.h) (revision b54c79b15d7c1a101c43994e9a403b07d695c8dc) @@ -40,6 +40,7 @@ UINT GetLastCommandID() const { return m_uiNextMenuID; } TShellMenuItemPtr GetCommandByMenuItemOffset(UINT uiOffset); + TShellMenuItemPtr GetCommandByItemID(UINT uiOffset); protected: void UpdateMenuRecursive(const TShellMenuItemPtr& spRootMenuItem, HMENU hMenu, UINT uiFirstItemPosition, const TShellExtData& rShellExtData, bool bOverrideDefaultItem); Index: src/common/TShellExtMenuConfig.cpp =================================================================== diff -u -r960167a493c3ae7ecbdc7e8c2b91619106d7a685 -rb54c79b15d7c1a101c43994e9a403b07d695c8dc --- src/common/TShellExtMenuConfig.cpp (.../TShellExtMenuConfig.cpp) (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) +++ src/common/TShellExtMenuConfig.cpp (.../TShellExtMenuConfig.cpp) (revision b54c79b15d7c1a101c43994e9a403b07d695c8dc) @@ -277,6 +277,16 @@ m_strItemTip = wstrItemTip; } +bool TShellMenuItem::SpecifiesDestinationPath() const +{ + return !IsGroupItem() && (m_tDestinationPath.GetDstPathSource() == TDestinationPathInfo::eDstType_Specified); +} + +bool TShellMenuItem::RequiresClipboardPaths() const +{ + return !IsGroupItem() && (m_tDestinationPath.GetDstPathSource() == TDestinationPathInfo::eDstType_Clipboard || m_tSourcePaths.GetSrcPathsSource() == TSourcePathsInfo::eSrcType_Clipboard); +} + size_t TShellMenuItem::GetChildrenCount() const { return m_vChildItems.size(); Index: src/common/TShellExtMenuConfig.h =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -rb54c79b15d7c1a101c43994e9a403b07d695c8dc --- src/common/TShellExtMenuConfig.h (.../TShellExtMenuConfig.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/common/TShellExtMenuConfig.h (.../TShellExtMenuConfig.h) (revision b54c79b15d7c1a101c43994e9a403b07d695c8dc) @@ -172,9 +172,9 @@ bool IsSpecialOperation() const { return m_bSpecialOperation; } // helper - retrieves info if the destination path is already specified - bool SpecifiesDestinationPath() const { return !IsGroupItem() && !m_tDestinationPath.GetDstPathSource() == TDestinationPathInfo::eDstType_Specified; } + bool SpecifiesDestinationPath() const; // helper - retrieves info if this command requires some paths present in clipboard to be enabled - bool RequiresClipboardPaths() const { return !IsGroupItem() && (m_tDestinationPath.GetDstPathSource() == TDestinationPathInfo::eDstType_Clipboard || m_tSourcePaths.GetSrcPathsSource() == TSourcePathsInfo::eSrcType_Clipboard); } + bool RequiresClipboardPaths() const; // operations on children size_t GetChildrenCount() const;