diff options
author | Michi Henning <michi@zeroc.com> | 2007-09-24 17:20:15 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-09-24 17:25:53 +1000 |
commit | bc0bc51721c9a7d863561418e1eb022eb2c80799 (patch) | |
tree | f7bd97af366e9c52b011676d588df218abc1b18b /cpp/src/Slice/CsUtil.cpp | |
parent | Ice.Admin.DelayCreation fixes (diff) | |
download | ice-bc0bc51721c9a7d863561418e1eb022eb2c80799.tar.bz2 ice-bc0bc51721c9a7d863561418e1eb022eb2c80799.tar.xz ice-bc0bc51721c9a7d863561418e1eb022eb2c80799.zip |
Fixed bug 2473 and
http://www.zeroc.com/forums/bug-reports/3395-c-nested-struct-unmarshalling-problem.html#post14910
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rwxr-xr-x | cpp/src/Slice/CsUtil.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index 6db9f79c216..9a515839e42 100755 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -130,6 +130,21 @@ Slice::CsGenerator::fixId(const string& name, int baseTypes, bool mangleCasts) } string +Slice::CsGenerator::fixId(const ContainedPtr& cont, int baseTypes, bool mangleCasts) +{ + ContainerPtr container = cont->container(); + ContainedPtr contained = ContainedPtr::dynamicCast(container); + if(contained && contained->hasMetaData("clr:property")) + { + return cont->name() + "_prop"; + } + else + { + return fixId(cont->name(), baseTypes, mangleCasts); + } +} + +string Slice::CsGenerator::typeToString(const TypePtr& type) { if(!type) @@ -519,7 +534,10 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, else { string typeS = typeToString(type); - out << nl << param << " = new " << typeS << "();"; + if(param.size() < 6 || param.substr(param.size() - 5) != "_prop") + { + out << nl << param << " = new " << typeS << "();"; + } if(streamingAPI) { out << nl << param << ".ice_read(" << stream << ");"; |