summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-03-17 23:49:37 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-19 16:10:33 +0100
commit68fd5b36e31f7d0efbefc14d018b10cc9c7de22c (patch)
tree38f7a4edb25b15306f8a68e43f8f8c13f6956ff7 /editeng/source
parente0b94a575024b6d20c4adb117a6d3a0079d80d39 (diff)
tdf#112118: Use correct border when calculating margin
This is a longstanding (at least since 2000: already present in commit 7b0b5cdf) error where left border linespace was used when calculating right margin. It was copypasted from ww8 import to ooxml code verbatim. The problem only manifests itself when left and right border spacings are not the same; and since we had other errors in the borders import, that additional problem simply wasn't apparent. Also use scaled border width in border distance/margin calculations. Unit tests updated. Change-Id: I70961e1bde29471def69e1ef944ba2779cffe307 Reviewed-on: https://gerrit.libreoffice.org/51474 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/51489 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/items/frmitems.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index b6494b764e01..a82259546566 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2984,10 +2984,10 @@ void BorderDistancesToWord(const SvxBoxItem& rBox, const WordPageMargins& rMargi
const SvxBorderLine* pLnR = rBox.GetLine(SvxBoxItemLine::RIGHT);
// We need to take border widths into account
- const long nWidthT = pLnT ? pLnT->GetWidth() : 0;
- const long nWidthL = pLnL ? pLnL->GetWidth() : 0;
- const long nWidthB = pLnB ? pLnB->GetWidth() : 0;
- const long nWidthR = pLnR ? pLnR->GetWidth() : 0;
+ const long nWidthT = pLnT ? pLnT->GetScaledWidth() : 0;
+ const long nWidthL = pLnL ? pLnL->GetScaledWidth() : 0;
+ const long nWidthB = pLnB ? pLnB->GetScaledWidth() : 0;
+ const long nWidthR = pLnR ? pLnR->GetScaledWidth() : 0;
// Resulting distances from text to borders
const sal_Int32 nT2BT = pLnT ? nT : 0;