diff options
author | Justin Luth <justin_luth@sil.org> | 2020-02-19 08:49:07 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2020-03-13 05:33:10 +0100 |
commit | 888cff8bb0326153415b1d64d1ca6a45ac3ae84c (patch) | |
tree | a756e8ef7faf07768c567b9c782a9756585e6e6f /svx | |
parent | eef1bfd60ac7988dedec35998747320a36121e04 (diff) |
tdf#80194 proof search: assert to find proof of code correctness.
I'm sure that these functions need to change because they
just seem very wrong. I think these are fall-back, safety
sections because usually the nEsc is already converted
away from _AUTO_ prior to reaching this point.
But this is all just based on code-reading.
It would be nice to have proof of this - especially
since the values for subscript are unexpected. I would
have expected it to use a value comparable to DFLT_ESC_SUB,
and not some random/magical -20.
(Note: the _AUTO_SUPER historically refered to an absolute 33
and not DFLT_ESC_SUPER until I recently changed that...)
Change-Id: I3bef0841f9a20f09994b2372e9a7db5941b29c9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88997
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 36734264f185..8769b16b8ddc 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -171,7 +171,8 @@ namespace aNewTransform.scale(aFontScaling.getX(), aFontScaling.getY()); // look for proportional font scaling, if necessary, scale accordingly - if(100 != rInfo.mrFont.GetPropr()) + sal_Int8 nPropr(rInfo.mrFont.GetPropr()); + if(100 != nPropr) { const double fFactor(rInfo.mrFont.GetPropr() / 100.0); aNewTransform.scale(fFactor, fFactor); @@ -190,10 +191,14 @@ namespace if(DFLT_ESC_AUTO_SUPER == nEsc) { + nEsc = .8 * (100 - nPropr); + assert (nEsc == DFLT_ESC_SUPER && "I'm sure this formula needs to be changed, but how to confirm that???"); nEsc = DFLT_ESC_SUPER; } else if(DFLT_ESC_AUTO_SUB == nEsc) { + nEsc = .2 * -(100 - nPropr); + assert (nEsc == -20 && "I'm sure this formula needs to be changed, but how to confirm that???"); nEsc = -20; } |