summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2010-09-24 15:29:31 +0200
committerKurt Zenker <kz@openoffice.org>2010-09-24 15:29:31 +0200
commit4ad5d2ff2763a17d0ab7eebe735add9dcf12aa46 (patch)
treeaed9903592221c82a94158f259494897ff61f809
parent0826f6744d05e0966704b17cdb4ad6b344251f71 (diff)
parent3d4502d95a77e80087bc0711e637abd8a791f9e1 (diff)
CWS-TOOLING: integrate CWS fwk158ooo/OOO330_m9
-rw-r--r--configmgr/source/components.cxx45
-rw-r--r--configmgr/source/components.hxx5
2 files changed, 36 insertions, 14 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 33b0eca3f6..cc5ea1e1e7 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -334,12 +334,14 @@ void Components::insertModificationXcuFile(
Modifications * modifications)
{
OSL_ASSERT(modifications != 0);
+ Partial part(includedPaths, excludedPaths);
try {
- Partial part(includedPaths, excludedPaths);
- parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications, 0);
- } catch (css::uno::Exception & e) { //TODO: more specific exception catching
+ parseFileLeniently(
+ &parseXcuFile, fileUri, Data::NO_LAYER, data_, &part, modifications,
+ 0);
+ } catch (css::container::NoSuchElementException & e) {
OSL_TRACE(
- "configmgr error inserting %s: %s",
+ "configmgr error inserting non-existing %s: %s",
rtl::OUStringToOString(fileUri, RTL_TEXTENCODING_UTF8).getStr(),
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
}
@@ -492,20 +494,32 @@ Components::Components(
"com.sun.star.comp.deployment.configuration."
"PackageRegistryBackend/configmgr.ini"))),
true);
+ parseModificationLayer();
+ RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing");
+}
+
+Components::~Components() {}
+
+void Components::parseFileLeniently(
+ FileParser * parseFile, rtl::OUString const & url, int layer, Data & data,
+ Partial const * partial, Modifications * modifications,
+ Additions * additions)
+{
+ OSL_ASSERT(parseFile != 0);
try {
- parseModificationLayer();
+ (*parseFile)(url, layer, data, partial, modifications, additions);
+ } catch (css::container::NoSuchElementException &) {
+ throw;
} catch (css::uno::Exception & e) { //TODO: more specific exception catching
- // Silently ignore unreadable parts of a corrupted user modification
- // layer, instead of completely preventing OOo from starting:
+ // Silently ignore invalid XML files, instead of completely preventing
+ // OOo from starting:
OSL_TRACE(
- "configmgr error reading user modification layer: %s",
+ "configmgr error reading %s: %s",
+ rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr(),
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
}
- RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing");
}
-Components::~Components() {}
-
void Components::parseFiles(
int layer, rtl::OUString const & extension, FileParser * parseFile,
rtl::OUString const & url, bool recursive)
@@ -557,7 +571,8 @@ void Components::parseFiles(
file.match(extension, file.getLength() - extension.getLength()))
{
try {
- (*parseFile)(stat.getFileURL(), layer, data_, 0, 0, 0);
+ parseFileLeniently(
+ parseFile, stat.getFileURL(), layer, data_, 0, 0, 0);
} catch (css::container::NoSuchElementException & e) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -584,7 +599,7 @@ void Components::parseFileList(
adds = data_.addExtensionXcuAdditions(url, layer);
}
try {
- (*parseFile)(url, layer, data_, 0, 0, adds);
+ parseFileLeniently(parseFile, url, layer, data_, 0, 0, adds);
} catch (css::container::NoSuchElementException & e) {
OSL_TRACE(
"configmgr file does not exist: %s",
@@ -746,7 +761,9 @@ rtl::OUString Components::getModificationFileUrl() const {
void Components::parseModificationLayer() {
try {
- parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0, 0);
+ parseFileLeniently(
+ &parseXcuFile, getModificationFileUrl(), Data::NO_LAYER, data_, 0,
+ 0, 0);
} catch (css::container::NoSuchElementException &) {
OSL_TRACE(
"configmgr user registrymodifications.xcu does not (yet) exist");
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 880ac95d34..4fc47f7918 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -123,6 +123,11 @@ private:
~Components();
+ void parseFileLeniently(
+ FileParser * parseFile, rtl::OUString const & url, int layer,
+ Data & data, Partial const * partial, Modifications * modifications,
+ Additions * additions);
+
void parseFiles(
int layer, rtl::OUString const & extension, FileParser * parseFile,
rtl::OUString const & url, bool recursive);