parent
075709e31d
commit
092ba3bf66
@ -0,0 +1,69 @@
|
|||||||
|
From df71f13b80c30cb98e310baf8f6aee11f8cbe81d Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Tardon <dtardon@redhat.com>
|
||||||
|
Date: Fri, 9 May 2014 13:07:33 +0200
|
||||||
|
Subject: [PATCH] rhbz#1071604 don't crash if slide layout configs are missing
|
||||||
|
|
||||||
|
Change-Id: I5cbf4ed0683cc5736a45fb980827b1b56bd0c74c
|
||||||
|
---
|
||||||
|
sd/source/core/drawdoc.cxx | 38 ++++++++++++++++++++++++++------------
|
||||||
|
1 file changed, 26 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
|
||||||
|
index 1de1f33..5904a64 100644
|
||||||
|
--- a/sd/source/core/drawdoc.cxx
|
||||||
|
+++ b/sd/source/core/drawdoc.cxx
|
||||||
|
@@ -1008,12 +1008,19 @@ void SdDrawDocument::InitLayoutVector()
|
||||||
|
const Reference<XDocumentBuilder> xDocBuilder(
|
||||||
|
DocumentBuilder::create( comphelper::getComponentContext (xServiceFactory) ));
|
||||||
|
|
||||||
|
- // loop over every layout entry in current file
|
||||||
|
- const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
|
||||||
|
- const Reference<XNodeList> layoutlist = xDoc->getElementsByTagName("layout");
|
||||||
|
- const int nElements = layoutlist->getLength();
|
||||||
|
- for(int index=0; index < nElements; index++)
|
||||||
|
- maLayoutInfo.push_back( layoutlist->item(index) );
|
||||||
|
+ try
|
||||||
|
+ {
|
||||||
|
+ // loop over every layout entry in current file
|
||||||
|
+ const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
|
||||||
|
+ const Reference<XNodeList> layoutlist = xDoc->getElementsByTagName("layout");
|
||||||
|
+ const int nElements = layoutlist->getLength();
|
||||||
|
+ for(int index=0; index < nElements; index++)
|
||||||
|
+ maLayoutInfo.push_back( layoutlist->item(index) );
|
||||||
|
+ }
|
||||||
|
+ catch (const uno::Exception &)
|
||||||
|
+ {
|
||||||
|
+ // skip missing config. files
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1037,12 +1044,19 @@ void SdDrawDocument::InitObjectVector()
|
||||||
|
const Reference<XDocumentBuilder> xDocBuilder(
|
||||||
|
DocumentBuilder::create( comphelper::getComponentContext (xServiceFactory) ));
|
||||||
|
|
||||||
|
- // loop over every object entry in current file
|
||||||
|
- const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
|
||||||
|
- const Reference<XNodeList> objectlist = xDoc->getElementsByTagName("object");
|
||||||
|
- const int nElements = objectlist->getLength();
|
||||||
|
- for(int index=0; index < nElements; index++)
|
||||||
|
- maPresObjectInfo.push_back( objectlist->item(index) );
|
||||||
|
+ try
|
||||||
|
+ {
|
||||||
|
+ // loop over every object entry in current file
|
||||||
|
+ const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
|
||||||
|
+ const Reference<XNodeList> objectlist = xDoc->getElementsByTagName("object");
|
||||||
|
+ const int nElements = objectlist->getLength();
|
||||||
|
+ for(int index=0; index < nElements; index++)
|
||||||
|
+ maPresObjectInfo.push_back( objectlist->item(index) );
|
||||||
|
+ }
|
||||||
|
+ catch (const uno::Exception &)
|
||||||
|
+ {
|
||||||
|
+ // skip missing config. files
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
--
|
||||||
|
1.9.0
|
||||||
|
|
Loading…
Reference in new issue