i#79611: SvxFieldData::Create() is not supposed to throw.

Change-Id: Ied4e5cc9211b2a541006432d0b4d257f014249f4
This commit is contained in:
Jan Holesovsky 2013-04-11 13:29:36 +02:00
parent c226e93159
commit 763011690b

View file

@ -43,7 +43,18 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe
if (!xPropSet.is())
return NULL;
uno::Any aAny = xPropSet->getPropertyValue(UNO_TC_PROP_TEXTFIELD_TYPE);
// we do not support these fields from Writer, so make sure we do not throw
// here - see fdo#63436 how to possibly extend Writer to make use of this
uno::Any aAny;
try {
aAny = xPropSet->getPropertyValue(UNO_TC_PROP_TEXTFIELD_TYPE);
if ( !aAny.has<sal_Int32>() )
return NULL;
} catch ( const beans::UnknownPropertyException& e )
{
return NULL;
}
sal_Int32 nFieldType = aAny.get<sal_Int32>();
switch (nFieldType)