diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-09-14 10:46:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-09-14 10:49:44 +0200 |
commit | 874cc6cb72e6e795f48bcee5d4fe5c595fb1f702 (patch) | |
tree | 88479e3236128740a813452c538fae44596e9524 | |
parent | 58fb53d53e2bf46d448a5f52aa6714ae6c539e12 (diff) |
Don't read out-of-range ContentTypeId from configuration
officecfg/registry/schema/org/openoffice/Office/Writer.xcs specifies -1 as
default for /org.openoffice.Office/Writer/Navigator/RootType, which now triggers
the assert in o3tl::enumarray::operator[] during JunitTest_toolkit_unoapi_1.
Regression introduced with cb45d0d4272da54f90cb2b03d2cdbe1a4eebc75c "convert
CONTENT_TYPE to scoped enum." (A better fix might be to replace
ContentTypeId::UNKNOWN with -1; to be followed-up upon.)
Change-Id: Id12c775cee8936ef2fd411da25558acabb5fa0c9
-rw-r--r-- | sw/source/uibase/utlui/navicfg.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/uibase/utlui/navicfg.cxx b/sw/source/uibase/utlui/navicfg.cxx index 1a4375ae797a..f9440e7c029b 100644 --- a/sw/source/uibase/utlui/navicfg.cxx +++ b/sw/source/uibase/utlui/navicfg.cxx @@ -77,7 +77,12 @@ SwNavigationConfig::SwNavigationConfig() : { sal_uInt32 nTmp; if (pValues[nProp] >>= nTmp) + { + if (nTmp > sal_uInt32(ContentTypeId::LAST)) { + nTmp = sal_uInt32(ContentTypeId::UNKNOWN); + } nRootType = static_cast<ContentTypeId>(nTmp); + } break; } case 1: pValues[nProp] >>= nSelectedPos; break; |