From a360d5901565fe498cc932023dc8e37e92dc3ad5 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 14 May 2012 14:48:00 +0200 Subject: [PATCH] hide progress bar even if loading failed Change-Id: Ia330e70e393309dbbad025fc2ede8f4ab41a674c --- writerfilter/source/filter/RtfFilter.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx index 0f37279b94dd..7e862c8ed835 100644 --- a/writerfilter/source/filter/RtfFilter.cxx +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -69,6 +69,9 @@ sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescri return xFltr->filter(aDescriptor); } + sal_Bool bResult(sal_False); + uno::Reference xStatusIndicator; + try { MediaDescriptor aMediaDesc( aDescriptor ); @@ -89,7 +92,7 @@ sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescri uno::Reference xFrame = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_FRAME(), uno::Reference()); - uno::Reference xStatusIndicator = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_STATUSINDICATOR(), + xStatusIndicator = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_STATUSINDICATOR(), uno::Reference()); writerfilter::Stream::Pointer_t pStream( @@ -97,20 +100,21 @@ sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescri writerfilter::rtftok::RTFDocument::Pointer_t const pDocument( writerfilter::rtftok::RTFDocumentFactory::createDocument(m_xContext, xInputStream, m_xDstDoc, xFrame, xStatusIndicator)); pDocument->resolve(*pStream); + bResult = sal_True; #ifdef DEBUG_IMPORT dmapperLogger->endDocument(); #endif - if (xStatusIndicator.is()) - xStatusIndicator->end(); sal_uInt32 nEndTime = osl_getGlobalTimer(); SAL_INFO("writerfilter.profile", OSL_THIS_FUNC << " finished in " << nEndTime - nStartTime << " ms"); - return sal_True; } catch (const uno::Exception& e) { SAL_INFO("writerfilter", "Exception caught: " << e.Message); - return sal_False; } + + if (xStatusIndicator.is()) + xStatusIndicator->end(); + return bResult; } void RtfFilter::cancel( ) throw (uno::RuntimeException)