summaryrefslogtreecommitdiff
path: root/sw/source/core/objectpositioning
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-04-28 17:28:16 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-04-28 19:26:17 +0200
commitdd52fdba87d0cfee039cc236b86241708d4e63b8 (patch)
treeb931d30a853c5d06357cf2e210f3b78dabf7cfb0 /sw/source/core/objectpositioning
parent781a1a82231ee4b95733dfb76249224948d6d894 (diff)
sw from-bottom relative orientation: add layout
The implementation is a combination of what "bottom" and "from-top" already provided. Change-Id: Id7bac8cbcccbadcca377fe9946a21ccb3e368913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93086 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/objectpositioning')
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 3c40f3b91aef..95331da7f8a2 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -543,6 +543,18 @@ void SwToContentAnchoredObjectPosition::CalcPosition()
aRectFnSet.GetTop(aPgPrtRect),
nTopOfOrient );
}
+ else if (aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM)
+ {
+ // The anchored object is relative from the bottom of the page's print area.
+ SwRect aPgPrtRect(rPageAlignLayFrame.getFrameArea());
+ if (rPageAlignLayFrame.IsPageFrame())
+ {
+ auto& rPageFrame = static_cast<const SwPageFrame&>(rPageAlignLayFrame);
+ aPgPrtRect = rPageFrame.PrtWithoutHeaderAndFooter();
+ }
+ SwTwips nPageBottom = aRectFnSet.GetBottom(aPgPrtRect);
+ nVertOffsetToFrameAnchorPos += aRectFnSet.YDiff(nPageBottom, nTopOfOrient);
+ }
nRelPosY = nVertOffsetToFrameAnchorPos + aVert.GetPos();
}