summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-15 00:24:26 +0100
committerMichael Stahl <mstahl@redhat.com>2014-02-15 00:25:55 +0100
commitcf26d7614364176742ae0303efb4499a37ae04c8 (patch)
treef4627eff00c011e145d5bfd6fe004830050029f8
parent772c3a202481506b92c496948cfdc0f23ab94b2c (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.cxx15
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;
+ }
}
}
}