OSDN Git Service

Fixed incorrectly SubEditList ReadOnly attribute storage; refactoring (#1580)
authorYurii Hordiienko <45203053+hordi@users.noreply.github.com>
Sun, 20 Nov 2022 00:19:21 +0000 (19:19 -0500)
committerGitHub <noreply@github.com>
Sun, 20 Nov 2022 00:19:21 +0000 (09:19 +0900)
commit1b9ea1f14b62bd8204979907c782fcd168d5d7c9
tree2806d2f8bb299d9f5925b2583137ed3cfd3f5ebc
parent61e6dd359218f4cdc0c0ba30cbdd48d0148e2074
Fixed incorrectly SubEditList ReadOnly attribute storage; refactoring (#1580)

Originally SubEditList uses std::set<bool> m_readOnlyColumns storage for read-only columns.
Expectedly int-type should be used instead of bool-type if we want to make any particular (not only 0-index) column work in read-only mode or it doesn't have any sense to use std::set at all. Original code doesn't produce any issue because that function used in one place (I hope) with index 0 only, respectively 0-column only read-only and any other does not.
Code refactored to eliminate usage of 2 redundant std::set storages for 2 different attributes and used one only std::vector to store and read_only+boolean_value type and EditStyle.
Src/SubeditList.cpp
Src/SubeditList.h