diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-10-26 17:41:29 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-10-26 17:41:29 +0100 |
commit | 37cd2a528c5346a56e5d65e2991443e78f56489a (patch) | |
tree | 7d1338fa631c51f5fb71486f7e35c51c6786ce88 /toolkit | |
parent | acae9170ea69e3b54b31ebf0322b53e4818172a3 (diff) | |
parent | cf144cb77169bfc84604434f4b7923fe5dac3d1e (diff) |
merge commit for m62
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index a8c0912a583e..9ca21c5fb36b 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2506,7 +2506,14 @@ void VCLXWindow::setZoom( float fZoomX, float /*fZoomY*/ ) throw(::com::sun::sta ::vos::OGuard aGuard( GetMutex() ); if ( GetWindow() ) - GetWindow()->SetZoom( Fraction( fZoomX ) ); + { + // Fraction::Fraction takes a double, but we have a float only. + // The implicit conversion from float to double can result in a precision loss, i.e. 1.2 is converted to + // 1.200000000047something. To prevent this, we convert explicitly to double, and round it. + double nZoom( fZoomX ); + nZoom = ::rtl::math::round( nZoom, 4 ); + GetWindow()->SetZoom( Fraction( nZoom ) ); + } } // ::com::sun::star::lang::XEventListener |