xmloff/source/draw/ximpstyl.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit 498c2d3944b666c2f016b65903001920db2cb2a4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Nov 6 10:00:53 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Nov 7 15:52:08 2019 +0100 fetch the values just once Change-Id: I915dbba18f560cedf4dc719b25c889e8b02aa0c2 Reviewed-on: https://gerrit.libreoffice.org/82212 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index e44881f0aa62..929fa5b37aa2 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -1396,15 +1396,17 @@ SvXMLImportContextRef SdXMLMasterStylesContext::CreateChildContext( if( xMasterPages.is() ) { - if(GetSdImport().GetNewMasterPageCount() + 1 > xMasterPages->getCount()) + sal_Int32 nNewMasterPageCount = GetSdImport().GetNewMasterPageCount(); + sal_Int32 nMasterPageCount = xMasterPages->getCount(); + if (nNewMasterPageCount + 1 > nMasterPageCount) { // new page, create and insert - xNewMasterPage = xMasterPages->insertNewByIndex(xMasterPages->getCount()); + xNewMasterPage = xMasterPages->insertNewByIndex(nMasterPageCount); } else { // existing page, use it - xMasterPages->getByIndex(GetSdImport().GetNewMasterPageCount()) >>= xNewMasterPage; + xMasterPages->getByIndex(nNewMasterPageCount) >>= xNewMasterPage; } // increment global import page counter _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits