summaryrefslogtreecommitdiff
path: root/configmgr/source/components.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-07-01 16:19:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-07-02 15:35:20 +0200
commit824adeee90e9bb0d3398cdf04b5bb5c96afdd021 (patch)
tree7ce38f304d40c6a2ba991f0f05b00273e9a9b8dd /configmgr/source/components.cxx
parent94032236ba65c00ba29498a0dded42fa2f60b198 (diff)
Minor clean up
Change-Id: I7be5bf1319ac927ffb746d47f9e0d596284e2283
Diffstat (limited to 'configmgr/source/components.cxx')
-rw-r--r--configmgr/source/components.cxx52
1 files changed, 23 insertions, 29 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 5c585ec5b69a..dc0c4be5a4e7 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <config_folders.h>
-
#include <sal/config.h>
#include <algorithm>
@@ -38,6 +36,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/XInterface.hpp>
+#include <config_folders.h>
#include <osl/conditn.hxx>
#include <osl/file.hxx>
#include <osl/mutex.hxx>
@@ -64,7 +63,8 @@
#include "xcdparser.hxx"
#include "xcuparser.hxx"
#include "xcsparser.hxx"
-#ifdef WNT
+
+#if defined WNT
#include "winreg.hxx"
#endif
@@ -490,16 +490,15 @@ Components::Components(
}
OUString type(conf.copy(i, c - i));
OUString url(conf.copy(c + 1, n - c - 1));
- if ( type == "xcsxcu" ) {
+ if (type == "xcsxcu") {
sal_uInt32 nStartTime = osl_getGlobalTimer();
parseXcsXcuLayer(layer, url);
SAL_INFO("configmgr", "parseXcsXcuLayer() took " << (osl_getGlobalTimer() - nStartTime) << " ms");
layer += 2; //TODO: overflow
- } else if ( type == "bundledext" )
- {
+ } else if (type == "bundledext") {
parseXcsXcuIniLayer(layer, url, false);
layer += 2; //TODO: overflow
- } else if ( type == "sharedext" ) {
+ } else if (type == "sharedext") {
if (sharedExtensionLayer_ != -1) {
throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: multiple \"sharedext\" layers");
@@ -507,7 +506,7 @@ Components::Components(
sharedExtensionLayer_ = layer;
parseXcsXcuIniLayer(layer, url, true);
layer += 2; //TODO: overflow
- } else if ( type == "userext" ) {
+ } else if (type == "userext") {
if (userExtensionLayer_ != -1) {
throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: multiple \"userext\" layers");
@@ -515,40 +514,35 @@ Components::Components(
userExtensionLayer_ = layer;
parseXcsXcuIniLayer(layer, url, true);
layer += 2; //TODO: overflow
- } else if ( type == "module" ) {
+ } else if (type == "module") {
parseModuleLayer(layer, url);
++layer; //TODO: overflow
- } else if ( type == "res" ) {
+ } else if (type == "res") {
sal_uInt32 nStartTime = osl_getGlobalTimer();
parseResLayer(layer, url);
SAL_INFO("configmgr", "parseResLayer() took " << (osl_getGlobalTimer() - nStartTime) << " ms");
++layer; //TODO: overflow
- } else if ( type == "user" ) {
- if (url.isEmpty()) {
- throw css::uno::RuntimeException(
- "CONFIGURATION_LAYERS: empty \"user\" URL");
- }
- modificationFileUrl_ = url;
- parseModificationLayer(url);
- }
-#ifdef WNT
- else if ( type == "winreg" )
- {
+#if defined WNT
+ } else if (type == "winreg") {
if (!url.isEmpty()) {
- SAL_WARN(
- "configmgr",
- "winreg URL is not empty, URL handling is not implemented for winreg");
+ throw css::uno::RuntimeException(
+ "CONFIGURATION_LAYERS: non-empty \"winreg\" URL");
}
OUString aTempFileURL;
- if ( dumpWindowsRegistry(&aTempFileURL) )
- {
+ if (dumpWindowsRegistry(&aTempFileURL)) {
parseFileLeniently(&parseXcuFile, aTempFileURL, layer, 0, 0, 0);
- layer++;
osl::File::remove(aTempFileURL);
}
- }
+ ++layer; //TODO: overflow
#endif
- else {
+ } else if (type == "user") {
+ if (url.isEmpty()) {
+ throw css::uno::RuntimeException(
+ "CONFIGURATION_LAYERS: empty \"user\" URL");
+ }
+ modificationFileUrl_ = url;
+ parseModificationLayer(url);
+ } else {
throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: unknown layer type \"" + type + "\"");
}