summaryrefslogtreecommitdiff
path: root/vcl/source/control/field.cxx
diff options
context:
space:
mode:
authorAmelia Wang <amwang@novell.com>2010-09-13 14:40:57 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-09-13 15:57:19 +0200
commitc85db626029fd8a5e0dfcb312937279df32339a0 (patch)
tree6d7b208776d8c70d8fd514e901d3786904fb90c9 /vcl/source/control/field.cxx
parent51fb3c7f1925c7d1604549dfd8fcc0139e54a36b (diff)
cjk-character-units-ui.diff: add a new unit 'character unit'
Diffstat (limited to 'vcl/source/control/field.cxx')
-rw-r--r--vcl/source/control/field.cxx34
1 files changed, 21 insertions, 13 deletions
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 090aa2a84163..db8d210e2f67 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1128,6 +1128,10 @@ static FieldUnit ImplStringToMetric( const String &rMetricString )
if ( strAllUnits->GetString( i ).Equals( aStr ) )
return (FieldUnit) strAllUnits->GetValue( i );
+ // Amelia : about character unit
+ if (aStr.EqualsIgnoreCaseAscii("cm"))
+ return FUNIT_CM;
+
return FUNIT_NONE;
}
@@ -1143,20 +1147,24 @@ static FieldUnit ImplMetricGetUnit( const XubString& rStr )
#define M *1000000L
#define X *5280L
-static const sal_Int64 aImplFactor[FUNIT_MILE+1][FUNIT_MILE+1] =
+// Amelia : about measurement unit, 'char' and 'line'
+//static const sal_Int64 aImplFactor[FUNIT_MILE+1][FUNIT_MILE+1] =
+static const sal_Int64 aImplFactor[FUNIT_LINE+1][FUNIT_LINE+1] =
{ /*
-mm/100 mm cm m km twip point pica inch foot mile */
-{ 1, 100, 1 K, 100 K, 100 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X },
-{ 1, 1, 10, 1 K, 1 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X },
-{ 1, 1, 1, 100, 100 K, 254, 254, 254, 254, 254*12, 254*12 X },
-{ 1, 1, 1, 1, 1 K, 254, 254, 254, 254, 254*12, 254*12 X },
-{ 1, 1, 1, 1, 1, 0, 254, 254, 254, 254*12, 254*12 X },
-{ 1440,144 K,144 K,14400 K, 0, 1, 20, 240, 1440,1440*12,1440*12 X },
-{ 72, 7200, 7200, 720 K, 720 M, 1, 1, 12, 72, 72*12, 72*12 X },
-{ 6, 600, 600, 60 K, 60 M, 1, 1, 1, 6, 6*12, 6*12 X },
-{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 12, 12 X },
-{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 X },
-{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 }
+mm/100 mm cm m km twip point pica inch foot mile char line*/
+{ 1, 100, 1 K, 100 K, 100 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X , 53340, 396240},
+{ 1, 1, 10, 1 K, 1 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X , 5334, 396240},
+{ 1, 1, 1, 100, 100 K, 254, 254, 254, 254, 254*12, 254*12 X , 5334, 39624},
+{ 1, 1, 1, 1, 1 K, 254, 254, 254, 254, 254*12, 254*12 X , 533400, 39624},
+{ 1, 1, 1, 1, 1, 0, 254, 254, 254, 254*12, 254*12 X ,533400 K, 39624},
+{ 1440,144 K,144 K,14400 K, 0, 1, 20, 240, 1440,1440*12,1440*12 X , 210, 3120},
+{ 72, 7200, 7200, 720 K, 720 M, 1, 1, 12, 72, 72*12, 72*12 X , 210, 156},
+{ 6, 600, 600, 60 K, 60 M, 1, 1, 1, 6, 6*12, 6*12 X , 210, 10},
+{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 12, 12 X , 210, 45},
+{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 X , 210, 45},
+{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 , 210, 45},
+{ 144, 1440,14400, 14400, 14400, 1, 20, 240, 1440,1440*12, 1440*12 X, 1, 156 },
+{ 720,72000,72000, 7200 K,7200 M, 20, 10, 13, 11, 11*12, 11*12 X, 105, 1 }
};
#undef X