diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-20 11:32:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-22 06:46:43 +0100 |
commit | f61f00862380fed99a09a11d67fef5d8efbce368 (patch) | |
tree | a03527b6780c835aa1124b7179c4df53fcb00589 /sw | |
parent | 1c58b2a437a7083c40c93a1c2e12a6fe6b6fd637 (diff) |
log exceptions when parsing
to make debugging easier
Change-Id: Ia19384a925a2bb437fa5d961e6c3d44eebe0c6b6
Reviewed-on: https://gerrit.libreoffice.org/83345
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/swg/SwXMLTextBlocks1.cxx | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx index 843e545a39a0..f4880417e929 100644 --- a/sw/source/core/swg/SwXMLTextBlocks1.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx @@ -23,6 +23,7 @@ #include <svl/macitem.hxx> #include <svtools/unoevent.hxx> #include <sfx2/docfile.hxx> +#include <tools/diagnose_ex.h> #include <unotools/streamwrap.hxx> #include <comphelper/fileformat.h> #include <comphelper/processfactory.hxx> @@ -400,11 +401,12 @@ ErrCode SwXMLTextBlocks::PutBlockText( const OUString& rShort, void SwXMLTextBlocks::ReadInfo() { - try - { const OUString sDocName( XMLN_BLOCKLIST ); - if ( xBlkRoot.is() && xBlkRoot->hasByName( sDocName ) && xBlkRoot->isStreamElement( sDocName ) ) + try { + if ( !xBlkRoot.is() || !xBlkRoot->hasByName( sDocName ) || !xBlkRoot->isStreamElement( sDocName ) ) + return; + uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); @@ -425,26 +427,12 @@ void SwXMLTextBlocks::ReadInfo() xParser->setTokenHandler( xTokenHandler ); // parse - try - { - xParser->parseStream( aParserInput ); - } - catch( xml::sax::SAXParseException& ) - { - // re throw ? - } - catch( xml::sax::SAXException& ) - { - // re throw ? - } - catch( io::IOException& ) - { - // re throw ? - } - } + xParser->parseStream( aParserInput ); } catch ( uno::Exception& ) { + TOOLS_WARN_EXCEPTION("sw", "when loading " << sDocName); + // re throw ? } } void SwXMLTextBlocks::WriteInfo() |