diff --git a/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp b/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp index 4595cfbe685..79b38d8c034 100644 --- a/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp +++ b/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp @@ -117,7 +117,7 @@ void SwiperPattern::OnAttachToFrameNode() void SwiperPattern::OnDetachFromFrameNode(FrameNode* node) { - auto pipeline = GetContext(); + auto pipeline = PipelineContext::GetCurrentContextSafely(); CHECK_NULL_VOID(pipeline); if (HasSurfaceChangedCallback()) { pipeline->UnregisterSurfaceChangedCallback(surfaceChangedCallbackId_.value_or(-1)); diff --git a/frameworks/core/interfaces/native/node/node_text_modifier.cpp b/frameworks/core/interfaces/native/node/node_text_modifier.cpp index 74e2363ad0b..b4f28b081f1 100644 --- a/frameworks/core/interfaces/native/node/node_text_modifier.cpp +++ b/frameworks/core/interfaces/native/node/node_text_modifier.cpp @@ -714,6 +714,8 @@ void GetFont(ArkUINodeHandle node, ArkUITextFont* font) } g_strValue = families; font->fontFamilies = g_strValue.c_str(); + } else { + font->fontFamilies = "HarmonyOS Sans"; } if (value.fontStyle.has_value()) { font->fontStyle = static_cast(value.fontStyle.value()); diff --git a/interfaces/native/node/style_modifier.cpp b/interfaces/native/node/style_modifier.cpp index 90df5d514e6..3c015ecd67d 100644 --- a/interfaces/native/node/style_modifier.cpp +++ b/interfaces/native/node/style_modifier.cpp @@ -1214,7 +1214,7 @@ int32_t SetBrightness(ArkUI_NodeHandle node, const ArkUI_AttributeItem* item) if (actualSize < 0) { return ERROR_CODE_PARAM_INVALID; } - if (LessNotEqual(item->value[0].f32, 0.0f) || GreatNotEqual(item->value[0].f32, 2.0f)) { + if (LessNotEqual(item->value[0].f32, 0.0f)) { return ERROR_CODE_PARAM_INVALID; } auto fullImpl = GetFullImpl(); @@ -1377,7 +1377,7 @@ void ResetLinearGradient(ArkUI_NodeHandle node) int32_t SetAlign(ArkUI_NodeHandle node, const ArkUI_AttributeItem* item) { auto actualSize = CheckAttributeItemArray(item, REQUIRED_ONE_PARAM); - if (actualSize < 0) { + if (actualSize < 0 || !InRegion(NUM_0, NUM_8, item->value[0].i32)) { return ERROR_CODE_PARAM_INVALID; } auto fullImpl = GetFullImpl(); @@ -2677,7 +2677,7 @@ const ArkUI_AttributeItem* GetRadialGradient(ArkUI_NodeHandle node) int32_t SetMask(ArkUI_NodeHandle node, const ArkUI_AttributeItem* item) { - if (item->size < 4) { + if (item->size < NUM_3) { return ERROR_CODE_PARAM_INVALID; } auto* fullImpl = GetFullImpl(); @@ -4911,7 +4911,7 @@ int32_t SetScrollScrollSnap(ArkUI_NodeHandle node, const ArkUI_AttributeItem* it paginationParams[item->size - NUM_3 + NUM_0] = snapAlign; paginationParams[item->size - NUM_3 + NUM_1] = enableSnapToStart; paginationParams[item->size - NUM_3 + NUM_2] = enableSnapToEnd; - paginationParams[item->size] = (item->size - NUM_3 > 1) ? true : false; + paginationParams[item->size] = (item->size - NUM_3 >= 1) ? true : false; fullImpl->getNodeModifiers()->getScrollModifier()->setScrollScrollSnap( node->uiNodeHandle, paginations, item->size - NUM_3, paginationParams, item->size + NUM_1); @@ -6269,7 +6269,7 @@ int32_t SetTextFont(ArkUI_NodeHandle node, const ArkUI_AttributeItem* item) } // family std::vector familyArray; - if (item->string == nullptr) { + if (item->string != nullptr) { std::string value(item->string); StringUtils::StringSplitter(value, ',', familyArray); }