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 /sd | |
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 'sd')
33 files changed, 84 insertions, 84 deletions
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 39cded4e3e74..7727d48119cc 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -192,12 +192,12 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) // Allow UI scale only for draw documents. if( eType == DOCUMENT_TYPE_DRAW ) - SetUIUnit( (FieldUnit)pOptions->GetMetric(), boost::rational<long>( nX, nY ) ); // user-defined + SetUIUnit( (FieldUnit)pOptions->GetMetric(), boost::rational<sal_Int64>( nX, nY ) ); // user-defined else - SetUIUnit( (FieldUnit)pOptions->GetMetric(), boost::rational<long>( 1, 1 ) ); // default + SetUIUnit( (FieldUnit)pOptions->GetMetric(), boost::rational<sal_Int64>( 1, 1 ) ); // default SetScaleUnit(MAP_100TH_MM); - SetScaleFraction(boost::rational<long>(1, 1)); + SetScaleFraction(boost::rational<sal_Int64>(1, 1)); SetDefaultFontHeight(847); // 24p pItemPool->SetDefaultMetric(SFX_MAPUNIT_100TH_MM); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 1e96f6f0aa68..032a0a0080bd 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1843,8 +1843,8 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR long nOldWidth = GetWdt() - GetLftBorder() - GetRgtBorder(); long nOldHeight = GetHgt() - GetUppBorder() - GetLwrBorder(); - boost::rational<long> aFractX( aNewPageSize.Width(), nOldWidth ); - boost::rational<long> aFractY( aNewPageSize.Height(), nOldHeight ); + boost::rational<sal_Int64> aFractX( aNewPageSize.Width(), nOldWidth ); + boost::rational<sal_Int64> aFractY( aNewPageSize.Height(), nOldHeight ); const size_t nObjCnt = (mbScaleObjects ? GetObjCount() : 0); diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 427f884e24b4..3194ec8487f5 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1095,7 +1095,7 @@ void ImplExportComments( uno::Reference< drawing::XDrawPage > xPage, SvMemoryStr uno::Reference< office::XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement() ); geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() ); - MapMode aMapDest( MAP_INCH, Point(), boost::rational<long>( 1, 576 ), boost::rational<long>( 1, 576 ) ); + MapMode aMapDest( MAP_INCH, Point(), boost::rational<sal_Int64>( 1, 576 ), boost::rational<sal_Int64>( 1, 576 ) ); Point aPoint( OutputDevice::LogicToLogic( Point( static_cast< sal_Int32 >( aRealPoint2D.X * 100.0 ), static_cast< sal_Int32 >( aRealPoint2D.Y * 100.0 ) ), MAP_100TH_MM, aMapDest ) ); diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx index b5dd80321481..457600cba8cb 100644 --- a/sd/source/filter/eppt/epptbase.hxx +++ b/sd/source/filter/eppt/epptbase.hxx @@ -350,7 +350,7 @@ protected: sal_uInt32 mnPages; ///< number of Slides ( w/o master pages & notes & handout ) sal_uInt32 mnMasterPages; - boost::rational<long> maFraction; + boost::rational<sal_Int64> maFraction; MapMode maMapModeSrc; MapMode maMapModeDest; ::com::sun::star::awt::Size maDestPageSize; diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 8e56d350e884..18e2f34107a5 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -652,7 +652,7 @@ ParagraphObj::ParagraphObj(const ::com::sun::star::uno::Reference< ::com::sun::s , SOParagraph() , mvPortions() , maMapModeSrc(MAP_100TH_MM) - , maMapModeDest(MAP_INCH, Point(), boost::rational<long>( 1, 576 ), boost::rational<long>( 1, 576 )) + , maMapModeDest(MAP_INCH, Point(), boost::rational<sal_Int64>( 1, 576 ), boost::rational<sal_Int64>( 1, 576 )) , mnTextSize(0) , mbFirstParagraph(false) , mbLastParagraph(false) @@ -682,7 +682,7 @@ ParagraphObj::ParagraphObj(::com::sun::star::uno::Reference< ::com::sun::star::t , SOParagraph() , mvPortions() , maMapModeSrc(MAP_100TH_MM) - , maMapModeDest(MAP_INCH, Point(), boost::rational<long>( 1, 576 ), boost::rational<long>( 1, 576 )) + , maMapModeDest(MAP_INCH, Point(), boost::rational<sal_Int64>( 1, 576 ), boost::rational<sal_Int64>( 1, 576 )) , mnTextSize(0) , mbIsBullet(false) , mbFirstParagraph( aParaFlags.bFirstParagraph ) diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 8db6f17d7f52..7a06ad74f73a 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -502,7 +502,7 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot ) if(pFrameView) { - const boost::rational<long>& rFraction = pDoc->GetUIScale(); + const boost::rational<sal_Int64>& rFraction = pDoc->GetUIScale(); nX=rFraction.numerator(); nY=rFraction.denominator(); } @@ -595,7 +595,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet ) // Apply to document only if doc type match if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() ) { - pDoc->SetUIScale( boost::rational<long>( nX, nY ) ); + pDoc->SetUIScale( boost::rational<sal_Int64>( nX, nY ) ); if( pViewShell ) pViewShell->SetRuler( pViewShell->HasRuler() ); } diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index f8db33ebe451..79f71a72228a 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -100,7 +100,7 @@ void SdDisplay::Paint( const Rectangle& ) aBitmapEx.Draw( this, aPt, aBmpSize ); } -void SdDisplay::SetScale( const boost::rational<long>& rFrac ) +void SdDisplay::SetScale( const boost::rational<sal_Int64>& rFrac ) { aScale = rFrac; } @@ -468,7 +468,7 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn ) } // calculate and set zoom for DisplayWin - boost::rational<long> aFrac( GetScale() ); + boost::rational<sal_Int64> aFrac( GetScale() ); aCtlDisplay.SetScale( aFrac ); UpdateControl(); @@ -643,9 +643,9 @@ void AnimationWindow::WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime, } } -boost::rational<long> AnimationWindow::GetScale() +boost::rational<sal_Int64> AnimationWindow::GetScale() { - boost::rational<long> aFrac; + boost::rational<sal_Int64> aFrac; size_t const nCount = m_FrameList.size(); if (nCount > 0) { @@ -733,7 +733,7 @@ void AnimationWindow::Resize() aGrpAnimation.SetPosPixel( aGrpAnimation.GetPosPixel() + aPt ); // calculate and set zoom for DisplayWin - boost::rational<long> aFrac( GetScale() ); + boost::rational<sal_Int64> aFrac( GetScale() ); aCtlDisplay.SetScale( aFrac ); aBtnFirst.Show(); @@ -963,7 +963,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) } // calculate and set zoom for DisplayWin - boost::rational<long> aFrac( GetScale() ); + boost::rational<sal_Int64> aFrac( GetScale() ); aCtlDisplay.SetScale( aFrac ); UpdateControl(); diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index a6f2fa7787ae..91877806858d 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -237,7 +237,7 @@ void SdDocPreviewWin::updateViewSettings() VirtualDevice aVDev; - const boost::rational<long> aFrac( pDoc->GetScaleFraction() ); + const boost::rational<sal_Int64> aFrac( pDoc->GetScaleFraction() ); const MapMode aMap( pDoc->GetScaleUnit(), Point(), aFrac, aFrac ); aVDev.SetMapMode( aMap ); diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index ecb5a2966cbc..b4dd8f59ae7f 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -113,7 +113,7 @@ void SdVectorizeDlg::InitPreviewBmp() m_pBmpWin->SetGraphic( aPreviewBmp ); } -Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, boost::rational<long>& rScale ) +Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, boost::rational<sal_Int64>& rScale ) { Bitmap aNew( rBmp ); const Size aSizePix( aNew.GetSizePixel() ); @@ -121,11 +121,11 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, boost::rational<long>& r if( aSizePix.Width() > VECTORIZE_MAX_EXTENT || aSizePix.Height() > VECTORIZE_MAX_EXTENT ) { const Rectangle aRect( GetRect( Size( VECTORIZE_MAX_EXTENT, VECTORIZE_MAX_EXTENT ), aSizePix ) ); - rScale = boost::rational<long>( aSizePix.Width(), aRect.GetWidth() ); + rScale = boost::rational<sal_Int64>( aSizePix.Width(), aRect.GetWidth() ); aNew.Scale( aRect.GetSize() ); } else - rScale = boost::rational<long>( 1, 1 ); + rScale = boost::rational<sal_Int64>( 1, 1 ); aNew.ReduceColors( (sal_uInt16) m_pNmLayers->GetValue(), BMP_REDUCE_SIMPLE ); @@ -137,7 +137,7 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ) mpDocSh->SetWaitCursor( true ); m_pPrgs->SetValue( 0 ); - boost::rational<long> aScale; + boost::rational<sal_Int64> aScale; Bitmap aTmp( GetPreparedBitmap( rBmp, aScale ) ); if( !!aTmp ) diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index 0cf004be3498..8887b1b1e736 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -199,7 +199,7 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe const Size aPixSize( aVDev.LogicToPixel( aSize ) ); const sal_uLong nMaxEdgePix = std::max( aPixSize.Width(), aPixSize.Height() ); - boost::rational<long> aFrac( nMaxEdgePixel, nMaxEdgePix ); + boost::rational<sal_Int64> aFrac( nMaxEdgePixel, nMaxEdgePix ); aMapMode.SetScaleX( aFrac ); aMapMode.SetScaleY( aFrac ); @@ -207,7 +207,7 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe aVDev.SetOutputSize( aSize ); // that we also get the dark lines at the right and bottom page margin - aFrac = boost::rational<long>( nMaxEdgePixel - 1, nMaxEdgePix ); + aFrac = boost::rational<sal_Int64>( nMaxEdgePixel - 1, nMaxEdgePix ); aMapMode.SetScaleX( aFrac ); aMapMode.SetScaleY( aFrac ); aVDev.SetMapMode( aMapMode ); diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index e1d0b57f76b2..dbfb7e4f8fcf 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -235,8 +235,8 @@ void FuCopy::DoExecute( SfxRequest& rReq ) } } - boost::rational<long> aWidth( aRect.Right() - aRect.Left() + lWidth, aRect.Right() - aRect.Left() ); - boost::rational<long> aHeight( aRect.Bottom() - aRect.Top() + lHeight, aRect.Bottom() - aRect.Top() ); + boost::rational<sal_Int64> aWidth( aRect.Right() - aRect.Left() + lWidth, aRect.Right() - aRect.Left() ); + boost::rational<sal_Int64> aHeight( aRect.Bottom() - aRect.Top() + lHeight, aRect.Bottom() - aRect.Top() ); if( mpView->IsResizeAllowed() ) mpView->ResizeAllMarked( aRect.TopLeft(), aWidth, aHeight ); diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 8ffedbdf7569..da0749cab2c0 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -408,7 +408,7 @@ protected: virtual SvxRuler* CreateVRuler(::sd::Window* pWin) SAL_OVERRIDE; virtual void UpdateHRuler() SAL_OVERRIDE; virtual void UpdateVRuler() SAL_OVERRIDE; - virtual void SetZoomFactor(const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY) SAL_OVERRIDE; + virtual void SetZoomFactor(const boost::rational<sal_Int64>& rZoomX, const boost::rational<sal_Int64>& rZoomY) SAL_OVERRIDE; void SetupPage( Size &rSize, long nLeft, long nRight, long nUpper, long nLower, bool bSize, bool bMargin, bool bScaleAll ); diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 18e3cd43be3c..8c53ccb5321b 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -537,8 +537,8 @@ protected: virtual void Activate(bool IsMDIActivate) SAL_OVERRIDE; virtual void Deactivate(bool IsMDIActivate) SAL_OVERRIDE; - virtual void SetZoomFactor( const boost::rational<long>& rZoomX, - const boost::rational<long>& rZoomY ); + virtual void SetZoomFactor( const boost::rational<sal_Int64>& rZoomX, + const boost::rational<sal_Int64>& rZoomY ); /** This must be called after the ctor, but before anything else. diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index c744a3d3a085..3a49fa8338f5 100644 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -161,8 +161,8 @@ public: virtual void Activate (bool IsMDIActivate) SAL_OVERRIDE; virtual void Deactivate (bool IsMDIActivate) SAL_OVERRIDE; virtual void SetZoomFactor ( - const boost::rational<long>& rZoomX, - const boost::rational<long>& rZoomY) SAL_OVERRIDE; + const boost::rational<sal_Int64>& rZoomX, + const boost::rational<sal_Int64>& rZoomY) SAL_OVERRIDE; virtual bool PrepareClose (bool bUI = true) SAL_OVERRIDE; virtual void WriteUserData (OUString&, bool bBrowse = false) SAL_OVERRIDE; virtual void ReadUserData (const OUString&, bool bBrowse = false) SAL_OVERRIDE; diff --git a/sd/source/ui/inc/animobjs.hxx b/sd/source/ui/inc/animobjs.hxx index 2178f829108c..ca27764c1638 100644 --- a/sd/source/ui/inc/animobjs.hxx +++ b/sd/source/ui/inc/animobjs.hxx @@ -61,7 +61,7 @@ class SdDisplay : public Control { private: BitmapEx aBitmapEx; - boost::rational<long> aScale; + boost::rational<sal_Int64> aScale; public: SdDisplay( vcl::Window* pWin, SdResId Id ); @@ -70,7 +70,7 @@ public: virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE; void SetBitmapEx( BitmapEx* pBmpEx ); - void SetScale( const boost::rational<long>& rFrac ); + void SetScale( const boost::rational<sal_Int64>& rFrac ); virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; }; @@ -155,7 +155,7 @@ private: void ResetAttrs(); void WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime, SfxProgress* pStbMgr ) const; - boost::rational<long> GetScale(); + boost::rational<sal_Int64> GetScale(); }; /** diff --git a/sd/source/ui/inc/copydlg.hxx b/sd/source/ui/inc/copydlg.hxx index f62bf44f3b39..fba9779cf8ed 100644 --- a/sd/source/ui/inc/copydlg.hxx +++ b/sd/source/ui/inc/copydlg.hxx @@ -64,7 +64,7 @@ private: const SfxItemSet& mrOutAttrs; XColorListRef mpColorList; - boost::rational<long> maUIScale; + boost::rational<sal_Int64> maUIScale; ::sd::View* mpView; DECL_LINK( SelectColorHdl, void * ); diff --git a/sd/source/ui/inc/dlgsnap.hxx b/sd/source/ui/inc/dlgsnap.hxx index befaa538ceba..1042144b1651 100644 --- a/sd/source/ui/inc/dlgsnap.hxx +++ b/sd/source/ui/inc/dlgsnap.hxx @@ -53,7 +53,7 @@ private: long nXValue; long nYValue; FieldUnit eUIUnit; - boost::rational<long> aUIScale; + boost::rational<sal_Int64> aUIScale; DECL_LINK( ClickHdl, Button * ); diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx index 6107c7ed99a1..dee673bc13bb 100644 --- a/sd/source/ui/inc/vectdlg.hxx +++ b/sd/source/ui/inc/vectdlg.hxx @@ -67,7 +67,7 @@ class SdVectorizeDlg : public ModalDialog void UpdatePreviewMtf(); Rectangle GetRect( const Size& rDispSize, const Size& rBmpSize ) const; - Bitmap GetPreparedBitmap( Bitmap& rBmp, boost::rational<long>& rScale ); + Bitmap GetPreparedBitmap( Bitmap& rBmp, boost::rational<sal_Int64>& rScale ); void Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ); void AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf, long nPosX, long nPosY, long nWidth, long nHeight ); diff --git a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx index b6555cc5ac89..5ffe1e8d4b4c 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx @@ -114,7 +114,7 @@ public: /** Return the scale factor that can be set at the map mode of the output window. */ - boost::rational<long> GetScaleFactor (void) const; + boost::rational<sal_Int64> GetScaleFactor (void) const; Size GetPageObjectSize (void) const; diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 3113433ff3b9..c9ff1054aa79 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -383,9 +383,9 @@ void PreviewRenderer::SetupOutputSize ( { const sal_Int32 nFrameWidth (mbHasFrame ? snFrameWidth : 0); aMapMode.SetScaleX( - boost::rational<long>(rFramePixelSize.Width()-2*nFrameWidth-1, aPageModelSize.Width())); + boost::rational<sal_Int64>(rFramePixelSize.Width()-2*nFrameWidth-1, aPageModelSize.Width())); aMapMode.SetScaleY( - boost::rational<long>(rFramePixelSize.Height()-2*nFrameWidth-1, aPageModelSize.Height())); + boost::rational<sal_Int64>(rFramePixelSize.Height()-2*nFrameWidth-1, aPageModelSize.Height())); aMapMode.SetOrigin(mpPreviewDevice->PixelToLogic(Point(nFrameWidth,nFrameWidth),aMapMode)); } else diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 3d4703c742e3..52551a4a62b5 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -677,7 +677,7 @@ throw (UnknownPropertyException, PropertyVetoException, sal_Int32 nValue = 0; if( *pValues >>= nValue ) { - boost::rational<long> aFract( nValue, pDoc->GetUIScale().denominator() ); + boost::rational<sal_Int64> aFract( nValue, pDoc->GetUIScale().denominator() ); pDoc->SetUIScale( aFract ); bOk = true; bChanged = true; @@ -689,7 +689,7 @@ throw (UnknownPropertyException, PropertyVetoException, sal_Int32 nValue = 0; if( *pValues >>= nValue ) { - boost::rational<long> aFract( pDoc->GetUIScale().numerator(), nValue ); + boost::rational<sal_Int64> aFract( pDoc->GetUIScale().numerator(), nValue ); pDoc->SetUIScale( aFract ); bOk = true; bChanged = true; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 16fe7c1eca44..be94ae7d6c59 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2226,10 +2226,10 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice, // that VirtualDevices use a DPI of 96. // We specifically calculate these scales first as we're still // in TWIPs, and might as well minimise the number of conversions. - boost::rational<long> scaleX = boost::rational<long>( nOutputWidth, 96 ) * boost::rational<long>(1440L) / - boost::rational<long>( nTileWidth ); - boost::rational<long> scaleY = boost::rational<long>( nOutputHeight, 96 ) * boost::rational<long>(1440L) / - boost::rational<long>( nTileHeight ); + boost::rational<sal_Int64> scaleX = boost::rational<sal_Int64>( nOutputWidth, 96 ) * boost::rational<sal_Int64>(1440L) / + boost::rational<sal_Int64>( nTileWidth ); + boost::rational<sal_Int64> scaleY = boost::rational<sal_Int64>( nOutputHeight, 96 ) * boost::rational<sal_Int64>(1440L) / + boost::rational<sal_Int64>( nTileHeight ); // svx seems to be the only component that works natively in // 100th mm rather than TWIP. It makes most sense just to diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 1da275481f44..46f63ad667f7 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1607,8 +1607,8 @@ private: { MapMode aMap (rInfo.maMap); Point aPageOfs (rInfo.mpPrinter->GetPageOffset() ); - aMap.SetScaleX(boost::rational<long>(1,2)); - aMap.SetScaleY(boost::rational<long>(1,2)); + aMap.SetScaleX(boost::rational<sal_Int64>(1,2)); + aMap.SetScaleY(boost::rational<sal_Int64>(1,2)); mpPrinter->SetMapMode(aMap); Rectangle aOutRect(aPageOfs, rInfo.mpPrinter->GetOutputSize()); @@ -1802,11 +1802,11 @@ private: const double fHorz = (double) aPrintSize.Width() / aPageSize.Width(); const double fVert = (double) aPrintSize.Height() / aPageSize.Height(); - boost::rational<long> aFract; + boost::rational<sal_Int64> aFract; if ( fHorz < fVert ) - aFract = boost::rational<long>(aPrintSize.Width(), aPageSize.Width()); + aFract = boost::rational<sal_Int64>(aPrintSize.Width(), aPageSize.Width()); else - aFract = boost::rational<long>(aPrintSize.Height(), aPageSize.Height()); + aFract = boost::rational<sal_Int64>(aPrintSize.Height(), aPageSize.Height()); aMap.SetScaleX(aFract); aMap.SetScaleY(aFract); @@ -1930,11 +1930,11 @@ private: const double fHorz ((double) rInfo.maPrintSize.Width() / aPageSize.Width()); const double fVert ((double) rInfo.maPrintSize.Height() / aPageSize.Height()); - boost::rational<long> aFract; + boost::rational<sal_Int64> aFract; if (fHorz < fVert) - aFract = boost::rational<long>(rInfo.maPrintSize.Width(), aPageSize.Width()); + aFract = boost::rational<sal_Int64>(rInfo.maPrintSize.Width(), aPageSize.Width()); else - aFract = boost::rational<long>(rInfo.maPrintSize.Height(), aPageSize.Height()); + aFract = boost::rational<sal_Int64>(rInfo.maPrintSize.Height(), aPageSize.Height()); aMap.SetScaleX(aFract); aMap.SetScaleY(aFract); @@ -2012,8 +2012,8 @@ private: } MapMode aMap (rInfo.maMap); - aMap.SetScaleX( boost::rational<long>( aPageSize_2.Width(), rInfo.maPageSize.Width() ) ); - aMap.SetScaleY( boost::rational<long>( aPageSize_2.Height(), rInfo.maPageSize.Height() ) ); + aMap.SetScaleX( boost::rational<sal_Int64>( aPageSize_2.Width(), rInfo.maPageSize.Width() ) ); + aMap.SetScaleY( boost::rational<sal_Int64>( aPageSize_2.Height(), rInfo.maPageSize.Height() ) ); // calculate adjusted print size const Size aAdjustedPrintSize (OutputDevice::LogicToLogic( diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 63d89849de5a..3c1eb9d13a95 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -453,8 +453,8 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize) aSize.Height() -= (aBorder.Top() + aBorder.Bottom()); Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel( aObjSize, MAP_100TH_MM ); SfxViewShell::SetZoomFactor( - boost::rational<long>( aSize.Width(), std::max( aObjSizePixel.Width(), (long int)1 ) ), - boost::rational<long>( aSize.Height(), std::max( aObjSizePixel.Height(), (long int)1) ) ); + boost::rational<sal_Int64>( aSize.Width(), std::max( aObjSizePixel.Width(), (long int)1 ) ), + boost::rational<sal_Int64>( aSize.Height(), std::max( aObjSizePixel.Height(), (long int)1) ) ); } mpImpl->ResizePixel(rOrigin, rSize, false); @@ -735,8 +735,8 @@ void ViewShellBase::Deactivate (bool bIsMDIActivate) } void ViewShellBase::SetZoomFactor ( - const boost::rational<long>& rZoomX, - const boost::rational<long>& rZoomY) + const boost::rational<sal_Int64>& rZoomX, + const boost::rational<sal_Int64>& rZoomY) { SfxViewShell::SetZoomFactor (rZoomX, rZoomY); // Forward call to main sub shell. diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 8dd8d031990a..4361a9f827f8 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -500,7 +500,7 @@ SvxRuler* DrawViewShell::CreateHRuler (::sd::Window* pWin, bool bIsFirst) // ... and also set DefTab at the ruler pRuler->SetDefTabDist( GetDoc()->GetDefaultTabulator() ); // new - boost::rational<long> aUIScale(pWin->GetMapMode().GetScaleX()); + boost::rational<sal_Int64> aUIScale(pWin->GetMapMode().GetScaleX()); aUIScale *= GetDoc()->GetUIScale(); pRuler->SetZoom(aUIScale); @@ -529,7 +529,7 @@ SvxRuler* DrawViewShell::CreateVRuler(::sd::Window* pWin) pRuler->SetUnit( FieldUnit( nMetric ) ); - boost::rational<long> aUIScale(pWin->GetMapMode().GetScaleY()); + boost::rational<sal_Int64> aUIScale(pWin->GetMapMode().GetScaleY()); aUIScale *= GetDoc()->GetUIScale(); pRuler->SetZoom(aUIScale); diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index 9c9a151c08c1..e04024f80d5b 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -440,7 +440,7 @@ void DrawViewShell::Paint(const Rectangle& rRect, ::sd::Window* pWin) /** * adjust zoom factor for InPlace */ -void DrawViewShell::SetZoomFactor(const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY) +void DrawViewShell::SetZoomFactor(const boost::rational<sal_Int64>& rZoomX, const boost::rational<sal_Int64>& rZoomY) { ViewShell::SetZoomFactor(rZoomX, rZoomY); mbZoomOnPage = false; diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 4f12613fdd7a..1fb96287f604 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -644,7 +644,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) { Point aPos = GetActiveWindow()->PixelToLogic(maMousePos); pPageView->LogicToPagePos(aPos); - boost::rational<long> aUIScale(GetDoc()->GetUIScale()); + boost::rational<sal_Int64> aUIScale(GetDoc()->GetUIScale()); aPos.X() = boost::rational_cast<long>(aPos.X() / aUIScale); aPos.Y() = boost::rational_cast<long>(aPos.Y() / aUIScale); diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 8f48aeca2f1f..5aec01f58672 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -202,7 +202,7 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * maVisibleLayers.SetAll(); maPrintableLayers.SetAll(); SetGridCoarse( Size( 1000, 1000 ) ); - SetSnapGridWidth(boost::rational<long>(1000, 1), boost::rational<long>(1000, 1)); + SetSnapGridWidth(boost::rational<sal_Int64>(1000, 1), boost::rational<sal_Int64>(1000, 1)); SetActiveLayer( SD_RESSTR(STR_LAYER_LAYOUT) ); mbNoColors = true; mbNoAttribs = false; @@ -302,8 +302,8 @@ void FrameView::Update(SdOptions* pOptions) SetGridCoarse( Size( pOptions->GetFldDrawX(), pOptions->GetFldDrawY() ) ); SetGridFine( Size( pOptions->GetFldDivisionX(), pOptions->GetFldDivisionY() ) ); - boost::rational<long> aFractX(pOptions->GetFldDrawX(), pOptions->GetFldDrawX() / ( pOptions->GetFldDivisionX() ? pOptions->GetFldDivisionX() : 1 )); - boost::rational<long> aFractY(pOptions->GetFldDrawY(), pOptions->GetFldDrawY() / ( pOptions->GetFldDivisionY() ? pOptions->GetFldDivisionY() : 1 )); + boost::rational<sal_Int64> aFractX(pOptions->GetFldDrawX(), pOptions->GetFldDrawX() / ( pOptions->GetFldDivisionX() ? pOptions->GetFldDivisionX() : 1 )); + boost::rational<sal_Int64> aFractY(pOptions->GetFldDrawY(), pOptions->GetFldDrawY() / ( pOptions->GetFldDivisionY() ? pOptions->GetFldDivisionY() : 1 )); SetSnapGridWidth(aFractX, aFractY); SetQuickEdit(pOptions->IsQuickEdit()); @@ -928,8 +928,8 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < : default: SetViewShEditModeOnLoad(EM_PAGE); break; } - const boost::rational<long> aSnapGridWidthX( aSnapGridWidthXNum, aSnapGridWidthXDom ); - const boost::rational<long> aSnapGridWidthY( aSnapGridWidthYNum, aSnapGridWidthYDom ); + const boost::rational<sal_Int64> aSnapGridWidthX( aSnapGridWidthXNum, aSnapGridWidthXDom ); + const boost::rational<sal_Int64> aSnapGridWidthY( aSnapGridWidthYNum, aSnapGridWidthYDom ); SetSnapGridWidth( aSnapGridWidthX, aSnapGridWidthY ); } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index fabc2aa506a8..f5b9e38d1ea8 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -876,8 +876,8 @@ void View::SetMarkedOriginalSize() Rectangle aDrawRect( pObj->GetLogicRect() ); pUndoGroup->AddAction( mrDoc.GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) ); - pObj->Resize( aDrawRect.TopLeft(), boost::rational<long>( aOleSize.Width(), aDrawRect.GetWidth() ), - boost::rational<long>( aOleSize.Height(), aDrawRect.GetHeight() ) ); + pObj->Resize( aDrawRect.TopLeft(), boost::rational<sal_Int64>( aOleSize.Width(), aDrawRect.GetWidth() ), + boost::rational<sal_Int64>( aOleSize.Height(), aDrawRect.GetHeight() ) ); } } } @@ -938,8 +938,8 @@ void View::DoConnect(SdrOle2Obj* pObj) MapMode aMapMode( mrDoc.GetScaleUnit() ); Size aObjAreaSize = pObj->GetOrigObjSize( &aMapMode ); - boost::rational<long> aScaleWidth (aDrawSize.Width(), aObjAreaSize.Width() ); - boost::rational<long> aScaleHeight(aDrawSize.Height(), aObjAreaSize.Height() ); + boost::rational<sal_Int64> aScaleWidth (aDrawSize.Width(), aObjAreaSize.Width() ); + boost::rational<sal_Int64> aScaleHeight(aDrawSize.Height(), aObjAreaSize.Height() ); rational_ReduceInaccurate(aScaleWidth, 10); // compatible to SdrOle2Obj rational_ReduceInaccurate(aScaleHeight, 10); pSdClient->SetSizeScale(aScaleWidth, aScaleHeight); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 3524a77565d2..01b5f1dcbcac 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -703,8 +703,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Rectangle aObjRect( pNewObj->GetCurrentBoundRect() ); Size aObjSize( aObjRect.GetSize() ); - boost::rational<long> aScaleWidth( aPickObjSize.Width(), aObjSize.Width() ); - boost::rational<long> aScaleHeight( aPickObjSize.Height(), aObjSize.Height() ); + boost::rational<sal_Int64> aScaleWidth( aPickObjSize.Width(), aObjSize.Width() ); + boost::rational<sal_Int64> aScaleHeight( aPickObjSize.Height(), aObjSize.Height() ); pNewObj->NbcResize( aObjRect.TopLeft(), aScaleWidth, aScaleHeight ); aVec -= aObjRect.TopLeft(); diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index e0a48d4f1cc2..974b36aebf8c 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -228,8 +228,8 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, Rectangle aObjRect(pNewGrafObj->GetCurrentBoundRect()); Size aObjSize(aObjRect.GetSize()); - boost::rational<long> aScaleWidth(aPickObjSize.Width(), aObjSize.Width()); - boost::rational<long> aScaleHeight(aPickObjSize.Height(), aObjSize.Height()); + boost::rational<sal_Int64> aScaleWidth(aPickObjSize.Width(), aObjSize.Width()); + boost::rational<sal_Int64> aScaleHeight(aPickObjSize.Height(), aObjSize.Height()); pNewGrafObj->NbcResize(aObjRect.TopLeft(), aScaleWidth, aScaleHeight); Point aVec = aPickObjRect.TopLeft() - aObjRect.TopLeft(); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 49149706a986..1d498ee0f12c 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -318,8 +318,8 @@ long Window::SetZoomFactor(long nZoom) // Set the zoom factor at the window's map mode. MapMode aMap(GetMapMode()); - aMap.SetScaleX(boost::rational<long>(nZoom, 100)); - aMap.SetScaleY(boost::rational<long>(nZoom, 100)); + aMap.SetScaleX(boost::rational<sal_Int64>(nZoom, 100)); + aMap.SetScaleY(boost::rational<sal_Int64>(nZoom, 100)); SetMapMode(aMap); // invalidate previous size - it was relative to the old scaling diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 3724d462142a..7408267060ca 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -332,7 +332,7 @@ void ViewShell::Scroll(long nScrollX, long nScrollY) */ void ViewShell::SetZoom(long nZoom) { - boost::rational<long> aUIScale(nZoom, 100); + boost::rational<sal_Int64> aUIScale(nZoom, 100); aUIScale *= GetDoc()->GetUIScale(); if (mpHorizontalRuler.get() != NULL) @@ -399,7 +399,7 @@ void ViewShell::ScrollCenter() void ViewShell::SetZoomRect(const Rectangle& rZoomRect) { long nZoom = GetActiveWindow()->SetZoomRect(rZoomRect); - boost::rational<long> aUIScale(nZoom, 100); + boost::rational<sal_Int64> aUIScale(nZoom, 100); aUIScale *= GetDoc()->GetUIScale(); Point aPos = GetActiveWindow()->GetWinViewPos(); @@ -651,7 +651,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, /** * Set zoom factor for InPlace */ -void ViewShell::SetZoomFactor(const boost::rational<long>& rZoomX, const boost::rational<long>&) +void ViewShell::SetZoomFactor(const boost::rational<sal_Int64>& rZoomX, const boost::rational<sal_Int64>&) { long nZoom = (long)(boost::rational_cast<double>(rZoomX) * 100); SetZoom(nZoom); @@ -870,8 +870,8 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) if( pObj->IsChart() ) //charts never should be stretched see #i84323# for example aObjAreaSize = aDrawSize; - boost::rational<long> aScaleWidth (aDrawSize.Width(), aObjAreaSize.Width() ); - boost::rational<long> aScaleHeight(aDrawSize.Height(), aObjAreaSize.Height() ); + boost::rational<sal_Int64> aScaleWidth (aDrawSize.Width(), aObjAreaSize.Width() ); + boost::rational<sal_Int64> aScaleHeight(aDrawSize.Height(), aObjAreaSize.Height() ); rational_ReduceInaccurate(aScaleWidth, 10); // kompatibel zum SdrOle2Obj rational_ReduceInaccurate(aScaleHeight, 10); pSdClient->SetSizeScale(aScaleWidth, aScaleHeight); |