diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-29 11:43:43 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-29 11:50:43 +0100 |
commit | 7c7fdf3e97bbf2301f9938082d4d44162f4ec3c0 (patch) | |
tree | 02a323692cbef5c115c0d63adbf12cf3ce89f760 | |
parent | 9941687ff16d3a4b393563006ca4bdee5409fdbb (diff) |
swpagerelsize: take care of GetHeightPercentRelation() in SwFlyFrm::CalcRel
Layout part, height.
Change-Id: Iee239e1a39dd495ee965ac45325a0f7087fdcdfa
-rw-r--r-- | sw/source/core/layout/fly.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 8f42605785b4..1aa75a534f84 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2487,7 +2487,8 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize &rSz ) const // When size is a relative to page size, ignore size of SwBodyFrm. if (rSz.GetWidthPercentRelation() != text::RelOrientation::PAGE_FRAME) nRelWidth = std::min( nRelWidth, pRel->Prt().Width() ); - nRelHeight = std::min( nRelHeight, pRel->Prt().Height() ); + if (rSz.GetHeightPercentRelation() != text::RelOrientation::PAGE_FRAME) + nRelHeight = std::min( nRelHeight, pRel->Prt().Height() ); if( !pRel->IsPageFrm() ) { const SwPageFrm* pPage = FindPageFrm(); @@ -2498,7 +2499,11 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize &rSz ) const nRelWidth = std::min( nRelWidth, pPage->Frm().Width() ); else nRelWidth = std::min( nRelWidth, pPage->Prt().Width() ); - nRelHeight = std::min( nRelHeight, pPage->Prt().Height() ); + if (rSz.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME) + // Ignore margins of pPage. + nRelHeight = std::min( nRelHeight, pPage->Frm().Height() ); + else + nRelHeight = std::min( nRelHeight, pPage->Prt().Height() ); } } |