From f22c19c0a47df4c848b40d78c2788da797f33d09 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 4 Feb 2015 09:50:19 +0000 Subject: coverity#1267694 Uncaught exception Change-Id: Idfa32d54ed8af7eda823da2223cbaaf2f396e8d9 --- filter/source/config/cache/filtercache.cxx | 57 ++++++++++++++---------------- filter/source/config/cache/filtercache.hxx | 7 +--- 2 files changed, 28 insertions(+), 36 deletions(-) (limited to 'filter/source') diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index c6da21f3d930..1bbdfc667e14 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -2161,53 +2161,50 @@ void FilterCache::impl_interpretDataVal4Filter(const OUString& sValue, That would be useful to guarantee a consistent cache. -----------------------------------------------*/ void FilterCache::impl_readOldFormat() - throw(css::uno::Exception) { // Attention: Opening/Reading of this old configuration format has to be handled gracefully. // Its optional and should not disturb our normal work! // E.g. we must check, if the package exists ... - - css::uno::Reference< css::container::XNameAccess > xCfg; try { css::uno::Reference< css::uno::XInterface > xInt = impl_openConfig(E_PROVIDER_OLD); - xCfg = css::uno::Reference< css::container::XNameAccess >(xInt, css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::container::XNameAccess > xCfg = + css::uno::Reference< css::container::XNameAccess >(xInt, css::uno::UNO_QUERY_THROW); + + OUString TYPES_SET("Types"); + + // May be there is no type set ... + if (xCfg->hasByName(TYPES_SET)) + { + css::uno::Reference< css::container::XNameAccess > xSet; + xCfg->getByName(TYPES_SET) >>= xSet; + const css::uno::Sequence< OUString > lItems = xSet->getElementNames(); + const OUString* pItems = lItems.getConstArray(); + for (sal_Int32 i=0; ihasByName(FILTER_SET)) + { + css::uno::Reference< css::container::XNameAccess > xSet; + xCfg->getByName(FILTER_SET) >>= xSet; + const css::uno::Sequence< OUString > lItems = xSet->getElementNames(); + const OUString* pItems = lItems.getConstArray(); + for (sal_Int32 i=0; ihasByName(TYPES_SET)) - { - css::uno::Reference< css::container::XNameAccess > xSet; - xCfg->getByName(TYPES_SET) >>= xSet; - const css::uno::Sequence< OUString > lItems = xSet->getElementNames(); - const OUString* pItems = lItems.getConstArray(); - for (sal_Int32 i=0; ihasByName(FILTER_SET)) { - css::uno::Reference< css::container::XNameAccess > xSet; - xCfg->getByName(FILTER_SET) >>= xSet; - const css::uno::Sequence< OUString > lItems = xSet->getElementNames(); - const OUString* pItems = lItems.getConstArray(); - for (sal_Int32 i=0; i& xSet , EItemType eType, const OUString& sItem) diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx index 1c3d998fc0d2..59339eb88e4c 100644 --- a/filter/source/config/cache/filtercache.hxx +++ b/filter/source/config/cache/filtercache.hxx @@ -905,13 +905,8 @@ class FilterCache : public BaseLock const CacheItem& rItem) throw(css::uno::Exception); - - /** TODO */ - void impl_readOldFormat() - throw(css::uno::Exception); - - + void impl_readOldFormat(); /** TODO */ CacheItem impl_readOldItem(const css::uno::Reference< css::container::XNameAccess >& xSet , -- cgit