Kaydet (Commit) 32262b0a authored tarafından László Németh's avatar László Németh

tdf#120412 char formatting UI: clean-up DFLT_ESC_AUTO

Default auto values must be outside of the new
enlarged range of the superscript/subscript percent values.

Note: the raising limit was modified to 13999 from 14400,
because the RTF unit test tdf112208_hangingIndent.rtf
lost its hanging from the bigger value.

Change-Id: I3a7e9715a27570278ee4ee70f9fc9ad29457e100
Reviewed-on: https://gerrit.libreoffice.org/73166
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst a2720a24
......@@ -2705,7 +2705,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
m_nSubProp = static_cast<sal_uInt8>(sUser.getToken( 0, ';', nIdx ).toInt32());
// tdf#120412 up to 14400% (eg. 1584 pt with 11 pt letters)
m_xHighLowMF->set_max(14400, FieldUnit::PERCENT);
m_xHighLowMF->set_max(MAX_ESC_POS, FieldUnit::PERCENT);
//fdo#75307 validate all the entries and discard all of them if any are
//out of range
......
......@@ -28,8 +28,9 @@
#define DFLT_ESC_SUPER 33 // 1/3
#define DFLT_ESC_SUB -33 // also 1/3 previously 8/100
#define DFLT_ESC_PROP 58
#define DFLT_ESC_AUTO_SUPER 101
#define DFLT_ESC_AUTO_SUB -101
#define MAX_ESC_POS 13999
#define DFLT_ESC_AUTO_SUPER (MAX_ESC_POS+1)
#define DFLT_ESC_AUTO_SUB -DFLT_ESC_AUTO_SUPER
/* [Description]
......
......@@ -68,6 +68,7 @@
#include <comphelper/types.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/sequence.hxx>
#include <editeng/escapementitem.hxx>
#include <filter/msfilter/util.hxx>
#include <sfx2/DocumentMetadataAccess.hxx>
#include <unotools/mediadescriptor.hxx>
......@@ -2206,9 +2207,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
sal_Int16 nEscapement = 0;
sal_Int8 nProp = 58;
if ( sStringValue == "superscript" )
nEscapement = 101;
nEscapement = DFLT_ESC_AUTO_SUPER;
else if ( sStringValue == "subscript" )
nEscapement = -101;
nEscapement = DFLT_ESC_AUTO_SUB;
else
nProp = 100;
......@@ -2839,8 +2840,17 @@ void DomainMapper::processDeferredCharacterProperties( const std::map< sal_Int32
nEscapement = ( nIntValue > 0 ) ? 58: -58;
}
}
// tdf#120412 up to 14400% (eg. 1584 pt with 11 pt letters)
if( nEscapement > 14400 ) nEscapement = 14400;
if ( nEscapement > MAX_ESC_POS )
{
nEscapement = MAX_ESC_POS;
}
else if ( nEscapement < -MAX_ESC_POS )
{
nEscapement = -MAX_ESC_POS;
}
rContext->Insert(PROP_CHAR_ESCAPEMENT, uno::makeAny( nEscapement ) );
rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, uno::makeAny( nProp ) );
}
......
......@@ -28,10 +28,11 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
// this is a copy of defines in svx/inc/escpitem.hxx
// this is a copy of defines in include/editeng/escapementitem.hxx
#define DFLT_ESC_PROP 58
#define DFLT_ESC_AUTO_SUPER 101
#define DFLT_ESC_AUTO_SUB -101
#define MAX_ESC_POS 13999
#define DFLT_ESC_AUTO_SUPER (MAX_ESC_POS+1)
#define DFLT_ESC_AUTO_SUB -DFLT_ESC_AUTO_SUPER
// class XMLEscapementPropHdl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment