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,9 +3760,12 @@ void XMLAnnotationImportContext::EndElement() ...@@ -3760,9 +3760,12 @@ 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);
uno::Reference< beans::XPropertySetInfo > xCurrFieldPropInfo = xCurrField->getPropertySetInfo();
if ( xCurrFieldPropInfo->hasPropertyByName( sPropertyName ) )
{
OUString aFieldName; OUString aFieldName;
xCurrField->getPropertyValue(sPropertyName) >>= aFieldName; xCurrField->getPropertyValue( sPropertyName ) >>= aFieldName;
if ( aFieldName == aName ) if ( aFieldName == aName )
{ {
xPrevField.set( xCurrField, uno::UNO_QUERY ); xPrevField.set( xCurrField, uno::UNO_QUERY );
...@@ -3770,6 +3773,7 @@ void XMLAnnotationImportContext::EndElement() ...@@ -3770,6 +3773,7 @@ void XMLAnnotationImportContext::EndElement()
} }
} }
} }
}
if ( xPrevField.is() ) if ( xPrevField.is() )
{ {
// So we are ending a previous annotation, // So we are ending a previous annotation,
......
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