[Libreoffice-commits] core.git: vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 19 14:13:47 UTC 2019


 vcl/source/control/field.cxx  |   10 ++++++++--
 vcl/source/window/builder.cxx |   10 ++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit eb6eb8c6df2ae75f1525bdbb7e9c72262dd74c0f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 19 13:15:27 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Aug 19 16:12:55 2019 +0200

    There should not be a space between the number and the prime mark
    
    e.g. The Art of Type and Typography: Explorations in Use and Practice
    
    Change-Id: Iddb08fce2efa8a5614d9afc4f96c3f609e8aa0fb
    Reviewed-on: https://gerrit.libreoffice.org/77717
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index be87437c06a2..fadd02f7eeae 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1384,10 +1384,16 @@ OUString MetricFormatter::CreateFieldText( sal_Int64 nValue ) const
         aStr += maCustomUnitText;
     else
     {
-        if (meUnit != FieldUnit::NONE && meUnit != FieldUnit::DEGREE)
+        OUString aSuffix = ImplMetricToString( meUnit );
+        if (meUnit != FieldUnit::NONE && meUnit != FieldUnit::DEGREE && meUnit != FieldUnit::INCH)
             aStr += " ";
+        if (meUnit == FieldUnit::INCH)
+        {
+            if (aSuffix != "\"")
+                aStr += " ";
+        }
         assert(meUnit != FieldUnit::PERCENT);
-        aStr += ImplMetricToString( meUnit );
+        aStr += aSuffix;
     }
     return aStr;
 }
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index b2eb2c65142c..502ae061367f 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -242,10 +242,16 @@ namespace weld
         else
         {
             aStr = rLocaleData.getNum(nValue, nDecimalDigits, true, true);
-            if (m_eSrcUnit != FieldUnit::NONE && m_eSrcUnit != FieldUnit::DEGREE)
+            OUString aSuffix = MetricToString(m_eSrcUnit);
+            if (m_eSrcUnit != FieldUnit::NONE && m_eSrcUnit != FieldUnit::DEGREE && m_eSrcUnit != FieldUnit::INCH)
                 aStr += " ";
+            if (m_eSrcUnit == FieldUnit::INCH)
+            {
+                if (aSuffix != "\"")
+                    aStr += " ";
+            }
             assert(m_eSrcUnit != FieldUnit::PERCENT);
-            aStr += MetricToString(m_eSrcUnit);
+            aStr += aSuffix;
         }
 
         return aStr;


More information about the Libreoffice-commits mailing list