dbdf5c5ea9e3161233f0588a7616b7e4fedc7870.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From dbdf5c5ea9e3161233f0588a7616b7e4fedc7870 Mon Sep 17 00:00:00 2001
  2. From: mortenmacfly <mortenmacfly@2a5c6006-c6dd-42ca-98ab-0921f2732cef>
  3. Date: Sat, 3 Apr 2021 05:14:39 +0000
  4. Subject: [PATCH] * applied patch #1079 Don't call wxChoice::GetString() with
  5. wxNOT_FOUND (thanks Miguel Gimenez)
  6. git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@12312 2a5c6006-c6dd-42ca-98ab-0921f2732cef
  7. ---
  8. .../FileManager/FileExplorerUpdater.cpp | 20 +++++++++++++++----
  9. 1 file changed, 16 insertions(+), 4 deletions(-)
  10. diff --git a/src/plugins/contrib/FileManager/FileExplorerUpdater.cpp b/src/plugins/contrib/FileManager/FileExplorerUpdater.cpp
  11. index 5a0b3a9ee..9dee80696 100644
  12. --- a/src/plugins/contrib/FileManager/FileExplorerUpdater.cpp
  13. +++ b/src/plugins/contrib/FileManager/FileExplorerUpdater.cpp
  14. @@ -150,10 +150,16 @@ void FileExplorerUpdater::Update(const wxTreeItemId &ti)
  15. m_path=wxString(m_fe->GetFullPath(ti).c_str());
  16. m_wildcard=wxString(m_fe->m_WildCards->GetValue().c_str());
  17. m_vcs_type=wxString(m_fe->m_VCS_Type->GetLabel().c_str());
  18. - m_vcs_commit_string=wxString(m_fe->m_VCS_Control->GetString(m_fe->m_VCS_Control->GetSelection()).c_str());
  19. + const int selection = m_fe->m_VCS_Control->GetSelection();
  20. + if (selection == wxNOT_FOUND)
  21. + m_vcs_commit_string.clear();
  22. + else
  23. + m_vcs_commit_string = wxString(m_fe->m_VCS_Control->GetString(selection).c_str());
  24. +
  25. m_vcs_changes_only = m_fe->m_VCS_ChangesOnly->IsChecked();
  26. - if (m_vcs_type != wxEmptyString)
  27. + if (!m_vcs_type.empty())
  28. m_repo_path=wxString(m_fe->GetRootFolder().c_str());
  29. +
  30. GetTreeState(ti);
  31. if (Create()==wxTHREAD_NO_ERROR)
  32. {
  33. @@ -1262,11 +1268,17 @@ void VCSFileLoader::Update(const wxString &op, const wxString &source_path, cons
  34. m_source_path=wxString(source_path.c_str());
  35. m_destination_path=wxString(destination_path.c_str());
  36. m_vcs_type=wxString(m_fe->m_VCS_Type->GetLabel().c_str());
  37. - m_vcs_commit_string=wxString(m_fe->m_VCS_Control->GetString(m_fe->m_VCS_Control->GetSelection()).c_str());
  38. + const int selection = m_fe->m_VCS_Control->GetSelection();
  39. + if (selection == wxNOT_FOUND)
  40. + m_vcs_commit_string.clear();
  41. + else
  42. + m_vcs_commit_string = wxString(m_fe->m_VCS_Control->GetString(selection).c_str());
  43. +
  44. m_vcs_op = wxString(op.c_str());
  45. m_vcs_comp_commit = wxString(comp_commit.c_str());
  46. - if (m_vcs_type != wxEmptyString)
  47. + if (!m_vcs_type.empty())
  48. m_repo_path=wxString(m_fe->GetRootFolder().c_str());
  49. +
  50. if (Create()==wxTHREAD_NO_ERROR)
  51. {
  52. SetPriority(20);