Kaydet (Commit) 3d038663 authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann

124607: ODF import: check on certain property existence in annotation import to avoid exceptions

üst bd1eb988
...@@ -3760,13 +3760,17 @@ void XMLAnnotationImportContext::EndElement() ...@@ -3760,13 +3760,17 @@ void XMLAnnotationImportContext::EndElement()
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
while (xFields->hasMoreElements()) while (xFields->hasMoreElements())
{ {
uno::Reference<beans::XPropertySet> xCurrField(xFields->nextElement(), uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xCurrField(xFields->nextElement(), uno::UNO_QUERY);
OUString aFieldName; uno::Reference< beans::XPropertySetInfo > xCurrFieldPropInfo = xCurrField->getPropertySetInfo();
xCurrField->getPropertyValue(sPropertyName) >>= aFieldName; if ( xCurrFieldPropInfo->hasPropertyByName( sPropertyName ) )
if ( aFieldName == aName )
{ {
xPrevField.set( xCurrField, uno::UNO_QUERY ); OUString aFieldName;
break; xCurrField->getPropertyValue( sPropertyName ) >>= aFieldName;
if ( aFieldName == aName )
{
xPrevField.set( xCurrField, uno::UNO_QUERY );
break;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment