summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2020-02-21 14:21:08 +0300
committerJustin Luth <justin_luth@sil.org>2020-03-11 20:28:09 +0100
commitba09d436dfd1f0b07b95aad3d375e7cd7318440b (patch)
tree43d117d01960230bac29c249b47d99b319a5e361 /svx
parent97e9a83888a377035f99fc6dd0566482469a3dfa (diff)
tdf#89849 editeng: adjust escapement before resetting Propr
THIS IS A LAYOUT REGRESSION FIX FOR SUBSCRIPTS/SUPERSCRIPTS. The position of subscripts and superscripts is a percentage based on the 100% fontsize. When LO 4.1 tricked the font into thinking it was 100%, it failed to adjust the escapement to be relative to the new fake size. In the default case, this meant that the superscript was only raised about half as much as it should have. THIS CHANGE WILL AFFECT EXISTING DOCUMENTS WHERE THE TEXTBOX IS SET TO "AUTOFIT THE TEXT". This will primarily be Impress documents, since many of the templates enable autofit text. As a result of this bug, users creating new documents since 4.1 using autofit-text will have specified highly exaggerated subscript/superscript positioning in order to look nice. This fix will expose the exaggerated percentages and make the document look poor. I don't know how that can be avoided. Nor do I know how to create a unit test for a layout bug. I guess QA's PDF compare tests will suffice for this. A clearly exaggerated unit test is attached to the bug report. The new ability to have a larger-than-100% escapement in LO 6.3 comes in handy here, so that small superscripts can gain a fake escapment big enough to put them in the proper position. Change-Id: I0f8dcff8741eb05d8657235930a4eb684629b9d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89214 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 9f56c2730eb3..36734264f185 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -197,13 +197,13 @@ namespace
nEsc = -20;
}
- if(nEsc > 100)
+ if(nEsc > MAX_ESC_POS)
{
- nEsc = 100;
+ nEsc = MAX_ESC_POS;
}
- else if(nEsc < -100)
+ else if(nEsc < -MAX_ESC_POS)
{
- nEsc = -100;
+ nEsc = -MAX_ESC_POS;
}
const double fEscapement(nEsc / -100.0);