diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-02-15 00:24:26 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-02-15 00:25:55 +0100 |
commit | cf26d7614364176742ae0303efb4499a37ae04c8 (patch) | |
tree | f4627eff00c011e145d5bfd6fe004830050029f8 | |
parent | 772c3a202481506b92c496948cfdc0f23ab94b2c (diff) |
fdo#74524: ODF import: fix unhandled exception in annotation import
Crash with unhandled UnknownPropertyException when trying to get "Name"
property from a PageNumber field.
Change-Id: I501cc138caba034c85630519014b94d783ab8f39
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 2728f9e71b6f..56c94884afd1 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -3716,12 +3716,17 @@ void XMLAnnotationImportContext::EndElement() while (xFields->hasMoreElements()) { uno::Reference<beans::XPropertySet> xCurrField(xFields->nextElement(), uno::UNO_QUERY); - OUString aFieldName; - xCurrField->getPropertyValue(sPropertyName) >>= aFieldName; - if ( aFieldName == aName ) + uno::Reference<beans::XPropertySetInfo> const xInfo( + xCurrField->getPropertySetInfo()); + if (xInfo->hasPropertyByName(sPropertyName)) { - xPrevField.set( xCurrField, uno::UNO_QUERY ); - break; + OUString aFieldName; + xCurrField->getPropertyValue(sPropertyName) >>= aFieldName; + if (aFieldName == aName) + { + xPrevField.set( xCurrField, uno::UNO_QUERY ); + break; + } } } } |