Kaydet (Commit) 7ffb5349 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Miklos Vajna

SwPageFrm::MakeAll Refactored

Browser and Hide Whitespace page height now use
SwPageFrm::GetContentHeight, which is const.

A few improvements are done for both paths as well.

Reviewed-on: https://gerrit.libreoffice.org/19730Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
(cherry picked from commit f05da45c)

Conflicts:
	sw/source/core/layout/calcmove.cxx

Change-Id: I73a8e920ccfa96d76cbbb002bed6a85f2e636ede
üst 98195b6d
......@@ -111,7 +111,7 @@ protected:
virtual void SwClientNotify(const SwModify&, const SfxHint&) SAL_OVERRIDE;
/// Calculate the content height of a page (without columns).
size_t GetContentHeight();
size_t GetContentHeight(const long nTop, const long nBottom) const;
public:
DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm)
......
......@@ -118,15 +118,20 @@ public:
bool CalcMinDiff( SwTwips& rMinDiff ) const;
/**
* If we don't pass a @param bOverSize or false, the return value is > 0 for
* undersized Frames, or 0
* Returns the size delta that the section would like to be
* greater if it has undersized TextFrms in it.
*
* If we don't pass a @param bOverSize or false, the return value
* is > 0 for undersized Frames, or 0 otherwise.
* If @param bOverSize == true, we can also get a negative return value,
* if the SectionFrm is not completely filled, which happens often for
* e.g. SectionFrms with Follows.
*
* If necessary the undersized-flag is corrected.
* We need this in the FormatWidthCols to "deflate" columns there.
*/
long Undersize( bool bOverSize = false );
SwTwips Undersize(bool bOverSize = false);
SwTwips Undersize() const;
/// Adapt size to surroundings
void _CheckClipping( bool bGrow, bool bMaximize );
......
......@@ -2491,21 +2491,18 @@ void SwSectionFrm::InvalidateFootnotePos()
}
}
/** Returns the value that the section would like to be
* greater if it has undersized TextFrms in it,
* otherwise Null.
* If necessary the undersized-flag is corrected.
*/
long SwSectionFrm::Undersize( bool bOverSize )
SwTwips SwSectionFrm::Undersize() const
{
m_bUndersized = false;
SWRECTFN( this )
long nRet = InnerHeight() - (Prt().*fnRect->fnGetHeight)();
if( nRet > 0 )
m_bUndersized = true;
else if( !bOverSize )
nRet = 0;
return nRet;
SWRECTFN(this);
return InnerHeight() - (Prt().*fnRect->fnGetHeight)();
}
SwTwips SwSectionFrm::Undersize(bool bOverSize)
{
SWRECTFN(this);
const auto nRet = InnerHeight() - (Prt().*fnRect->fnGetHeight)();
m_bUndersized = (nRet > 0);
return (nRet <= 0 && !bOverSize) ? 0 : nRet;
}
void SwSectionFrm::CalcFootnoteContent()
......
......@@ -2938,7 +2938,7 @@ void SwLayoutFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
const sal_uInt16 nRight = (sal_uInt16)pAttrs->CalcRight(this);
const sal_uInt16 nLower = pAttrs->CalcBottom();
bool bVert = IsVertical() && !IsPageFrm();
const bool bVert = IsVertical() && !IsPageFrm();
SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
if ( !mbValidPrtArea )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment