Fraction->double in SwPagePreviewLayout
Change-Id: I98d60742d2c24456621c7c618af530b951af8f1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
class SwViewShell;
|
||||
class SwRootFrame;
|
||||
class SwPageFrame;
|
||||
class Fraction;
|
||||
|
||||
/** page preview functionality in the writer */
|
||||
class SwPagePreviewLayout
|
||||
@@ -336,8 +335,8 @@ public:
|
||||
|
||||
@return Point, start position for new scale
|
||||
*/
|
||||
Point GetPreviewStartPosForNewScale( const Fraction& _aNewScale,
|
||||
const Fraction& _aOldScale,
|
||||
Point GetPreviewStartPosForNewScale( double _fNewScale,
|
||||
double _fOldScale,
|
||||
const Size& _aNewWinSize ) const;
|
||||
|
||||
/** determines, if page with given page number is visible in preview
|
||||
|
||||
@@ -720,13 +720,13 @@ bool SwPagePreviewLayout::SetBookPreviewMode( const bool _bEnableBookPreview,
|
||||
/** calculate start position for new scale
|
||||
|
||||
*/
|
||||
Point SwPagePreviewLayout::GetPreviewStartPosForNewScale(
|
||||
const Fraction& _aNewScale,
|
||||
const Fraction& _aOldScale,
|
||||
Point SwPagePreviewLayout:: GetPreviewStartPosForNewScale(
|
||||
double _fNewScale,
|
||||
double _fOldScale,
|
||||
const Size& _aNewWinSize ) const
|
||||
{
|
||||
Point aNewPaintStartPos = maPaintedPreviewDocRect.TopLeft();
|
||||
if ( _aNewScale < _aOldScale )
|
||||
if ( _fNewScale < _fOldScale )
|
||||
{
|
||||
// increase paint width by moving start point to left.
|
||||
if ( mnPreviewLayoutWidth < _aNewWinSize.Width() )
|
||||
|
||||
@@ -1765,7 +1765,7 @@ void SwPagePreviewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor,
|
||||
// calculate new start position for preview paint
|
||||
Size aNewWinSize = PixelToLogic( maPxWinSize );
|
||||
Point aNewPaintStartPos =
|
||||
mpPgPreviewLayout->GetPreviewStartPosForNewScale( aNewScale, maScale, aNewWinSize );
|
||||
mpPgPreviewLayout->GetPreviewStartPosForNewScale( double(aNewScale), double(maScale), aNewWinSize );
|
||||
|
||||
// remember new scaling and prepare preview paint
|
||||
// Note: paint of preview will be performed by a corresponding invalidate
|
||||
|
||||
Reference in New Issue
Block a user