summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-22 14:44:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-22 17:56:57 +0100
commite227d96bbc500afd810064eee64175b800bfc11f (patch)
treee4a62855fadd4da2f89035196330061c658e2d4c
parent922a8bd4ae026ca33c634023703b551cd465491e (diff)
use prime symbol for foot
Change-Id: Ieb1743b89a3c069d7b24cab0869294522ae2a6d7 Reviewed-on: https://gerrit.libreoffice.org/83503 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/inc/units.hrc2
-rw-r--r--vcl/source/control/field.cxx13
-rw-r--r--vcl/source/window/builder.cxx11
3 files changed, 23 insertions, 3 deletions
diff --git a/vcl/inc/units.hrc b/vcl/inc/units.hrc
index b13ad4476904..74c4496755e1 100644
--- a/vcl/inc/units.hrc
+++ b/vcl/inc/units.hrc
@@ -38,6 +38,8 @@ std::pair<const char*, FieldUnit> SV_FUNIT_STRINGS[] =
{ NC_("SV_FUNIT_STRINGS", "\""), FieldUnit::INCH },
{ NC_("SV_FUNIT_STRINGS", "in"), FieldUnit::INCH },
{ NC_("SV_FUNIT_STRINGS", "inch"), FieldUnit::INCH },
+ /* To translators: prime symbol for foot */
+ { NC_("SV_FUNIT_STRINGS", "′"), FieldUnit::FOOT },
{ NC_("SV_FUNIT_STRINGS", "'"), FieldUnit::FOOT },
{ NC_("SV_FUNIT_STRINGS", "ft"), FieldUnit::FOOT },
{ NC_("SV_FUNIT_STRINGS", "foot"), FieldUnit::FOOT },
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 6307b9ae49d7..2aa7e85a402f 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1045,7 +1045,7 @@ static OUString ImplMetricGetUnitText(const OUString& rStr)
for (sal_Int32 i = rStr.getLength()-1; i >= 0; --i)
{
sal_Unicode c = rStr[i];
- if ( (c == '\'') || (c == '\"') || (c == '%') || (c == 0x2033) || unicode::isAlpha(c) || unicode::isControl(c) )
+ if ( (c == '\'') || (c == '\"') || (c == '%') || (c == 0x2032) || (c == 0x2033) || unicode::isAlpha(c) || unicode::isControl(c) )
aStr.insert(0, c);
else
{
@@ -1464,7 +1464,7 @@ OUString MetricFormatter::CreateFieldText( sal_Int64 nValue ) const
else
{
OUString aSuffix = ImplMetricToString( meUnit );
- if (meUnit != FieldUnit::NONE && meUnit != FieldUnit::DEGREE && meUnit != FieldUnit::INCH)
+ if (meUnit != FieldUnit::NONE && meUnit != FieldUnit::DEGREE && meUnit != FieldUnit::INCH && meUnit != FieldUnit::FOOT)
aStr += " ";
if (meUnit == FieldUnit::INCH)
{
@@ -1474,6 +1474,15 @@ OUString MetricFormatter::CreateFieldText( sal_Int64 nValue ) const
else
aSuffix = sDoublePrime;
}
+ else if (meUnit == FieldUnit::FOOT)
+ {
+ OUString sPrime = u"\u2032";
+ if (aSuffix != "'" && aSuffix != sPrime)
+ aStr += " ";
+ else
+ aSuffix = sPrime;
+ }
+
assert(meUnit != FieldUnit::PERCENT);
aStr += aSuffix;
}
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 3936d94026f7..ee6259d4c5d3 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -247,7 +247,7 @@ namespace weld
{
aStr = rLocaleData.getNum(nValue, nDecimalDigits, true, true);
OUString aSuffix = MetricToString(m_eSrcUnit);
- if (m_eSrcUnit != FieldUnit::NONE && m_eSrcUnit != FieldUnit::DEGREE && m_eSrcUnit != FieldUnit::INCH)
+ if (m_eSrcUnit != FieldUnit::NONE && m_eSrcUnit != FieldUnit::DEGREE && m_eSrcUnit != FieldUnit::INCH && m_eSrcUnit != FieldUnit::FOOT)
aStr += " ";
if (m_eSrcUnit == FieldUnit::INCH)
{
@@ -257,6 +257,15 @@ namespace weld
else
aSuffix = sDoublePrime;
}
+ else if (m_eSrcUnit == FieldUnit::FOOT)
+ {
+ OUString sPrime = u"\u2032";
+ if (aSuffix != "'" && aSuffix != sPrime)
+ aStr += " ";
+ else
+ aSuffix = sPrime;
+ }
+
assert(m_eSrcUnit != FieldUnit::PERCENT);
aStr += aSuffix;
}