summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-06 10:00:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-07 15:52:08 +0100
commit498c2d3944b666c2f016b65903001920db2cb2a4 (patch)
tree4eed15b04975f3213d7ac6d6112adfc15aa24953
parentd5cb1c694cb52e83781363d292a6d2d80fbd9c51 (diff)
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>
-rw-r--r--xmloff/source/draw/ximpstyl.cxx8
1 files changed, 5 insertions, 3 deletions
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