From: Soeren Apel Date: Tue, 14 Jan 2020 18:04:34 +0000 (+0100) Subject: HexView: Don't send out an extra byte when exporting all data X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e094bcb296efa6066b546c580b398acb37b7efc1;p=pulseview.git HexView: Don't send out an extra byte when exporting all data --- diff --git a/pv/views/decoder_output/QHexView.cpp b/pv/views/decoder_output/QHexView.cpp index 0104de15..59fe779f 100644 --- a/pv/views/decoder_output/QHexView.cpp +++ b/pv/views/decoder_output/QHexView.cpp @@ -142,7 +142,7 @@ pair QHexView::get_selection() const // Nothing is currently selected start = 0; end = data_size_; - } else + } if (end < data_size_) end++; return std::make_pair(start, end); diff --git a/pv/views/decoder_output/view.cpp b/pv/views/decoder_output/view.cpp index 9e69622d..0f127c87 100644 --- a/pv/views/decoder_output/view.cpp +++ b/pv/views/decoder_output/view.cpp @@ -265,6 +265,8 @@ void View::save_data() const pair selection = hex_view_->get_selection(); vector data; + data.resize(selection.second - selection.first + 1); + signal_->get_merged_binary_data_chunks_by_offset(current_segment_, decoder_, bin_class_id_, selection.first, selection.second, &data); @@ -303,6 +305,8 @@ void View::save_data_as_hex_dump(bool with_offset, bool with_ascii) const pair selection = hex_view_->get_selection(); vector data; + data.resize(selection.second - selection.first + 1); + signal_->get_merged_binary_data_chunks_by_offset(current_segment_, decoder_, bin_class_id_, selection.first, selection.second, &data);