summaryrefslogtreecommitdiff
path: root/oox/source/core/fragmenthandler2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source/core/fragmenthandler2.cxx')
-rw-r--r--oox/source/core/fragmenthandler2.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx
index 668eb7fbee49..8133b7382133 100644
--- a/oox/source/core/fragmenthandler2.cxx
+++ b/oox/source/core/fragmenthandler2.cxx
@@ -67,6 +67,12 @@ bool FragmentHandler2::prepareMceContext( sal_Int32 nElement, const AttributeLis
case MCE_TOKEN( Choice ):
{
OUString aRequires = rAttribs.getString( ( XML_Requires ), OUString("none") );
+ if (!getFilter().hasNamespaceURL(aRequires))
+ // Check to see if we have this namespace defined first,
+ // because calling getNamespaceURL() would throw if the
+ // namespace doesn't exist.
+ return false;
+
aRequires = getFilter().getNamespaceURL( aRequires );
if( getFilter().getNamespaceId( aRequires ) > 0 && !aMceState.empty() && aMceState.back() == MCE_STARTED )
aMceState.back() = MCE_FOUND_CHOICE;