[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - xmloff/source
Michael Stahl
mstahl at redhat.com
Tue May 20 01:48:27 PDT 2014
xmloff/source/text/txtfldi.cxx | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
New commits:
commit 6a66844b611dce6d3c7962b5f31b02cbc5d2cc9c
Author: Michael Stahl <mstahl at redhat.com>
Date: Sat Feb 15 00:24:26 2014 +0100
fdo#74524: ODF import: fix unhandled exception in annotation import cp#1000075
Crash with unhandled UnknownPropertyException when trying to get "Name"
property from a PageNumber field.
(cherry picked from commit cf26d7614364176742ae0303efb4499a37ae04c8)
Change-Id: I501cc138caba034c85630519014b94d783ab8f39
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 9d62939..349cd37 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -3735,12 +3735,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;
+ }
}
}
}
More information about the Libreoffice-commits
mailing list