summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff')
-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