diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-08-10 09:47:40 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-08-29 13:13:15 +0200 |
commit | 9eff9e699e17cc5a8a25895bd28dc8e4ceb8071e (patch) | |
tree | a63d87649f68250a343eb8c30ad537c07a9743f2 | |
parent | 28b4c575703430602c72a442f59bb5f9f6aeb749 (diff) |
Don't re-check valid SwPageDescs when layouting
nCheckPageNum is set to USHRT_MAX, if all SwPageDesc were checked.
Code manipulating SwPageFrm objects checks the pages via
CheckPageDescs(). If this is currently forbidden, CheckPageDescs()
sets nCheckPageNum to the first page to check.
I guess the !pPage check is there to check the pages - at the end,
if someone has missed the CheckPageDescs call. And we have to run
the check, if the current page is unchecked AKA
pPage->GetPhyPageNum() >= nCheckPageNum
to do correct layouting.
Change-Id: Ib67878115cde04b7161c919a67131a1e1dc67d8d
-rw-r--r-- | sw/source/core/layout/layact.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index a8d04afc4e38..f4164265f453 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -454,7 +454,10 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) sal_uInt16 nPercentPageNum = 0; while ( (pPage && !IsInterrupt()) || m_nCheckPageNum != USHRT_MAX ) { - if (!pPage || (m_nCheckPageNum != USHRT_MAX && pPage->GetPhyPageNum() >= m_nCheckPageNum)) + // nCheckPageNum is set to USHRT_MAX in this code path after we have + // checked the SwPageDescs and set tos the minimal changed SwPageDesc. + // We don't need to check the SwPageDescs without changes. + if ( (m_nCheckPageNum != USHRT_MAX) && (!pPage || pPage->GetPhyPageNum() >= m_nCheckPageNum) ) { if ( !pPage || pPage->GetPhyPageNum() > m_nCheckPageNum ) { |