diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-02-28 14:05:36 +0100 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-02-28 16:01:38 +0100 |
commit | 741f88c9ec38becafba48477abbcfd500fcdc8e1 (patch) | |
tree | 1d7138219ca1e469b6a372aab032b2bd6e4dbf6e /unoidl | |
parent | 1037edf4ec9bd2d17b2b39aab47a162b17335b96 (diff) |
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 <stephan.bergmann@allotropia.de>
Diffstat (limited to 'unoidl')
-rw-r--r-- | unoidl/source/sourcetreeprovider.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
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); |