!37008 【safeWarning】TextPicker与Select安全告警修改

Merge pull request !37008 from yyuanche/warning
This commit is contained in:
openharmony_ci 2024-07-04 13:11:02 +00:00 committed by Gitee
commit e5ae5409ca
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 7 deletions

View File

@ -627,7 +627,7 @@ void SelectPattern::SetOptionBgColor(const Color& color)
{
optionBgColor_ = color;
for (size_t i = 0; i < options_.size(); ++i) {
if (i == selected_ && selectedBgColor_.has_value()) {
if (static_cast<int32_t>(i) == selected_ && selectedBgColor_.has_value()) {
continue;
}
auto pattern = options_[i]->GetPattern<OptionPattern>();
@ -640,7 +640,7 @@ void SelectPattern::SetOptionFontSize(const Dimension& value)
{
optionFont_.FontSize = value;
for (size_t i = 0; i < options_.size(); ++i) {
if (i == selected_ && selectedFont_.FontSize.has_value()) {
if (static_cast<int32_t>(i) == selected_ && selectedFont_.FontSize.has_value()) {
continue;
}
auto pattern = options_[i]->GetPattern<OptionPattern>();
@ -653,7 +653,7 @@ void SelectPattern::SetOptionItalicFontStyle(const Ace::FontStyle& value)
{
optionFont_.FontStyle = value;
for (size_t i = 0; i < options_.size(); ++i) {
if (i == selected_ && selectedFont_.FontStyle.has_value()) {
if (static_cast<int32_t>(i) == selected_ && selectedFont_.FontStyle.has_value()) {
continue;
}
auto pattern = options_[i]->GetPattern<OptionPattern>();
@ -666,7 +666,7 @@ void SelectPattern::SetOptionFontWeight(const FontWeight& value)
{
optionFont_.FontWeight = value;
for (size_t i = 0; i < options_.size(); ++i) {
if (i == selected_ && selectedFont_.FontWeight.has_value()) {
if (static_cast<int32_t>(i) == selected_ && selectedFont_.FontWeight.has_value()) {
continue;
}
auto pattern = options_[i]->GetPattern<OptionPattern>();
@ -679,7 +679,7 @@ void SelectPattern::SetOptionFontFamily(const std::vector<std::string>& value)
{
optionFont_.FontFamily = value;
for (size_t i = 0; i < options_.size(); ++i) {
if (i == selected_ && selectedFont_.FontFamily.has_value()) {
if (static_cast<int32_t>(i) == selected_ && selectedFont_.FontFamily.has_value()) {
continue;
}
auto pattern = options_[i]->GetPattern<OptionPattern>();
@ -692,7 +692,7 @@ void SelectPattern::SetOptionFontColor(const Color& color)
{
optionFont_.FontColor = color;
for (size_t i = 0; i < options_.size(); ++i) {
if (i == selected_ && selectedFont_.FontColor.has_value()) {
if (static_cast<int32_t>(i) == selected_ && selectedFont_.FontColor.has_value()) {
continue;
}
auto pattern = options_[i]->GetPattern<OptionPattern>();

View File

@ -89,7 +89,7 @@ void GetTextPickerSelectedIndex(ArkUINodeHandle node, ArkUI_Uint32* values, ArkU
values[0] = selectedValue;
} else {
auto selectedValue = TextPickerModelNG::getTextPickerSelecteds(frameNode);
if (size != selectedValue.size()) {
if (static_cast<ArkUI_Uint32>(size) != selectedValue.size()) {
return;
}
for (int i = 0; i < size; i++) {