[Libreoffice-commits] core.git: 2 commits - cui/source include/editeng nlpsolver/src writerfilter/source xmloff/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jun 3 14:13:16 UTC 2019
cui/source/tabpages/chardlg.cxx | 2 -
include/editeng/escapementitem.hxx | 5 +--
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java | 4 +-
writerfilter/source/dmapper/DomainMapper.cxx | 16 ++++++++--
xmloff/source/style/escphdl.cxx | 7 ++--
5 files changed, 23 insertions(+), 11 deletions(-)
New commits:
commit 32262b0a537207832d7d126d8427d8949b9e821d
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Wed May 29 16:36:41 2019 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Mon Jun 3 16:12:27 2019 +0200
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: László Németh <nemeth at numbertext.org>
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index d1340a4463b3..8fa64293fe87 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -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
diff --git a/include/editeng/escapementitem.hxx b/include/editeng/escapementitem.hxx
index 86e148361051..82f9dde70823 100644
--- a/include/editeng/escapementitem.hxx
+++ b/include/editeng/escapementitem.hxx
@@ -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]
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 6276d56a1b01..195e360a671d 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -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 ) );
}
diff --git a/xmloff/source/style/escphdl.cxx b/xmloff/source/style/escphdl.cxx
index f97ca6ee1f2f..f52c360d0865 100644
--- a/xmloff/source/style/escphdl.cxx
+++ b/xmloff/source/style/escphdl.cxx
@@ -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
commit a2720a24328fcee3bde431dc632c068b266228c9
Author: Todor Balabanov <todor.balabanov at gmail.com>
AuthorDate: Fri May 17 17:13:13 2019 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jun 3 16:12:17 2019 +0200
Checking of min and max factor value was added.
It is possible user to swap these two values.
Change-Id: Ib375d705e42f7257aa9b16d72ab834020e401cde
Reviewed-on: https://gerrit.libreoffice.org/72483
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java
index 2e5c38d0d179..f152cf92d481 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java
@@ -128,8 +128,8 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver
agents[i].setPbest(m_library.getSelectedPoint(i));
DEGTBehavior deGTBehavior = new DEGTBehavior();
- deGTBehavior.MIN_FACTOR = m_minFactor.getValue();
- deGTBehavior.MAX_FACTOR = m_maxFactor.getValue();
+ deGTBehavior.MIN_FACTOR = Math.min(m_minFactor.getValue(), m_maxFactor.getValue());
+ deGTBehavior.MAX_FACTOR = Math.max(m_minFactor.getValue(), m_maxFactor.getValue());
deGTBehavior.CR = m_CR.getValue();
PSGTBehavior psGTBehavior = new PSGTBehavior();
More information about the Libreoffice-commits
mailing list