mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 01:03:08 +00:00
!42474 coody告警处理0904
Merge pull request !42474 from 冯峰/alarm_20240904_shangfen
This commit is contained in:
commit
9d3b593d3d
@ -27,6 +27,7 @@ constexpr char END_CHAR = '\0';
|
||||
ArkUI_CharPtr ParseStringToCharPtr(std::string str)
|
||||
{
|
||||
char* id = static_cast<char*>(malloc((str.length() + 1) * sizeof(char)));
|
||||
CHECK_NULL_RETURN(id, nullptr);
|
||||
str.copy(id, str.length());
|
||||
id[str.length()] = END_CHAR;
|
||||
return id;
|
||||
|
@ -523,6 +523,7 @@ panda::Local<panda::JSValueRef> ViewMeasureLayout::JSLayout(panda::JsiRuntimeCal
|
||||
Local<JSValueRef> thisObj = runtimeCallInfo->GetThisRef();
|
||||
auto ptr = static_cast<NG::MeasureLayoutChild*>(panda::Local<panda::ObjectRef>(thisObj)->GetNativePointerField(
|
||||
vm, 0));
|
||||
CHECK_NULL_RETURN(ptr, panda::JSValueRef::Undefined(vm));
|
||||
auto child = ptr->GetChild();
|
||||
if (!child) {
|
||||
return panda::JSValueRef::Undefined(vm);
|
||||
@ -561,6 +562,7 @@ panda::Local<panda::JSValueRef> ViewMeasureLayout::JSPlaceChildren(panda::JsiRun
|
||||
Local<JSValueRef> thisObj = runtimeCallInfo->GetThisRef();
|
||||
auto ptr = static_cast<NG::MeasureLayoutChild*>(panda::Local<panda::ObjectRef>(thisObj)->GetNativePointerField(
|
||||
vm, 0));
|
||||
CHECK_NULL_RETURN(ptr, panda::JSValueRef::Undefined(vm));
|
||||
auto child = ptr->GetChild();
|
||||
if (!child) {
|
||||
return panda::JSValueRef::Undefined(vm);
|
||||
@ -596,6 +598,7 @@ panda::Local<panda::JSValueRef> ViewMeasureLayout::JSGetMargin(panda::JsiRuntime
|
||||
Local<JSValueRef> thisObj = runtimeCallInfo->GetThisRef();
|
||||
auto ptr = static_cast<NG::MeasureLayoutChild*>(panda::Local<panda::ObjectRef>(thisObj)->GetNativePointerField(
|
||||
vm, 0));
|
||||
CHECK_NULL_RETURN(ptr, panda::JSValueRef::Undefined(vm));
|
||||
auto child = ptr->GetOrCreateChild();
|
||||
if (!(child && child->GetLayoutProperty())) {
|
||||
return GenEdgesGlobalized({}, TextDirection::LTR).Get().GetLocalHandle();
|
||||
@ -611,6 +614,7 @@ panda::Local<panda::JSValueRef> ViewMeasureLayout::JSGetPadding(panda::JsiRuntim
|
||||
Local<JSValueRef> thisObj = runtimeCallInfo->GetThisRef();
|
||||
auto ptr = static_cast<NG::MeasureLayoutChild*>(panda::Local<panda::ObjectRef>(thisObj)->GetNativePointerField(
|
||||
vm, 0));
|
||||
CHECK_NULL_RETURN(ptr, panda::JSValueRef::Undefined(vm));
|
||||
auto child = ptr->GetOrCreateChild();
|
||||
if (!(child && child->GetLayoutProperty())) {
|
||||
return GenEdgesGlobalized({}, TextDirection::LTR).Get().GetLocalHandle();
|
||||
@ -628,6 +632,7 @@ panda::Local<panda::JSValueRef> ViewMeasureLayout::JSGetBorderWidth(panda::JsiRu
|
||||
Local<JSValueRef> thisObj = runtimeCallInfo->GetThisRef();
|
||||
auto ptr = static_cast<NG::MeasureLayoutChild*>(panda::Local<panda::ObjectRef>(thisObj)->GetNativePointerField(
|
||||
vm, 0));
|
||||
CHECK_NULL_RETURN(ptr, panda::JSValueRef::Undefined(vm));
|
||||
auto child = ptr->GetOrCreateChild();
|
||||
if (!(child && child->GetLayoutProperty())) {
|
||||
return GenBorderWidthGlobalized({}, TextDirection::LTR).Get().GetLocalHandle();
|
||||
|
@ -255,6 +255,7 @@ void LayoutProperty::Clone(RefPtr<LayoutProperty> layoutProperty) const
|
||||
|
||||
void LayoutProperty::UpdateLayoutProperty(const LayoutProperty* layoutProperty)
|
||||
{
|
||||
CHECK_NULL_VOID(layoutProperty);
|
||||
layoutConstraint_ = layoutProperty->layoutConstraint_;
|
||||
if (layoutProperty->gridProperty_) {
|
||||
gridProperty_ = std::make_unique<GridProperty>(*layoutProperty->gridProperty_);
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "napi/native_common.h"
|
||||
#include "napi/native_node_api.h"
|
||||
|
||||
#include "base/utils/utils.h"
|
||||
#include "bridge/common/media_query/media_queryer.h"
|
||||
#include "bridge/common/utils/engine_helper.h"
|
||||
#include "bridge/js_frontend/engine/common/js_engine.h"
|
||||
@ -31,6 +32,7 @@
|
||||
namespace OHOS::Ace::Napi {
|
||||
namespace {
|
||||
constexpr size_t STR_BUFFER_SIZE = 1024;
|
||||
constexpr int32_t TWO_ARGS = 2;
|
||||
}
|
||||
|
||||
using namespace OHOS::Ace::Framework;
|
||||
@ -170,8 +172,10 @@ public:
|
||||
napi_value thisVar = nullptr;
|
||||
napi_value cb = nullptr;
|
||||
size_t argc = ParseArgs(env, info, thisVar, cb);
|
||||
NAPI_ASSERT(env, (argc == 2 && thisVar != nullptr && cb != nullptr), "Invalid arguments");
|
||||
|
||||
if (!(argc == TWO_ARGS && thisVar != nullptr && cb != nullptr)) {
|
||||
napi_close_handle_scope(env, scope);
|
||||
return nullptr;
|
||||
}
|
||||
MediaQueryListener* listener = GetListener(env, thisVar);
|
||||
if (!listener) {
|
||||
napi_close_handle_scope(env, scope);
|
||||
@ -316,6 +320,7 @@ private:
|
||||
{
|
||||
MediaQueryListener* listener = nullptr;
|
||||
napi_unwrap(env, thisVar, (void**)&listener);
|
||||
CHECK_NULL_RETURN(listener, nullptr);
|
||||
listener->Initialize(env, thisVar);
|
||||
return listener;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user