unoidl/source/sourcetreeprovider.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 741f88c9ec38becafba48477abbcfd500fcdc8e1 Author: Stephan Bergmann <[email protected]> AuthorDate: Wed Feb 28 14:05:36 2024 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Wed Feb 28 16:01:38 2024 +0100 Some improvements to the UNOIDL SourceTreeProvider Trying to do $ instdir/sdk/bin/unoidl-read udkapi (i.e., parsing the udkapi/com/sun/star/**.idl tree and printing it out): first failed with > Bad input <file:///.../udkapi/com/sun/star/beans/theIntrospection.idl>: source file defines more than one entity because of its > published interface XIntrospection; forward declaration, so ignore such interface forward declarations; then failed with > Bad input <file:///.../udkapi/com/sun/star/modules.idl>: source file defines no entity because "this file contains documentation of the modules", so ignore such effectively empty files; then failed with > Bad input <file:///.../udkapi/type_reference/udkapi.idl>: source file defines more than one entity so instead do $ mkdir TMP $ cp -r udkapi/com TMP/ $ instdir/sdk/bin/unoidl-read TMP $ rm -r TMP which succeeded. Change-Id: I465052539b474733e7945b312c996af27a034335 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164094 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/unoidl/source/sourcetreeprovider.cxx b/unoidl/source/sourcetreeprovider.cxx index 629e50fbf8f3..852a5a9bb30d 100644 --- a/unoidl/source/sourcetreeprovider.cxx +++ b/unoidl/source/sourcetreeprovider.cxx @@ -195,8 +195,7 @@ rtl::Reference<Entity> Cursor::getNext(OUString * name) { } auto ent = data.entities.end(); for (auto j = data.entities.begin(); j != data.entities.end(); ++j) { - if (j->second.kind == SourceProviderEntity::KIND_EXTERNAL - || j->second.kind == SourceProviderEntity::KIND_MODULE) + if (j->second.kind != SourceProviderEntity::KIND_LOCAL) { continue; } @@ -207,8 +206,10 @@ rtl::Reference<Entity> Cursor::getNext(OUString * name) { ent = j; } if (ent == data.entities.end()) { - throw FileFormatException( - stat.getFileURL(), "source file defines no entity"); + SAL_INFO( + "unoidl", + "source file <" << stat.getFileURL() << "> defines no entity"); + continue; } //TODO: Check that the entity's name matches the suffix of stat.getFileURL(): *name = ent->first.copy(ent->first.lastIndexOf('.') + 1);
