You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by or...@apache.org on 2014/04/06 10:31:59 UTC
svn commit: r1585261 - /openoffice/trunk/main/xmloff/source/text/txtfldi.cxx
Author: orw
Date: Sun Apr 6 08:31:58 2014
New Revision: 1585261
URL: http://svn.apache.org/r1585261
Log:
124607: ODF import: check on certain property existence in annotation import to avoid exceptions
Modified:
openoffice/trunk/main/xmloff/source/text/txtfldi.cxx
Modified: openoffice/trunk/main/xmloff/source/text/txtfldi.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/xmloff/source/text/txtfldi.cxx?rev=1585261&r1=1585260&r2=1585261&view=diff
==============================================================================
--- openoffice/trunk/main/xmloff/source/text/txtfldi.cxx (original)
+++ openoffice/trunk/main/xmloff/source/text/txtfldi.cxx Sun Apr 6 08:31:58 2014
@@ -3760,13 +3760,17 @@ void XMLAnnotationImportContext::EndElem
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
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::XPropertySet > xCurrField(xFields->nextElement(), uno::UNO_QUERY);
+ uno::Reference< beans::XPropertySetInfo > xCurrFieldPropInfo = xCurrField->getPropertySetInfo();
+ if ( xCurrFieldPropInfo->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;
+ }
}
}
}