sw/source/uibase/utlui/navicfg.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 874cc6cb72e6e795f48bcee5d4fe5c595fb1f702
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Mon Sep 14 10:46:13 2015 +0200

    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

diff --git a/sw/source/uibase/utlui/navicfg.cxx 
b/sw/source/uibase/utlui/navicfg.cxx
index 1a4375a..f9440e7 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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to