summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-11-14 13:37:28 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-11-14 13:38:15 +0000
commit1aafcb90209ebdfdeb974fad8bdc28ebfffaa486 (patch)
tree52fec3b7c299899cfb0436e6f2a14ede66ffc226 /oox
parent8ea17cdae772fa5e4853d576c766088a8fb3b206 (diff)
oox: reduce exception count reading missing attributes.
Diffstat (limited to 'oox')
-rw-r--r--oox/source/helper/attributelist.cxx4
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 );