summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2011-11-28 17:50:25 +0100
committerRadek Doulik <rodo@novell.com>2011-11-28 17:51:02 +0100
commitf970963fd7438fe4a026febf2046a2f4430d0a9f (patch)
tree8c68f39483a197925e1427639308ff1723690640 /sax
parent59df2942aec0fd8123b15799c6375abc83b9937e (diff)
added conversion from MeasureUnit::CM
Diffstat (limited to 'sax')
-rw-r--r--sax/source/tools/converter.cxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index e9a08c4b7d52..198ea4d14732 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -1966,6 +1966,49 @@ double Converter::GetConversionFactor(::rtl::OUStringBuffer& rUnit, sal_Int16 nS
}
break;
}
+ case MeasureUnit::CM:
+ {
+ switch(nTargetUnit)
+ {
+ case MeasureUnit::MM_100TH:
+ {
+ fRetval = .001;
+ break;
+ }
+ case MeasureUnit::MM_10TH:
+ {
+ fRetval = .01;
+ break;
+ }
+ case MeasureUnit::MM:
+ {
+ fRetval = .1;
+ psUnit = gpsMM;
+ break;
+ }
+ case MeasureUnit::CM:
+ {
+ break;
+ }
+ case MeasureUnit::POINT:
+ {
+ // 0.01pt = 0.35 mm/100 (exactly)
+ fRetval = 2.54 / 72.0;
+ psUnit = gpsPT;
+ break;
+ }
+ case MeasureUnit::INCH:
+ default:
+ {
+ OSL_ENSURE( MeasureUnit::INCH == nTargetUnit, "output unit not supported for cm values");
+ // 0.0001in = 0.254 mm/100 (exactly)
+ fRetval = 2.54;
+ psUnit = gpsINCH;
+ break;
+ }
+ }
+ break;
+ }
default:
OSL_ENSURE(false, "sax::Converter::GetConversionFactor(): "
"source unit not supported");