diff options
Diffstat (limited to 'vcl/source/gdi/mapmod.cxx')
-rw-r--r-- | vcl/source/gdi/mapmod.cxx | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx index c95351829bdf..0c4bc512fd62 100644 --- a/vcl/source/gdi/mapmod.cxx +++ b/vcl/source/gdi/mapmod.cxx @@ -25,7 +25,6 @@ #include <tools/vcompat.hxx> #include <tools/debug.hxx> - struct MapMode::ImplMapMode { sal_uLong mnRefCount; @@ -208,6 +207,52 @@ void MapMode::SetScaleY( const Fraction& rScaleY ) mpImplMapMode->maScaleY.ReduceInaccurate(32); } +double MapMode::GetUnitMultiplier() const +{ + double nMul; + switch ( GetMapUnit() ) + { + case MAP_PIXEL : + case MAP_SYSFONT : + case MAP_APPFONT : + + case MAP_100TH_MM : + nMul = 1; + break; + case MAP_10TH_MM : + nMul = 10; + break; + case MAP_MM : + nMul = 100; + break; + case MAP_CM : + nMul = 1000; + break; + case MAP_1000TH_INCH : + nMul = 2.54; + break; + case MAP_100TH_INCH : + nMul = 25.4; + break; + case MAP_10TH_INCH : + nMul = 254; + break; + case MAP_INCH : + nMul = 2540; + break; + case MAP_TWIP : + nMul = 1.76388889; + break; + case MAP_POINT : + nMul = 35.27777778; + break; + default: + nMul = 1.0; + break; + } + return nMul; +} + MapMode& MapMode::operator=( const MapMode& rMapMode ) { DBG_ASSERT( rMapMode.mpImplMapMode->mnRefCount < 0xFFFFFFFE, "MapMode: RefCount overflow" ); |