From 634cf6b7beba3df7c8ee33207e99c72dbb27945a Mon Sep 17 00:00:00 2001 From: Dmitry Vedenko Date: Tue, 9 Apr 2024 16:35:30 +0300 Subject: [PATCH] Correctly read the track height for the project Resolves #6248 --- src/tracks/ui/ChannelView.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tracks/ui/ChannelView.cpp b/src/tracks/ui/ChannelView.cpp index b8ac3bbd07e2..8420d724288d 100644 --- a/src/tracks/ui/ChannelView.cpp +++ b/src/tracks/ui/ChannelView.cpp @@ -17,7 +17,6 @@ Paul Licameli split from TrackPanel.cpp #include "XMLTagHandler.h" #include "XMLWriter.h" -#include ChannelView::ChannelView(const std::shared_ptr &pChannel) : CommonChannelCell{ pChannel } @@ -121,10 +120,11 @@ void ChannelView::AdjustPositions() namespace { // Append a channel number to a base attribute name unless it is 0 -std::string AttributeName(std::string name, size_t index) { - std::stringstream stream{ name }; - stream << index; - return stream.str(); +std::string AttributeName(const std::string& name, size_t index) { + if (index == 0) + return name; + + return name + std::to_string(index); } std::string HeightAttributeName(size_t index) { return AttributeName("height", index);