[Libreoffice-commits] core.git: Branch 'aoo/trunk' - xmloff/source
Oliver-Rainer Wittmann
orw at apache.org
Sun Apr 6 03:07:39 PDT 2014
xmloff/source/text/txtfldi.cxx | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
New commits:
commit 3d038663f44b20efbe10ab9b7149e8e58b648f5f
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Sun Apr 6 08:31:58 2014 +0000
124607: ODF import: check on certain property existence in annotation import to avoid exceptions
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 3e506fc..090f7fc 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -3760,13 +3760,17 @@ void XMLAnnotationImportContext::EndElement()
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;
+ }
}
}
}
More information about the Libreoffice-commits
mailing list