summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2009-11-13 15:46:58 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2009-11-13 15:46:58 +0100
commit0b93d9ef2d826b697ea9f27bb8b22b153a1533a4 (patch)
treeb4d72a987a26bd77b111c8fedbf1a35772b76c4c /toolkit
parentd2b148f667115467247e985816595fd951f9bd7b (diff)
parent24534f00dd8799b3c2b2365ccd8c0009e19cddd5 (diff)
merge with DEV300_m64
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxwindow.cxx9
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