[Uml-devel] kdesdk/umbrello/umbrello/codegenerators
Brian Thomas
thomas at mail630.gsfc.nasa.gov
Thu Dec 4 09:53:01 UTC 2003
CVS commit by thomas:
small tweak from prior bug fix to Java generator : it appears desirable to have some codeblocks be hidden instead of just empty for certain conditions
M +10 -2 cppheadercodedocument.cpp 1.15
M +5 -1 cppsourcecodedocument.cpp 1.11
M +1 -1 javacodeclassfield.cpp 1.7
--- kdesdk/umbrello/umbrello/codegenerators/cppheadercodedocument.cpp #1.14:1.15
@@ -455,5 +455,9 @@ void CPPHeaderCodeDocument::updateConten
}
// now, add/update the includes codeblock
- addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, "", 0, false);
+ CodeBlockWithComments * inclBlock = addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, "", 0, false);
+ if(includeStatement.isEmpty() && inclBlock->getContentType() == CodeBlock::AutoGenerated)
+ inclBlock->setWriteOutText(false);
+ else
+ inclBlock->setWriteOutText(true);
// Using
@@ -464,5 +468,9 @@ void CPPHeaderCodeDocument::updateConten
}
}
- addOrUpdateTaggedCodeBlockWithComments("using", usingStatement, "", 0, false);
+ CodeBlockWithComments * usingBlock = addOrUpdateTaggedCodeBlockWithComments("using", usingStatement, "", 0, false);
+ if(usingStatement.isEmpty() && usingBlock->getContentType() == CodeBlock::AutoGenerated)
+ usingBlock->setWriteOutText(false);
+ else
+ usingBlock->setWriteOutText(true);
// namespace
--- kdesdk/umbrello/umbrello/codegenerators/cppsourcecodedocument.cpp #1.10:1.11
@@ -208,5 +208,9 @@ void CPPSourceCodeDocument::updateConten
}
// now, add/update the includes codeblock
- addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, "", 0, false);
+ CodeBlockWithComments * iblock = addOrUpdateTaggedCodeBlockWithComments("includes", includeStatement, "", 0, false);
+ if(includeStatement.isEmpty() && iblock->getContentType() == CodeBlock::AutoGenerated)
+ iblock->setWriteOutText(false);
+ else
+ iblock->setWriteOutText(true);
// After the includes we have just 2 big blocks basically, the "constructor" block and the
--- kdesdk/umbrello/umbrello/codegenerators/javacodeclassfield.cpp #1.6:1.7
@@ -93,5 +93,5 @@ QString JavaCodeClassField::getInitialVa
// FIX : IF the multiplicity is "1" then we should init a new object here, if its 0 or 1,
// then we can just return 'empty' string (minor problem).
- return "";
+ return QString("");
} else {
return " new "+getListFieldClassName()+"( )";
More information about the umbrello-devel
mailing list