diff options
author | David Tardon <dtardon@redhat.com> | 2014-10-16 15:30:32 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-10-16 17:44:44 +0200 |
commit | 582ef22d3e8e30ffd58f092d37ffda30bd07bd9e (patch) | |
tree | 80c42b34da7e7ee05843b572f7311b3c230de9dd /sw/source/uibase/uiview | |
parent | ada4862afc3227b04c12960ded761db24f61257e (diff) |
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
Diffstat (limited to 'sw/source/uibase/uiview')
-rw-r--r-- | sw/source/uibase/uiview/pview.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewmdi.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewport.cxx | 12 |
4 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 912be1e4cedf..464cab290b85 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1741,7 +1741,7 @@ void SwPagePreviewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor, else if ( _nZoomFactor != 0 ) { // calculate new scaling and set mapping mode appropriately. - boost::rational<long> aNewScale( _nZoomFactor, 100 ); + boost::rational<sal_Int64> aNewScale( _nZoomFactor, 100 ); MapMode aNewMapMode = GetMapMode(); aNewMapMode.SetScaleX( aNewScale ); aNewMapMode.SetScaleY( aNewScale ); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 7be4f15c7efd..2ce3d09188a5 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -892,7 +892,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) StartListening( *pDocSh, true ); // Set Zoom-factor from HRuler - boost::rational<long> aZoomFract( aUsrPref.GetZoom(), 100 ); + boost::rational<sal_Int64> aZoomFract( aUsrPref.GetZoom(), 100 ); m_pHRuler->SetZoom( aZoomFract ); m_pVRuler->SetZoom( aZoomFract ); m_pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick )); diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index a8043956e0d3..be64b4af30aa 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -192,7 +192,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, m_pWrtShell->ApplyViewOptions( aOpt ); } - const boost::rational<long> aFrac( nFac, 100 ); + const boost::rational<sal_Int64> aFrac( nFac, 100 ); m_pVRuler->SetZoom( aFrac ); m_pVRuler->ForceUpdate(); m_pHRuler->SetZoom( aFrac ); diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 1002cdceb769..9ef2c9b42e1b 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -947,8 +947,8 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize ) aSize.Width() -= (aBorder.Left() + aBorder.Right()); aSize.Height() -= (aBorder.Top() + aBorder.Bottom()); Size aObjSizePixel = GetWindow()->LogicToPixel( aObjSize, MAP_TWIP ); - SfxViewShell::SetZoomFactor( boost::rational<long>( aSize.Width(), aObjSizePixel.Width() ), - boost::rational<long>( aSize.Height(), aObjSizePixel.Height() ) ); + SfxViewShell::SetZoomFactor( boost::rational<sal_Int64>( aSize.Width(), aObjSizePixel.Width() ), + boost::rational<sal_Int64>( aSize.Height(), aObjSizePixel.Height() ) ); } m_bInInnerResizePixel = true; @@ -985,10 +985,10 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize ) if( m_pHRuler->IsVisible() || m_pVRuler->IsVisible() ) { - const boost::rational<long>& rFrac = GetEditWin().GetMapMode().GetScaleX(); + const boost::rational<sal_Int64>& rFrac = GetEditWin().GetMapMode().GetScaleX(); long nZoom = rFrac.numerator() * 100L / rFrac.denominator(); - const boost::rational<long> aFrac( nZoom, 100 ); + const boost::rational<sal_Int64> aFrac( nZoom, 100 ); m_pVRuler->SetZoom( aFrac ); m_pHRuler->SetZoom( aFrac ); InvalidateRulerPos(); // Invalidate content. @@ -1134,9 +1134,9 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) } } -void SwView::SetZoomFactor( const boost::rational<long>& rX, const boost::rational<long>& rY ) +void SwView::SetZoomFactor( const boost::rational<sal_Int64>& rX, const boost::rational<sal_Int64>& rY ) { - const boost::rational<long>&rFrac = rX < rY ? rX : rY; + const boost::rational<sal_Int64>&rFrac = rX < rY ? rX : rY; SetZoom( SVX_ZOOM_PERCENT, (short) boost::rational_cast<long>(rFrac * 100) ); // To minimize rounding errors we also adjust the odd values |