Resolves: tdf#127695 IsGroupObject == true doesn't mean its a SdrObjGroup

but that it has a SubList

Change-Id: I473464de5c6bba5c36be1ad7cbd21a3158645d66
Reviewed-on: https://gerrit.libreoffice.org/79412
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 4d8775f..851be694 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1306,10 +1306,12 @@ static void lcl_SetNumUsedBit(std::vector<sal_uInt8>& rSetFlags, size_t nFormatS
    // contents for name collision check
    if (rObj.IsGroupObject())
    {
        const SdrObjGroup &rGroupObj = static_cast<const SdrObjGroup&>(rObj);
        for (size_t i = 0, nCount = rGroupObj.GetObjCount(); i < nCount; ++i)
        const SdrObjList* pSub(rObj.GetSubList());
        assert(pSub && "IsGroupObject is implented as GetSubList != nullptr");
        const size_t nCount = pSub->GetObjCount();
        for (size_t i = 0; i < nCount; ++i)
        {
            SdrObject* pObj = rGroupObj.GetObj(i);
            SdrObject* pObj = pSub->GetObj(i);
            if (!pObj)
                continue;
            lcl_SetNumUsedBit(rSetFlags, nFormatSize, nNmLen, *pObj, rCmpName);