diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-11-14 13:37:28 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-11-14 13:38:15 +0000 |
commit | 1aafcb90209ebdfdeb974fad8bdc28ebfffaa486 (patch) | |
tree | 52fec3b7c299899cfb0436e6f2a14ede66ffc226 /oox | |
parent | dropped obsolete --with-system-gettext configure option (diff) | |
download | core-1aafcb90209ebdfdeb974fad8bdc28ebfffaa486.tar.gz core-1aafcb90209ebdfdeb974fad8bdc28ebfffaa486.zip |
oox: reduce exception count reading missing attributes.
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/helper/attributelist.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
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 ); |