Fixed package diagram generation after refactoring class diagram model
This commit is contained in:
@@ -229,8 +229,7 @@ void translation_unit_visitor::process_namespace(
|
|||||||
auto usn = util::split(ctx.config().using_namespace()[0], "::");
|
auto usn = util::split(ctx.config().using_namespace()[0], "::");
|
||||||
|
|
||||||
if (!util::starts_with(usn, package_path)) {
|
if (!util::starts_with(usn, package_path)) {
|
||||||
auto p = std::make_unique<common::model::package>(
|
auto p = std::make_unique<common::model::package>(usn);
|
||||||
util::split(ctx.config().using_namespace()[0], "::"));
|
|
||||||
util::remove_prefix(package_path, usn);
|
util::remove_prefix(package_path, usn);
|
||||||
|
|
||||||
p->set_name(e.name());
|
p->set_name(e.name());
|
||||||
|
|||||||
@@ -98,10 +98,8 @@ void translation_unit_visitor::operator()(const cppast::cpp_entity &file)
|
|||||||
ctx.config().using_namespace()[0], "::");
|
ctx.config().using_namespace()[0], "::");
|
||||||
|
|
||||||
if (!util::starts_with(usn, package_path)) {
|
if (!util::starts_with(usn, package_path)) {
|
||||||
auto p = std::make_unique<package>(
|
auto p = std::make_unique<package>(usn);
|
||||||
ctx.config().using_namespace());
|
|
||||||
util::remove_prefix(package_path, usn);
|
util::remove_prefix(package_path, usn);
|
||||||
util::remove_prefix(package_parent, usn);
|
|
||||||
|
|
||||||
p->set_name(e.name());
|
p->set_name(e.name());
|
||||||
p->set_namespace(package_parent);
|
p->set_namespace(package_parent);
|
||||||
@@ -122,8 +120,8 @@ void translation_unit_visitor::operator()(const cppast::cpp_entity &file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!p->skip()) {
|
if (!p->skip()) {
|
||||||
ctx.diagram().add_element(
|
auto rns = p->get_relative_namespace();
|
||||||
package_parent, std::move(p));
|
ctx.diagram().add_element(rns, std::move(p));
|
||||||
ctx.set_current_package(
|
ctx.set_current_package(
|
||||||
ctx.diagram().get_element<package>(
|
ctx.diagram().get_element<package>(
|
||||||
package_path));
|
package_path));
|
||||||
|
|||||||
Reference in New Issue
Block a user