[Libreoffice-commits] .: 2 commits - sfx2/source xmloff/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Mar 4 06:16:44 PST 2011
sfx2/source/doc/sfxbasemodel.cxx | 4 ++--
xmloff/source/core/DocumentSettingsContext.cxx | 16 ++++++++++++----
2 files changed, 14 insertions(+), 6 deletions(-)
New commits:
commit 3bcdba062358e36a319dc425194c4b5e35485ac5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 4 10:57:24 2011 +0000
survive broken config
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index 4f917e2..337879b 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -451,10 +451,18 @@ void XMLDocumentSettingsContext::EndElement()
}
sal_Bool bLoadDocPrinter( sal_True );
- ::comphelper::ConfigurationHelper::readDirectKey(
- ::comphelper::getProcessServiceFactory(),
- C2U("org.openoffice.Office.Common/"), C2U("Save/Document"), C2U("LoadPrinter"),
- ::comphelper::ConfigurationHelper::E_READONLY ) >>= bLoadDocPrinter;
+
+ try
+ {
+ ::comphelper::ConfigurationHelper::readDirectKey(
+ ::comphelper::getProcessServiceFactory(),
+ C2U("org.openoffice.Office.Common/"), C2U("Save/Document"), C2U("LoadPrinter"),
+ ::comphelper::ConfigurationHelper::E_READONLY ) >>= bLoadDocPrinter;
+ }
+ catch( const uno::Exception& )
+ {
+ }
+
uno::Sequence<beans::PropertyValue> aSeqConfigProps;
if ( m_pData->aConfigProps >>= aSeqConfigProps )
{
commit 3111d28aa89dbe5b15782cd288b2e2141bd16a95
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 4 08:48:28 2011 +0000
Be more fault tolerant here.
If we're already going to catch any uno::Exception, then
we might as well accept failure of existance as well
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index cf91c1b..018f519 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -866,10 +866,10 @@ uno::Reference< document::XDocumentInfo > SAL_CALL SfxBaseModel::getDocumentInfo
try {
rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
uno::Reference < beans::XPropertySet > xSet(
- getDocumentStorage(), uno::UNO_QUERY );
+ getDocumentStorage(), uno::UNO_QUERY_THROW );
uno::Any aMediaType = xSet->getPropertyValue( aName );
uno::Reference < beans::XPropertySet > xDocSet(
- m_pData->m_xDocumentInfo, uno::UNO_QUERY );
+ m_pData->m_xDocumentInfo, uno::UNO_QUERY_THROW );
xDocSet->setPropertyValue( aName, aMediaType );
} catch (uno::Exception &) {
//ignore
More information about the Libreoffice-commits
mailing list