Fixed generation of empty packages in class diagrams (Fixes #253)

This commit is contained in:
Bartek Kryza 2024-05-03 22:15:47 +02:00
parent bf119aff74
commit f1677193ba
No known key found for this signature in database
GPG Key ID: 241B25F44E85B4D7
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# CHANGELOG
* Fixed generation of empty packages in class diagrams (#253)
* Added option inline_lambda_messages to omit lambda expressions from sequence
diagrams (#261)
* Added support for CUDA calls in sequence diagrams (#263)

View File

@ -724,7 +724,10 @@ void generator::generate(const package &p, std::ostream &ostr) const
if (dynamic_cast<package *>(subpackage.get()) != nullptr) {
// TODO: add option - generate_empty_packages
const auto &sp = dynamic_cast<package &>(*subpackage);
if (!sp.is_empty()) {
if (!sp.is_empty() &&
!sp.all_of([this](const common::model::element &e) {
return !model().should_include(e);
})) {
together_group_stack_.enter();
generate(sp, ostr);