ofz#21531 limit to ord number under total obj count

which fails recently since...

commit b74798941d
Author: Julien Nabet <serval2412@yahoo.fr>
Date:   Mon Mar 30 09:42:08 2020 +0200

    Simplify SdrObjList::GetObj (svx/svdpage)

commit 8bbd58eca1
Date:   Sun Mar 29 22:44:52 2020 +0200

    Replace OSL_ASSERT by assert in GetObj (svx/svdpage)

Change-Id: Ieaafe4af370ecb83a95246010f2a973f503d12c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91422
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2020-04-01 20:26:05 +02:00
parent 6922748cea
commit 57229c65dc
2 changed files with 3 additions and 1 deletions
Binary file not shown.
+3 -1
View File
@@ -367,9 +367,11 @@ void SdPage::lateInit(const SdPage& rSrcPage)
// use shape list directly to preserve constness of rSrcPage
const std::list< SdrObject* >& rShapeList = rSrcPage.maPresentationShapeList.getList();
const size_t nObjCount = GetObjCount();
for( SdrObject* pObj : rShapeList )
{
InsertPresObj(GetObj(pObj->GetOrdNum()), rSrcPage.GetPresObjKind(pObj));
size_t nOrdNum = pObj->GetOrdNum();
InsertPresObj(nOrdNum < nObjCount ? GetObj(nOrdNum) : nullptr, rSrcPage.GetPresObjKind(pObj));
}
// header footer