summaryrefslogtreecommitdiff
path: root/unoidl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-18 10:47:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-18 11:36:26 +0200
commitdcff0c200f25e8f2906901708841d1f680e8cc63 (patch)
tree67edc7721db6682cc41516c931de905e2dc0e75b /unoidl
parent1e6dc8e4f746662ed5d1e750019b41b7d3644e5b (diff)
unoidl-read: Avoid redundant redeclarations
...of interfaces for which such a forward declaration has already been emitted. Update the reference rdbs accordingly with LD_LIBRARY_PATH=.../master/instdir/program \ .../master/workdir/LinkTarget/Executable/unoidl-read --published \ .../libreoffice-7.0.0.3/instdir/program/types.rdb \ >.../master/udkapi/type_reference/udkapi.idl LD_LIBRARY_PATH=.../master/instdir/program \ .../master/workdir/LinkTarget/Executable/unoidl-read --published \ .../libreoffice-7.0.0.3/instdir/program/types.rdb \ .../libreoffice-7.0.0.3/instdir/program/types/offapi.rdb \ >.../master/offapi/type_reference/offapi.idl Change-Id: I7448ae44d479a8c622f6f534abe6087ce8a8ea32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100896 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unoidl')
-rw-r--r--unoidl/source/unoidl-read.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx
index 2cd44aceefa5..2b733c0f6f31 100644
--- a/unoidl/source/unoidl-read.cxx
+++ b/unoidl/source/unoidl-read.cxx
@@ -135,11 +135,12 @@ OUString decomposeType(
struct Entity {
enum class Sorted { NO, ACTIVE, YES };
+ enum class Written { NO, DECLARATION, DEFINITION };
explicit Entity(
rtl::Reference<unoidl::Entity> const & theEntity, bool theRelevant):
entity(theEntity), relevant(theRelevant), sorted(Sorted::NO),
- written(false)
+ written(Written::NO)
{}
rtl::Reference<unoidl::Entity> const entity;
@@ -147,7 +148,7 @@ struct Entity {
std::set<OUString> interfaceDependencies;
bool relevant;
Sorted sorted;
- bool written;
+ Written written;
};
void insertEntityDependency(
@@ -549,11 +550,12 @@ void writeEntity(
{
std::map<OUString, Entity>::iterator i(entities.find(name));
if (i != entities.end() && i->second.relevant) {
- assert(!i->second.written);
- i->second.written = true;
+ assert(i->second.written != Entity::Written::DEFINITION);
+ i->second.written = Entity::Written::DEFINITION;
for (auto & j: i->second.interfaceDependencies) {
std::map<OUString, Entity>::iterator k(entities.find(j));
- if (k != entities.end() && !k->second.written) {
+ if (k != entities.end() && k->second.written == Entity::Written::NO) {
+ k->second.written = Entity::Written::DECLARATION;
OUString id(openModulesFor(modules, j));
if (k->second.entity->getSort()
!= unoidl::Entity::SORT_INTERFACE_TYPE)