[Libreoffice-commits] core.git: 5 commits - sw/source vcl/source xmloff/source

Michael Stahl mstahl at redhat.com
Wed May 6 07:23:57 PDT 2015


 sw/source/uibase/config/modcfg.cxx |  541 +++++++++++++++++--------------------
 vcl/source/window/dialog.cxx       |    5 
 xmloff/source/meta/xmlmetae.cxx    |   12 
 xmloff/source/style/xmlprmap.cxx   |   21 -
 4 files changed, 284 insertions(+), 295 deletions(-)

New commits:
commit f1097c868afe618d99f13c28418d5df23983601d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 6 16:12:08 2015 +0200

    vcl: valgrind - initialize Dialog::mnInitFlag
    
    The assignment in the 3rd ctor is actually executed after the use from
    loadUI().
    
    (regression from 39078c247d31674544901f8449f5141185f79f7f)
    
    Change-Id: I34b3d7fb9d6c4637d15c7865e6034f2c9d968b99

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 0e55548..a2dbdac 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -451,6 +451,7 @@ void Dialog::ImplInitSettings()
 
 Dialog::Dialog( WindowType nType )
     : SystemWindow( nType )
+    , mnInitFlag(InitFlag::Default)
 {
     ImplInitDialogData();
 }
@@ -495,6 +496,7 @@ void Dialog::doDeferredInit(WinBits nBits)
 
 Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription)
     : SystemWindow(WINDOW_DIALOG)
+    , mnInitFlag(InitFlag::Default)
 {
     ImplInitDialogData();
     loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription);
@@ -502,14 +504,15 @@ Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXML
 
 Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, WindowType nType, InitFlag eFlag)
     : SystemWindow(nType)
+    , mnInitFlag(eFlag)
 {
     ImplInitDialogData();
     loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription);
-    mnInitFlag = eFlag;
 }
 
 Dialog::Dialog(vcl::Window* pParent, WinBits nStyle, InitFlag eFlag)
     : SystemWindow(WINDOW_DIALOG)
+    , mnInitFlag(eFlag)
 {
     ImplInitDialogData();
     ImplInit( pParent, nStyle, eFlag );
commit 83d8ccfb0a1e175149d6507e35757317568c7883
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 6 15:19:00 2015 +0200

    xmloff: convert to assert in SvXMLMetaExport
    
    Change-Id: Ib959da6f4dab0b290955e8b786d6efeef7f307b0

diff --git a/xmloff/source/meta/xmlmetae.cxx b/xmloff/source/meta/xmlmetae.cxx
index 77ece02..a9bb477 100644
--- a/xmloff/source/meta/xmlmetae.cxx
+++ b/xmloff/source/meta/xmlmetae.cxx
@@ -286,7 +286,7 @@ void SvXMLMetaExport::_MExport()
                         XML_NAMESPACE_META, XML_CELL_COUNT, aValue );
                 else
                 {
-                    DBG_ASSERT( false, "Unknown statistic value!\n" );
+                    SAL_WARN("xmloff", "Unknown statistic value!");
                 }
             }
         }
@@ -308,7 +308,7 @@ SvXMLMetaExport::SvXMLMetaExport(
     m_level( 0 ),
     m_preservedNSs()
 {
-    DBG_ASSERT( mxDocProps.is(), "no document properties" );
+    assert(mxDocProps.is());
 }
 
 SvXMLMetaExport::~SvXMLMetaExport()
@@ -331,7 +331,7 @@ void SvXMLMetaExport::Export()
             } else if (attrname.equalsAsciiL(s_xmlns, strlen(s_xmlns))) {
                 // default initialized empty string
             } else {
-            OSL_FAIL("namespace attribute not starting with xmlns unexpected");
+                assert(!"namespace attribute not starting with xmlns unexpected");
             }
             ns.Second = rNsMap.GetNameByKey(key);
             namespaces.push_back(ns);
@@ -352,7 +352,7 @@ SvXMLMetaExport::startDocument()
     throw (uno::RuntimeException, xml::sax::SAXException, std::exception)
 {
     // ignore: has already been done by SvXMLExport::exportDoc
-    DBG_ASSERT( m_level == 0, "SvXMLMetaExport: level error" );
+    assert(m_level == 0 && "SvXMLMetaExport: level error");
 }
 
 void SAL_CALL
@@ -360,7 +360,7 @@ SvXMLMetaExport::endDocument()
     throw (uno::RuntimeException, xml::sax::SAXException, std::exception)
 {
     // ignore: will be done by SvXMLExport::exportDoc
-    DBG_ASSERT( m_level == 0, "SvXMLMetaExport: level error" );
+    assert(m_level == 0 && "SvXMLMetaExport: level error");
 }
 
 // unfortunately, this method contains far too much ugly namespace mangling.
@@ -456,7 +456,7 @@ SvXMLMetaExport::endElement(const OUString & i_rName)
         // ignore the root; see startElement
         return;
     }
-    DBG_ASSERT( m_level >= 0, "SvXMLMetaExport: level error" );
+    assert(m_level >= 0 && "SvXMLMetaExport: level error");
     mrExport.EndElement(i_rName, false);
 }
 
commit 068f16e2f44b21df0bf7423eb02e8d57b4cb589c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 6 15:10:56 2015 +0200

    xmloff: assert validity of XMLPropertySetMapper indexes
    
    Apparently -1 is used for invalidated ones.
    
    Change-Id: I31901ff9f1caf3d011e476e220cec71669f5a356

diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx
index c1302b4..046fd3d 100644
--- a/xmloff/source/style/xmlprmap.cxx
+++ b/xmloff/source/style/xmlprmap.cxx
@@ -181,13 +181,13 @@ sal_Int32 XMLPropertySetMapper::GetEntryCount() const
 
 sal_uInt32 XMLPropertySetMapper::GetEntryFlags( sal_Int32 nIndex ) const
 {
-    DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" );
+    assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
     return mpImpl->maMapEntries[nIndex].nType & ~MID_FLAG_MASK;
 }
 
 sal_uInt32 XMLPropertySetMapper::GetEntryType( sal_Int32 nIndex, bool bWithFlags ) const
 {
-    DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" );
+    assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
     sal_uInt32 nType = mpImpl->maMapEntries[nIndex].nType;
     if( !bWithFlags )
         nType = nType & MID_FLAG_MASK;
@@ -196,37 +196,37 @@ sal_uInt32 XMLPropertySetMapper::GetEntryType( sal_Int32 nIndex, bool bWithFlags
 
 sal_uInt16 XMLPropertySetMapper::GetEntryNameSpace( sal_Int32 nIndex ) const
 {
-    DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" );
+    assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
     return mpImpl->maMapEntries[nIndex].nXMLNameSpace;
 }
 
 const OUString& XMLPropertySetMapper::GetEntryXMLName( sal_Int32 nIndex ) const
 {
-    DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" );
+    assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
     return mpImpl->maMapEntries[nIndex].sXMLAttributeName;
 }
 
 const OUString& XMLPropertySetMapper::GetEntryAPIName( sal_Int32 nIndex ) const
 {
-    DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" );
+    assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
     return mpImpl->maMapEntries[nIndex].sAPIPropertyName;
 }
 
 sal_Int16 XMLPropertySetMapper::GetEntryContextId( sal_Int32 nIndex ) const
 {
-    DBG_ASSERT( (nIndex >= -1) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" );
+    assert((-1 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
     return nIndex == -1 ? 0 : mpImpl->maMapEntries[nIndex].nContextId;
 }
 
 SvtSaveOptions::ODFDefaultVersion XMLPropertySetMapper::GetEarliestODFVersionForExport( sal_Int32 nIndex ) const
 {
-    DBG_ASSERT( (nIndex >= -1) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" );
+    assert((-1 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
     return nIndex == -1 ? SvtSaveOptions::ODFVER_UNKNOWN : mpImpl->maMapEntries[nIndex].nEarliestODFVersionForExport;
 }
 
 const XMLPropertyHandler* XMLPropertySetMapper::GetPropertyHandler( sal_Int32 nIndex ) const
 {
-    DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" );
+    assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
     return mpImpl->maMapEntries[nIndex].pHdl;
 }
 
commit cd84fffd506e7d681d6542f979045691c49bbd8c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 6 15:06:27 2015 +0200

    xmloff: assert existence of XMLPropertyHandler
    
    Change-Id: I2554c77245eb2c22201b6e680ab42db666b2ee8b

diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx
index dcc9c28..c1302b4 100644
--- a/xmloff/source/style/xmlprmap.cxx
+++ b/xmloff/source/style/xmlprmap.cxx
@@ -86,6 +86,7 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl(
     bImportOnly( rMapEntry.mbImportOnly),
     pHdl( rFactory->GetPropertyHandler( rMapEntry.mnType & MID_FLAG_MASK ) )
 {
+    assert(pHdl);
 }
 
 XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl(
@@ -99,7 +100,7 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl(
     bImportOnly( rEntry.bImportOnly),
     pHdl( rEntry.pHdl)
 {
-    DBG_ASSERT( pHdl, "Unknown XML property type handler!" );
+    assert(pHdl);
 }
 
 struct XMLPropertySetMapper::Impl
@@ -239,7 +240,7 @@ bool XMLPropertySetMapper::exportXML(
 
     const XMLPropertyHandler* pHdl = GetPropertyHandler( rProperty.mnIndex );
 
-    DBG_ASSERT( pHdl, "Unknown XML Type!" );
+    assert(pHdl);
     if( pHdl )
         bRet = pHdl->exportXML( rStrExpValue, rProperty.maValue,
                                 rUnitConverter );
commit 0252f24c9212456077c88853ab09c3f7417f3738
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 6 15:02:14 2015 +0200

    sw: clean up some defensive programming in modcfg.cxx
    
    Change-Id: I901d934d1c2bdf6f15760292481091eb740dfda1

diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index d7ab106..e695c32 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -347,26 +347,23 @@ void SwRevisionConfig::Load()
     const Sequence<OUString>& aNames = GetPropertyNames();
     Sequence<Any> aValues = GetProperties(aNames);
     const Any* pValues = aValues.getConstArray();
-    OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
-    if(aValues.getLength() == aNames.getLength())
+    assert(aValues.getLength() == aNames.getLength());
+    for (sal_Int32 nProp = 0; nProp < aNames.getLength(); ++nProp)
     {
-        for(int nProp = 0; nProp < aNames.getLength(); nProp++)
+        if (pValues[nProp].hasValue())
         {
-            if(pValues[nProp].hasValue())
+            sal_Int32 nVal = 0;
+            pValues[nProp] >>= nVal;
+            switch (nProp)
             {
-                sal_Int32 nVal = 0;
-                pValues[nProp] >>= nVal;
-                switch(nProp)
-                {
-                    case 0 : lcl_ConvertCfgToAttr(nVal, aInsertAttr); break;
-                    case 1 : aInsertAttr.nColor     = nVal; break;
-                    case 2 : lcl_ConvertCfgToAttr(nVal, aDeletedAttr, true); break;
-                    case 3 : aDeletedAttr.nColor    = nVal; break;
-                    case 4 : lcl_ConvertCfgToAttr(nVal, aFormatAttr); break;
-                    case 5 : aFormatAttr.nColor     = nVal; break;
-                    case 6 : nMarkAlign = sal::static_int_cast< sal_uInt16, sal_Int32>(nVal); break;
-                    case 7 : aMarkColor.SetColor(nVal); break;
-                }
+                case 0 : lcl_ConvertCfgToAttr(nVal, aInsertAttr); break;
+                case 1 : aInsertAttr.nColor     = nVal; break;
+                case 2 : lcl_ConvertCfgToAttr(nVal, aDeletedAttr, true); break;
+                case 3 : aDeletedAttr.nColor    = nVal; break;
+                case 4 : lcl_ConvertCfgToAttr(nVal, aFormatAttr); break;
+                case 5 : aFormatAttr.nColor     = nVal; break;
+                case 6 : nMarkAlign = sal::static_int_cast< sal_uInt16, sal_Int32>(nVal); break;
+                case 7 : aMarkColor.SetColor(nVal); break;
             }
         }
     }
@@ -874,230 +871,227 @@ void SwInsertConfig::Load()
     const Sequence<OUString>& aNames = GetPropertyNames();
     Sequence<Any> aValues = GetProperties(aNames);
     const Any* pValues = aValues.getConstArray();
-    OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
-    if(aValues.getLength() == aNames.getLength())
+    assert(aValues.getLength() == aNames.getLength());
+    InsCaptionOpt* pWriterTableOpt = 0;
+    InsCaptionOpt* pWriterFrameOpt = 0;
+    InsCaptionOpt* pWriterGraphicOpt = 0;
+    InsCaptionOpt* pOLECalcOpt = 0;
+    InsCaptionOpt* pOLEImpressOpt = 0;
+    InsCaptionOpt* pOLEChartOpt = 0;
+    InsCaptionOpt* pOLEFormulaOpt = 0;
+    InsCaptionOpt* pOLEDrawOpt = 0;
+    if (pCapOptions)
     {
-        InsCaptionOpt* pWriterTableOpt = 0;
-        InsCaptionOpt* pWriterFrameOpt = 0;
-        InsCaptionOpt* pWriterGraphicOpt = 0;
-        InsCaptionOpt* pOLECalcOpt = 0;
-        InsCaptionOpt* pOLEImpressOpt = 0;
-        InsCaptionOpt* pOLEChartOpt = 0;
-        InsCaptionOpt* pOLEFormulaOpt = 0;
-        InsCaptionOpt* pOLEDrawOpt = 0;
-        if(pCapOptions)
-        {
-            pWriterTableOpt = pCapOptions->Find(TABLE_CAP, 0);
-            pWriterFrameOpt = pCapOptions->Find(FRAME_CAP, 0);
-            pWriterGraphicOpt = pCapOptions->Find(GRAPHIC_CAP, 0);
-            pOLECalcOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_CALC]);
-            pOLEImpressOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_IMPRESS]);
-            pOLEDrawOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_DRAW   ]);
-            pOLEFormulaOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_MATH   ]);
-            pOLEChartOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_CHART  ]);
-        }
-        else if(!bIsWeb)
-            return;
+        pWriterTableOpt = pCapOptions->Find(TABLE_CAP, 0);
+        pWriterFrameOpt = pCapOptions->Find(FRAME_CAP, 0);
+        pWriterGraphicOpt = pCapOptions->Find(GRAPHIC_CAP, 0);
+        pOLECalcOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_CALC]);
+        pOLEImpressOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_IMPRESS]);
+        pOLEDrawOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_DRAW   ]);
+        pOLEFormulaOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_MATH   ]);
+        pOLEChartOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_CHART  ]);
+    }
+    else if (!bIsWeb)
+        return;
 
-        sal_uInt16 nInsTblFlags = 0;
-        for(int nProp = 0; nProp < aNames.getLength(); nProp++)
+    sal_uInt16 nInsTblFlags = 0;
+    for (sal_Int32 nProp = 0; nProp < aNames.getLength(); ++nProp)
+    {
+        if (pValues[nProp].hasValue())
         {
-            if(pValues[nProp].hasValue())
+            bool bBool = nProp < INS_PROP_CAP_OBJECT_TABLE_ENABLE && *static_cast<sal_Bool const *>(pValues[nProp].getValue());
+            switch (nProp)
             {
-                bool bBool = nProp < INS_PROP_CAP_OBJECT_TABLE_ENABLE && *static_cast<sal_Bool const *>(pValues[nProp].getValue());
-                switch(nProp)
+                case INS_PROP_TABLE_HEADER:
+                {
+                    if(bBool)
+                        nInsTblFlags|= tabopts::HEADLINE;
+                }
+                break;//"Table/Header",
+                case INS_PROP_TABLE_REPEATHEADER:
                 {
-                    case INS_PROP_TABLE_HEADER:
+                    aInsTblOpts.mnRowsToRepeat = bBool? 1 : 0;
+
+                }
+                break;//"Table/RepeatHeader",
+                case INS_PROP_TABLE_BORDER:
+                {
+                    if(bBool)
+                        nInsTblFlags|= tabopts::DEFAULT_BORDER;
+                }
+                break;//"Table/Border",
+                case INS_PROP_TABLE_SPLIT:
+                {
+                    if(bBool)
+                        nInsTblFlags|= tabopts::SPLIT_LAYOUT;
+                }
+                break;//"Table/Split",
+                case INS_PROP_CAP_AUTOMATIC:
+                    bInsWithCaption = bBool;
+                break;
+                case INS_PROP_CAP_CAPTIONORDERNUMBERINGFIRST: bCaptionOrderNumberingFirst = bBool; break;
+                case INS_PROP_CAP_OBJECT_TABLE_ENABLE:
+                case INS_PROP_CAP_OBJECT_TABLE_CATEGORY:
+                case INS_PROP_CAP_OBJECT_TABLE_NUMBERING:
+                case INS_PROP_CAP_OBJECT_TABLE_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_TABLE_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_TABLE_DELIMITER:
+                case INS_PROP_CAP_OBJECT_TABLE_LEVEL:
+                case INS_PROP_CAP_OBJECT_TABLE_POSITION:
+                case INS_PROP_CAP_OBJECT_TABLE_CHARACTERSTYLE:
+                    if(!pWriterTableOpt)
                     {
-                        if(bBool)
-                            nInsTblFlags|= tabopts::HEADLINE;
+                        pWriterTableOpt = new InsCaptionOpt(TABLE_CAP);
+                        pCapOptions->Insert(pWriterTableOpt);
                     }
-                    break;//"Table/Header",
-                    case INS_PROP_TABLE_REPEATHEADER:
+                    lcl_ReadOpt(*pWriterTableOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_TABLE_ENABLE);
+                break;
+                case INS_PROP_CAP_OBJECT_FRAME_ENABLE:
+                case INS_PROP_CAP_OBJECT_FRAME_CATEGORY:
+                case INS_PROP_CAP_OBJECT_FRAME_NUMBERING:
+                case INS_PROP_CAP_OBJECT_FRAME_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_FRAME_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_FRAME_DELIMITER:
+                case INS_PROP_CAP_OBJECT_FRAME_LEVEL:
+                case INS_PROP_CAP_OBJECT_FRAME_POSITION:
+                case INS_PROP_CAP_OBJECT_FRAME_CHARACTERSTYLE:
+                    if(!pWriterFrameOpt)
                     {
-                        aInsTblOpts.mnRowsToRepeat = bBool? 1 : 0;
-
+                        pWriterFrameOpt = new InsCaptionOpt(FRAME_CAP);
+                        pCapOptions->Insert(pWriterFrameOpt);
                     }
-                    break;//"Table/RepeatHeader",
-                    case INS_PROP_TABLE_BORDER:
+                    lcl_ReadOpt(*pWriterFrameOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_FRAME_ENABLE);
+                break;
+                case INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_CATEGORY:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERING:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_DELIMITER:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_LEVEL:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_POSITION:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_CHARACTERSTYLE:
+                case INS_PROP_CAP_OBJECT_GRAPHIC_APPLYATTRIBUTES:
+                    if(!pWriterGraphicOpt)
                     {
-                        if(bBool)
-                            nInsTblFlags|= tabopts::DEFAULT_BORDER;
+                        pWriterGraphicOpt = new InsCaptionOpt(GRAPHIC_CAP);
+                        pCapOptions->Insert(pWriterGraphicOpt);
                     }
-                    break;//"Table/Border",
-                    case INS_PROP_TABLE_SPLIT:
+                    lcl_ReadOpt(*pWriterGraphicOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE);
+                break;
+                case INS_PROP_CAP_OBJECT_CALC_ENABLE:
+                case INS_PROP_CAP_OBJECT_CALC_CATEGORY:
+                case INS_PROP_CAP_OBJECT_CALC_NUMBERING:
+                case INS_PROP_CAP_OBJECT_CALC_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_CALC_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_CALC_DELIMITER:
+                case INS_PROP_CAP_OBJECT_CALC_LEVEL:
+                case INS_PROP_CAP_OBJECT_CALC_POSITION:
+                case INS_PROP_CAP_OBJECT_CALC_CHARACTERSTYLE:
+                case INS_PROP_CAP_OBJECT_CALC_APPLYATTRIBUTES:
+                    if(!pOLECalcOpt)
                     {
-                        if(bBool)
-                            nInsTblFlags|= tabopts::SPLIT_LAYOUT;
+                        pOLECalcOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_CALC]);
+                        pCapOptions->Insert(pOLECalcOpt);
                     }
-                    break;//"Table/Split",
-                    case INS_PROP_CAP_AUTOMATIC:
-                        bInsWithCaption = bBool;
-                    break;
-                    case INS_PROP_CAP_CAPTIONORDERNUMBERINGFIRST: bCaptionOrderNumberingFirst = bBool; break;
-                    case INS_PROP_CAP_OBJECT_TABLE_ENABLE:
-                    case INS_PROP_CAP_OBJECT_TABLE_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_TABLE_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_TABLE_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_TABLE_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_TABLE_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_TABLE_LEVEL:
-                    case INS_PROP_CAP_OBJECT_TABLE_POSITION:
-                    case INS_PROP_CAP_OBJECT_TABLE_CHARACTERSTYLE:
-                        if(!pWriterTableOpt)
-                        {
-                            pWriterTableOpt = new InsCaptionOpt(TABLE_CAP);
-                            pCapOptions->Insert(pWriterTableOpt);
-                        }
-                        lcl_ReadOpt(*pWriterTableOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_TABLE_ENABLE);
-                    break;
-                    case INS_PROP_CAP_OBJECT_FRAME_ENABLE:
-                    case INS_PROP_CAP_OBJECT_FRAME_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_FRAME_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_FRAME_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_FRAME_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_FRAME_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_FRAME_LEVEL:
-                    case INS_PROP_CAP_OBJECT_FRAME_POSITION:
-                    case INS_PROP_CAP_OBJECT_FRAME_CHARACTERSTYLE:
-                        if(!pWriterFrameOpt)
-                        {
-                            pWriterFrameOpt = new InsCaptionOpt(FRAME_CAP);
-                            pCapOptions->Insert(pWriterFrameOpt);
-                        }
-                        lcl_ReadOpt(*pWriterFrameOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_FRAME_ENABLE);
-                    break;
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_LEVEL:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_POSITION:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_CHARACTERSTYLE:
-                    case INS_PROP_CAP_OBJECT_GRAPHIC_APPLYATTRIBUTES:
-                        if(!pWriterGraphicOpt)
-                        {
-                            pWriterGraphicOpt = new InsCaptionOpt(GRAPHIC_CAP);
-                            pCapOptions->Insert(pWriterGraphicOpt);
-                        }
-                        lcl_ReadOpt(*pWriterGraphicOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE);
-                    break;
-                    case INS_PROP_CAP_OBJECT_CALC_ENABLE:
-                    case INS_PROP_CAP_OBJECT_CALC_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_CALC_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_CALC_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_CALC_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_CALC_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_CALC_LEVEL:
-                    case INS_PROP_CAP_OBJECT_CALC_POSITION:
-                    case INS_PROP_CAP_OBJECT_CALC_CHARACTERSTYLE:
-                    case INS_PROP_CAP_OBJECT_CALC_APPLYATTRIBUTES:
-                        if(!pOLECalcOpt)
-                        {
-                            pOLECalcOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_CALC]);
-                            pCapOptions->Insert(pOLECalcOpt);
-                        }
-                        lcl_ReadOpt(*pOLECalcOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_CALC_ENABLE);
-                    break;
-                    case INS_PROP_CAP_OBJECT_IMPRESS_ENABLE:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_LEVEL:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_POSITION:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_CHARACTERSTYLE:
-                    case INS_PROP_CAP_OBJECT_IMPRESS_APPLYATTRIBUTES:
-                        if(!pOLEImpressOpt)
-                        {
-                            pOLEImpressOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_IMPRESS]);
-                            pCapOptions->Insert(pOLEImpressOpt);
-                        }
-                        lcl_ReadOpt(*pOLEImpressOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_IMPRESS_ENABLE);
-                    break;
-                    case INS_PROP_CAP_OBJECT_CHART_ENABLE:
-                    case INS_PROP_CAP_OBJECT_CHART_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_CHART_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_CHART_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_CHART_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_CHART_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_CHART_LEVEL:
-                    case INS_PROP_CAP_OBJECT_CHART_POSITION:
-                    case INS_PROP_CAP_OBJECT_CHART_CHARACTERSTYLE:
-                    case INS_PROP_CAP_OBJECT_CHART_APPLYATTRIBUTES:
-                        if(!pOLEChartOpt)
-                        {
-                            pOLEChartOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_CHART]);
-                            pCapOptions->Insert(pOLEChartOpt);
-                        }
-                        lcl_ReadOpt(*pOLEChartOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_CHART_ENABLE);
-                    break;
-                    case INS_PROP_CAP_OBJECT_FORMULA_ENABLE:
-                    case INS_PROP_CAP_OBJECT_FORMULA_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_FORMULA_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_FORMULA_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_FORMULA_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_FORMULA_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_FORMULA_LEVEL:
-                    case INS_PROP_CAP_OBJECT_FORMULA_POSITION:
-                    case INS_PROP_CAP_OBJECT_FORMULA_CHARACTERSTYLE:
-                    case INS_PROP_CAP_OBJECT_FORMULA_APPLYATTRIBUTES:
-                        if(!pOLEFormulaOpt)
-                        {
-                            pOLEFormulaOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_MATH]);
-                            pCapOptions->Insert(pOLEFormulaOpt);
-                        }
-                        lcl_ReadOpt(*pOLEFormulaOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_FORMULA_ENABLE);
-                    break;
-                    case INS_PROP_CAP_OBJECT_DRAW_ENABLE:
-                    case INS_PROP_CAP_OBJECT_DRAW_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_DRAW_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_DRAW_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_DRAW_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_DRAW_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_DRAW_LEVEL:
-                    case INS_PROP_CAP_OBJECT_DRAW_POSITION:
-                    case INS_PROP_CAP_OBJECT_DRAW_CHARACTERSTYLE:
-                    case INS_PROP_CAP_OBJECT_DRAW_APPLYATTRIBUTES:
-                        if(!pOLEDrawOpt)
-                        {
-                            pOLEDrawOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_DRAW]);
-                            pCapOptions->Insert(pOLEDrawOpt);
-                        }
-                        lcl_ReadOpt(*pOLEDrawOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_DRAW_ENABLE);
-                    break;
-                    case INS_PROP_CAP_OBJECT_OLEMISC_ENABLE:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_CATEGORY:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_NUMBERING:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_NUMBERINGSEPARATOR:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_CAPTIONTEXT:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_DELIMITER:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_LEVEL:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_POSITION:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_CHARACTERSTYLE:
-                    case INS_PROP_CAP_OBJECT_OLEMISC_APPLYATTRIBUTES:
-                        if(!pOLEMiscOpt)
-                        {
-                            pOLEMiscOpt = new InsCaptionOpt(OLE_CAP);
-                        }
-                        lcl_ReadOpt(*pOLEMiscOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_OLEMISC_ENABLE);
-                    break;
-                }
-            }
-            else if(nProp == INS_PROP_CAP_CAPTIONORDERNUMBERINGFIRST)
-            {
-                //#i61007#  initialize caption order, right now only HUNGARIAN seems to need a different order
-                SvtSysLocaleOptions aSysLocaleOptions;
-                OUString sLang = aSysLocaleOptions.GetLocaleConfigString();
-                bCaptionOrderNumberingFirst = sLang.startsWith( "hu" );
+                    lcl_ReadOpt(*pOLECalcOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_CALC_ENABLE);
+                break;
+                case INS_PROP_CAP_OBJECT_IMPRESS_ENABLE:
+                case INS_PROP_CAP_OBJECT_IMPRESS_CATEGORY:
+                case INS_PROP_CAP_OBJECT_IMPRESS_NUMBERING:
+                case INS_PROP_CAP_OBJECT_IMPRESS_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_IMPRESS_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_IMPRESS_DELIMITER:
+                case INS_PROP_CAP_OBJECT_IMPRESS_LEVEL:
+                case INS_PROP_CAP_OBJECT_IMPRESS_POSITION:
+                case INS_PROP_CAP_OBJECT_IMPRESS_CHARACTERSTYLE:
+                case INS_PROP_CAP_OBJECT_IMPRESS_APPLYATTRIBUTES:
+                    if(!pOLEImpressOpt)
+                    {
+                        pOLEImpressOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_IMPRESS]);
+                        pCapOptions->Insert(pOLEImpressOpt);
+                    }
+                    lcl_ReadOpt(*pOLEImpressOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_IMPRESS_ENABLE);
+                break;
+                case INS_PROP_CAP_OBJECT_CHART_ENABLE:
+                case INS_PROP_CAP_OBJECT_CHART_CATEGORY:
+                case INS_PROP_CAP_OBJECT_CHART_NUMBERING:
+                case INS_PROP_CAP_OBJECT_CHART_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_CHART_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_CHART_DELIMITER:
+                case INS_PROP_CAP_OBJECT_CHART_LEVEL:
+                case INS_PROP_CAP_OBJECT_CHART_POSITION:
+                case INS_PROP_CAP_OBJECT_CHART_CHARACTERSTYLE:
+                case INS_PROP_CAP_OBJECT_CHART_APPLYATTRIBUTES:
+                    if(!pOLEChartOpt)
+                    {
+                        pOLEChartOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_CHART]);
+                        pCapOptions->Insert(pOLEChartOpt);
+                    }
+                    lcl_ReadOpt(*pOLEChartOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_CHART_ENABLE);
+                break;
+                case INS_PROP_CAP_OBJECT_FORMULA_ENABLE:
+                case INS_PROP_CAP_OBJECT_FORMULA_CATEGORY:
+                case INS_PROP_CAP_OBJECT_FORMULA_NUMBERING:
+                case INS_PROP_CAP_OBJECT_FORMULA_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_FORMULA_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_FORMULA_DELIMITER:
+                case INS_PROP_CAP_OBJECT_FORMULA_LEVEL:
+                case INS_PROP_CAP_OBJECT_FORMULA_POSITION:
+                case INS_PROP_CAP_OBJECT_FORMULA_CHARACTERSTYLE:
+                case INS_PROP_CAP_OBJECT_FORMULA_APPLYATTRIBUTES:
+                    if(!pOLEFormulaOpt)
+                    {
+                        pOLEFormulaOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_MATH]);
+                        pCapOptions->Insert(pOLEFormulaOpt);
+                    }
+                    lcl_ReadOpt(*pOLEFormulaOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_FORMULA_ENABLE);
+                break;
+                case INS_PROP_CAP_OBJECT_DRAW_ENABLE:
+                case INS_PROP_CAP_OBJECT_DRAW_CATEGORY:
+                case INS_PROP_CAP_OBJECT_DRAW_NUMBERING:
+                case INS_PROP_CAP_OBJECT_DRAW_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_DRAW_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_DRAW_DELIMITER:
+                case INS_PROP_CAP_OBJECT_DRAW_LEVEL:
+                case INS_PROP_CAP_OBJECT_DRAW_POSITION:
+                case INS_PROP_CAP_OBJECT_DRAW_CHARACTERSTYLE:
+                case INS_PROP_CAP_OBJECT_DRAW_APPLYATTRIBUTES:
+                    if(!pOLEDrawOpt)
+                    {
+                        pOLEDrawOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_DRAW]);
+                        pCapOptions->Insert(pOLEDrawOpt);
+                    }
+                    lcl_ReadOpt(*pOLEDrawOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_DRAW_ENABLE);
+                break;
+                case INS_PROP_CAP_OBJECT_OLEMISC_ENABLE:
+                case INS_PROP_CAP_OBJECT_OLEMISC_CATEGORY:
+                case INS_PROP_CAP_OBJECT_OLEMISC_NUMBERING:
+                case INS_PROP_CAP_OBJECT_OLEMISC_NUMBERINGSEPARATOR:
+                case INS_PROP_CAP_OBJECT_OLEMISC_CAPTIONTEXT:
+                case INS_PROP_CAP_OBJECT_OLEMISC_DELIMITER:
+                case INS_PROP_CAP_OBJECT_OLEMISC_LEVEL:
+                case INS_PROP_CAP_OBJECT_OLEMISC_POSITION:
+                case INS_PROP_CAP_OBJECT_OLEMISC_CHARACTERSTYLE:
+                case INS_PROP_CAP_OBJECT_OLEMISC_APPLYATTRIBUTES:
+                    if(!pOLEMiscOpt)
+                    {
+                        pOLEMiscOpt = new InsCaptionOpt(OLE_CAP);
+                    }
+                    lcl_ReadOpt(*pOLEMiscOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_OLEMISC_ENABLE);
+                break;
             }
-
         }
-        aInsTblOpts.mnInsMode = nInsTblFlags;
+        else if (nProp == INS_PROP_CAP_CAPTIONORDERNUMBERINGFIRST)
+        {
+            //#i61007#  initialize caption order, right now only HUNGARIAN seems to need a different order
+            SvtSysLocaleOptions aSysLocaleOptions;
+            OUString sLang = aSysLocaleOptions.GetLocaleConfigString();
+            bCaptionOrderNumberingFirst = sLang.startsWith( "hu" );
+        }
+
     }
+    aInsTblOpts.mnInsMode = nInsTblFlags;
 }
 
 const Sequence<OUString>& SwTableConfig::GetPropertyNames()
@@ -1162,25 +1156,22 @@ void SwTableConfig::Load()
     const Sequence<OUString>& aNames = GetPropertyNames();
     Sequence<Any> aValues = GetProperties(aNames);
     const Any* pValues = aValues.getConstArray();
-    OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
-    if(aValues.getLength() == aNames.getLength())
+    assert(aValues.getLength() == aNames.getLength());
+    for (sal_Int32 nProp = 0; nProp < aNames.getLength(); ++nProp)
     {
-        for(int nProp = 0; nProp < aNames.getLength(); nProp++)
+        if (pValues[nProp].hasValue())
         {
-            if(pValues[nProp].hasValue())
+            sal_Int32 nTemp = 0;
+            switch (nProp)
             {
-                sal_Int32 nTemp = 0;
-                switch(nProp)
-                {
-                    case 0 : pValues[nProp] >>= nTemp; nTblHMove = (sal_uInt16)convertMm100ToTwip(nTemp); break;  //"Shift/Row",
-                    case 1 : pValues[nProp] >>= nTemp; nTblVMove = (sal_uInt16)convertMm100ToTwip(nTemp); break;     //"Shift/Column",
-                    case 2 : pValues[nProp] >>= nTemp; nTblHInsert = (sal_uInt16)convertMm100ToTwip(nTemp); break;   //"Insert/Row",
-                    case 3 : pValues[nProp] >>= nTemp; nTblVInsert = (sal_uInt16)convertMm100ToTwip(nTemp); break;   //"Insert/Column",
-                    case 4 : pValues[nProp] >>= nTemp; eTblChgMode = (TblChgMode)nTemp; break;   //"Change/Effect",
-                    case 5 : bInsTblFormatNum = *static_cast<sal_Bool const *>(pValues[nProp].getValue());  break;  //"Input/NumberRecognition",
-                    case 6 : bInsTblChangeNumFormat = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;  //"Input/NumberFormatRecognition",
-                    case 7 : bInsTblAlignNum = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;  //"Input/Alignment"
-                }
+                case 0 : pValues[nProp] >>= nTemp; nTblHMove = (sal_uInt16)convertMm100ToTwip(nTemp); break;  //"Shift/Row",
+                case 1 : pValues[nProp] >>= nTemp; nTblVMove = (sal_uInt16)convertMm100ToTwip(nTemp); break;     //"Shift/Column",
+                case 2 : pValues[nProp] >>= nTemp; nTblHInsert = (sal_uInt16)convertMm100ToTwip(nTemp); break;   //"Insert/Row",
+                case 3 : pValues[nProp] >>= nTemp; nTblVInsert = (sal_uInt16)convertMm100ToTwip(nTemp); break;   //"Insert/Column",
+                case 4 : pValues[nProp] >>= nTemp; eTblChgMode = (TblChgMode)nTemp; break;   //"Change/Effect",
+                case 5 : bInsTblFormatNum = *static_cast<sal_Bool const *>(pValues[nProp].getValue());  break;  //"Input/NumberRecognition",
+                case 6 : bInsTblChangeNumFormat = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;  //"Input/NumberFormatRecognition",
+                case 7 : bInsTblAlignNum = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;  //"Input/Alignment"
             }
         }
     }
@@ -1271,31 +1262,28 @@ void SwMiscConfig::Load()
     const Sequence<OUString>& aNames = GetPropertyNames();
     Sequence<Any> aValues = GetProperties(aNames);
     const Any* pValues = aValues.getConstArray();
-    OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
-    if(aValues.getLength() == aNames.getLength())
+    assert(aValues.getLength() == aNames.getLength());
+    OUString sTmp;
+    for (sal_Int32 nProp = 0; nProp < aNames.getLength(); ++nProp)
     {
-        OUString sTmp;
-        for(int nProp = 0; nProp < aNames.getLength(); nProp++)
+        if (pValues[nProp].hasValue())
         {
-            if(pValues[nProp].hasValue())
+            switch (nProp)
             {
-                switch(nProp)
-                {
-                    case 0 : pValues[nProp] >>= sTmp;
-                        sWordDelimiter = SwModuleOptions::ConvertWordDelimiter(sTmp, true);
-                    break;
-                    case 1 : bDefaultFontsInCurrDocOnly = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                    case 2 : bShowIndexPreview = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                    case 3 : bGrfToGalleryAsLnk = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                    case 4 : bNumAlignSize = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                    case 5 : bSinglePrintJob = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                    case 6 : nMailingFormats = static_cast<MailTxtFormats>(*static_cast<sal_uInt8 const *>(pValues[nProp].getValue())); break;
-                    case 7 : pValues[nProp] >>= sTmp; sNameFromColumn = sTmp; break;
-                    case 8 : pValues[nProp] >>= sTmp; sMailingPath = sTmp;  break;
-                    case 9 : pValues[nProp] >>= sTmp; sMailName = sTmp;     break;
-                    case 10: bIsNameFromColumn = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                    case 11: pValues[nProp] >>= bAskForMailMergeInPrint; break;
-                }
+                case 0 : pValues[nProp] >>= sTmp;
+                    sWordDelimiter = SwModuleOptions::ConvertWordDelimiter(sTmp, true);
+                break;
+                case 1 : bDefaultFontsInCurrDocOnly = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+                case 2 : bShowIndexPreview = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+                case 3 : bGrfToGalleryAsLnk = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+                case 4 : bNumAlignSize = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+                case 5 : bSinglePrintJob = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+                case 6 : nMailingFormats = static_cast<MailTxtFormats>(*static_cast<sal_uInt8 const *>(pValues[nProp].getValue())); break;
+                case 7 : pValues[nProp] >>= sTmp; sNameFromColumn = sTmp; break;
+                case 8 : pValues[nProp] >>= sTmp; sMailingPath = sTmp;  break;
+                case 9 : pValues[nProp] >>= sTmp; sMailName = sTmp;     break;
+                case 10: bIsNameFromColumn = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+                case 11: pValues[nProp] >>= bAskForMailMergeInPrint; break;
             }
         }
     }
@@ -1360,24 +1348,21 @@ void SwCompareConfig::Load()
     const Sequence<OUString>& aNames = GetPropertyNames();
     Sequence<Any> aValues = GetProperties(aNames);
     const Any* pValues = aValues.getConstArray();
-    DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
-    if(aValues.getLength() == aNames.getLength())
+    assert(aValues.getLength() == aNames.getLength());
+    for (sal_Int32 nProp = 0; nProp < aNames.getLength(); nProp++)
     {
-        for(int nProp = 0; nProp < aNames.getLength(); nProp++)
+        if (pValues[nProp].hasValue())
         {
-            if(pValues[nProp].hasValue())
-            {
-                sal_Int32 nVal = 0;
-                pValues[nProp] >>= nVal;
+            sal_Int32 nVal = 0;
+            pValues[nProp] >>= nVal;
 
-                switch(nProp)
-                {
-                    case 0 : eCmpMode = (SvxCompareMode) nVal; break;;
-                    case 1 : bUseRsid = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                    case 2 : bIgnorePieces = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                    case 3 : nPieceLen = nVal; break;
-                    case 4 : m_bStoreRsid = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                }
+            switch(nProp)
+            {
+                case 0 : eCmpMode = (SvxCompareMode) nVal; break;;
+                case 1 : bUseRsid = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+                case 2 : bIgnorePieces = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+                case 3 : nPieceLen = nVal; break;
+                case 4 : m_bStoreRsid = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
             }
         }
     }


More information about the Libreoffice-commits mailing list