diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-10-23 17:41:47 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-10-23 18:34:39 +0200 |
commit | 31af61ea091cc895b893c849f2130aa35792b7db (patch) | |
tree | 6c7b63c5b538034bd5d356c5a8667b7e95d59b9c /svx/source/dialog/connctrl.cxx | |
parent | e92c0d6f9b7a6251e00dc55219a203a7e53c96e2 (diff) |
Fraction: Revert "fdo#81356: convert Fraction to boost::rational<long> - wip"
This reverts commit 47a2d7642d249d70b5da0c330a73f3a0032e4bba.
Conflicts:
cui/source/tabpages/transfrm.cxx
svx/source/svdraw/svdedtv1.cxx
svx/source/svdraw/svdibrow.cxx
sw/source/filter/ww1/w1filter.cxx
tools/source/generic/rational.cxx
Change-Id: I4849916f5f277a4afef0e279b0135c76b36b9d15
Diffstat (limited to 'svx/source/dialog/connctrl.cxx')
-rw-r--r-- | svx/source/dialog/connctrl.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index 7075c0249cec..f87d310a37e1 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -113,9 +113,9 @@ void SvxXConnectionPreview::AdaptSize() aNewSize.Height()= (long) ( (double) nWidth / fRectWH ); } - boost::rational<long> aFrac1( aWinSize.Width(), aRect.GetWidth() ); - boost::rational<long> aFrac2( aWinSize.Height(), aRect.GetHeight() ); - boost::rational<long> aMinFrac( aFrac1 <= aFrac2 ? aFrac1 : aFrac2 ); + Fraction aFrac1( aWinSize.Width(), aRect.GetWidth() ); + Fraction aFrac2( aWinSize.Height(), aRect.GetHeight() ); + Fraction aMinFrac( aFrac1 <= aFrac2 ? aFrac1 : aFrac2 ); // Implement MapMode aDisplayMap.SetScaleX( aMinFrac ); @@ -261,29 +261,29 @@ void SvxXConnectionPreview::MouseButtonDown( const MouseEvent& rMEvt ) if( bZoomIn || bZoomOut ) { MapMode aMapMode = GetMapMode(); - boost::rational<long> aXFrac = aMapMode.GetScaleX(); - boost::rational<long> aYFrac = aMapMode.GetScaleY(); - boost::scoped_ptr<boost::rational<long>> pMultFrac; + Fraction aXFrac = aMapMode.GetScaleX(); + Fraction aYFrac = aMapMode.GetScaleY(); + boost::scoped_ptr<Fraction> pMultFrac; if( bZoomIn ) { if( bCtrl ) - pMultFrac.reset(new boost::rational<long>( 3, 2 )); + pMultFrac.reset(new Fraction( 3, 2 )); else - pMultFrac.reset(new boost::rational<long>( 11, 10 )); + pMultFrac.reset(new Fraction( 11, 10 )); } else { if( bCtrl ) - pMultFrac.reset(new boost::rational<long>( 2, 3 )); + pMultFrac.reset(new Fraction( 2, 3 )); else - pMultFrac.reset(new boost::rational<long>( 10, 11 )); + pMultFrac.reset(new Fraction( 10, 11 )); } aXFrac *= *pMultFrac; aYFrac *= *pMultFrac; - if( boost::rational_cast<double>(aXFrac) > 0.001 && boost::rational_cast<double>(aXFrac) < 1000.0 && - boost::rational_cast<double>(aYFrac) > 0.001 && boost::rational_cast<double>(aYFrac) < 1000.0 ) + if( (double)aXFrac > 0.001 && (double)aXFrac < 1000.0 && + (double)aYFrac > 0.001 && (double)aYFrac < 1000.0 ) { aMapMode.SetScaleX( aXFrac ); aMapMode.SetScaleY( aYFrac ); @@ -292,8 +292,8 @@ void SvxXConnectionPreview::MouseButtonDown( const MouseEvent& rMEvt ) Size aOutSize( GetOutputSize() ); Point aPt( aMapMode.GetOrigin() ); - long nX = (long)( ( (double)aOutSize.Width() - ( (double)aOutSize.Width() * boost::rational_cast<double>(* pMultFrac) ) ) / 2.0 + 0.5 ); - long nY = (long)( ( (double)aOutSize.Height() - ( (double)aOutSize.Height() * boost::rational_cast<double>(* pMultFrac) ) ) / 2.0 + 0.5 ); + long nX = (long)( ( (double)aOutSize.Width() - ( (double)aOutSize.Width() * (double)*pMultFrac ) ) / 2.0 + 0.5 ); + long nY = (long)( ( (double)aOutSize.Height() - ( (double)aOutSize.Height() * (double)*pMultFrac ) ) / 2.0 + 0.5 ); aPt.X() += nX; aPt.Y() += nY; |