related tdf#80194 editeng RTF: set automatic subscript for \sub

The RTF specs say that \sub means "Subscripts text and shrinks
point size according to font information."
while \up is unambiguous with "Subscript position in half-points
(the default is 6)."

So, \sub leaves it up to the program to set the best values
for subscripting or superscripting. That would correspond
to the auto values.

Previously, this translated into a 26% superscript (close to
the default of 33%) and a 26% subscript (which is way too low).

For unit tests: although I managed to open an RTF file in draw,
it had no text in it, so I couldn't write a test. In the UI,
you use the Page menu to "Insert page from file".

Change-Id: I06003dbe2177fc87237624438b4daaaaf2482631
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89020
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index acfc59c..45a579d 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -540,13 +540,13 @@ SET_FONTALIGNMENT:
                if( aPlainMap.nEscapement )
                {
                    const sal_uInt16 nEsc = aPlainMap.nEscapement;
                    if( -1 == nTokenValue || RTF_SUB == nToken )
                        nTokenValue = 6;
                    if( -1 == nTokenValue )
                         nTokenValue = 6;  //RTF default \dn value in half-points
                    if( IsCalcValue() )
                        CalcValue();
                    const SvxEscapementItem& rOld =
                        static_cast<const SvxEscapementItem&>(pSet->Get( nEsc,false));
                    short nEs;
                    sal_Int16 nEs;
                    sal_uInt8 nProp;
                    if( DFLT_ESC_AUTO_SUPER == rOld.GetEsc() )
                    {
@@ -555,7 +555,7 @@ SET_FONTALIGNMENT:
                    }
                    else
                    {
                        nEs = static_cast<short>(-nTokenValue);
                        nEs = (nToken == RTF_SUB) ? DFLT_ESC_AUTO_SUB : -nTokenValue;
                        nProp = (nToken == RTF_SUB) ? DFLT_ESC_PROP : 100;
                    }
                    pSet->Put( SvxEscapementItem( nEs, nProp, nEsc ));
@@ -900,13 +900,13 @@ ATTR_SETOVERLINE:
                if( aPlainMap.nEscapement )
                {
                    const sal_uInt16 nEsc = aPlainMap.nEscapement;
                    if( -1 == nTokenValue || RTF_SUPER == nToken )
                        nTokenValue = 6;
                    if( -1 == nTokenValue )
                        nTokenValue = 6;  //RTF default \up value in half-points
                    if( IsCalcValue() )
                        CalcValue();
                    const SvxEscapementItem& rOld =
                        static_cast<const SvxEscapementItem&>(pSet->Get( nEsc,false));
                    short nEs;
                    sal_Int16 nEs;
                    sal_uInt8 nProp;
                    if( DFLT_ESC_AUTO_SUB == rOld.GetEsc() )
                    {
@@ -915,7 +915,7 @@ ATTR_SETOVERLINE:
                    }
                    else
                    {
                        nEs = static_cast<short>(nTokenValue);
                        nEs =  (nToken == RTF_SUPER) ? DFLT_ESC_AUTO_SUPER : nTokenValue;
                        nProp = (nToken == RTF_SUPER) ? DFLT_ESC_PROP : 100;
                    }
                    pSet->Put( SvxEscapementItem( nEs, nProp, nEsc ));