From 582ef22d3e8e30ffd58f092d37ffda30bd07bd9e Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 16 Oct 2014 15:30:32 +0200 Subject: fdo#84854 it seems long is not enough on 32 bit Fraction used BigInt internally for computations, rational does nothing like that. Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5 --- cui/source/tabpages/grfpage.cxx | 4 ++-- cui/source/tabpages/transfrm.cxx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'cui/source') diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 59e24f9f7c34..2121a05dd41b 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -812,8 +812,8 @@ void SvxCropExample::SetFrameSize( const Size& rSz ) if(!aFrameSize.Height()) aFrameSize.Height() = 1; Size aWinSize( GetOutputSizePixel() ); - boost::rational aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 ); - boost::rational aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 ); + boost::rational aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 ); + boost::rational aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 ); if( aYScale < aXScale ) aXScale = aYScale; diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index ff024add4d14..26a8678ddc82 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -90,7 +90,7 @@ static void lcl_ConvertRect(basegfx::B2DRange& rRange, const sal_uInt16 nDigits, rRange = basegfx::B2DRange(aTopLeft, aBottomRight); } -static void lcl_ScaleRect(basegfx::B2DRange& rRange, const boost::rational aUIScale) +static void lcl_ScaleRect(basegfx::B2DRange& rRange, const boost::rational aUIScale) { const double fFactor(1.0 / boost::rational_cast(aUIScale)); rRange = basegfx::B2DRange(rRange.getMinimum() * fFactor, rRange.getMaximum() * fFactor); @@ -254,7 +254,7 @@ void SvxAngleTabPage::Construct() } // take scale into account - const boost::rational aUIScale = pView->GetModel()->GetUIScale(); + const boost::rational aUIScale = pView->GetModel()->GetUIScale(); lcl_ScaleRect(maRange, aUIScale); // take UI units into account @@ -475,7 +475,7 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs) if( m_pMtrRadius->IsValueChangedFromSaved() ) { - boost::rational aUIScale = pView->GetModel()->GetUIScale(); + boost::rational aUIScale = pView->GetModel()->GetUIScale(); long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit ); nTmp = boost::rational_cast(nTmp * aUIScale); @@ -758,7 +758,7 @@ void SvxPositionSizeTabPage::Construct() } // take scale into account - const boost::rational aUIScale = mpView->GetModel()->GetUIScale(); + const boost::rational aUIScale = mpView->GetModel()->GetUIScale(); lcl_ScaleRect( maWorkRange, aUIScale ); lcl_ScaleRect( maRange, aUIScale ); @@ -828,7 +828,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) if ( m_pMtrWidth->IsValueModified() || m_pMtrHeight->IsValueModified() ) { - boost::rational aUIScale = mpView->GetModel()->GetUIScale(); + boost::rational aUIScale = mpView->GetModel()->GetUIScale(); // get Width double nWidth = static_cast(m_pMtrWidth->GetValue( meDlgUnit )); -- cgit v1.2.3