From 1aafcb90209ebdfdeb974fad8bdc28ebfffaa486 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 14 Nov 2012 13:37:28 +0000 Subject: oox: reduce exception count reading missing attributes. --- oox/source/helper/attributelist.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'oox') diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index 40bc8f31c243..183794263ef0 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -228,6 +228,10 @@ sal_Int32 AttributeList::getToken( sal_Int32 nAttrToken, sal_Int32 nDefault ) co OUString AttributeList::getString( sal_Int32 nAttrToken, const OUString& rDefault ) const { + // try to avoid slow exception throw/catch if we can + if (rDefault.isEmpty()) + return mxAttribs->getOptionalValue( nAttrToken ); + try { return mxAttribs->getValue( nAttrToken ); -- cgit