[Libreoffice-commits] .: 2 commits - writerfilter/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Tue Mar 13 08:34:50 PDT 2012
writerfilter/source/dmapper/ModelEventListener.cxx | 25 +++++++++++++--------
1 file changed, 16 insertions(+), 9 deletions(-)
New commits:
commit 2352ed8a8c86a2c8fcb2b7b75b750cec6956d2d7
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Mar 13 16:30:32 2012 +0100
writerfilter: catch UnknownPropertyExcetion early
diff --git a/writerfilter/source/dmapper/ModelEventListener.cxx b/writerfilter/source/dmapper/ModelEventListener.cxx
index 22c6b9a..f4fd04a 100644
--- a/writerfilter/source/dmapper/ModelEventListener.cxx
+++ b/writerfilter/source/dmapper/ModelEventListener.cxx
@@ -83,13 +83,20 @@ void ModelEventListener::notifyEvent( const document::EventObject& rEvent ) thro
sal_Int32 nIndex = 0;
while(xEnumeration->hasMoreElements())
{
- uno::Reference<beans::XPropertySet> xPropertySet(xEnumeration->nextElement(), uno::UNO_QUERY);
- sal_Int16 nSource = 0;
- xPropertySet->getPropertyValue(rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_SOURCE)) >>= nSource;
- sal_Int16 nPart = 0;
- xPropertySet->getPropertyValue(rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_PART)) >>= nPart;
- if (nSource == text::ReferenceFieldSource::BOOKMARK && nPart == text::ReferenceFieldPart::PAGE)
- ++nIndex;
+ try
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(xEnumeration->nextElement(), uno::UNO_QUERY);
+ sal_Int16 nSource = 0;
+ xPropertySet->getPropertyValue(rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_SOURCE)) >>= nSource;
+ sal_Int16 nPart = 0;
+ xPropertySet->getPropertyValue(rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_PART)) >>= nPart;
+ if (nSource == text::ReferenceFieldSource::BOOKMARK && nPart == text::ReferenceFieldPart::PAGE)
+ ++nIndex;
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ // doesn't even have such a property? ignore
+ }
}
if (nIndex)
{
commit 2ff3ce4b7e9ff6603ba472cbb8d35f75b9ef9c16
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Mar 13 15:38:36 2012 +0100
writerfilter: log exception message in ModelEventListener
diff --git a/writerfilter/source/dmapper/ModelEventListener.cxx b/writerfilter/source/dmapper/ModelEventListener.cxx
index a5b2ca5..22c6b9a 100644
--- a/writerfilter/source/dmapper/ModelEventListener.cxx
+++ b/writerfilter/source/dmapper/ModelEventListener.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include <ModelEventListener.hxx>
#include <PropertyIds.hxx>
+#include <rtl/oustringostreaminserter.hxx>
#include <com/sun/star/document/XEventBroadcaster.hpp>
#include <com/sun/star/text/XDocumentIndex.hpp>
#include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
@@ -98,8 +99,7 @@ void ModelEventListener::notifyEvent( const document::EventObject& rEvent ) thro
}
catch( const uno::Exception& rEx )
{
- (void)rEx;
- OSL_FAIL( "exception while updating indexes" );
+ SAL_WARN("writerfilter", "exception while updating indexes: " << rEx.Message);
}
}
}
More information about the Libreoffice-commits
mailing list