[Libreoffice-commits] core.git: xmloff/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 7 14:52:51 UTC 2019


 xmloff/source/draw/ximpstyl.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 498c2d3944b666c2f016b65903001920db2cb2a4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 6 10:00:53 2019 +0000
Commit:     Caolán McNamara <caolanm at 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 <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at 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


More information about the Libreoffice-commits mailing list