summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-12-16 15:41:38 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-12-16 16:02:19 +0100
commit72f0067258fd7738217abd43452abe282e05c11b (patch)
treeb039f65f342366264867f1c692f2c9c4f51c66ec /sw/source
parent97361478e64f11330f7f7aea819d60c7562fb0f6 (diff)
tdf#96536 sw Hide Whitespace: shrink oversized page frames on para delete
The body frame did get a request to shrink, but because it had fixed size, nothing happened. Trigger a recalc that does the right thing wrt. hidden whitespace. Change-Id: I446978da8b33372c2ab30200b45b1bcec1dea7a0
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/calcmove.cxx3
-rw-r--r--sw/source/core/layout/wsfrm.cxx15
2 files changed, 17 insertions, 1 deletions
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 922041702f1e..21d479a79131 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1522,7 +1522,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
const long nPrtBottom = (GetUpper()->*fnRect->fnGetPrtBottom)();
long nBottomDist = (Frame().*fnRect->fnBottomDist)(nPrtBottom);
- if (getRootFrame()->GetCurrShell()->GetViewOptions()->IsWhitespaceHidden())
+ SwViewShell* pShell = getRootFrame()->GetCurrShell();
+ if (pShell && pShell->GetViewOptions()->IsWhitespaceHidden())
{
// When whitespace is hidden, the page frame has two heights: the
// nominal (defined by the frame format), and the actual (which is
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index edd660df2471..0f60476f84ce 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2358,6 +2358,21 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
const bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const sal_uInt16 nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse by Body.
+
+ if (pSh && pSh->GetViewOptions()->IsWhitespaceHidden())
+ {
+ if (IsBodyFrame())
+ {
+ // Whitespace is hidden and this body frame will not shrink, as it
+ // has a fix size.
+ // Invalidate the page frame size, so in case the reason for the
+ // shrink was that there is more whitespace on this page, the size
+ // without whitespace will be recalculated correctly.
+ SwPageFrame* pPageFrame = FindPageFrame();
+ pPageFrame->InvalidateSize();
+ }
+ }
+
if( !(GetType() & nTmpType) && HasFixSize() )
return 0;