Kaydet (Commit) 874cc6cb authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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 cb45d0d4 "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
üst 58fb53d5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment