[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - cui/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 12 12:09:38 UTC 2019


 cui/source/tabpages/tplnedef.cxx |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit ac996989897dca899b8fd388c32c6512021b802b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Aug 9 12:18:53 2019 +0100
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Mon Aug 12 14:08:43 2019 +0200

    Resolves: tdf#126736 change range on change of unit
    
    and make the max % 800 instead of 500 while we're at it
    (0.15cm is considered 100% FWIW)
    
    when flipping from measurement unit to %
    
    Change-Id: Ia1b15559f3db0d1e11d4563ad7c6aacc3f9ba32d
    Reviewed-on: https://gerrit.libreoffice.org/77194
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 5d822005f8ba..dea7c0e3ba02 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -408,6 +408,11 @@ void SvxLineDefTabPage::ChangeMetricHdl_Impl(weld::ToggleButton* p)
         m_xMtrLength2->set_unit(eFUnit);
         m_xMtrDistance->set_unit(eFUnit);
 
+        // tdf#126736 max 5cm
+        m_xMtrLength1->set_range(0, 500, FieldUnit::CM);
+        m_xMtrLength2->set_range(0, 500, FieldUnit::CM);
+        m_xMtrDistance->set_range(0, 500, FieldUnit::CM);
+
         SetMetricValue( *m_xMtrLength1, nTmp1, ePoolUnit );
         SetMetricValue( *m_xMtrLength2, nTmp2, ePoolUnit );
         SetMetricValue( *m_xMtrDistance, nTmp3, ePoolUnit );
@@ -438,10 +443,14 @@ void SvxLineDefTabPage::ChangeMetricHdl_Impl(weld::ToggleButton* p)
         m_xMtrLength2->set_unit(FieldUnit::PERCENT);
         m_xMtrDistance->set_unit(FieldUnit::PERCENT);
 
-        SetMetricValue( *m_xMtrLength1, nTmp1, ePoolUnit );
-        SetMetricValue( *m_xMtrLength2, nTmp2, ePoolUnit );
-        SetMetricValue( *m_xMtrDistance, nTmp3, ePoolUnit );
+        // tdf#126736 800%
+        m_xMtrLength1->set_range(0, 800, FieldUnit::PERCENT);
+        m_xMtrLength2->set_range(0, 800, FieldUnit::PERCENT);
+        m_xMtrDistance->set_range(0, 800, FieldUnit::PERCENT);
 
+        m_xMtrLength1->set_value(nTmp1, FieldUnit::PERCENT);
+        m_xMtrLength2->set_value(nTmp2, FieldUnit::PERCENT);
+        m_xMtrDistance->set_value(nTmp3, FieldUnit::PERCENT);
     }
     SelectTypeHdl_Impl( nullptr );
 }


More information about the Libreoffice-commits mailing list