diff options
Diffstat (limited to 'dbaccess/source/filter')
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 6dd868a4a0b1..b5477eeae235 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -74,7 +74,7 @@ namespace dbaxml { using namespace ::com::sun::star::util; /// read a component (file + filter version) -sal_Int32 ReadThroughComponent( +ErrCode ReadThroughComponent( const uno::Reference<XInputStream>& xInputStream, const uno::Reference<XComponent>& xModelComponent, const uno::Reference<XComponentContext> & rxContext, @@ -95,7 +95,7 @@ sal_Int32 ReadThroughComponent( // get filter OSL_ENSURE( _xFilter.is(), "Can't instantiate filter component." ); if( !_xFilter.is() ) - return 1; + return ErrCode(1); // connect parser and filter xParser->setDocumentHandler( _xFilter ); @@ -116,11 +116,11 @@ sal_Int32 ReadThroughComponent( #else (void)r; #endif - return 1; + return ErrCode(1); } catch (const SAXException&) { - return 1; + return ErrCode(1); } catch (const packages::zip::ZipIOException&) { @@ -137,7 +137,7 @@ sal_Int32 ReadThroughComponent( /// read a component (storage version) -sal_Int32 ReadThroughComponent( +ErrCode ReadThroughComponent( const uno::Reference< embed::XStorage >& xStorage, const uno::Reference<XComponent>& xModelComponent, const sal_Char* pStreamName, @@ -185,7 +185,7 @@ sal_Int32 ReadThroughComponent( } catch (const uno::Exception&) { - return 1; // TODO/LATER: error handling + return ErrCode(1); // TODO/LATER: error handling } uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream(); @@ -197,7 +197,7 @@ sal_Int32 ReadThroughComponent( } // TODO/LATER: better error handling - return 1; + return ErrCode(1); } @@ -331,7 +331,7 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) SetNumberFormatsSupplier(xNum); uno::Reference<XComponent> xModel(GetModel(),UNO_QUERY); - sal_Int32 nRet = ReadThroughComponent( xStorage + ErrCode nRet = ReadThroughComponent( xStorage ,xModel ,"settings.xml" ,"Settings.xml" @@ -358,18 +358,14 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) } else { - switch( nRet ) + if ( nRet == ERRCODE_IO_BROKENPACKAGE ) + ;// TODO/LATER: no way to transport the error outside from the filter! + else { - case ERRCODE_IO_BROKENPACKAGE: - // TODO/LATER: no way to transport the error outside from the filter! - break; - default: - { - // TODO/LATER: this is completely wrong! Filter code should never call ErrorHandler directly! But for now this is the only way! - ErrorHandler::HandleError( nRet ); - if( nRet & ERRCODE_WARNING_MASK ) - bRet = true; - } + // TODO/LATER: this is completely wrong! Filter code should never call ErrorHandler directly! But for now this is the only way! + ErrorHandler::HandleError( nRet ); + if( nRet.IsWarning() ) + bRet = true; } } } |