diff --git a/frameworks/core/components_ng/base/frame_node.cpp b/frameworks/core/components_ng/base/frame_node.cpp index 85cc72459dcc6b1d012cd167a4af8f65f82f1f79..9046999ae48b032abd716e975fb4031b4448a26c 100644 --- a/frameworks/core/components_ng/base/frame_node.cpp +++ b/frameworks/core/components_ng/base/frame_node.cpp @@ -709,9 +709,9 @@ RefPtr FrameNode::UpdateLayoutWrapper( if (layoutProperty_->GetVisibility().value_or(VisibleType::VISIBLE) == VisibleType::GONE) { if (!layoutWrapper) { layoutWrapper = - MakeRefPtr(WeakClaim(this), geometryNode_->Clone(), layoutProperty_->Clone()); + MakeRefPtr(WeakClaim(this), MakeRefPtr(), MakeRefPtr()); } else { - layoutWrapper->Update(WeakClaim(this), geometryNode_->Clone(), layoutProperty_->Clone()); + layoutWrapper->Update(WeakClaim(this), MakeRefPtr(), MakeRefPtr()); } layoutWrapper->SetLayoutAlgorithm(MakeRefPtr(nullptr, true, true)); isLayoutDirtyMarked_ = false; diff --git a/frameworks/core/components_ng/pattern/grid/grid_layout/grid_layout_algorithm.cpp b/frameworks/core/components_ng/pattern/grid/grid_layout/grid_layout_algorithm.cpp index 86d89a09b2880cde957ea796c99df39e65d4fac0..8d39a4dc8907bc393014f924bc8fa7280f27acc0 100644 --- a/frameworks/core/components_ng/pattern/grid/grid_layout/grid_layout_algorithm.cpp +++ b/frameworks/core/components_ng/pattern/grid/grid_layout/grid_layout_algorithm.cpp @@ -64,7 +64,7 @@ LayoutConstraintF GridLayoutAlgorithm::CreateChildConstraint(const SizeF& idealS layoutConstraint.maxSize = SizeF(colLen, rowLen); layoutConstraint.percentReference = SizeF(colLen, rowLen); - if (!childLayoutProperty || !childLayoutProperty->GetCalcLayoutConstraint()) { + if (!childLayoutProperty->GetCalcLayoutConstraint()) { layoutConstraint.selfIdealSize.UpdateIllegalSizeWithCheck(layoutConstraint.maxSize); } return layoutConstraint; @@ -197,11 +197,9 @@ OffsetF GridLayoutAlgorithm::ComputeItemPosition(LayoutWrapper* layoutWrapper, i } colLen += (colSpan - 1) * columnsGap_; - if (childLayoutProperty) { - auto layoutConstraint = childLayoutProperty->GetLayoutConstraint(); - if (layoutConstraint.has_value()) { - OffsetByAlign(layoutConstraint.value(), rowLen, colLen, positionX, positionY); - } + auto layoutConstraint = childLayoutProperty->GetLayoutConstraint(); + if (layoutConstraint.has_value()) { + OffsetByAlign(layoutConstraint.value(), rowLen, colLen, positionX, positionY); } // If RTL, place the item from right.