summaryrefslogtreecommitdiff
path: root/unoidl/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-08 14:04:08 +0200
committerNoel Grandin <noel@peralex.com>2015-04-09 08:41:11 +0200
commit7b4ca582fcfd77b20eea5a11bd0e87b39d640e91 (patch)
tree3065c665ba7250d47bc41e4e46ec453192ab0fd0 /unoidl/source
parent95600edeaf48a80a1e84c44b37f4035bc4db3070 (diff)
convert RegError to scoped enum
Change-Id: I55977c38578cb59deb195d91f8948da2e0905b6a
Diffstat (limited to 'unoidl/source')
-rw-r--r--unoidl/source/legacyprovider.cxx44
1 files changed, 22 insertions, 22 deletions
diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
index e7bd73b17647..db042069ef86 100644
--- a/unoidl/source/legacyprovider.cxx
+++ b/unoidl/source/legacyprovider.cxx
@@ -103,11 +103,11 @@ Cursor::Cursor(
prefix_ += "/";
}
RegError e = key_.getKeyNames("", names_);
- if (e != REG_NO_ERROR) {
+ if (e != RegError::NO_ERROR) {
throw FileFormatException(
key_.getRegistryName(),
("legacy format: cannot get sub-key names of " + key_.getName()
- + ": " + OUString::number(e)));
+ + ": " + OUString::number(static_cast<int>(e))));
}
}
}
@@ -150,11 +150,11 @@ private:
std::vector< OUString > Module::getMemberNames() const {
RegistryKeyNames names;
RegError e = key_.getKeyNames("", names);
- if (e != REG_NO_ERROR) {
+ if (e != RegError::NO_ERROR) {
throw FileFormatException(
key_.getRegistryName(),
("legacy format: cannot get sub-key names of " + key_.getName()
- + ": " + OUString::number(e)));
+ + ": " + OUString::number(static_cast<int>(e))));
}
std::vector< OUString > ns;
for (sal_uInt32 i = 0; i != names.getLength(); ++i) {
@@ -168,11 +168,11 @@ typereg::Reader getReader(RegistryKey & key, std::vector< char > * buffer) {
RegValueType type;
sal_uInt32 size;
RegError e = key.getValueInfo("", &type, &size);
- if (e != REG_NO_ERROR) {
+ if (e != RegError::NO_ERROR) {
throw FileFormatException(
key.getRegistryName(),
("legacy format: cannot get value info about key " + key.getName()
- + ": " + OUString::number(e)));
+ + ": " + OUString::number(static_cast<int>(e))));
}
if (type != RegValueType::BINARY) {
throw FileFormatException(
@@ -190,11 +190,11 @@ typereg::Reader getReader(RegistryKey & key, std::vector< char > * buffer) {
}
buffer->resize(static_cast< std::vector< char >::size_type >(size));
e = key.getValue("", &(*buffer)[0]);
- if (e != REG_NO_ERROR) {
+ if (e != RegError::NO_ERROR) {
throw FileFormatException(
key.getRegistryName(),
("legacy format: cannot get binary value of key " + key.getName()
- + ": " + OUString::number(e)));
+ + ": " + OUString::number(static_cast<int>(e))));
}
typereg::Reader reader(&(*buffer)[0], size, false, TYPEREG_VERSION_1);
if (!reader.isValid()) {
@@ -213,9 +213,9 @@ rtl::Reference< Entity > readEntity(
RegistryKey sub;
RegError e = key.openKey(path, sub);
switch (e) {
- case REG_NO_ERROR:
+ case RegError::NO_ERROR:
break;
- case REG_KEY_NOT_EXISTS:
+ case RegError::KEY_NOT_EXISTS:
if (probe) {
return rtl::Reference< Entity >();
}
@@ -224,7 +224,7 @@ rtl::Reference< Entity > readEntity(
throw FileFormatException(
key.getRegistryName(),
("legacy format: cannot open sub-key " + path + " of "
- + key.getName() + ": " + OUString::number(e)));
+ + key.getName() + ": " + OUString::number(static_cast<int>(e))));
}
std::vector< char > buf;
typereg::Reader reader(getReader(sub, &buf));
@@ -725,9 +725,9 @@ rtl::Reference< Entity > readEntity(
RegistryKey key2;
e = ucr.openKey(basePath, key2);
switch (e) {
- case REG_NO_ERROR:
+ case RegError::NO_ERROR:
break;
- case REG_KEY_NOT_EXISTS:
+ case RegError::KEY_NOT_EXISTS:
throw FileFormatException(
key.getRegistryName(),
("legacy format: unknown super-type " + basePath
@@ -736,7 +736,7 @@ rtl::Reference< Entity > readEntity(
throw FileFormatException(
key.getRegistryName(),
("legacy format: cannot open ucr sub-key " + basePath
- + ": " + OUString::number(e)));
+ + ": " + OUString::number(static_cast<int>(e))));
}
std::vector< char > buf2;
typereg::Reader reader2(getReader(key2, &buf2));
@@ -798,28 +798,28 @@ LegacyProvider::LegacyProvider(Manager & manager, OUString const & uri):
Registry reg;
RegError e = reg.open(uri, RegAccessMode::READONLY);
switch (e) {
- case REG_NO_ERROR:
+ case RegError::NO_ERROR:
break;
- case REG_REGISTRY_NOT_EXISTS:
+ case RegError::REGISTRY_NOT_EXISTS:
throw NoSuchFileException(uri);
default:
throw FileFormatException(
- uri, "cannot open legacy file: " + OUString::number(e));
+ uri, "cannot open legacy file: " + OUString::number(static_cast<int>(e)));
}
RegistryKey root;
e = reg.openRootKey(root);
- if (e != REG_NO_ERROR) {
+ if (e != RegError::NO_ERROR) {
throw FileFormatException(
- uri, "legacy format: cannot open root key: " + OUString::number(e));
+ uri, "legacy format: cannot open root key: " + OUString::number(static_cast<int>(e)));
}
e = root.openKey("UCR", ucr_);
switch (e) {
- case REG_NO_ERROR:
- case REG_KEY_NOT_EXISTS: // such effectively empty files exist in the wild
+ case RegError::NO_ERROR:
+ case RegError::KEY_NOT_EXISTS: // such effectively empty files exist in the wild
break;
default:
throw FileFormatException(
- uri, "legacy format: cannot open UCR key: " + OUString::number(e));
+ uri, "legacy format: cannot open UCR key: " + OUString::number(static_cast<int>(e)));
}
}