summaryrefslogtreecommitdiff
path: root/unoidl
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-03-26 13:35:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-26 18:02:19 +0100
commitb624b13b3d5a8e573c7de8158cadc66b1982d157 (patch)
tree56948e6a5e8d7f5a7cbde6328a27f13ecd8a72bc /unoidl
parent8136620ff432bf17815bef1f88c7531edb839d23 (diff)
loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoidl')
-rw-r--r--unoidl/source/legacyprovider.cxx25
-rw-r--r--unoidl/source/unoidl-write.cxx45
2 files changed, 36 insertions, 34 deletions
diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index a5062cdeb8d0..cadd1b855b31 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -96,18 +96,19 @@ Cursor::Cursor(
RegistryKey const & key):
manager_(manager), ucr_(ucr), key_(key), index_(0)
{
- if (ucr_.isValid()) {
- prefix_ = key_.getName();
- if (!prefix_.endsWith("/")) {
- prefix_ += "/";
- }
- RegError e = key_.getKeyNames("", names_);
- if (e != RegError::NO_ERROR) {
- throw FileFormatException(
- key_.getRegistryName(),
- ("legacy format: cannot get sub-key names of " + key_.getName()
- + ": " + OUString::number(static_cast<int>(e))));
- }
+ if (!ucr_.isValid())
+ return;
+
+ prefix_ = key_.getName();
+ if (!prefix_.endsWith("/")) {
+ prefix_ += "/";
+ }
+ RegError e = key_.getKeyNames("", names_);
+ if (e != RegError::NO_ERROR) {
+ throw FileFormatException(
+ key_.getRegistryName(),
+ ("legacy format: cannot get sub-key names of " + key_.getName()
+ + ": " + OUString::number(static_cast<int>(e))));
}
}
diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx
index 8ffcaa040d7d..b0fbc31e5023 100644
--- a/unoidl/source/unoidl-write.cxx
+++ b/unoidl/source/unoidl-write.cxx
@@ -419,28 +419,29 @@ void mapCursor(
rtl::Reference< unoidl::MapCursor > const & cursor,
std::map< OUString, Item > & map)
{
- if (cursor.is()) {
- for (;;) {
- OUString name;
- rtl::Reference< unoidl::Entity > ent(cursor->getNext(&name));
- if (!ent.is()) {
- break;
- }
- std::pair< std::map< OUString, Item >::iterator, bool > i(
- map.insert(std::make_pair(name, Item(ent))));
- if (!i.second) {
- std::cout << "Duplicate name \"" << name << '"' << std::endl;
- std::exit(EXIT_FAILURE);
- }
- if (i.first->second.entity->getSort()
- == unoidl::Entity::SORT_MODULE)
- {
- mapCursor(
- rtl::Reference< unoidl::ModuleEntity >(
- static_cast< unoidl::ModuleEntity * >(
- i.first->second.entity.get()))->createCursor(),
- i.first->second.module);
- }
+ if (!cursor.is())
+ return;
+
+ for (;;) {
+ OUString name;
+ rtl::Reference< unoidl::Entity > ent(cursor->getNext(&name));
+ if (!ent.is()) {
+ break;
+ }
+ std::pair< std::map< OUString, Item >::iterator, bool > i(
+ map.insert(std::make_pair(name, Item(ent))));
+ if (!i.second) {
+ std::cout << "Duplicate name \"" << name << '"' << std::endl;
+ std::exit(EXIT_FAILURE);
+ }
+ if (i.first->second.entity->getSort()
+ == unoidl::Entity::SORT_MODULE)
+ {
+ mapCursor(
+ rtl::Reference< unoidl::ModuleEntity >(
+ static_cast< unoidl::ModuleEntity * >(
+ i.first->second.entity.get()))->createCursor(),
+ i.first->second.module);
}
}
}