From ba1f211dbd5250cd92fa716188c090d478d4d72c Mon Sep 17 00:00:00 2001 From: Yangdingcheng <335776680@qq.com> Date: Tue, 12 Nov 2024 20:04:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?TicketNO:=20DTS2024060420525=20Description:?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=EF=BC=8C=E8=BF=BD?= =?UTF-8?q?=E8=B8=AA=E5=8D=A1=E7=89=87ID=E4=BF=A1=E6=81=AF=20Team:=20Featu?= =?UTF-8?q?re=20or=20Bugfix:=20Binary=20source:=20PrivateCode(Yes/No):No?= =?UTF-8?q?=20Signed-off-by:=20y30069754=20<335776680@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/bridge/declarative_frontend/jsview/js_form.cpp | 2 ++ .../core/components/form/resource/form_manager_delegate.cpp | 3 ++- frameworks/core/components_ng/pattern/form/form_pattern.cpp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frameworks/bridge/declarative_frontend/jsview/js_form.cpp b/frameworks/bridge/declarative_frontend/jsview/js_form.cpp index 0d7c7d08166..946da7cc1cd 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_form.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_form.cpp @@ -70,6 +70,7 @@ void JSForm::Create(const JSCallbackInfo& info) JSRef shape = obj->GetProperty("shape"); RequestFormInfo formInfo; if (id->IsString()) { + LOGI("JSForm Create, info.id: %{public}s", id->ToString().c_str()); if (!StringUtils::IsNumber(id->ToString())) { LOGE("Invalid form id : %{public}s", id->ToString().c_str()); return; @@ -83,6 +84,7 @@ void JSForm::Create(const JSCallbackInfo& info) } if (id->IsNumber()) { formInfo.id = id->ToNumber(); + LOGI("JSForm Create, info.id: %{public}" PRId64, formInfo.id); } formInfo.cardName = name->ToString(); formInfo.bundleName = bundle->ToString(); diff --git a/frameworks/core/components/form/resource/form_manager_delegate.cpp b/frameworks/core/components/form/resource/form_manager_delegate.cpp index 77c12a513ec..ed3b42bdfad 100644 --- a/frameworks/core/components/form/resource/form_manager_delegate.cpp +++ b/frameworks/core/components/form/resource/form_manager_delegate.cpp @@ -126,6 +126,7 @@ void FormManagerDelegate::AddForm(const WeakPtr& context, const Re SetParamForWant(info, formInfo); OHOS::AppExecFwk::FormJsInfo formJsInfo; auto clientInstance = OHOS::AppExecFwk::FormHostClient::GetInstance(); + TAG_LOGI(AceLogTag::ACE_FORM, "Before FormMgr adding form, info.id: %{public}" PRId64, info.id); auto ret = OHOS::AppExecFwk::FormMgr::GetInstance().AddForm(info.id, wantCache_, clientInstance, formJsInfo); if (ret != 0) { auto errorMsg = OHOS::AppExecFwk::FormMgr::GetInstance().GetErrorMessage(ret); @@ -956,7 +957,7 @@ void FormManagerDelegate::ProcessFormUpdate(const AppExecFwk::FormJsInfo& formJs void FormManagerDelegate::ReleaseRenderer() { - TAG_LOGI(AceLogTag::ACE_FORM, "FormManagerDelegate releaseForm. formId: %{public}" PRId64 ", %{public}s", + TAG_LOGI(AceLogTag::ACE_FORM, "FormManagerDelegate releaseRenderer. formId: %{public}" PRId64 ", %{public}s", runningCardId_, runningCompId_.c_str()); if (runningCardId_ <= 0) { return; diff --git a/frameworks/core/components_ng/pattern/form/form_pattern.cpp b/frameworks/core/components_ng/pattern/form/form_pattern.cpp index daa66b348fd..31e7d76b1d0 100644 --- a/frameworks/core/components_ng/pattern/form/form_pattern.cpp +++ b/frameworks/core/components_ng/pattern/form/form_pattern.cpp @@ -608,6 +608,7 @@ void FormPattern::OnModifyDone() } // Convert DimensionUnit to DimensionUnit::PX auto info = layoutProperty->GetRequestFormInfo().value_or(RequestFormInfo()); + TAG_LOGI(AceLogTag::ACE_FORM, "requestFormInfo.id: %{public}" PRId64, info.id); info.width = Dimension(width.ConvertToPx()); info.height = Dimension(height.ConvertToPx()); auto &&borderWidthProperty = layoutProperty->GetBorderWidthProperty(); From 9de9f0c173a9ffa778908b69610180d4cc214756 Mon Sep 17 00:00:00 2001 From: Yangdingcheng <335776680@qq.com> Date: Wed, 13 Nov 2024 10:45:48 +0800 Subject: [PATCH 2/4] =?UTF-8?q?TicketNO:=20DTS2024060420525=20Description:?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=EF=BC=8C=E8=BF=BD?= =?UTF-8?q?=E8=B8=AA=E5=8D=A1=E7=89=87ID=E4=BF=A1=E6=81=AF=20Team:=20Featu?= =?UTF-8?q?re=20or=20Bugfix:=20Binary=20source:=20PrivateCode(Yes/No):No?= =?UTF-8?q?=20Signed-off-by:=20y30069754=20<335776680@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/bridge/declarative_frontend/jsview/js_form.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frameworks/bridge/declarative_frontend/jsview/js_form.cpp b/frameworks/bridge/declarative_frontend/jsview/js_form.cpp index 946da7cc1cd..378c8b83110 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_form.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_form.cpp @@ -54,9 +54,9 @@ namespace OHOS::Ace::Framework { void JSForm::Create(const JSCallbackInfo& info) { - if (info.Length() == 0 || !info[0]->IsObject()) { + if (info.Length() == 0 || !info[0]->IsObject()) return; - } + auto obj = JSRef::Cast(info[0]); JSRef id = obj->GetProperty("id"); JSRef name = obj->GetProperty("name"); @@ -70,7 +70,6 @@ void JSForm::Create(const JSCallbackInfo& info) JSRef shape = obj->GetProperty("shape"); RequestFormInfo formInfo; if (id->IsString()) { - LOGI("JSForm Create, info.id: %{public}s", id->ToString().c_str()); if (!StringUtils::IsNumber(id->ToString())) { LOGE("Invalid form id : %{public}s", id->ToString().c_str()); return; @@ -84,8 +83,8 @@ void JSForm::Create(const JSCallbackInfo& info) } if (id->IsNumber()) { formInfo.id = id->ToNumber(); - LOGI("JSForm Create, info.id: %{public}" PRId64, formInfo.id); } + LOGI("JSForm Create, info.id: %{public}" PRId64, formInfo.id); formInfo.cardName = name->ToString(); formInfo.bundleName = bundle->ToString(); formInfo.abilityName = ability->ToString(); From 40413dd598b07005fa3aea22fdb7bb1f8d5b4c83 Mon Sep 17 00:00:00 2001 From: Yangdingcheng <335776680@qq.com> Date: Fri, 22 Nov 2024 15:28:49 +0800 Subject: [PATCH 3/4] =?UTF-8?q?TicketNO:=20DTS2024060420525=20Description:?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=EF=BC=8C=E8=BF=BD?= =?UTF-8?q?=E8=B8=AA=E5=8D=A1=E7=89=87ID=E4=BF=A1=E6=81=AF=20Team:=20Featu?= =?UTF-8?q?re=20or=20Bugfix:=20Binary=20source:=20PrivateCode(Yes/No):No?= =?UTF-8?q?=20Signed-off-by:=20y30069754=20<335776680@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/core/components_ng/pattern/form/form_pattern.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frameworks/core/components_ng/pattern/form/form_pattern.cpp b/frameworks/core/components_ng/pattern/form/form_pattern.cpp index 31e7d76b1d0..fb3b7fade6d 100644 --- a/frameworks/core/components_ng/pattern/form/form_pattern.cpp +++ b/frameworks/core/components_ng/pattern/form/form_pattern.cpp @@ -138,6 +138,7 @@ void FormPattern::OnAttachToFrameNode() auto uiTaskExecutor = SingleTaskExecutor::Make(context->GetTaskExecutor(), TaskExecutor::TaskType::UI); auto id = subContainer->GetRunningCardId(); + TAG_LOGI(AceLogTag::ACE_FORM, "FormPattern::OnAttachToFrameNode, cardId: %{public}" PRId64, id); FormManager::GetInstance().AddSubContainer(id, subContainer); uiTaskExecutor.PostDelayedTask( [id, nodeId = subContainer->GetNodeId()] { @@ -608,7 +609,7 @@ void FormPattern::OnModifyDone() } // Convert DimensionUnit to DimensionUnit::PX auto info = layoutProperty->GetRequestFormInfo().value_or(RequestFormInfo()); - TAG_LOGI(AceLogTag::ACE_FORM, "requestFormInfo.id: %{public}" PRId64, info.id); + TAG_LOGI(AceLogTag::ACE_FORM, "FormPattern::OnModifyDone, info.id: %{public}" PRId64, info.id); info.width = Dimension(width.ConvertToPx()); info.height = Dimension(height.ConvertToPx()); auto &&borderWidthProperty = layoutProperty->GetBorderWidthProperty(); From fb0b955cf99ba4edff6aec17c0bea2087a91e532 Mon Sep 17 00:00:00 2001 From: Yangdingcheng <335776680@qq.com> Date: Fri, 22 Nov 2024 17:33:53 +0800 Subject: [PATCH 4/4] =?UTF-8?q?TicketNO:=20DTS2024060420525=20Description:?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=EF=BC=8C=E8=BF=BD?= =?UTF-8?q?=E8=B8=AA=E5=8D=A1=E7=89=87ID=E4=BF=A1=E6=81=AF=20Team:=20Featu?= =?UTF-8?q?re=20or=20Bugfix:=20Binary=20source:=20PrivateCode(Yes/No):No?= =?UTF-8?q?=20Signed-off-by:=20y30069754=20<335776680@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/bridge/declarative_frontend/jsview/js_form.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frameworks/bridge/declarative_frontend/jsview/js_form.cpp b/frameworks/bridge/declarative_frontend/jsview/js_form.cpp index 378c8b83110..5ee3c576e8c 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_form.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_form.cpp @@ -54,9 +54,9 @@ namespace OHOS::Ace::Framework { void JSForm::Create(const JSCallbackInfo& info) { - if (info.Length() == 0 || !info[0]->IsObject()) + if (info.Length() == 0 || !info[0]->IsObject()) { return; - + } auto obj = JSRef::Cast(info[0]); JSRef id = obj->GetProperty("id"); JSRef name = obj->GetProperty("name"); @@ -80,8 +80,7 @@ void JSForm::Create(const JSCallbackInfo& info) return; } formInfo.id = inputFormId; - } - if (id->IsNumber()) { + } else if (id->IsNumber()) { formInfo.id = id->ToNumber(); } LOGI("JSForm Create, info.id: %{public}" PRId64, formInfo.id);