diff --git a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp index 21e50401a..1e6f24840 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp +++ b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp @@ -399,14 +399,27 @@ bool ProjectPanel::buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem) else if (lstrcmp(TEXT("File"), v) == 0) { const TCHAR *strValue = (childNode->ToElement())->Attribute(TEXT("name")); + generic_string fullPath = getAbsoluteFilePath(strValue); TCHAR *strValueLabel = ::PathFindFileName(strValue); - int iImage = ::PathFileExists(strValue)?INDEX_LEAF:INDEX_LEAF_INVALID; - _treeView.addItem(strValueLabel, hParentItem, iImage, strValue); + int iImage = ::PathFileExists(fullPath.c_str())?INDEX_LEAF:INDEX_LEAF_INVALID; + _treeView.addItem(strValueLabel, hParentItem, iImage, fullPath.c_str()); } } return true; } +generic_string ProjectPanel::getAbsoluteFilePath(const TCHAR * relativePath) +{ + if (!::PathIsRelative(relativePath)) + return relativePath; + + TCHAR absolutePath[MAX_PATH]; + lstrcpy(absolutePath, _workSpaceFilePath.c_str()); + ::PathRemoveFileSpec(absolutePath); + ::PathAppend(absolutePath, relativePath); + return absolutePath; +} + void ProjectPanel::notified(LPNMHDR notification) { if((notification->hwndFrom == _treeView.getHSelf())) diff --git a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.h b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.h index 38fb317c6..42382f9b9 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.h +++ b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.h @@ -90,6 +90,6 @@ protected: bool buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem); void notified(LPNMHDR notification); void showContextMenu(int x, int y); - + generic_string getAbsoluteFilePath(const TCHAR * relativePath); }; #endif // PROJECTPANEL_H