Skip to content

Commit

Permalink
# fix gridview function call
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghitamutu committed Dec 29, 2023
1 parent 1b6042b commit 6f4dc88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion GViewCore/src/View/GridViewer/GridViewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace View
void SetCustomPropertyValue(uint32 propertyID) override;
bool IsPropertyValueReadOnly(uint32 propertyID) override;
const vector<Property> GetPropertiesList() override;
vector<uint8_t> getHexCellContent(const std::string& content);
vector<uint8_t> getHexCellContent(const AppCUI::Utils::String& content);

private:
void PopulateGrid();
Expand Down
12 changes: 5 additions & 7 deletions GViewCore/src/View/GridViewer/Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,13 @@ bool Instance::OnUpdateCommandBar(AppCUI::Application::CommandBar& commandBar)
return false;
}

vector<uint8_t> Instance::getHexCellContent(const std::string& content) {

vector<uint8_t> Instance::getHexCellContent(const AppCUI::Utils::String& content) {
constexpr uint32_t SIZE = 8;
vector<uint8_t> hexData;
for (auto chunkIndex = 0; chunkIndex < content.size() / 8; chunkIndex++)
{
for (auto chunkIndex = 0; chunkIndex < content.Len() / SIZE; chunkIndex++) {
uint8_t value = 0;
for (auto valueIndex = chunkIndex * 8; valueIndex < (chunkIndex + 1) * 8; valueIndex++)
{
value = value * 2 + content[valueIndex] - '0';
for (auto valueIndex = chunkIndex * SIZE; valueIndex < (chunkIndex + 1) * SIZE; valueIndex++) {
value = value * 2 + content.GetChar(valueIndex) - '0';
}
hexData.push_back(value);
}
Expand Down

0 comments on commit 6f4dc88

Please sign in to comment.