fetch the values just once
Change-Id: I915dbba18f560cedf4dc719b25c889e8b02aa0c2
Reviewed-on: https://gerrit.libreoffice.org/82212
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index e44881f0..929fa5b 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