summaryrefslogtreecommitdiff
path: root/sw/source/core/objectpositioning
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2020-08-14 08:19:28 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-24 17:31:16 +0200
commit6788133b3bdf02097d66a99047aa7bcba3a99a66 (patch)
treeff1f1c18a5d630a8350205f59d35cd85f1948329 /sw/source/core/objectpositioning
parent92b37ecdef6ca915698d91cdfd053bb3950a0f98 (diff)
tdf#135720 sw: fix PAGE_PRINT_AREA_BOTTOM alignment with footer
Top of the page margin area was the footer instead of the page text area bottom, when the vertical position of the object was "top" or "center" instead of "from top", resulting lower positions after DOCX import. Follow-up of commit d54264e34c1ccc0eaf4178ab165a843028500223 (tdf#133071 DOCX import: fix vertical alignment to bottom page margin) Co-authored-by: Attila Szűcs (NISZ) Change-Id: I4be46501fc4a3e5fb17330ea5f695a65014a7585 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100720 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/objectpositioning')
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 236e4fafa6f0..d83eaffb106d 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -292,6 +292,23 @@ void SwAnchoredObjectPosition::GetVertAlignmentValues(
nOffset = aRectFnSet.YDiff(
aRectFnSet.GetPrtBottom(_rPageAlignLayFrame),
nVertOrientTop);
+
+ if (_rPageAlignLayFrame.IsPageFrame() && !aRectFnSet.IsVert())
+ {
+ const SwFrame* pPrtFrame =
+ static_cast<const SwPageFrame&>(_rPageAlignLayFrame).Lower();
+
+ while (pPrtFrame)
+ {
+ if (pPrtFrame->IsFooterFrame())
+ {
+ nHeight += pPrtFrame->getFrameArea().Height();
+ nOffset -= pPrtFrame->getFrameArea().Height();
+ }
+ pPrtFrame = pPrtFrame->GetNext();
+ }
+ }
+
}
break;
// #i22341# - vertical alignment at top of line