From 78ea2110d283e7a89f8fef66d097023521114afe Mon Sep 17 00:00:00 2001 From: Don HO Date: Mon, 7 Aug 2017 02:00:50 +0200 Subject: [PATCH] Fix export fuctionlist bug --- .../FunctionList/functionListPanel.cpp | 20 +++++++++---------- .../FunctionList/functionListPanel.h | 9 +-------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index 9afdeceb6..652d5a02a 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -251,10 +251,10 @@ bool FunctionListPanel::serialize(const generic_string & outputFilename) if (!f) return false; - for (const auto & info : _funcinfos) + for (const auto & info : _foundFuncInfos) { generic_string entryName; - if (info._pos2 != -1) + if (!info._data2.empty()) { entryName = info._data2; entryName += TEXT("=>"); @@ -290,7 +290,7 @@ void FunctionListPanel::reload() ::SendMessage(_hSearchEdit, WM_SETTEXT, 0, reinterpret_cast(TEXT(""))); setSort(false); - _funcinfos.clear(); + _foundFuncInfos.clear(); Buffer* currentBuf = (*_ppEditView)->getCurrentBuffer(); const TCHAR *fn = currentBuf->getFileName(); @@ -306,30 +306,30 @@ void FunctionListPanel::reload() TCHAR *ext = ::PathFindExtension(fn); - bool parsedOK = _funcParserMgr.parse(_funcinfos, AssociationInfo(-1, langID, ext, udln)); + bool parsedOK = _funcParserMgr.parse(_foundFuncInfos, AssociationInfo(-1, langID, ext, udln)); if (parsedOK) { _treeView.addItem(fn, NULL, INDEX_ROOT, TEXT("-1")); } - for (size_t i = 0, len = _funcinfos.size(); i < len; ++i) + for (size_t i = 0, len = _foundFuncInfos.size(); i < len; ++i) { // no 2 level bool b = false; if (b) { generic_string entryName = TEXT(""); - if (_funcinfos[i]._pos2 != -1) + if (!_foundFuncInfos[i]._data2.empty()) { - entryName = _funcinfos[i]._data2; + entryName = _foundFuncInfos[i]._data2; entryName += TEXT("=>"); } - entryName += _funcinfos[i]._data; - addEntry(NULL, entryName.c_str(), _funcinfos[i]._pos); + entryName += _foundFuncInfos[i]._data; + addEntry(NULL, entryName.c_str(), _foundFuncInfos[i]._pos); } else { - addEntry(_funcinfos[i]._data2.c_str(), _funcinfos[i]._data.c_str(), _funcinfos[i]._pos); + addEntry(_foundFuncInfos[i]._data2.c_str(), _foundFuncInfos[i]._data.c_str(), _foundFuncInfos[i]._pos); } } diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.h b/PowerEditor/src/WinControls/FunctionList/functionListPanel.h index f85db1358..e0ed8c34a 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.h +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.h @@ -42,10 +42,6 @@ class ScintillaEditView; -struct FuncInfo { - generic_string _displayText; - size_t _offsetPos; -}; /* 1. global function + object + methods: Tree view of 2 levels - only the leaf contains the position info root @@ -115,8 +111,6 @@ public: bool serialize(const generic_string & outputFilename = TEXT("")); void addEntry(const TCHAR *node, const TCHAR *displayText, size_t pos); void removeAllEntries(); - void removeEntry(); - void modifyEntry(); void searchFuncAndSwitchView(); protected: @@ -133,11 +127,10 @@ private: generic_string _sortTipStr; generic_string _reloadTipStr; - std::vector _funcinfos; + std::vector _foundFuncInfos; ScintillaEditView **_ppEditView; FunctionParsersManager _funcParserMgr; - std::vector _funcInfos; std::vector< std::pair > _skipZones; std::vector _treeParams; HIMAGELIST _hTreeViewImaLst;