summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rsc/inc/vclrsc.hxx2
-rw-r--r--rsc/source/parser/rscibas.cxx3
-rw-r--r--svl/inc/svl/poolitem.hxx2
-rw-r--r--svtools/source/control/ruler.cxx8
-rw-r--r--tools/inc/tools/fldunit.hxx2
-rw-r--r--vcl/source/control/field.cxx34
-rw-r--r--vcl/source/src/units.src3
7 files changed, 36 insertions, 18 deletions
diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index 19677171dcb2..49847bd91e69 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -173,7 +173,7 @@ typedef sal_Int64 WinBits;
// from vcl/inc/fldunit.hxx
enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
- FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM,
+ FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CHAR, FUNIT_LINE, FUNIT_CUSTOM,
FUNIT_PERCENT, FUNIT_100TH_MM };
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index 1a896c897e27..6b79b4fdd3b3 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -237,6 +237,9 @@ RscEnum * RscTypCont::InitFieldUnitsType()
SETCONST( pFieldUnits, "FUNIT_FOOT", FUNIT_FOOT );
SETCONST( pFieldUnits, "FUNIT_MILE", FUNIT_MILE );
SETCONST( pFieldUnits, "FUNIT_CUSTOM", FUNIT_CUSTOM );
+ // Amelia : adds two units ,"char" and "line"
+ SETCONST( pFieldUnits, "FUNIT_CHAR", FUNIT_CHAR );
+ SETCONST( pFieldUnits, "FUNIT_LINE", FUNIT_LINE );
SETCONST( pFieldUnits, "FUNIT_PERCENT", FUNIT_PERCENT );
return pFieldUnits;
diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx
index c0cf53fb6ded..498b48d31aac 100644
--- a/svl/inc/svl/poolitem.hxx
+++ b/svl/inc/svl/poolitem.hxx
@@ -100,7 +100,7 @@ enum SfxFieldUnit
{
SFX_FUNIT_NONE, SFX_FUNIT_MM, SFX_FUNIT_CM, SFX_FUNIT_M, SFX_FUNIT_KM,
SFX_FUNIT_TWIP, SFX_FUNIT_POINT, SFX_FUNIT_PICA,
- SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CUSTOM
+ SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CHAR, SFX_FUNIT_LINE, SFX_FUNIT_CUSTOM
};
enum SfxMapUnit
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 9cf87414650b..9897c96e1672 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -81,7 +81,9 @@
#define RULER_UNIT_MILE 6
#define RULER_UNIT_POINT 7
#define RULER_UNIT_PICA 8
-#define RULER_UNIT_COUNT 9
+#define RULER_UNIT_CHAR 9
+#define RULER_UNIT_LINE 10
+#define RULER_UNIT_COUNT 11
// -----------------
// - ImplRulerData -
@@ -145,7 +147,9 @@ static ImplRulerUnitData aImplRulerUnitTab[RULER_UNIT_COUNT] =
{ MAP_100TH_INCH, 1200, 120, 600, 1200, 30480, 3, "'" }, // FOOT
{ MAP_10TH_INCH, 633600, 63360, 316800, 633600, 1609344, 4, " miles" }, // MILE
{ MAP_POINT, 1, 12, 12, 36, 353, 2, " pt" }, // POINT
-{ MAP_100TH_MM, 423, 423, 423, 846, 423, 3, " pi" } // PICA
+{ MAP_100TH_MM, 423, 423, 423, 846, 423, 3, " pi" }, // PICA
+{ MAP_100TH_MM, 371, 371, 371, 743, 371, 3, " ch" }, // CHAR
+{ MAP_100TH_MM, 551, 551, 551, 1102, 551, 3, " li" } // LINE
};
// =======================================================================
diff --git a/tools/inc/tools/fldunit.hxx b/tools/inc/tools/fldunit.hxx
index 637539f6dd6f..d877776d4d86 100644
--- a/tools/inc/tools/fldunit.hxx
+++ b/tools/inc/tools/fldunit.hxx
@@ -35,7 +35,7 @@
// By changes you must also change: rsc/vclrsc.hxx
enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
- FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM,
+ FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CHAR, FUNIT_LINE, FUNIT_CUSTOM,
FUNIT_PERCENT, FUNIT_100TH_MM };
#endif // _TOOLS_FLDUNIT_HXX
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
diff --git a/vcl/source/src/units.src b/vcl/source/src/units.src
index 16b40b3f41a3..0a680fcb1913 100644
--- a/vcl/source/src/units.src
+++ b/vcl/source/src/units.src
@@ -30,6 +30,7 @@
#include <vcl/svids.hrc>
#endif
+// Amelia : adds two units , 'ch' and 'line'
StringArray SV_FUNIT_STRINGS
{
ItemList [ en-US ] =
@@ -51,6 +52,8 @@ StringArray SV_FUNIT_STRINGS
< "feet" ; FUNIT_FOOT ; > ;
< "miles" ; FUNIT_MILE ; > ;
< "mile" ; FUNIT_MILE ; > ;
+ < "ch" ; FUNIT_CHAR ; > ;
+ < "line" ; FUNIT_LINE ; > ;
< "%" ; FUNIT_PERCENT ; > ;
};
};