summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-10-16 15:30:32 +0200
committerDavid Tardon <dtardon@redhat.com>2014-10-16 17:44:44 +0200
commit582ef22d3e8e30ffd58f092d37ffda30bd07bd9e (patch)
tree80c42b34da7e7ee05843b572f7311b3c230de9dd /sd/source/ui/view
parentada4862afc3227b04c12960ded761db24f61257e (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/source/ui/view')
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx20
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx8
-rw-r--r--sd/source/ui/view/drviews1.cxx4
-rw-r--r--sd/source/ui/view/drviews5.cxx2
-rw-r--r--sd/source/ui/view/drviewsa.cxx2
-rw-r--r--sd/source/ui/view/frmview.cxx10
-rw-r--r--sd/source/ui/view/sdview.cxx8
-rw-r--r--sd/source/ui/view/sdview3.cxx4
-rw-r--r--sd/source/ui/view/sdview4.cxx4
-rw-r--r--sd/source/ui/view/sdwindow.cxx4
-rw-r--r--sd/source/ui/view/viewshe2.cxx10
11 files changed, 38 insertions, 38 deletions
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);