sw/source/uibase/dbui/dbmgr.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit e8a46b0171a49e6b49a2e7b89c8bdfef84ef41ef
Author: Michael Weghorn <m.wegh...@posteo.de>
Date:   Mon Jun 11 17:20:44 2018 +0200

    tdf#118113 MM: Make sure page count is up to date
    
    Since the page layout may have changed, e.g. due to
    the visibility status of hidden sections having changed
    in the call to 'pWorkShell->SwViewShell::UpdateFields()',
    it's necessary to recalculate the layout to ensure that
    the correct page count is retrieved when calling
    'pWorkShell->CalcLayout()'.
    
    This fixes a regression introduced by the performance
    optimization done in commit
    ae5afe9bcebdd220a457829d47882fe8a0cf69fd, while
    still avoiding to have to do the expensive layout for the
    target document.
    
    Change-Id: I46f1b68758e4df330c17358a8e852e8b040a9520
    Reviewed-on: https://gerrit.libreoffice.org/55636
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>
    (cherry picked from commit 89f896d2cfd84b711583f98a6343e9835a9aed11)
    Reviewed-on: https://gerrit.libreoffice.org/55707
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 9b29507fa46b..77e8297f8892 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1550,6 +1550,8 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
                     ++targetDocPageCount; // Docs always start on odd pages 
(so offset must be even).
                 SwNodeIndex appendedDocStart = pTargetDoc->AppendDoc( 
*pWorkDoc,
                     nStartingPageNo, !bWorkDocInitialized, targetDocPageCount, 
nDocNo);
+                // ensure layout is up to date in order to get correct page 
count
+                pWorkShell->CalcLayout();
                 targetDocPageCount += pWorkShell->GetPageCnt();
 
                 if ( (nMaxDumpDocs < 0) || (nDocNo <= nMaxDumpDocs) )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to