diff options
author | Christian Lippka <cl@openoffice.org> | 2010-09-17 17:49:45 +0200 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2010-09-17 17:49:45 +0200 |
commit | 9988d9e42d124ab8faed24a63fd6ad1e7d2e3ee9 (patch) | |
tree | 6dba41ae3bdae5cfc9fcdcd76f541f2ab54ddb01 /framework | |
parent | mib19: #163566# do not throw exceptions if window is not available (diff) | |
download | core-9988d9e42d124ab8faed24a63fd6ad1e7d2e3ee9.tar.gz core-9988d9e42d124ab8faed24a63fd6ad1e7d2e3ee9.zip |
mib19: #163566# do not throw exceptions if path settings is not available
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/pathsettings.cxx | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index 5227cb9f302c..8a0040dd0e92 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -243,21 +243,24 @@ void PathSettings::impl_readAll() OUStringList PathSettings::impl_readOldFormat(const ::rtl::OUString& sPath) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_readOldFormat" ); - css::uno::Reference< css::container::XNameAccess > xCfg = fa_getCfgOld(); - css::uno::Any aVal = xCfg->getByName(sPath); + css::uno::Reference< css::container::XNameAccess > xCfg( fa_getCfgOld() ); + OUStringList aPathVal; - ::rtl::OUString sStringVal; - css::uno::Sequence< ::rtl::OUString > lStringListVal; - OUStringList aPathVal; - - if (aVal >>= sStringVal) + if( xCfg->hasByName(sPath) ) { - aPathVal.push_back(sStringVal); - } - else - if (aVal >>= lStringListVal) - { - aPathVal << lStringListVal; + css::uno::Any aVal( xCfg->getByName(sPath) ); + + ::rtl::OUString sStringVal; + css::uno::Sequence< ::rtl::OUString > lStringListVal; + + if (aVal >>= sStringVal) + { + aPathVal.push_back(sStringVal); + } + else if (aVal >>= lStringListVal) + { + aPathVal << lStringListVal; + } } return aPathVal; |