diff --git a/Import/GacUI.h b/Import/GacUI.h index a2ade74a..97880c1f 100644 --- a/Import/GacUI.h +++ b/Import/GacUI.h @@ -2442,6 +2442,16 @@ Native Window Services virtual bool ShowFileDialog(INativeWindow* window, collections::List& selectionFileNames, vint& selectionFilterIndex, FileDialogTypes dialogType, const WString& title, const WString& initialFileName, const WString& initialDirectory, const WString& defaultExtension, const WString& filter, FileDialogOptions options)=0; }; + inline INativeDialogService::FileDialogOptions operator|(INativeDialogService::FileDialogOptions a, INativeDialogService::FileDialogOptions b) + { + return static_cast(static_cast(a) | static_cast(b)); + } + + inline INativeDialogService::FileDialogOptions operator&(INativeDialogService::FileDialogOptions a, INativeDialogService::FileDialogOptions b) + { + return static_cast(static_cast(a) & static_cast(b)); + } + /*********************************************************************** Native Window Controller ***********************************************************************/ diff --git a/Import/GacUICompiler.h b/Import/GacUICompiler.h index 6f447a84..7ffc2888 100644 --- a/Import/GacUICompiler.h +++ b/Import/GacUICompiler.h @@ -1077,6 +1077,17 @@ GuiVrtualTypeInstanceLoader } } + if (!stopControlTemplateTd) + { + auto value = MakePtr(); + value->value.value = L"Cannot find a matched control template to create."; + + auto raiseStat = MakePtr(); + raiseStat->expression = value; + + block->statements.Add(raiseStat); + } + auto member = MakePtr(); member->kind = WfClassMemberKind::Override; member->declaration = funcCreateTemplate; diff --git a/Import/VlppWorkflowCompiler.cpp b/Import/VlppWorkflowCompiler.cpp index ab7c8eab..f3f6d460 100644 --- a/Import/VlppWorkflowCompiler.cpp +++ b/Import/VlppWorkflowCompiler.cpp @@ -14743,18 +14743,18 @@ WfCppConfig case ITypeInfo::RawPtr: return ConvertType(typeInfo->GetElementType()) + L"*"; case ITypeInfo::SharedPtr: - if (typeInfo->GetTypeDescriptor() == description::GetTypeDescriptor()) + if (typeInfo->GetElementType()->GetDecorator() == ITypeInfo::Generic) { - return ConvertType(typeInfo->GetElementType()); - } - else if (typeInfo->GetTypeDescriptor() == description::GetTypeDescriptor()) - { - return ConvertType(typeInfo->GetElementType()); - } - else - { - return L"::vl::Ptr<" + ConvertType(typeInfo->GetElementType()) + L">"; + if (typeInfo->GetTypeDescriptor() == description::GetTypeDescriptor()) + { + return ConvertType(typeInfo->GetElementType()); + } + else if (typeInfo->GetTypeDescriptor() == description::GetTypeDescriptor()) + { + return ConvertType(typeInfo->GetElementType()); + } } + return L"::vl::Ptr<" + ConvertType(typeInfo->GetElementType()) + L">"; case ITypeInfo::Nullable: return L"::vl::Nullable<" + ConvertType(typeInfo->GetElementType()) + L">"; case ITypeInfo::Generic: @@ -16279,7 +16279,7 @@ WfGenerateExpressionVisitor { auto fromType = types[0]; auto toType = types[1]; - ConvertType(config, writer, fromType, toType, writeExpression, true); + ConvertType(config, writer, fromType, toType, writeExpression, false); }); } else @@ -17632,24 +17632,16 @@ WfGenerateExpressionVisitor void Visit(WfInferExpression* node)override { - auto scope = config->manager->nodeScopes[node].Obj(); - auto typeInfo = CreateTypeInfoFromType(scope, node->type); - Call(node->expression, typeInfo.Obj()); + Call(node->expression); } void Visit(WfTypeCastingExpression* node)override { auto scope = config->manager->nodeScopes[node].Obj(); auto typeInfo = CreateTypeInfoFromType(scope, node->type); - if (node->strategy == WfTypeCastingStrategy::Strong) - { - Call(node->expression, typeInfo.Obj()); - } - else - { - auto result = config->manager->expressionResolvings[node->expression.Obj()]; - ConvertType(config, writer, result.type.Obj(), typeInfo.Obj(), [&]() {Call(node->expression); }, false); - } + bool strongCast = node->strategy == WfTypeCastingStrategy::Strong; + auto result = config->manager->expressionResolvings[node->expression.Obj()]; + ConvertType(config, writer, result.type.Obj(), typeInfo.Obj(), [&]() {Call(node->expression); }, strongCast); } void Visit(WfTypeTestingExpression* node)override