diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-04-28 15:07:43 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-04-28 15:07:43 +0300 |
| commit | eaa6e43d1de61c11d8d94c1113c872bfc3186806 (patch) | |
| tree | 5c7eabd8468c754336c2f7444f4dcf83eed27f8f | |
| parent | 81da71879b1b31adfc5577fb142811181ef3c95d (diff) | |
fixes #4999 (После починки #4984 сломалось #4649)
| -rw-r--r-- | plugins/NewStory/src/history_dlg.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/NewStory/src/history_dlg.cpp b/plugins/NewStory/src/history_dlg.cpp index 070d75d056..85dcd9ea5d 100644 --- a/plugins/NewStory/src/history_dlg.cpp +++ b/plugins/NewStory/src/history_dlg.cpp @@ -350,9 +350,6 @@ class CHistoryDlg : public CDlgBase HTREEITEM FindSibling(HTREEITEM root, int value)
{
if (root) {
- if (value < 1000)
- root = m_timeTree.GetChild(root);
-
for (HTREEITEM hti = root; hti; hti = m_timeTree.GetNextSibling(hti)) {
TVITEMEX tvi;
tvi.mask = TVIF_PARAM;
@@ -373,9 +370,13 @@ class CHistoryDlg : public CDlgBase if (err != 0)
return;
- HTREEITEM hti = FindSibling(m_timeTree.GetRoot(), ts.tm_year + 1900);
- hti = FindSibling(hti, ts.tm_mon + 1);
- hti = FindSibling(hti, ts.tm_mday);
+ int iValue = (ts.tm_year + 1900) * 100 * 100;
+ HTREEITEM hti = FindSibling(m_timeTree.GetRoot(), iValue);
+
+ iValue += (ts.tm_mon + 1) * 100;
+ hti = FindSibling(m_timeTree.GetChild(hti), iValue);
+
+ hti = FindSibling(m_timeTree.GetChild(hti), iValue + ts.tm_mday);
if (hti) {
disableTimeTreeChange = true;
m_timeTree.SelectItem(hti);
|
