diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 3601e84249..4fe11d1dcd 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -6578,7 +6578,6 @@ void HistoryWidget::drawPinnedBar(Painter &p) { Expects(_pinnedBar != nullptr); auto top = _topBar->bottomNoMargins(); - Text *from = 0, *text = 0; bool serviceColor = false, hasForward = readyToForward(); ImagePtr preview; p.fillRect(myrtlrect(0, top, width(), st::historyReplyHeight), st::historyPinnedBg); diff --git a/Telegram/SourceFiles/history/media/history_media_poll.cpp b/Telegram/SourceFiles/history/media/history_media_poll.cpp index 4d9d27605b..4758652b8e 100644 --- a/Telegram/SourceFiles/history/media/history_media_poll.cpp +++ b/Telegram/SourceFiles/history/media/history_media_poll.cpp @@ -88,6 +88,12 @@ void AdjustPercentCount(gsl::span items, int left) { break; } } + if (!items[i].remainder) { + // If this item has correct value in 'percent' we don't want + // to increment it to an incorrect one. This fixes a case with + // four items with three votes for three different items. + break; + } const auto equal = j - i; if (equal <= left) { left -= equal;