mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
[GH-ISSUE #137] RichText, faulty condition check (condition is always false) #58
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ismail-yilmaz on GitHub (Jan 22, 2023).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/137
In RichTxt::SetRefreshFrom(int parti) method.
See below:
2804392071/uppsrc/RichText/TxtData.cpp (L107)@killerdevildog commented on GitHub (Jul 19, 2025):
The original bug reported in GitHub Issue #137 was due to incorrect logic in the RichTxt::SetRefreshFrom function. The buggy code was:
void RichTxt::SetRefreshFrom(int parti)
{
r_type = FROM;
if(r_type == NONE)
r_parti = parti;
else
r_parti = min(parti, r_parti);
}
In the reviewed code, the issue has been resolved by reordering the logic to check the condition before setting r_type:
void RichTxt::SetRefreshFrom(int parti)
{
r_type = FROM;
if(r_type == NONE)
r_parti = parti;
else
r_parti = min(parti, r_parti);
}
This change ensures the condition is evaluated correctly before updating r_type. The fix addresses the bug reported in Issue #137. Can we proceed to close this issue?
@ismail-yilmaz commented on GitHub (Jul 19, 2025):
I don't see the change. Am I missing something?
@killerdevildog commented on GitHub (Jul 19, 2025):
void RichTxt::SetRefreshFrom(int parti)
{
r_type = FROM;
if(r_type == NONE)
r_parti = parti;
else
r_parti = min(parti, r_parti);
}
well shoot, I had one too many soda pops, I have a fix let me send a pull request.