Kaydet (Commit) 1dc1eaad authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix unoidl sourceprovider old-style service duplicate member checks

Change-Id: Ifa19a427543e76053e9b249c479e1e13f3599bcc
üst fee37966
...@@ -2673,9 +2673,21 @@ serviceBase: ...@@ -2673,9 +2673,21 @@ serviceBase:
+ " direct base service " + name + " is unpublished")); + " direct base service " + name + " is unpublished"));
YYERROR; YYERROR;
} }
//TODO: check uniqueness std::vector<unoidl::AnnotatedReference> & v(
(opt ? pad->directOptionalBaseServices : pad->directMandatoryBaseServices) opt
.push_back(unoidl::AnnotatedReference(name, annotations($1))); ? pad->directOptionalBaseServices : pad->directMandatoryBaseServices);
for (std::vector<unoidl::AnnotatedReference>::iterator i(v.begin());
i != v.end(); ++i)
{
if (name == i->name) {
error(
@4, yyscanner,
("accumulation-based service " + data->currentName
+ " duplicate direct base service " + name));
YYERROR;
}
}
v.push_back(unoidl::AnnotatedReference(name, annotations($1)));
} }
; ;
...@@ -2734,16 +2746,27 @@ serviceInterfaceBase: ...@@ -2734,16 +2746,27 @@ serviceInterfaceBase:
} }
if (data->publishedContext && !opt && !pubBase) { if (data->publishedContext && !opt && !pubBase) {
error( error(
@5, yyscanner, @4, yyscanner,
("published accumulation-based service " + data->currentName ("published accumulation-based service " + data->currentName
+ " direct base interface " + name + " is unpublished")); + " direct base interface " + name + " is unpublished"));
YYERROR; YYERROR;
} }
//TODO: check uniqueness std::vector<unoidl::AnnotatedReference> & v(
(opt opt
? pad->directOptionalBaseInterfaces ? pad->directOptionalBaseInterfaces
: pad->directMandatoryBaseInterfaces) : pad->directMandatoryBaseInterfaces);
.push_back(unoidl::AnnotatedReference(name, annotations($1))); for (std::vector<unoidl::AnnotatedReference>::iterator i(v.begin());
i != v.end(); ++i)
{
if (name == i->name) {
error(
@4, yyscanner,
("accumulation-based service " + data->currentName
+ " duplicate direct base interface " + name));
YYERROR;
}
}
v.push_back(unoidl::AnnotatedReference(name, annotations($1)));
} }
; ;
...@@ -2812,7 +2835,7 @@ serviceProperty: ...@@ -2812,7 +2835,7 @@ serviceProperty:
error( error(
@3, yyscanner, @3, yyscanner,
("illegal accumulation-based service " + data->currentName ("illegal accumulation-based service " + data->currentName
+ " direct attribute " + id + " type")); + " direct property " + id + " type"));
YYERROR; YYERROR;
break; break;
default: default:
...@@ -2821,7 +2844,18 @@ serviceProperty: ...@@ -2821,7 +2844,18 @@ serviceProperty:
rtl::Reference<unoidl::detail::SourceProviderAccumulationBasedServiceEntityPad> rtl::Reference<unoidl::detail::SourceProviderAccumulationBasedServiceEntityPad>
pad(getCurrentPad<unoidl::detail::SourceProviderAccumulationBasedServiceEntityPad>( pad(getCurrentPad<unoidl::detail::SourceProviderAccumulationBasedServiceEntityPad>(
data)); data));
//TODO: check uniqueness for (std::vector<unoidl::AccumulationBasedServiceEntity::Property>::iterator
i(pad->directProperties.begin());
i != pad->directProperties.end(); ++i)
{
if (id == i->name) {
error(
@4, yyscanner,
("accumulation-based service " + data->currentName
+ " duplicate direct property " + id));
YYERROR;
}
}
pad->directProperties.push_back( pad->directProperties.push_back(
unoidl::AccumulationBasedServiceEntity::Property( unoidl::AccumulationBasedServiceEntity::Property(
id, t.getName(), id, t.getName(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment