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 /editeng | |
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 'editeng')
-rw-r--r-- | editeng/source/items/svxfont.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index 891f3e2ab7c0..a8792df4c729 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -510,9 +510,17 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter, { short nTmpEsc; if( DFLT_ESC_AUTO_SUPER == nEsc ) + { + nTmpEsc = .8 * (100 - nPropr); + assert (nTmpEsc == DFLT_ESC_SUPER && "I'm sure this formula needs to be changed, but how to confirm that???"); nTmpEsc = DFLT_ESC_SUPER; + } else if( DFLT_ESC_AUTO_SUB == nEsc ) + { + nTmpEsc = .2 * -(100 - nPropr); + assert (nTmpEsc == -20 && "I'm sure this formula needs to be changed, but how to confirm that???"); nTmpEsc = -20; + } else nTmpEsc = nEsc; Size aSize = GetFontSize(); |