[Libreoffice-commits] core.git: svtools/source sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri May 22 20:01:35 UTC 2020


 svtools/source/misc/unitconv.cxx             |    4 ++++
 sw/source/uibase/sidebar/PageFormatPanel.cxx |    4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ec11b7330fab72dc56d847c7c3691fddbb18096e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 22 19:44:05 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 22 22:01:01 2020 +0200

    Related: tdf#133189 values not updated when units changed
    
    do it for all of them, not just the writer one. A braver move.
    
    Change-Id: Ib1f635ccc6a70c1ef00f82449bd351c82da7a13d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94707
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx
index 8076b6890196..93dab6ada967 100644
--- a/svtools/source/misc/unitconv.cxx
+++ b/svtools/source/misc/unitconv.cxx
@@ -26,8 +26,10 @@ void SetFieldUnit(weld::MetricSpinButton& rField, FieldUnit eUnit, bool bAll)
 {
     int nMin, nMax;
     rField.get_range(nMin, nMax, FieldUnit::TWIP);
+    int nValue = rField.get_value(FieldUnit::TWIP);
     nMin = rField.denormalize(nMin);
     nMax = rField.denormalize(nMax);
+    nValue = rField.denormalize(nValue);
 
     if (!bAll)
     {
@@ -78,6 +80,8 @@ void SetFieldUnit(weld::MetricSpinButton& rField, FieldUnit eUnit, bool bAll)
         nMax = rField.normalize(nMax);
         rField.set_range(nMin, nMax, FieldUnit::TWIP);
     }
+
+    rField.set_value(rField.normalize(nValue), FieldUnit::TWIP);
 }
 
 void SetMetricValue(weld::MetricSpinButton& rField, int nCoreValue, MapUnit eUnit)
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index 969d7d8210da..7a13c6553fde 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -198,12 +198,8 @@ void PageFormatPanel::NotifyItemUpdate(
             if (eFUnit != meFUnit)
             {
                 meFUnit = eFUnit;
-                auto nHeight = mxPaperHeight->GetCoreValue(meUnit);
                 mxPaperHeight->SetFieldUnit(meFUnit);
-                mxPaperHeight->SetMetricValue(nHeight, meUnit);
-                auto nWidth = mxPaperWidth->GetCoreValue(meUnit);
                 mxPaperWidth->SetFieldUnit(meFUnit);
-                mxPaperWidth->SetMetricValue(nWidth, meUnit);
                 SetMarginFieldUnit();
                 UpdateMarginBox();
             }


More information about the Libreoffice-commits mailing list