summaryrefslogtreecommitdiff
path: root/dbaccess/source/filter/xml/xmlfilter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/filter/xml/xmlfilter.cxx')
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx69
1 files changed, 31 insertions, 38 deletions
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 24516771289c..975044623258 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -51,7 +51,7 @@
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <svtools/sfxecode.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <osl/diagnose.h>
#include <comphelper/sequence.hxx>
#include <comphelper/types.hxx>
@@ -132,42 +132,40 @@ static ErrCode ReadThroughComponent(
OSL_ENSURE( xStorage.is(), "Need storage!");
OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!");
- if ( xStorage.is() )
- {
- uno::Reference< io::XStream > xDocStream;
+ if ( !xStorage )
+ // TODO/LATER: better error handling
+ return ErrCode(1);
- try
- {
- // open stream (and set parser input)
- OUString sStreamName = OUString::createFromAscii(pStreamName);
- if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
- {
- // stream name not found! return immediately with OK signal
- return ERRCODE_NONE;
- }
+ uno::Reference< io::XStream > xDocStream;
- // get input stream
- xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
- }
- catch (const packages::WrongPasswordException&)
- {
- return ERRCODE_SFX_WRONGPASSWORD;
- }
- catch (const uno::Exception&)
+ try
+ {
+ // open stream (and set parser input)
+ OUString sStreamName = OUString::createFromAscii(pStreamName);
+ if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
{
- return ErrCode(1); // TODO/LATER: error handling
+ // stream name not found! return immediately with OK signal
+ return ERRCODE_NONE;
}
- uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream();
- // read from the stream
- return ReadThroughComponent( xInputStream
- ,xModelComponent
- ,rxContext
- ,_rFilter );
+ // get input stream
+ xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
+ }
+ catch (const packages::WrongPasswordException&)
+ {
+ return ERRCODE_SFX_WRONGPASSWORD;
+ }
+ catch (const uno::Exception&)
+ {
+ return ErrCode(1); // TODO/LATER: error handling
}
- // TODO/LATER: better error handling
- return ErrCode(1);
+ uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream();
+ // read from the stream
+ return ReadThroughComponent( xInputStream
+ ,xModelComponent
+ ,rxContext
+ ,_rFilter );
}
@@ -188,7 +186,7 @@ ODBFilter::ODBFilter( const uno::Reference< XComponentContext >& _rxContext )
}
-ODBFilter::~ODBFilter() throw()
+ODBFilter::~ODBFilter() noexcept
{
}
@@ -402,12 +400,10 @@ public:
case XML_ELEMENT(OOO, XML_STYLES):
rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
return rImport.CreateStylesContext(false);
- break;
case XML_ELEMENT(OFFICE, XML_AUTOMATIC_STYLES):
case XML_ELEMENT(OOO, XML_AUTOMATIC_STYLES):
rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
return rImport.CreateStylesContext(true);
- break;
}
return nullptr;
}
@@ -454,15 +450,12 @@ public:
case XML_ELEMENT(OFFICE, XML_BODY):
case XML_ELEMENT(OOO, XML_BODY):
return new DBXMLDocumentBodyContext(rImport);
- break;
case XML_ELEMENT(OFFICE, XML_SCRIPTS):
return new XMLScriptContext(GetImport(), rImport.GetModel());
- break;
case XML_ELEMENT(OFFICE, XML_AUTOMATIC_STYLES):
case XML_ELEMENT(OOO, XML_AUTOMATIC_STYLES):
rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
return rImport.CreateStylesContext(true);
- break;
default: break;
}
return nullptr;
@@ -527,7 +520,7 @@ void ODBFilter::SetConfigurationSettings(const Sequence<PropertyValue>& aConfigP
pIter->Value >>= aWindows;
uno::Reference<XPropertySet> xProp(getDataSource());
if ( xProp.is() )
- xProp->setPropertyValue(PROPERTY_LAYOUTINFORMATION,makeAny(aWindows));
+ xProp->setPropertyValue(PROPERTY_LAYOUTINFORMATION,Any(aWindows));
}
}
}
@@ -610,7 +603,7 @@ void ODBFilter::setPropertyInfo()
{
try
{
- xDataSource->setPropertyValue(PROPERTY_INFO,makeAny(aInfo));
+ xDataSource->setPropertyValue(PROPERTY_INFO,Any(aInfo));
}
catch (const Exception&)
{